/* CuentAX — libreta de cuentas: papel cálido, tinta verde-negra, acento agave. */

@font-face {
  font-family: "Geist";
  src: url("fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: oklch(0.972 0.008 85);
  --surface: oklch(0.993 0.004 85);
  --surface-2: oklch(0.947 0.011 85);
  --ink: oklch(0.23 0.022 165);
  --ink-2: oklch(0.44 0.02 165);
  --ink-3: oklch(0.57 0.016 165);
  --line: oklch(0.895 0.011 85);
  --line-strong: oklch(0.82 0.014 85);
  --accent: oklch(0.47 0.105 163);
  --accent-press: oklch(0.42 0.1 163);
  --accent-ink: oklch(0.99 0.01 163);
  --accent-soft: oklch(0.93 0.035 163);
  --accent-soft-ink: oklch(0.36 0.08 163);
  --income: oklch(0.48 0.115 152);
  --warn: oklch(0.6 0.14 55);
  --warn-soft: oklch(0.94 0.04 70);
  --danger: oklch(0.53 0.17 27);
  --danger-soft: oklch(0.94 0.035 27);
  --shadow-sheet: 0 -12px 40px -12px oklch(0.25 0.03 165 / 0.22);
  --shadow-pop: 0 10px 30px -10px oklch(0.25 0.03 165 / 0.28), 0 2px 6px -2px oklch(0.25 0.03 165 / 0.12);
  --scrim: oklch(0.2 0.02 165 / 0.38);

  --m1: oklch(0.6 0.12 163);
  --m2: oklch(0.62 0.13 30);
  --m3: oklch(0.6 0.12 260);
  --m4: oklch(0.66 0.12 80);
  --m5: oklch(0.58 0.13 330);
  --m6: oklch(0.6 0.1 210);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: oklch(0.17 0.012 165);
    --surface: oklch(0.205 0.014 165);
    --surface-2: oklch(0.245 0.016 165);
    --ink: oklch(0.955 0.008 85);
    --ink-2: oklch(0.78 0.012 85);
    --ink-3: oklch(0.64 0.012 85);
    --line: oklch(0.29 0.014 165);
    --line-strong: oklch(0.36 0.016 165);
    --accent: oklch(0.74 0.12 163);
    --accent-press: oklch(0.68 0.12 163);
    --accent-ink: oklch(0.18 0.03 165);
    --accent-soft: oklch(0.29 0.05 163);
    --accent-soft-ink: oklch(0.86 0.08 163);
    --income: oklch(0.76 0.13 152);
    --warn: oklch(0.78 0.13 70);
    --warn-soft: oklch(0.3 0.05 70);
    --danger: oklch(0.72 0.15 27);
    --danger-soft: oklch(0.3 0.06 27);
    --shadow-sheet: 0 -12px 40px -12px oklch(0 0 0 / 0.6);
    --shadow-pop: 0 10px 30px -10px oklch(0 0 0 / 0.6);
    --scrim: oklch(0.05 0.01 165 / 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: oklch(0.17 0.012 165);
  --surface: oklch(0.205 0.014 165);
  --surface-2: oklch(0.245 0.016 165);
  --ink: oklch(0.955 0.008 85);
  --ink-2: oklch(0.78 0.012 85);
  --ink-3: oklch(0.64 0.012 85);
  --line: oklch(0.29 0.014 165);
  --line-strong: oklch(0.36 0.016 165);
  --accent: oklch(0.74 0.12 163);
  --accent-press: oklch(0.68 0.12 163);
  --accent-ink: oklch(0.18 0.03 165);
  --accent-soft: oklch(0.29 0.05 163);
  --accent-soft-ink: oklch(0.86 0.08 163);
  --income: oklch(0.76 0.13 152);
  --warn: oklch(0.78 0.13 70);
  --warn-soft: oklch(0.3 0.05 70);
  --danger: oklch(0.72 0.15 27);
  --danger-soft: oklch(0.3 0.06 27);
  --shadow-sheet: 0 -12px 40px -12px oklch(0 0 0 / 0.6);
  --shadow-pop: 0 10px 30px -10px oklch(0 0 0 / 0.6);
  --scrim: oklch(0.05 0.01 165 / 0.6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.45 "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
::selection { background: var(--accent-soft); color: var(--accent-soft-ink); }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[x-cloak] { display: none !important; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; flex: none; }
svg.i-sm { width: 16px; height: 16px; flex: none; }
svg.i-lg { width: 24px; height: 24px; flex: none; }

/* ---------- Layout ---------- */
.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; position: relative; }
.screen {
  padding: calc(var(--safe-t) + 12px) 16px calc(var(--tab-h) + var(--safe-b) + 32px);
}
.screen-plain { padding: calc(var(--safe-t) + 20px) 20px calc(var(--safe-b) + 28px); min-height: 100dvh; display: flex; flex-direction: column; }

.topbar { display: flex; align-items: center; gap: 8px; min-height: 48px; margin-bottom: 8px; }
.topbar h1 { font-size: 1.375rem; font-weight: 650; letter-spacing: -0.02em; margin: 0; flex: 1; }
.month-switch { display: inline-flex; align-items: center; gap: 2px; }
.month-switch .label { font-weight: 600; font-size: 1.0625rem; min-width: 8.5ch; text-align: center; text-transform: capitalize; }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--ink-2);
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(0.94); }

.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 10px; }
.section-head h2 { font-size: 1rem; font-weight: 620; margin: 0; letter-spacing: -0.01em; }
.link { color: var(--accent); font-weight: 560; font-size: 0.9375rem; padding: 6px 2px; }
.link:active { opacity: 0.7; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 0.875rem; }
.tiny { font-size: 0.8125rem; }

