/* =========================================================
   LEMBRA — estilos
   Ideia visual: o bilhete amarelo de recado. Tudo é calmo e
   azul-tinta; o amarelo aparece só onde você "anota" algo.
   ========================================================= */

:root {
  --bg: #F2F4F7;
  --surface: #FFFFFF;
  --surface-2: #E9EDF2;
  --ink: #182033;
  --muted: #586378;
  --line: #E0E5EC;
  --brand: #2C3E73;
  --note: #FFD33D;
  --note-deep: #E9B800;
  --note-ink: #2B2300;
  --late: #BF3029;
  --late-bg: #FBEAE8;
  --soon: #B85F00;
  --soon-bg: #FDF0DF;
  --done: #1C7A50;
  --done-bg: #E2F3EA;
  --focus: #3D63DD;
  --shadow: 0 1px 2px rgba(24, 32, 51, .06), 0 8px 24px -12px rgba(24, 32, 51, .18);

  --c-teal: #0F7C7A;   --c-teal-bg: #DDF2F1;
  --c-blue: #2F5FC4;   --c-blue-bg: #E2EAFB;
  --c-violet: #6B48B8; --c-violet-bg: #ECE6F8;
  --c-green: #2E7D32;  --c-green-bg: #E3F2E4;
  --c-orange: #B4530B; --c-orange-bg: #FCEBDD;
  --c-slate: #4E5A70;  --c-slate-bg: #E7EAF0;

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --font: "Inter", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", system-ui, -apple-system, sans-serif;
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #141925;
  --surface: #1C2231;
  --surface-2: #252C3D;
  --ink: #E8ECF4;
  --muted: #A0AABC;
  --line: #2C3446;
  --brand: #A9BCF5;
  --note: #F7C93B;
  --note-deep: #D9A800;
  --note-ink: #231C00;
  --late: #FF8A80;
  --late-bg: #3A2025;
  --soon: #FFB459;
  --soon-bg: #3A2B1A;
  --done: #5CD49A;
  --done-bg: #183427;
  --focus: #8FA8FF;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .7);

  --c-teal: #5ED1CC;   --c-teal-bg: #183536;
  --c-blue: #8EB0FF;   --c-blue-bg: #1D2A4A;
  --c-violet: #C2A8FF; --c-violet-bg: #2B2246;
  --c-green: #86D68A;  --c-green-bg: #1B3420;
  --c-orange: #FFB27A; --c-orange-bg: #3A2617;
  --c-slate: #B4BED0;  --c-slate-bg: #2A3142;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.danger-text { color: var(--late) !important; }

.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { top: calc(8px + var(--safe-t)); }

/* ---------- moldura ---------- */
#main {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(18px + var(--safe-t)) 18px calc(var(--nav-h) + var(--safe-b) + 40px);
  outline: none;
  min-height: 100vh;
}
.boot { display: grid; place-items: center; min-height: 70vh; color: var(--muted); }

