:root {
  --bg: #fff6ef; --card: #ffffff; --ink: #3d2c3e; --muted: #9a8a99; --line: #f1e4dc;
  --pink: #ff8fa3; --blue: #7bc8f6; --yellow: #ffd166; --green: #7ed9a6; --purple: #b9a3ff; --orange: #ffad7a;
  --danger: #ff6b6b; --radius: 22px; --shadow: 0 6px 20px rgba(120, 70, 90, .08);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Nunito', system-ui, sans-serif; font-weight: 600; }
body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.loading { display: grid; place-items: center; height: 100vh; font-size: 64px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 28px; font-weight: 900; margin: 0; }
h2 { font-size: 18px; font-weight: 800; margin: 22px 0 10px; }
.wrap { max-width: 640px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 16px 16px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.sub { color: var(--muted); font-size: 14px; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.list > * + * { border-top: 1.5px dashed var(--line); }
.item { display: flex; align-items: center; gap: 10px; padding: 11px 0; }
.item .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.done .t { text-decoration: line-through; color: var(--muted); }
.check { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--pink); background: #fff; flex: none; display: grid; place-items: center; cursor: pointer; padding: 0; }
.done .check { background: var(--pink); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 800; background: #fbeee7; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.btn { border: 0; border-radius: 16px; padding: 11px 16px; font-weight: 800; background: var(--pink); color: #fff; cursor: pointer; }
.btn.soft { background: #fbeee7; color: var(--ink); }
.btn.small { padding: 6px 11px; border-radius: 12px; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--muted); padding: 6px 8px; }
.btn:active { transform: scale(.97); }
form.add { display: grid; gap: 8px; }
form.add .row > * { flex: 1; min-width: 0; }
input, select, textarea { width: 100%; border: 2px solid var(--line); background: #fffdfb; border-radius: 14px; padding: 10px 12px; outline: none; font-size: 16px; }
input:focus, select:focus, textarea:focus { border-color: var(--pink); }
input[type=date], input[type=time] { min-width: 0; -webkit-appearance: none; appearance: none; min-height: 46px; }
label.f { min-width: 0; }
textarea { min-height: 80px; resize: vertical; }
label.f { font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
details summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 6px 0; }
.empty { color: var(--muted); text-align: center; padding: 18px 0; font-size: 15px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { border-radius: var(--radius); padding: 14px; color: var(--ink); box-shadow: var(--shadow); }
.tile b { font-size: 26px; font-weight: 900; display: block; }
.seg { display: flex; background: #fbeee7; border-radius: 16px; padding: 4px; margin: 10px 0 14px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 12px; font-weight: 800; cursor: pointer; }
.seg button.on { background: #fff; box-shadow: var(--shadow); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; margin: 6px -16px 0; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-btn { flex: none; border: 0; background: #fff; box-shadow: var(--shadow); border-radius: 99px; padding: 9px 14px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.chip-btn.on { background: var(--pink); color: #fff; }
.chip-btn small { opacity: .7; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.nav b { text-align: center; flex: 1; }
.badge { font-size: 12px; font-weight: 900; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.b-late { background: #ffe0e0; color: #c43c3c; } .b-soon { background: #fff1c9; color: #9a6b00; } .b-ok { background: #def7e8; color: #227a4b; }
/* Tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 10; }
.tabbar a { text-decoration: none; color: var(--muted); display: grid; justify-items: center; font-size: 11px; font-weight: 800; gap: 1px; padding: 4px 6px; border-radius: 14px; min-width: 52px; }
.tabbar a span { font-size: 22px; filter: grayscale(.7); opacity: .7; }
.tabbar a.on { color: var(--ink); background: #fbeee7; }
.tabbar a.on span { filter: none; opacity: 1; }
/* Calendario */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .h { font-size: 12px; color: var(--muted); padding-bottom: 4px; }
.cal button { border: 0; background: #fff; border-radius: 12px; aspect-ratio: 1; padding: 2px; display: grid; align-content: center; justify-items: center; gap: 2px; cursor: pointer; font-weight: 800; font-size: 14px; }
.cal button.out { opacity: .35; }
.cal button.today { outline: 2.5px solid var(--yellow); }
.cal button.sel { background: var(--pink); color: #fff; }
.cal .dots { display: flex; gap: 2px; height: 6px; }
.cal .dots i { width: 6px; height: 6px; border-radius: 50%; }
/* Menu */
.day { background: #fff; border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 10px; }
.day.today { outline: 2.5px solid var(--yellow); }
.day .slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.day .slots label { font-size: 12px; color: var(--muted); display: grid; gap: 3px; }
.day .slots input { padding: 8px 10px; font-size: 15px; }
.bar { height: 12px; border-radius: 99px; background: #fbeee7; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; border-radius: 99px; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; font-size: 14px; z-index: 20; max-width: calc(100% - 32px); text-align: center; }
.auth { max-width: 420px; margin: 0 auto; padding: 60px 16px; text-align: center; }
.auth .logo { font-size: 72px; }
.auth form { display: grid; gap: 10px; text-align: left; margin-top: 18px; }
.colors { display: flex; gap: 10px; justify-content: center; }
.colors label input { display: none; }
.colors label span { width: 36px; height: 36px; border-radius: 50%; display: block; border: 3px solid #fff; box-shadow: var(--shadow); cursor: pointer; }
.colors label input:checked + span { outline: 3px solid var(--ink); }
.demo { background: #fff1c9; color: #7a5600; font-size: 13px; padding: 8px 12px; border-radius: 14px; margin-bottom: 12px; }
