:root {
  --blue: #0b6bff; --blue-d: #0848b8; --blue-l: #e8f0ff; --ink: #0f1b33; --mute: #64718b;
  --bg: #f4f7fd; --card: #fff; --ok: #12a86b; --line: #dbe4f5;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.stick { position: sticky; top: 0; z-index: 8; }
.banner { display: block; width: 100%; border: 0; background: #d92d20; color: #fff; font-weight: 700; font-size: 14px; line-height: 1.3; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; text-align: center; cursor: pointer; }
a.banner { text-decoration: none; }
.banner[hidden] { display: none; }
.top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--blue); color: #fff; }
.top img { border-radius: 8px; }
.top h1 { margin: 0; font-size: 20px; letter-spacing: .2px; flex: 1; }
.net.out { border: 0; color: #fff; cursor: pointer; }
.modal { position: fixed; inset: 0; background: #0f1b3399; z-index: 20; display: grid; place-items: center; padding: 16px; }
.modal .box { width: 100%; max-width: 420px; margin: 0; }
.mute { color: var(--mute); font-size: 14px; }
.err { color: #c0261e; min-height: 1.2em; font-size: 14px; }
.net { font-size: 12px; background: #ffffff33; padding: 2px 8px; border-radius: 99px; }
.view { max-width: 560px; margin: 0 auto; padding: 12px; }
.view[hidden], [hidden] { display: none !important; }
.card { background: var(--card); border-radius: 16px; padding: 12px; margin-bottom: 12px; box-shadow: 0 1px 3px #0b2a6b14; }
.card h2 { margin: 0 0 8px; font-size: 17px; }
input, select, button { font: inherit; }
input, select { width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); margin-bottom: 8px; }
input:focus, select:focus { outline: none; border-color: var(--blue); }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.btn { border: 0; border-radius: 12px; padding: 12px; background: var(--blue-l); color: var(--blue-d); font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--blue); color: #fff; width: 100%; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.btn.danger { background: #fff0f0; color: #c0261e; }
.btn:active { transform: scale(.98); }
.group h3 { margin: 14px 4px 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--blue-d); }
.item { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 10px 12px; margin-bottom: 6px; box-shadow: 0 1px 2px #0b2a6b10; }
.item input[type=checkbox] { width: 26px; height: 26px; margin: 0; accent-color: var(--ok); flex: none; }
.item .t { flex: 1; min-width: 0; word-break: break-word; }
.item .t small { display: block; color: var(--mute); }
.item.done .t b { text-decoration: line-through; color: var(--mute); }
.item .spent { width: 96px; margin: 0; padding: 8px; font-size: 14px; }
.item .x { background: none; border: 0; font-size: 22px; color: var(--mute); padding: 4px 8px; cursor: pointer; }
.prog { font-size: 13px; color: var(--mute); margin: 4px 4px 0; display: flex; justify-content: space-between; align-items: center; }
.prog button { background: none; border: 0; color: #c0261e; font-size: 13px; cursor: pointer; }
.rank { margin: 0; padding-left: 0; list-style: none; counter-reset: r; }
.rank li { counter-increment: r; display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rank li:last-child { border: 0; }
.rank li::before { content: counter(r); width: 24px; height: 24px; border-radius: 50%; background: var(--blue-l); color: var(--blue-d); font-weight: 700; font-size: 13px; display: grid; place-items: center; flex: none; }
.rank li span { flex: 1; }
.rank li small { color: var(--mute); }
.empty { text-align: center; color: var(--mute); padding: 24px 12px; }
.foot { text-align: center; font-size: 13px; }
.foot a { color: var(--mute); }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs button { flex: 1; border: 0; background: none; padding: 16px 0; font-weight: 600; color: var(--mute); cursor: pointer; }
.tabs button.on { color: var(--blue); box-shadow: inset 0 3px 0 var(--blue); }
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 99px; font-size: 14px; z-index: 9; max-width: 90%; }
/* paginas de texto */
.doc { max-width: 640px; margin: 0 auto; padding: 16px; }
.doc h1 { color: var(--blue-d); }
.doc li { margin-bottom: 4px; }
.top .refresh{margin-left:auto;font-size:18px;line-height:1;padding:4px 10px;border-radius:14px;border:1px solid rgba(255,255,255,.6);background:transparent;color:#fff;cursor:pointer}
.top .out + .refresh, .top .net:not([hidden]) ~ .refresh{margin-left:6px}
