/* ============================================================
   Finatex — sistema visual
   Tokens extraídos 1:1 del rediseño (Claude Design).
   ============================================================ */

:root {
  --canvas:#E9ECE6; --bg:#F6F7F4; --surface:#FFFFFF; --border:#E7EAE5;
  --line:#EEF0EC; --ink:#161A17; --muted:#6E756F; --faint:#9AA39C;
  --brand:#0E7A4F; --brandtext:#0E7A4F; --green:#0E7A4F; --greensoft:#E3F2EA;
  --red:#B23B2E; --redsoft:#F7E8E5; --tabbg:#FFFFFF; --chipbg:#FBFCFA;
  --shadow:0 24px 60px rgba(20,30,25,.16);
  --warn:#B8791C; --warnsoft:#FCF4E6; --warnborder:#E0A23C;
  --sans:'Plus Jakarta Sans',system-ui,sans-serif;
  --serif:'Newsreader',Georgia,serif;
  --mono:'IBM Plex Mono',ui-monospace,monospace;
}
[data-theme="dark"] {
  --canvas:#0D0B08; --bg:#15120E; --surface:#211C16; --border:#2A241D;
  --line:#221D17; --ink:#F3ECDF; --muted:#9B9080; --faint:#6E655A;
  --brand:#2E9E69; --brandtext:#7FCBA0; --green:#7FCBA0; --greensoft:#17251C;
  --red:#D2796A; --redsoft:#291C16; --tabbg:#1B1712; --chipbg:#1B1712;
  --shadow:0 24px 60px rgba(0,0,0,.32);
  --warn:#E0A23C; --warnsoft:#241C12; --warnborder:#5A4426;
}

* { box-sizing:border-box; -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; -webkit-tap-highlight-color:transparent; }
html,body { height:100%; }
body {
  margin:0;
  font-family:var(--sans);
  font-variant-numeric:tabular-nums lining-nums;
  background:var(--canvas);
  color:var(--ink);
  transition:background .25s ease,color .25s ease;
}
button { font-family:inherit; color:inherit; }
.mono { font-family:var(--mono); font-variant-numeric:tabular-nums; }
.serif { font-family:var(--serif); }
.pos { color:var(--green); }
.neg { color:var(--red); }
.neu { color:var(--ink); }
.hidden { display:none !important; }

/* ---------- App shell (centered phone column) ---------- */
#app {
  position:relative;
  width:100%;
  max-width:440px;
  min-height:100dvh;
  margin:0 auto;
  background:var(--bg);
  color:var(--ink);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  box-shadow:var(--shadow);
  padding-top:env(safe-area-inset-top); /* respeta la barra de estado real del teléfono */
}
@media (min-width:480px){
  body { padding:24px 0; display:flex; align-items:center; justify-content:center; }
  #app { min-height:840px; height:92dvh; border-radius:34px; border:1px solid var(--border); }
}

/* ---------- Screens ---------- */
.screens { flex:1; position:relative; overflow:hidden; }
.screen {
  position:absolute; inset:0;
  display:none; flex-direction:column;
  overflow-y:auto; overflow-x:hidden;
  padding:14px 18px 40px;
}
.screen.active { display:flex; }
/* Los bloques de contenido nunca se encogen — la pantalla scrollea.
   (Sin esto, los .list con overflow:hidden se comprimen y recortan items.) */
.screen > * { flex-shrink:0; }
.screen::-webkit-scrollbar { width:0; }
.screen.flush { padding:14px 22px 40px; }
/* clear the bottom nav only on screens that show it */
#app.tabbar-on .screen { padding-bottom:calc(96px + env(safe-area-inset-bottom)); }

.screen-head {
  display:flex; align-items:center; gap:12px; padding:8px 2px 4px; min-height:46px;
}
.screen-head .title { font-family:var(--serif); font-size:19px; font-weight:500; flex:1; }
.icon-btn {
  width:38px; height:38px; border-radius:12px; background:var(--surface);
  border:1px solid var(--border); display:flex; align-items:center; justify-content:center;
  color:var(--ink); cursor:pointer; flex-shrink:0; padding:0;
}
.icon-btn.sm { width:34px; height:34px; border-radius:10px; color:var(--brandtext); }
.icon-btn svg { width:19px; height:19px; }
.link { color:var(--brandtext); font-weight:600; font-size:12.5px; cursor:pointer; background:none; border:none; }