/* ---------- Balance (inicio) ---------- */
.balance { padding: 18px 4px 4px; }
.balance .caption { color: var(--ink-2); font-size: 0.9375rem; }
.balance .amount { font-size: 3rem; font-weight: 650; letter-spacing: -0.035em; line-height: 1.05; margin-top: 4px; }
.balance .amount.neg { color: var(--danger); }
.flow { margin-top: 18px; display: grid; gap: 10px; }
.flow-row { display: grid; grid-template-columns: 5.5rem 1fr auto; align-items: center; gap: 12px; font-size: 0.9375rem; }
.flow-row .bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.flow-row .bar > i { display: block; height: 100%; border-radius: inherit; transform-origin: left; transition: transform 500ms var(--ease-out); }
.flow-row .bar .in { background: var(--income); }
.flow-row .bar .out { background: var(--ink); }
.flow-row .v { font-weight: 600; min-width: 6.5rem; text-align: right; }

/* ---------- Listas ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 60px; width: 100%; text-align: left;
  transition: background-color 140ms ease;
}
.row + .row { border-top: 1px solid var(--line); }
button.row:active, a.row:active { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 540; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { color: var(--ink-3); font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .amt { font-weight: 600; text-align: right; white-space: nowrap; }
.amt.in { color: var(--income); }
.amt.tr { color: var(--ink-2); }
.day-head { display: flex; justify-content: space-between; padding: 18px 6px 8px; color: var(--ink-2); font-size: 0.8125rem; font-weight: 560; }

.glyph {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--surface-2); color: var(--ink-2);
}
.glyph.in { background: color-mix(in oklch, var(--income) 14%, var(--surface)); color: var(--income); }
.glyph.accent { background: var(--accent-soft); color: var(--accent-soft-ink); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 0.8125rem; font-weight: 650; color: white; background: var(--m1);
}
.avatar.lg { width: 44px; height: 44px; font-size: 1rem; }
.avatar.house { background: var(--surface-2); color: var(--ink-2); }

/* Presupuestos */
.budget { padding: 14px; }
.budget + .budget { border-top: 1px solid var(--line); }
.budget .top { display: flex; align-items: center; gap: 10px; }
.budget .name { flex: 1; font-weight: 540; }
.budget .left { font-size: 0.875rem; color: var(--ink-2); }
.budget .left.over { color: var(--danger); font-weight: 560; }
.meter { height: 6px; border-radius: 99px; background: var(--surface-2); margin-top: 10px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 500ms var(--ease-out); }
.meter.warn > i { background: var(--warn); }
.meter.over > i { background: var(--danger); }