/* ---------- Home ---------- */
.home-head { padding-top: 6px; }
.brand-row { display: flex; align-items: center; justify-content: space-between; }
.wordmark {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: .02em;
  line-height: 1;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.wordmark::before {
  content: "";
  width: 18px; height: 18px;
  background: linear-gradient(225deg, transparent 5px, var(--note) 5px);
  border-radius: 3px;
  transform: rotate(-6deg);
}
.wordmark.xl { font-size: 2.6rem; }
.wordmark.xl::before { width: 30px; height: 30px; }
.greeting { margin: 22px 0 14px; font-size: 1.45rem; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; max-width: 20ch; }

/* O bilhete: o botão principal */
.cta {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 16px 20px;
  border: 0;
  border-radius: 6px 6px 6px 6px;
  background: linear-gradient(225deg, transparent 16px, var(--note) 16px);
  color: var(--note-ink);
  font-size: 1.15rem; font-weight: 800;
  text-align: left;
  transform: rotate(-.6deg);
  box-shadow: 0 10px 22px -16px rgba(80, 60, 0, .8);
  transition: transform .15s ease;
}
.cta::after {
  content: ""; position: absolute; top: 0; right: 0;
  width: 22px; height: 22px;
  background: linear-gradient(45deg, var(--note-deep) 50%, transparent 50%);
  border-bottom-left-radius: 4px;
}
.cta:active { transform: rotate(0) scale(.985); }
.cta-plus { font-size: 1.5rem; line-height: 1; }

.quick {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  margin-top: 14px;
  padding: 10px 8px 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.quick-emoji { grid-row: 1 / 3; font-size: 1.4rem; }
.quick-label { font-size: .8rem; font-weight: 700; color: var(--muted); grid-column: 2; }
.quick-input { grid-column: 2; border: 0; background: none; padding: 2px 0; min-height: 30px; outline: none; font-size: 1rem; min-width: 0; }
.quick-input::placeholder { color: var(--muted); opacity: .75; }
.quick-go { grid-column: 3; grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--surface-2); display: grid; place-items: center; color: var(--ink); }

.summary { margin: 26px 0 4px; color: var(--muted); }
.summary strong { color: var(--ink); }
.all-clear { margin: 18px 4px; color: var(--done); font-weight: 600; }

/* ---------- Grupos e linhas ---------- */
.group { margin-top: 22px; }
.group-title {
  display: flex; align-items: center; gap: 8px;
  margin: 0 4px 8px;
  font-size: 1rem; font-weight: 750; letter-spacing: -.005em;
}
.group-title .count { margin-left: auto; font-size: .85rem; font-weight: 600; color: var(--muted); }
.tone-late .group-title { color: var(--late); }

.rows {
  list-style: none; margin: 0; padding: 0;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.row { position: relative; display: flex; align-items: center; min-height: 68px; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; height: 1px; background: var(--line); }
.st-bar { position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; }
.st-late .st-bar { background: var(--late); }
.st-soon .st-bar { background: var(--soon); }
.st-done .st-bar { background: var(--done); }

.row-main {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 6px 12px 14px;
  border: 0; background: none; text-align: left;
  min-height: 68px;
}
.row-main:active { background: var(--surface-2); }
.row-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.st-done .row-title { color: var(--muted); }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .86rem; color: var(--muted); }
.meta-ic { display: inline-flex; color: var(--muted); }
.late-tag { color: var(--late); font-weight: 700; }
.late-tag.big, .done-tag { display: inline-block; font-size: .9rem; padding: 3px 10px; border-radius: 99px; }
.late-tag.big { background: var(--late-bg); }
.done-tag { background: var(--done-bg); color: var(--done); font-weight: 700; }

.cat-badge {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 1.15rem;
  background: var(--surface-2);
}
.cat-badge.c-none::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: .5; }

.c-teal { --cc: var(--c-teal); --cb: var(--c-teal-bg); }
.c-blue { --cc: var(--c-blue); --cb: var(--c-blue-bg); }
.c-violet { --cc: var(--c-violet); --cb: var(--c-violet-bg); }
.c-green { --cc: var(--c-green); --cb: var(--c-green-bg); }
.c-orange { --cc: var(--c-orange); --cb: var(--c-orange-bg); }
.c-slate { --cc: var(--c-slate); --cb: var(--c-slate-bg); }
.cat-badge[class*="c-"]:not(.c-none) { background: var(--cb); }