/* ---------- Cards ---------- */
.card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:20px; padding:18px;
}
.card.tight { border-radius:16px; padding:15px 16px; }
.section-label {
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.6px;
  color:var(--muted); margin:2px 0 0 2px;
}

/* ---------- Balance ---------- */
.balance-label { font-size:11px; letter-spacing:1.4px; text-transform:uppercase; color:var(--muted); font-weight:600; }
.balance-amount { font-family:var(--serif); font-size:38px; font-weight:500; margin-top:4px; }
.balance-split { display:flex; gap:10px; margin-top:14px; }
.balance-pill { flex:1; border-radius:13px; padding:9px 12px; }
.balance-pill.in { background:var(--greensoft); }
.balance-pill.out { background:var(--redsoft); }
.balance-pill .lbl { font-size:9.5px; font-weight:700; letter-spacing:.6px; }
.balance-pill.in .lbl { color:var(--green); }
.balance-pill.out .lbl { color:var(--red); }
.balance-pill .val { font-family:var(--mono); font-size:13px; font-weight:600; margin-top:3px; }
.balance-pill.in .val { color:var(--green); }
.balance-pill.out .val { color:var(--red); }

/* ---------- User header ---------- */
.user-row { display:flex; justify-content:space-between; align-items:center; padding:8px 2px 0; }
.user-id { display:flex; align-items:center; gap:10px; }
.avatar {
  width:36px; height:36px; border-radius:11px; background:var(--brand);
  display:flex; align-items:center; justify-content:center; color:#fff;
  font-family:var(--serif); font-weight:600; font-size:18px; flex-shrink:0;
}
.avatar.lg { width:48px; height:48px; border-radius:14px; font-size:20px; }
.user-greet { font-size:11px; color:var(--muted); font-weight:500; }
.user-wallet { font-family:var(--serif); font-size:17px; font-weight:500; }

/* ---------- Accounts strip ---------- */
.row-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.row-head .h { font-family:var(--serif); font-size:15px; font-weight:500; }
.accounts {
  display:flex; gap:10px; overflow-x:auto; padding:2px 22px 6px 2px; margin:0 -18px;
  scroll-snap-type:x mandatory;
}
.accounts::-webkit-scrollbar { height:0; }
.account-card {
  min-width:132px; background:var(--surface); border:1px solid var(--border);
  border-radius:16px; padding:13px; flex-shrink:0; scroll-snap-align:start; cursor:pointer;
}
.account-card .name { display:flex; align-items:center; gap:7px; font-size:12px; font-weight:600; }
.account-card .dot { width:9px; height:9px; border-radius:50%; flex-shrink:0; }
.account-card .amt { font-family:var(--mono); font-size:15px; font-weight:600; margin-top:11px; }
.account-card .sub { font-size:10px; color:var(--muted); margin-top:2px; }