/* Personas */
.people { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; margin: 0 -16px; padding-inline: 16px; }
.people::-webkit-scrollbar { display: none; }
.person {
  flex: none; min-width: 112px; padding: 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line);
  display: grid; gap: 8px; text-align: left;
}
.person .n { font-size: 0.875rem; color: var(--ink-2); }
.person .a { font-weight: 620; }

/* Aviso pendientes */
.notice {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; margin-top: 18px;
  border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent-soft-ink);
  transition: transform 160ms var(--ease-out);
}
.notice:active { transform: scale(0.985); }
.notice b { font-weight: 620; }
.notice.warn { background: var(--warn-soft); color: color-mix(in oklch, var(--warn) 70%, var(--ink)); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 22px; border-radius: 16px; font-weight: 600; font-size: 1rem; width: 100%;
  background: var(--accent); color: var(--accent-ink);
  transition: transform 160ms var(--ease-out), background-color 160ms ease, opacity 160ms ease;
}
.btn:active { transform: scale(0.97); background: var(--accent-press); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.btn.ghost:active { background: var(--surface-2); }
.btn.soft { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.sm { height: 40px; border-radius: 12px; font-size: 0.9375rem; padding: 0 14px; width: auto; }
.btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 600ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); font-size: 0.9375rem; font-weight: 500;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms var(--ease-out);
}
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip .avatar { width: 22px; height: 22px; font-size: 0.6875rem; margin-left: -6px; }
.chip svg { width: 16px; height: 16px; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 12px; background: var(--surface-2); position: relative; }
.seg button { height: 34px; border-radius: 9px; font-weight: 560; font-size: 0.9375rem; color: var(--ink-2); position: relative; z-index: 1; transition: color 160ms ease; }
.seg button[aria-pressed="true"] { color: var(--ink); }
.seg .thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; border-radius: 9px; background: var(--surface); box-shadow: 0 1px 3px oklch(0.2 0.02 165 / 0.14); transition: transform 240ms var(--ease-out); }

/* ---------- Formularios ---------- */
.field { display: grid; gap: 6px; margin-top: 18px; }
.field label { font-size: 0.875rem; font-weight: 560; color: var(--ink-2); }
.input {
  height: 52px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 1.0625rem; width: 100%; outline: none; transition: border-color 140ms ease, box-shadow 140ms ease;
  caret-color: var(--accent);
}
.input::placeholder { color: var(--ink-3); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 22%, transparent); }
.input.err { border-color: var(--danger); }
.hint { font-size: 0.8125rem; color: var(--ink-3); }
.hint.err { color: var(--danger); }
.hint.ok { color: var(--income); }
.inline-input { display: flex; gap: 8px; }
.inline-input .input { flex: 1; }