.check-btn {
  flex: none;
  width: 48px; height: 48px; margin-right: 8px;
  border-radius: 50%;
  border: 0; background: none;
  display: grid; place-items: center;
  color: transparent;
  position: relative;
}
.check-btn::before {
  content: ""; position: absolute; inset: 11px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  opacity: .55;
  transition: background .15s, border-color .15s, opacity .15s;
}
.check-btn .ic { position: relative; }
.check-btn:hover::before { opacity: 1; }
.check-btn.ticking::before { background: var(--done); border-color: var(--done); opacity: 1; }
.check-btn.ticking { color: #fff; }
.check-done { flex: none; width: 48px; display: grid; place-items: center; color: var(--done); margin-right: 8px; }
.tick { color: var(--done); font-weight: 800; }

.link-btn { display: inline-block; margin: 10px 6px 0; padding: 8px 4px; border: 0; background: none; color: var(--brand); font-weight: 650; text-decoration: none; }

/* ---------- Vazio ---------- */
.empty { text-align: center; padding: 34px 8px 10px; }
.empty h2 { margin: 18px 0 6px; font-size: 1.25rem; }
.empty p { margin: 0 auto 18px; max-width: 32ch; color: var(--muted); }
.empty .try { margin: 30px 0 10px; font-weight: 700; color: var(--ink); }
.empty-note {
  width: 76px; height: 76px; margin: 0 auto;
  background: linear-gradient(225deg, transparent 14px, var(--note) 14px);
  border-radius: 6px;
  transform: rotate(-5deg);
  position: relative;
}
.empty-note::before, .empty-note::after { content: ""; position: absolute; left: 14px; height: 4px; border-radius: 4px; background: rgba(43, 35, 0, .35); }
.empty-note::before { top: 28px; width: 40px; }
.empty-note::after { top: 40px; width: 28px; }

/* ---------- Páginas ---------- */
.page-head { margin-bottom: 14px; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.title-row .seg-btn { padding: 0 10px; font-size: .85rem; }
.page-title { margin: 6px 0 4px; font-size: 1.6rem; font-weight: 850; letter-spacing: -.015em; }
.page-head > .muted { margin: 0; }

.search {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--muted);
}
.search-input { flex: 1; min-width: 0; border: 0; background: none; outline: none; min-height: 48px; color: var(--ink); }

.chips { display: flex; gap: 8px; }
.chips.scroll { overflow-x: auto; padding: 2px 2px 6px; margin: 0 -18px; padding-left: 18px; padding-right: 18px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; }
.chips.center { justify-content: center; }
.chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .92rem; font-weight: 600;
  white-space: nowrap;
}
.chip.on, .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.cat.on { background: var(--cb, var(--ink)); color: var(--cc, var(--bg)); border-color: var(--cc, var(--ink)); box-shadow: inset 0 0 0 1px var(--cc, var(--ink)); }
.chip.small { min-height: 34px; font-size: .85rem; }
.chip.suggest { min-height: 44px; }
.emoji { font-size: 1.05rem; }

.sort-row { display: flex; justify-content: flex-end; margin: 4px 0 10px; }
.count-line { margin: 0 4px 8px; }
.none { text-align: center; padding: 40px 10px; color: var(--muted); }
.none p { margin: 0 0 12px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 12px; }
.seg.full { display: flex; }
.seg.full .seg-btn { flex: 1; justify-content: center; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: none; font-weight: 600; font-size: .9rem; color: var(--muted); }
.seg-btn.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* ---------- Calendário ---------- */
.cal { background: var(--surface); border-radius: var(--r-lg); padding: 12px 10px 10px; box-shadow: var(--shadow); margin-top: 6px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-title { margin: 0; font-size: 1.05rem; font-weight: 750; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: .78rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-day {
  aspect-ratio: 1 / 1; min-height: 42px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; border-radius: 12px; background: none; font-weight: 600; font-size: .95rem;
}
.cal-day.today .cal-num { color: var(--brand); font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }
.cal-day.sel { background: var(--ink); color: var(--bg); }
.cal-day.sel .cal-num { color: var(--bg); }
.cal-dots { display: flex; gap: 3px; height: 6px; }
.cal-dots i, .cal-legend i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.d-late { background: var(--late); } .d-soon { background: var(--soon); } .d-done { background: var(--done); }
.cal-legend { display: flex; align-items: center; gap: 6px; justify-content: center; margin: 8px 0 0; }
.cal-legend i { margin-left: 8px; }

/* ---------- Configurações ---------- */
.set-group { background: var(--surface); border-radius: var(--r-lg); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.set-group h2 { margin: 0 0 2px; font-size: 1.05rem; font-weight: 800; }
.set-group p { margin: 0; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; }
.set-row.col { flex-direction: column; align-items: stretch; gap: 6px; }
.set-row small { display: block; color: var(--muted); font-size: .85rem; line-height: 1.4; margin-top: 2px; }
.explain summary { cursor: pointer; font-weight: 650; color: var(--brand); padding: 8px 0; min-height: 44px; display: flex; align-items: center; }
.explain p { color: var(--muted); font-size: .92rem; margin-bottom: 8px; }

.switch {
  appearance: none; -webkit-appearance: none;
  flex: none; width: 52px; height: 32px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line);
  position: relative; transition: background .15s; cursor: pointer; margin: 0;
}
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s; }
.switch:checked { background: var(--done); border-color: var(--done); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-weight: 700; font-size: 1rem;
  text-decoration: none;
}
.btn.block { width: 100%; }
.btn.big { min-height: 56px; font-size: 1.05rem; }
.btn.small { min-height: 40px; font-size: .9rem; padding: 0 14px; }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:active { opacity: .85; }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: var(--late); color: #fff; }
.btn:disabled { opacity: .55; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; padding: 0 10px; }
.stack { display: flex; flex-direction: column; gap: 8px; }

.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: none; display: grid; place-items: center; color: var(--ink); }
.icon-btn:active { background: var(--surface-2); }