/* ---------- Transaction rows ---------- */
.tx-group-head { display:flex; justify-content:space-between; align-items:center; margin:6px 2px 0; }
.tx-group-head .d { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--muted); }
.tx-group-head .sum { font-family:var(--mono); font-size:11px; }
.tx {
  display:flex; align-items:center; gap:12px; padding:11px 2px;
  border-bottom:1px solid var(--line); cursor:pointer;
}
.tx:last-child { border-bottom:none; }
.tx-ico {
  width:38px; height:38px; border-radius:11px; background:var(--chipbg);
  border:1px solid var(--border); display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.tx-ico .dot { width:10px; height:10px; border-radius:50%; }
.tx-body { flex:1; min-width:0; }
.tx-body .t { font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tx-body .m { font-size:11px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tx-amt { font-family:var(--mono); font-size:13px; font-weight:600; flex-shrink:0; }

/* ---------- Bottom nav ---------- */
.tabbar {
  position:absolute; left:0; right:0; bottom:0;
  border-top:1px solid var(--border); background:var(--tabbg);
  padding:8px 14px calc(12px + env(safe-area-inset-bottom));
  display:flex; align-items:flex-end; z-index:30;
}
.tab {
  flex:1; display:flex; flex-direction:column; align-items:center; gap:3px;
  font-size:10px; font-weight:600; color:var(--faint); background:none; border:none; cursor:pointer; padding:0;
}
.tab svg { width:21px; height:21px; }
.tab.active { color:var(--brandtext); }
.tab.fab { justify-content:center; }
.fab-btn {
  width:52px; height:52px; border-radius:16px; background:var(--brand); color:#fff;
  display:flex; align-items:center; justify-content:center; margin-top:-24px;
  box-shadow:0 6px 14px rgba(0,0,0,.16); border:none; cursor:pointer;
}
.fab-btn svg { width:24px; height:24px; }

/* ---------- Segmented controls ---------- */
.seg { display:flex; gap:6px; background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:5px; }
.seg.sm { border-radius:12px; padding:4px; }
.seg button {
  flex:1; text-align:center; padding:9px 4px; border-radius:10px; border:none; cursor:pointer;
  color:var(--muted); font-size:12px; font-weight:600; background:transparent;
}
.seg.sm button { padding:8px; border-radius:8px; }
.seg button.on { background:var(--brand); color:#fff; font-weight:700; }
.pillrow { display:flex; gap:7px; flex-wrap:wrap; }
.pill {
  padding:7px 13px; border-radius:9px; background:var(--surface); border:1px solid var(--border);
  color:var(--muted); font-size:12px; font-weight:600; cursor:pointer;
}
.pill.on { background:var(--brand); color:#fff; border-color:transparent; }

/* ---------- Add / NL input ---------- */
.nl-card { padding:18px; }
.nl-label { font-size:10.5px; color:var(--muted); font-weight:700; letter-spacing:.7px; text-transform:uppercase; margin-bottom:11px; }
.nl-input {
  font-family:var(--serif); font-size:22px; font-weight:500; line-height:1.4;
  color:var(--ink); outline:none; min-height:32px; border:none; background:none; width:100%; resize:none;
}
.nl-input:empty:before { content:attr(data-ph); color:var(--faint); }
.interpret-head { display:flex; align-items:center; gap:9px; margin-bottom:13px; }
.interpret-dot { width:7px; height:7px; border-radius:50%; background:var(--brand); box-shadow:0 0 0 4px var(--greensoft); flex-shrink:0; }
.interpret-msg { font-size:12px; font-weight:600; color:var(--brandtext); }
.chips { display:flex; flex-wrap:wrap; gap:8px; }
.chip {
  display:flex; align-items:center; gap:6px; padding:8px 12px; border:1px solid var(--border);
  border-radius:11px; background:var(--chipbg); font-size:12px; font-weight:600; cursor:pointer;
}
.chip .k { color:var(--faint); font-weight:500; }
.chip .dot { width:8px; height:8px; border-radius:50%; }
.chip.missing { border:1.5px dashed var(--warnborder); background:var(--warnsoft); color:var(--warn); font-weight:700; }
.preview {
  border-radius:16px; padding:13px 16px; display:flex; justify-content:space-between; align-items:center;
}
.preview.out { background:var(--redsoft); }
.preview.in { background:var(--greensoft); }
.preview .t { font-size:13px; font-weight:700; }
.preview .m { font-size:11px; color:var(--muted); margin-top:2px; }
.preview .a { font-family:var(--mono); font-size:18px; font-weight:600; }

.warn-card { border:1px solid var(--warnborder); }
.warn-head { display:flex; align-items:center; gap:9px; margin-bottom:13px; }
.warn-badge {
  width:22px; height:22px; border-radius:50%; background:var(--warnsoft); display:flex;
  align-items:center; justify-content:center; color:var(--warn); flex-shrink:0;
}
.warn-msg { font-size:12px; font-weight:700; color:var(--warn); }
.acct-choices { display:flex; gap:8px; flex-wrap:wrap; margin-top:6px; }
.acct-choice {
  flex:1; min-width:88px; text-align:center; padding:9px 4px; border-radius:11px; background:var(--bg);
  border:1px solid var(--border); font-size:12px; font-weight:600; cursor:pointer;
}
.acct-choice .dot { width:8px; height:8px; border-radius:50%; display:inline-block; margin-right:5px; }

/* ---------- Selector de color (círculos) ---------- */
.color-row { display:flex; flex-wrap:wrap; gap:12px; margin-top:4px; }
.color-dot {
  width:34px; height:34px; border-radius:50%; border:none; padding:0; cursor:pointer;
  outline:2.5px solid transparent; outline-offset:2px; transition:outline-color .12s, transform .08s;
  -webkit-tap-highlight-color:transparent;
}
.color-dot:active { transform:scale(.9); }
.color-dot.on { outline-color:var(--ink); }

/* ---------- Aceptar términos (login) ---------- */
.accept-row {
  display:flex; align-items:flex-start; gap:10px; cursor:pointer;
  padding:6px 4px 14px; -webkit-user-select:none; user-select:none;
}
.accept-row input { position:absolute; opacity:0; width:0; height:0; }
.accept-box {
  width:22px; height:22px; border-radius:7px; border:2px solid var(--border);
  background:var(--surface); flex-shrink:0; margin-top:1px;
  display:flex; align-items:center; justify-content:center; transition:.15s;
}
.accept-box svg { width:14px; height:14px; opacity:0; transition:.15s; }
.accept-row input:checked + .accept-box { background:var(--brand); border-color:var(--brand); }
.accept-row input:checked + .accept-box svg { opacity:1; }
.accept-text { font-size:11.5px; color:var(--muted); line-height:1.5; }
.accept-text a { color:var(--brandtext); font-weight:600; text-decoration:none; }
.accept-row.shake { animation:shake .35s ease; }
.accept-row.shake .accept-box { border-color:var(--red); }

/* ---------- Collapsible sections (Ajustes) ---------- */
.collapse-head {
  width:100%; display:flex; align-items:center; justify-content:space-between;
  background:none; border:none; padding:14px 2px 6px; margin-top:8px; cursor:pointer;
  color:var(--ink);
}
.collapse-head .chev { color:var(--muted); transition:transform .28s ease; flex-shrink:0; }
.collapse-head.open .chev { transform:rotate(90deg); }
.collapse-count {
  font-size:11px; font-weight:700; color:var(--brandtext);
  background:var(--greensoft); padding:1px 7px; border-radius:8px; margin-left:4px;
  -webkit-text-fill-color:var(--brandtext);
}
.collapse-body {
  max-height:0; overflow:hidden; opacity:0;
  transition:max-height .32s ease, opacity .25s ease;
}
.collapse-body.open { max-height:1600px; opacity:1; }

/* ---------- Buttons ---------- */
.btn {
  height:54px; border-radius:16px; background:var(--brand); color:#fff; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:9px; font-size:15px; font-weight:700; width:100%;
}
.btn.ghost { background:var(--surface); border:1px solid var(--border); color:var(--ink); }
.btn.disabled { background:var(--border); color:var(--faint); pointer-events:none; }
.btn svg { width:20px; height:20px; }
.add-bar { display:flex; gap:11px; align-items:center; padding-top:6px; margin-top:auto; }
.mic-btn {
  width:54px; height:54px; border-radius:16px; background:var(--surface); border:1px solid var(--border);
  color:var(--brandtext); display:flex; align-items:center; justify-content:center; flex-shrink:0; cursor:pointer;
}

/* ---------- Budgets ---------- */
.budget-top { display:flex; align-items:baseline; gap:8px; margin-top:8px; }
.budget-top .big { font-family:var(--mono); font-size:26px; font-weight:600; }
.budget-top .of { font-size:13px; color:var(--muted); }
.bar { height:10px; border-radius:6px; background:var(--chipbg); border:1px solid var(--border); overflow:hidden; }
.bar.sm { height:8px; border-radius:5px; }
.bar > span { display:block; height:100%; border-radius:6px; background:var(--brand); }
.budget-note { display:flex; align-items:center; gap:7px; margin-top:11px; font-size:11.5px; color:var(--muted); }
.budget-cat-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:9px; }
.budget-cat-head .l { display:flex; align-items:center; gap:8px; }
.budget-cat-head .sq { width:9px; height:9px; border-radius:3px; }
.budget-cat-head .nm { font-size:13px; font-weight:600; }
.budget-cat-head .ratio { font-family:var(--mono); font-size:12px; color:var(--muted); }
.badge-warn { font-size:10px; font-weight:700; color:var(--warn); background:var(--warnsoft); padding:2px 7px; border-radius:6px; }
.alert-line { display:flex; align-items:center; gap:6px; margin-top:8px; font-size:11px; color:var(--warn); font-weight:600; }

/* ---------- Analysis ---------- */
.donut-wrap { display:flex; align-items:center; gap:18px; }
.donut { width:118px; height:118px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.donut .hole { width:74px; height:74px; border-radius:50%; background:var(--surface); display:flex; flex-direction:column; align-items:center; justify-content:center; }
.donut .hole .k { font-size:9px; color:var(--muted); font-weight:600; }
.donut .hole .v { font-family:var(--mono); font-size:13px; font-weight:600; }
.legend { flex:1; display:flex; flex-direction:column; gap:9px; }
.legend .row { display:flex; align-items:center; gap:8px; font-size:12px; }
.legend .sq { width:9px; height:9px; border-radius:3px; }
.legend .nm { flex:1; color:var(--muted); }
.legend .pc { font-weight:700; }
.weekbars { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; height:120px; }
.weekbars .col { flex:1; display:flex; flex-direction:column; align-items:center; gap:7px; height:100%; justify-content:flex-end; }
.weekbars .col > span:first-child { width:100%; background:var(--greensoft); border-radius:7px 7px 4px 4px; }
.weekbars .col.on > span:first-child { background:var(--brand); }
.weekbars .col .lab { font-size:10px; color:var(--muted); }
.weekbars .col.on .lab { color:var(--ink); font-weight:700; }
.note-soft { background:var(--greensoft); border-radius:16px; padding:13px 16px; display:flex; align-items:center; gap:11px; font-size:12px; line-height:1.4; }

/* ---------- Goals ---------- */
.goal-ring-wrap { display:flex; flex-direction:column; align-items:center; text-align:center; }
.goal-ring { width:140px; height:140px; border-radius:50%; display:flex; align-items:center; justify-content:center; }
.goal-ring .hole { width:104px; height:104px; border-radius:50%; background:var(--surface); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; }
.goal-ring .emoji { font-size:24px; }
.goal-ring .pc { font-family:var(--mono); font-size:27px; font-weight:700; color:var(--brandtext); }
.goal-mini-stats { display:flex; gap:10px; margin-top:16px; width:100%; }
.goal-mini { flex:1; background:var(--chipbg); border:1px solid var(--border); border-radius:12px; padding:10px; }
.goal-mini .k { font-size:10px; color:var(--muted); font-weight:600; }
.goal-mini .v { font-family:var(--mono); font-size:13px; font-weight:600; margin-top:2px; }
.goal-row { display:flex; align-items:center; gap:13px; }
.goal-row .em { width:40px; height:40px; border-radius:12px; background:var(--chipbg); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:17px; font-weight:700; color:var(--brandtext); flex-shrink:0; }
.goal-row .body { flex:1; }
.goal-row .body .t { font-size:13.5px; font-weight:700; }
.goal-row .pc { font-family:var(--mono); font-size:12px; font-weight:600; color:var(--muted); }

/* ---------- Detail ---------- */
.detail-hero { border-radius:20px; padding:24px; text-align:center; }
.detail-hero.out { background:var(--redsoft); }
.detail-hero.in { background:var(--greensoft); }
.detail-hero .ico { width:46px; height:46px; border-radius:14px; background:var(--bg); display:flex; align-items:center; justify-content:center; margin:0 auto 12px; }
.detail-hero .ico .dot { width:13px; height:13px; border-radius:50%; }
.detail-hero .amt { font-family:var(--mono); font-size:32px; font-weight:600; }
.detail-hero .lbl { font-size:14px; font-weight:700; margin-top:6px; }
.kv { background:var(--surface); border:1px solid var(--border); border-radius:16px; overflow:hidden; }
.kv .row { display:flex; justify-content:space-between; align-items:center; padding:13px 15px; }
.kv .k { font-size:12.5px; color:var(--muted); }
.kv .v { font-size:13px; font-weight:600; display:flex; align-items:center; gap:7px; }
.kv .v .dot { width:8px; height:8px; border-radius:50%; }
.kv .sep { height:1px; background:var(--line); margin:0 15px; }
.danger-row { display:flex; align-items:center; justify-content:center; gap:9px; padding:14px; color:var(--red); font-size:13.5px; font-weight:700; cursor:pointer; background:none; border:none; width:100%; }

/* ---------- Settings ---------- */
.list { background:var(--surface); border:1px solid var(--border); border-radius:16px; overflow:hidden; }
.list .item { display:flex; align-items:center; gap:12px; padding:13px 15px; cursor:pointer; }
.list .sep { height:1px; background:var(--line); margin:0 15px; }
.item-ico { width:30px; height:30px; border-radius:9px; background:var(--chipbg); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; color:var(--brandtext); flex-shrink:0; }
.item-ico svg { width:16px; height:16px; }
.item .lab { flex:1; font-size:13.5px; font-weight:600; }
.item .val { font-size:12.5px; color:var(--muted); font-weight:600; }
.chev { color:var(--faint); flex-shrink:0; }
.toggle { width:44px; height:26px; border-radius:13px; background:var(--chipbg); border:1px solid var(--border); position:relative; flex-shrink:0; cursor:pointer; transition:background .2s; }
.toggle > span { position:absolute; top:2px; left:2px; width:20px; height:20px; border-radius:50%; background:var(--faint); transition:.2s; }
.toggle.on { background:var(--brand); border-color:transparent; }
.toggle.on > span { left:auto; right:3px; top:3px; background:#fff; }
.profile-card { background:var(--surface); border:1px solid var(--border); border-radius:18px; padding:15px; display:flex; align-items:center; gap:13px; }
.premium-card { background:var(--brand); border-radius:18px; padding:15px 16px; display:flex; align-items:center; gap:13px; color:#fff; cursor:pointer; }
.premium-card .em { width:38px; height:38px; border-radius:11px; background:rgba(255,255,255,.18); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.premium-card .cta { background:#fff; color:var(--brand); font-size:11px; font-weight:700; padding:6px 12px; border-radius:9px; }

/* ---------- Empty state ---------- */
.empty { flex:1; display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center; gap:7px; padding:18px 0 28px; }
.empty .bubble { width:58px; height:58px; border-radius:18px; background:var(--greensoft); display:flex; align-items:center; justify-content:center; color:var(--green); margin-bottom:4px; }
.empty .h { font-family:var(--serif); font-size:21px; font-weight:600; }
.empty .p { font-size:13px; color:var(--muted); line-height:1.5; max-width:260px; }
.try-card { margin-top:10px; width:100%; background:var(--surface); border:1.5px dashed var(--brand); border-radius:16px; padding:15px 16px; text-align:left; cursor:pointer; }
.try-card .k { font-size:10px; color:var(--brandtext); font-weight:700; letter-spacing:.5px; text-transform:uppercase; margin-bottom:7px; }
.try-card .ex { font-family:var(--serif); font-size:18px; font-weight:500; }
.quick-ex { display:flex; gap:8px; flex-wrap:wrap; justify-content:center; margin-top:12px; }
.quick-ex span { font-size:12px; font-weight:600; color:var(--muted); background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:8px 12px; cursor:pointer; }

/* ---------- Toast ---------- */
#toast {
  position:absolute; left:18px; right:18px; bottom:90px; z-index:60;
  background:#16241B; border-radius:16px; padding:14px 16px; display:flex; align-items:center; gap:12px;
  box-shadow:0 12px 30px rgba(0,0,0,.25);
  opacity:0; transform:translateY(20px); pointer-events:none;
  transition:opacity .28s ease, transform .32s cubic-bezier(.2,.9,.3,1);
}
#toast.show { opacity:1; transform:translateY(0); pointer-events:auto; }
#toast .ico { width:32px; height:32px; border-radius:50%; background:#2E9E69; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
#toast .body { flex:1; }
#toast .body .t { font-size:13.5px; font-weight:700; color:#fff; }
#toast .body .m { font-size:11.5px; color:#9FB8A8; }
#toast .undo { font-size:12px; font-weight:700; color:#7FCBA0; cursor:pointer; background:none; border:none; }

/* ---------- Modal sheet ---------- */
.sheet-backdrop {
  position:absolute; inset:0; z-index:210; background:rgba(0,0,0,.4);
  display:none; align-items:flex-end; justify-content:center;
}
.sheet-backdrop.show { display:flex; }
.sheet {
  width:100%; background:var(--bg); border-radius:24px 24px 0 0; padding:10px 18px calc(20px + env(safe-area-inset-bottom));
  border-top:1px solid var(--border); max-height:86%; overflow-y:auto; animation:sheetup .26s ease;
}
@keyframes sheetup { from { transform:translateY(100%); } to { transform:translateY(0); } }
.sheet .grab { width:38px; height:4px; border-radius:3px; background:var(--border); margin:2px auto 14px; }
.sheet h3 { font-family:var(--serif); font-size:18px; font-weight:600; margin:0 0 14px; }
.field { margin-bottom:14px; }
.field label { display:block; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--muted); margin-bottom:6px; }
.field input, .field select {
  width:100%; height:48px; border-radius:12px; border:1px solid var(--border); background:var(--surface);
  color:var(--ink); padding:0 14px; font-size:14px; font-family:inherit; outline:none;
}
.field input:focus, .field select:focus { border-color:var(--brand); }

/* ---------- Onboarding / static info screens ---------- */
.login-center { flex:1; display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center; gap:6px; }
.login-mark { width:66px; height:66px; border-radius:20px; background:var(--brand); display:flex; align-items:center; justify-content:center; color:#fff; font-family:var(--serif); font-weight:600; font-size:34px; margin-bottom:8px; }
.oauth { height:52px; border-radius:14px; display:flex; align-items:center; justify-content:center; gap:11px; font-size:14.5px; font-weight:600; cursor:pointer; }
.oauth.google { background:#fff; border:1px solid #DADCE0; color:#3c4043; }
.oauth.mail { background:var(--surface); border:1px solid var(--border); color:var(--ink); }
.oauth.skip { background:none; border:1px dashed var(--border); color:var(--muted); }
.login-or { display:flex; align-items:center; gap:12px; color:var(--faint); font-size:12px; margin:2px 0; }
.login-or::before, .login-or::after { content:''; flex:1; height:1px; background:var(--border); }
.feat-row { display:flex; gap:13px; align-items:flex-start; }
.feat-ico { width:34px; height:34px; border-radius:10px; background:var(--chipbg); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; color:var(--brandtext); flex-shrink:0; }
.feat-row .t { font-size:13.5px; font-weight:700; }
.feat-row .d { font-size:12px; color:var(--muted); line-height:1.45; margin-top:2px; }
.roadmap-badge { font-size:10px; font-weight:700; letter-spacing:.4px; text-transform:uppercase; color:var(--brandtext); background:var(--greensoft); padding:5px 10px; border-radius:8px; }

.fab-spacer { height:8px; }

/* ---------- Plan picker (paywall) ---------- */
.plan { border:1px solid var(--border); transition:border-color .15s, background .15s; }
.plan.on { border:1.5px solid var(--brand); background:var(--greensoft); }

/* ---------- Interactive tutorial ---------- */
.tut-backdrop {
  position:absolute; inset:0; z-index:80; background:rgba(0,0,0,.62);
  display:none; align-items:center; justify-content:center; padding:24px;
}
.tut-backdrop.show { display:flex; }
.tut-card {
  background:var(--bg); border:1px solid var(--border); border-radius:24px;
  padding:28px 22px 20px; width:100%; max-width:344px; text-align:center; box-shadow:var(--shadow);
  animation:tutpop .22s ease;
}
@keyframes tutpop { from { opacity:0; transform:scale(.94); } to { opacity:1; transform:scale(1); } }
.tut-emoji { width:64px; height:64px; margin:0 auto; border-radius:18px; background:var(--greensoft); color:var(--brandtext); display:flex; align-items:center; justify-content:center; }
.tut-emoji svg { width:32px; height:32px; }
.tut-title { font-size:21px; font-weight:600; margin-top:12px; }
.tut-text { font-size:13.5px; color:var(--muted); line-height:1.55; margin-top:8px; }
.tut-text b { color:var(--ink); }
.tut-dots { display:flex; gap:6px; justify-content:center; margin:18px 0; }
.tut-dots span { width:7px; height:7px; border-radius:50%; background:var(--border); transition:.2s; }
.tut-dots span.on { background:var(--brand); width:18px; border-radius:4px; }
.tut-actions { display:flex; gap:10px; align-items:center; }
.tut-skip { background:none; border:none; color:var(--muted); font-weight:600; font-size:13px; cursor:pointer; padding:10px 14px; }

/* ---------- Login ---------- */
.oauth { width:100%; }


/* ---------- Lock screen (PIN + biometria) ---------- */
#lock-overlay {
  position:fixed; inset:0; z-index:200;
  background:var(--bg);
  display:flex; align-items:center; justify-content:center;
  padding-bottom:env(safe-area-inset-bottom);
}
#lock-overlay.hidden { display:none; }
.lock-inner {
  display:flex; flex-direction:column; align-items:center;
  width:100%; max-width:340px; padding:0 24px;
  gap:0;
}
.lock-avatar {
  width:72px; height:72px; border-radius:50%;
  background:var(--brand); color:#fff;
  font-family:var(--serif); font-size:30px; font-weight:600;
  display:flex; align-items:center; justify-content:center;
  margin-bottom:14px;
}
.lock-user { font-family:var(--serif); font-size:21px; font-weight:600; margin-bottom:4px; }
.lock-hint { font-size:13px; color:var(--muted); margin-bottom:26px; }
.lock-dots {
  display:flex; gap:18px; margin-bottom:8px;
}
.lock-dots span {
  width:13px; height:13px; border-radius:50%;
  background:var(--border);
  transition:background .14s, transform .14s;
}
.lock-dots span.filled {
  background:var(--brand); transform:scale(1.08);
}
.lock-err {
  font-size:12px; color:var(--red); font-weight:600;
  min-height:18px; margin-bottom:4px;
  animation:shake .3s ease;
}
.lock-err.hidden { visibility:hidden; }
@keyframes shake {
  0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)}
}
.lock-pad {
  display:grid; grid-template-columns:repeat(3,1fr);
  gap:6px; width:100%; max-width:290px;
  margin-top:24px;
}
.lock-key {
  aspect-ratio:1; border-radius:50%;
  background:none; border:none;
  font-size:29px; font-weight:500; font-family:var(--sans);
  color:var(--ink);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; -webkit-user-select:none; user-select:none;
  transition:background .15s ease, transform .08s ease;
  -webkit-tap-highlight-color:transparent;
}
.lock-key:active { background:var(--greensoft); transform:scale(.94); }
.lock-key.empty { background:none; border:none; cursor:default; }
.lock-key.del { font-size:17px; background:none; border:none; color:var(--muted); }
.lock-key.del:active { background:var(--greensoft); }
.lock-bio {
  margin-top:24px; background:none; border:none;
  color:var(--muted); cursor:pointer; padding:10px;
  transition:color .15s;
  -webkit-tap-highlight-color:transparent;
}
.lock-bio:active { color:var(--brand); }
.lock-bio.hidden { display:none; }
.lock-forgot {
  margin-top:10px; background:none; border:none;
  font-size:12.5px; color:var(--muted); cursor:pointer; text-decoration:underline;
}