/* ---------- Barra inferior ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 0 12px var(--safe-b); background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar-in { max-width: 560px; margin: 0 auto; height: var(--tab-h); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
.tab { display: grid; justify-items: center; gap: 3px; font-size: 0.6875rem; font-weight: 560; color: var(--ink-3); padding: 6px 0; position: relative; transition: color 160ms ease; }
.tab[aria-current="page"] { color: var(--ink); }
.tab .dot { position: absolute; top: 2px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.fab {
  justify-self: center; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -8px color-mix(in oklch, var(--accent) 70%, transparent);
  transition: transform 160ms var(--ease-out);
  margin-top: -18px;
}
.fab:active { transform: scale(0.94); }
.fab svg { width: 26px; height: 26px; stroke-width: 2.4; }

/* ---------- Hojas (bottom sheets) ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 560px; margin: 0 auto;
  background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-sheet);
  padding: 8px 20px calc(var(--safe-b) + 16px); max-height: 94dvh; overflow-y: auto; overscroll-behavior: contain;
}
.sheet .grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line-strong); margin: 4px auto 10px; }
.sheet h3 { margin: 4px 0 0; font-size: 1.1875rem; font-weight: 640; letter-spacing: -0.015em; }
.sheet-head { display: flex; align-items: center; gap: 8px; }
.sheet-head h3 { flex: 1; margin: 0; }

.t-sheet-enter { transition: transform 420ms var(--ease-drawer); }
.t-sheet-leave { transition: transform 260ms var(--ease-drawer); }
.t-sheet-from { transform: translateY(100%); }
.t-sheet-to { transform: translateY(0); }
.t-fade-enter { transition: opacity 300ms ease; }
.t-fade-leave { transition: opacity 200ms ease; }
.t-fade-from { opacity: 0; }
.t-fade-to { opacity: 1; }

/* ---------- Captura ---------- */
.cap-amount { text-align: center; padding: 14px 0 6px; }
.cap-amount .v { font-size: 3.25rem; font-weight: 660; letter-spacing: -0.04em; line-height: 1.1; }
.cap-amount .v .cur { color: var(--ink-3); font-weight: 500; margin-right: 2px; }
.cap-amount .v.empty { color: var(--ink-3); }
.cap-amount .v.in { color: var(--income); }
.cap-amount .v.bump { animation: bump 160ms var(--ease-out); }
@keyframes bump { 0% { transform: scale(0.985); } 100% { transform: scale(1); } }
.cap-label { font-size: 0.8125rem; font-weight: 560; color: var(--ink-3); margin: 16px 0 8px; }
.cap-meta { display: flex; gap: 8px; margin-top: 16px; }
.cap-meta .chip { height: 36px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 16px; }
.key {
  height: 54px; border-radius: 14px; font-size: 1.5rem; font-weight: 520; display: grid; place-items: center;
  transition: background-color 100ms ease, transform 100ms var(--ease-out);
}
.key:active { background: var(--surface-2); transform: scale(0.96); }
.save-row { display: flex; gap: 10px; margin-top: 12px; }

/* ---------- PIN ---------- */
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 28px 0 8px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); transition: background-color 120ms ease, border-color 120ms ease, transform 160ms var(--ease-out); }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); transform: scale(1.05); }
.pin-dots.shake { animation: shake 380ms var(--ease-out); }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.pinpad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 28px; justify-content: center; margin-top: 28px; }
.pinpad .key { width: 76px; height: 76px; border-radius: 50%; font-size: 1.75rem; background: var(--surface); border: 1px solid var(--line); }
.pinpad .key.bare { background: none; border: 0; font-size: 1rem; color: var(--ink-2); }

/* ---------- Onboarding ---------- */
.wordmark { font-size: 2.75rem; font-weight: 720; letter-spacing: -0.05em; line-height: 1; }
.wordmark span { color: var(--accent); }
.ob-step { font-size: 0.8125rem; font-weight: 560; color: var(--ink-3); }
.ob-title { font-size: 1.75rem; font-weight: 660; letter-spacing: -0.03em; line-height: 1.15; margin: 10px 0 8px; text-wrap: balance; }
.ob-lead { color: var(--ink-2); font-size: 1.0625rem; margin: 0; text-wrap: pretty; max-width: 34ch; }
.ob-foot { margin-top: auto; padding-top: 24px; display: grid; gap: 10px; }
.progress { display: flex; gap: 6px; margin-bottom: 24px; }
.progress i { height: 4px; flex: 1; border-radius: 99px; background: var(--line); transition: background-color 300ms ease; }
.progress i.on { background: var(--accent); }
.welcome-art { margin: 48px 0 32px; display: grid; gap: 10px; }
.ledger-line { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 2px; border-bottom: 1px dashed var(--line-strong); font-size: 1.0625rem; }
.ledger-line .num { font-weight: 600; }
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.yesno button { height: 64px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 1.0625rem; transition: transform 160ms var(--ease-out), border-color 140ms ease, background-color 140ms ease; }
.yesno button:active { transform: scale(0.97); }
.yesno button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.code-box {
  margin-top: 20px; padding: 18px; border-radius: var(--r-md); background: var(--surface-2); text-align: center;
  font-size: 1.5rem; font-weight: 640; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; user-select: all;
}
.ios-hint { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); font-size: 0.9375rem; color: var(--ink-2); }
.ios-hint b { color: var(--ink); }