.input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.input.slim { width: auto; min-height: 40px; padding: 6px 10px; font-size: .9rem; }
.input.num { width: 84px; }
select.input { appearance: auto; }
textarea.input { resize: vertical; min-height: 84px; }

/* ---------- Folhas (diálogos) ---------- */
dialog.sheet {
  position: fixed;
  inset: auto 0 0 0;
  margin: 0 auto;
  width: 100%; max-width: 640px;
  max-height: 92vh; max-height: 92dvh;
  padding: 0;
  border: 0;
  border-radius: 22px 22px 0 0;
  background: var(--bg);
  color: var(--ink);
  display: flex; flex-direction: column;
  animation: sheet-in .2s ease-out;
}
dialog.sheet:not([open]) { display: none; }
dialog.sheet::backdrop { background: rgba(10, 14, 24, .45); animation: fade .2s; }
dialog.sheet.closing { animation: sheet-out .16s ease-in forwards; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
@keyframes sheet-out { to { transform: translateY(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-head { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 4px 20px; }
.sheet-grip { position: absolute; top: 6px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: var(--line); }
.sheet-title { margin: 0; font-size: 1.15rem; font-weight: 800; }
.sheet-body { overflow-y: auto; padding: 6px 20px 18px; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--bg); }
.sheet-msg { margin: 0 0 16px; color: var(--muted); }

@media (min-width: 700px) {
  dialog.sheet { inset: 0; margin: auto; border-radius: 22px; max-height: 86vh; height: fit-content; }
  .sheet-grip { display: none; }
}

/* ---------- Formulário ---------- */
.form { display: flex; flex-direction: column; gap: 6px; }
.field { border: 0; margin: 0; padding: 12px 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.field > label, .field > legend { font-weight: 700; font-size: .95rem; padding: 0; }
.field > legend { margin-bottom: 10px; }
.label-big { font-size: 1.1rem !important; }
.title-input {
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 14px 16px;
  background: linear-gradient(225deg, transparent 14px, var(--note) 14px);
  color: var(--note-ink);
  font-size: 1.15rem; font-weight: 650; line-height: 1.35;
  resize: none;
  outline: none;
}
.title-input::placeholder { color: var(--note-ink); opacity: .5; }
.title-input:focus-visible { box-shadow: 0 0 0 3px var(--focus); }
.field-err { margin: 0; min-height: 0; color: var(--late); font-size: .9rem; font-weight: 600; }
.field-err:empty { display: none; }
.row2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.mini-field { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); font-weight: 600; min-width: 0; }
.row-end { display: flex; justify-content: flex-end; }
.inline-custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-custom[hidden] { display: none; }
.inline-custom select.input { width: auto; flex: 1; }
.alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.alert-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 4px 0 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: .9rem; font-weight: 600; }
.mini-x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; color: var(--muted); }

/* ---------- Detalhes ---------- */
.detail-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cat-pill { display: inline-block; padding: 4px 12px; border-radius: 99px; font-size: .88rem; font-weight: 700; background: var(--cb, var(--surface-2)); color: var(--cc, var(--muted)); }
.detail-title { flex-basis: 100%; margin: 8px 0 10px; font-size: 1.4rem; line-height: 1.3; font-weight: 800; overflow-wrap: anywhere; }
.facts { margin: 0; background: var(--surface); border-radius: var(--r-lg); padding: 4px 14px; }
.fact { display: flex; gap: 12px; padding: 12px 0; }
.fact + .fact { border-top: 1px solid var(--line); }
.fact dt { color: var(--muted); padding-top: 1px; }
.fact dd { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.fact dd.pre span:last-child { white-space: pre-wrap; overflow-wrap: anywhere; }
.fact-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.detail-actions { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Navegação inferior ---------- */
#nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around; align-items: center;
  max-width: 640px; margin: 0 auto;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 0 6px var(--safe-b);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
@media (min-width: 641px) { #nav { border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; } }
.nav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 56px;
  color: var(--muted);
  text-decoration: none;
  font-size: .72rem; font-weight: 650;
}
.nav-btn.on { color: var(--ink); }
.nav-btn.on .ic { stroke-width: 2.4; }
.nav-add {
  flex: none;
  width: 58px; height: 58px; margin: 0 6px;
  border: 0; border-radius: 6px;
  background: linear-gradient(225deg, transparent 10px, var(--note) 10px);
  color: var(--note-ink);
  display: grid; place-items: center;
  transform: translateY(-10px) rotate(-3deg);
  box-shadow: 0 10px 18px -10px rgba(80, 60, 0, .9);
}
.nav-add:active { transform: translateY(-10px) rotate(0) scale(.95); }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 0; right: 0; z-index: 100;
  bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
  display: flex; justify-content: center; padding: 0 14px;
  pointer-events: none;
  opacity: 0; transform: translateY(10px);
  transition: opacity .18s, transform .18s;
}
#toast.show { opacity: 1; transform: none; }
#toast.show .toast { pointer-events: auto; }
.toast {
  display: flex; align-items: center; gap: 12px;
  max-width: 560px;
  padding: 12px 8px 12px 16px;
  border-radius: 14px;
  background: var(--ink); color: var(--bg);
  font-weight: 600; font-size: .95rem;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .45);
}
.toast-btn { min-height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--note); font-weight: 800; }