/* ---------- Reportes ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .lbl { fill: var(--ink-3); font-size: 11px; font-weight: 500; }
.chart .b-in { fill: var(--income); }
.chart .b-out { fill: var(--ink); }
.chart .cur .lbl { fill: var(--ink); font-weight: 650; }
.legend { display: flex; gap: 16px; font-size: 0.8125rem; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.stat-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px; }
.stat-line + .stat-line { border-top: 1px solid var(--line); }
.stat-line .k { color: var(--ink-2); }
.stat-line .v { font-weight: 620; text-align: right; }
.delta { font-size: 0.8125rem; font-weight: 560; }
.delta.up { color: var(--danger); }
.delta.down { color: var(--income); }
.delta.up.good { color: var(--income); }
.delta.down.bad { color: var(--danger); }
.share { height: 4px; border-radius: 99px; background: var(--surface-2); margin-top: 8px; overflow: hidden; grid-column: 1 / -1; }
.share > i { display: block; height: 100%; background: var(--ink-2); border-radius: inherit; }

/* ---------- Vacío / toasts / estados ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--ink-2); }
.empty .glyph { margin: 0 auto 14px; width: 52px; height: 52px; border-radius: 16px; }
.empty h3 { color: var(--ink); font-size: 1.0625rem; margin: 0 0 6px; font-weight: 620; }
.empty p { margin: 0 auto 16px; max-width: 30ch; font-size: 0.9375rem; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); z-index: 60;
  transform: translateX(-50%); padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg);
  font-size: 0.9375rem; font-weight: 520; box-shadow: var(--shadow-pop); display: flex; gap: 12px; align-items: center;
  max-width: calc(100vw - 32px);
}
.toast button { color: var(--accent-soft); font-weight: 620; }
.t-toast-enter { transition: opacity 240ms var(--ease-out), transform 300ms var(--ease-out); }
.t-toast-leave { transition: opacity 200ms ease, transform 200ms ease; }
.t-toast-from { opacity: 0; transform: translate(-50%, 10px) scale(0.97); }
.t-toast-to { opacity: 1; transform: translate(-50%, 0) scale(1); }

.sync-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 99px; font-size: 0.8125rem; color: var(--ink-2); background: var(--surface-2); }
.sync-pill.off { color: color-mix(in oklch, var(--warn) 75%, var(--ink)); background: var(--warn-soft); }
.sync-pill svg { width: 14px; height: 14px; }
.sync-pill .spinning { animation: spin 900ms linear infinite; }

.search { position: relative; margin-bottom: 12px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search .input { padding-left: 42px; height: 46px; font-size: 1rem; }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); transition: transform 140ms var(--ease-out); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.swatch:active { transform: scale(0.92); }

.icon-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.icon-grid button { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.icon-grid button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.switch { width: 46px; height: 28px; border-radius: 99px; background: var(--line-strong); position: relative; flex: none; transition: background-color 200ms ease; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: white; box-shadow: 0 1px 3px oklch(0 0 0 / 0.2); transition: transform 220ms var(--ease-out); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
@media (min-width: 600px) {
  .screen { padding-inline: 24px; }
}