/* ---------- Primeira abertura ---------- */
.onb {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; flex-direction: column;
  padding: calc(16px + var(--safe-t)) 24px calc(24px + var(--safe-b));
}
.onb-skip { align-self: flex-end; min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--muted); font-weight: 650; }
.onb-body { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 460px; margin: 0 auto; width: 100%; }
.onb-note {
  width: 92px; height: 92px; margin-bottom: 30px;
  background: linear-gradient(225deg, transparent 16px, var(--note) 16px);
  border-radius: 6px; transform: rotate(-5deg);
  display: grid; place-items: center;
  font-size: 2.4rem; font-weight: 800; color: var(--note-ink);
}
.onb-big { margin: 0 0 6px; font-size: 2.4rem; font-weight: 900; letter-spacing: -.02em; }
.onb-text { margin: 10px 0 0; font-size: 1.3rem; line-height: 1.35; color: var(--muted); max-width: 22ch; }
.onb-foot { max-width: 460px; margin: 0 auto; width: 100%; }
.onb-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.onb-dots i { width: 8px; height: 8px; border-radius: 99px; background: var(--line); transition: width .2s; }
.onb-dots i.on { width: 22px; background: var(--ink); }

.fatal { text-align: center; padding: 60px 10px; }

@media (max-width: 360px) {
  #main { padding-left: 12px; padding-right: 12px; }
  .greeting { font-size: 1.25rem; }
  .nav-btn { font-size: .66rem; }
  .row2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Página de privacidade ---------- */
.doc { padding-bottom: 40px; max-width: 70ch; }
.doc h3 { margin: 26px 0 6px; font-size: 1.05rem; }
.doc p { margin: 0 0 10px; line-height: 1.6; }
