/* =====================================================================
   Alshei · glassmorphism claro
   Capas: fondo pastel con manchas de color → cristal blanco esmerilado
   ===================================================================== */
:root {
  --bg: #f6f3fc;
  --text: #1c1733;
  --muted: rgba(28, 23, 51, 0.64);
  --faint: rgba(28, 23, 51, 0.44);
  --line: rgba(28, 23, 51, 0.08);

  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --edge: rgba(255, 255, 255, 0.85);
  --edge-soft: rgba(28, 23, 51, 0.07);
  --shadow: 0 1px 2px rgba(60, 40, 120, 0.06), 0 10px 30px -14px rgba(60, 40, 120, 0.28);
  --shadow-lg: 0 24px 60px -20px rgba(60, 40, 120, 0.4);

  --accent: #ff6f4f;
  --accent-2: #8b6cf6;
  --accent-3: #12b8a0;
  --accent-grad: linear-gradient(135deg, #ff7a52, #f0508c 55%, #8b6cf6);
  --danger: #e5484d;
  --ok: #16a34a;

  --r-sm: 14px;
  --r: 22px;
  --r-lg: 30px;

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

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 70px;

  color-scheme: light;
  font: 100%/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background: transparent; /* el color lo pone html; si no, tapa el fondo de manchas */
  overflow-x: hidden;
}

/* ---------- Fondo pastel ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(55vmax 55vmax at -5% -5%, rgba(255, 176, 140, 0.75), transparent 60%),
    radial-gradient(50vmax 50vmax at 105% 10%, rgba(196, 176, 255, 0.8), transparent 60%),
    radial-gradient(55vmax 55vmax at 20% 105%, rgba(150, 232, 214, 0.7), transparent 60%),
    radial-gradient(40vmax 40vmax at 100% 95%, rgba(255, 182, 214, 0.65), transparent 60%),
    var(--bg);
}

/* ---------- Cristal ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow);
}

/* ---------- Tipografía ---------- */
h1, h2, h3 { margin: 0; font-weight: 700; }
.display { font-size: 2.1rem; line-height: 1.05; letter-spacing: -0.03em; }
h2 { font-size: 1.3rem; line-height: 1.2; letter-spacing: -0.02em; }
h3 { font-size: 1.02rem; line-height: 1.3; letter-spacing: -0.01em; font-weight: 650; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.88rem; }
.tiny { font-size: 0.76rem; }
.eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.brand { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.page {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 8px) 16px calc(var(--tabbar-h) + var(--safe-b) + 40px);
}
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: calc(-1 * (var(--safe-t) + 8px)) -16px 8px;
  padding: calc(var(--safe-t) + 10px) 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(to bottom, rgba(246, 243, 252, 0.85), rgba(246, 243, 252, 0.55) 75%, rgba(246, 243, 252, 0));
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  mask-image: linear-gradient(to bottom, #000 80%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent);
}

/* ---------- Botones ---------- */
button, a, [role="button"], .chip, label.chip {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 650;
  background: var(--glass-strong);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  transition: transform 140ms var(--ease-out), background-color 160ms ease, opacity 160ms ease;
}
.btn:active { transform: scale(0.97); background: #fff; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent-grad); border-color: transparent; color: #fff; box-shadow: 0 10px 24px -10px rgba(240, 80, 140, 0.7); }
.btn-primary:active { background: var(--accent-grad); filter: brightness(0.94); }
.btn-danger { color: var(--danger); }
.btn-danger.armed { background: var(--danger); color: #fff; border-color: transparent; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 0.88rem; }
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--edge-soft); }

.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--glass-strong);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.icon-btn:active { transform: scale(0.92); background: #fff; }
.icon-btn svg { width: 20px; height: 20px; }

@media (hover: hover) and (pointer: fine) {
  .btn:hover, .icon-btn:hover { background: #fff; }
  .btn-primary:hover { background: var(--accent-grad); filter: brightness(1.05); }
  .card-link:hover, .item:hover { background: var(--glass-strong); }
  .chip:hover { background: #fff; }
}

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 0.82rem; font-weight: 650; color: var(--muted); padding-left: 4px; }
.input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px; /* evita el zoom de iOS al enfocar */
  color: var(--text);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--edge-soft);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
textarea.input { resize: vertical; min-height: 84px; line-height: 1.4; }
.input::placeholder { color: var(--faint); }
.input:focus { border-color: rgba(240, 80, 140, 0.55); box-shadow: 0 0 0 4px rgba(240, 80, 140, 0.12); background: #fff; }
select.input {
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px;
  background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px;
}
input[type="date"].input, input[type="time"].input { min-width: 0; -webkit-appearance: none; appearance: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.amount-input { font-size: 2rem !important; font-weight: 700; letter-spacing: -0.02em; text-align: center; min-height: 64px; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-scroll {
  display: flex; gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 4px 16px 10px;
  scroll-padding-inline: 16px; /* al encajar una ficha, respeta el margen en vez de pegarla al borde */
  overscroll-behavior-x: contain;
}
.chips-scroll.in-sheet { margin: 0 -20px; padding: 2px 20px 6px; scroll-padding-inline: 20px; }
/* Con ratón: en el formulario las fichas pasan a varias filas, sin scroll horizontal */
@media (hover: hover) and (pointer: fine) {
  .chips-scroll.in-sheet { flex-wrap: wrap; overflow: visible; margin: 0; padding: 2px 0 6px; }
}
.chips-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px;
  border-radius: 999px;
  font-size: 0.92rem; font-weight: 550;
  background: var(--glass);
  border: 1px solid var(--edge);
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, color 160ms ease;
}
.chip:active { transform: scale(0.96); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
/* Dentro de las hojas el fondo ya es claro: las fichas necesitan su propio relleno para verse */
.sheet .chip:not(:has(input:checked)) { background: rgba(28, 23, 51, 0.06); border-color: transparent; }
.chip[aria-pressed="true"], .chip:has(input:checked) { background: var(--text); border-color: var(--text); color: #fff; }

/* Tira de días */
.day-chip {
  flex: none;
  min-width: 62px;
  padding: 8px 8px 6px;
  border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  background: var(--glass);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  scroll-snap-align: start;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, color 160ms ease;
}
.day-chip:active { transform: scale(0.95); }
.day-chip .dw { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.day-chip .dn { font-size: 1.35rem; font-weight: 750; line-height: 1.15; letter-spacing: -0.02em; }
.day-chip .wx { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.day-chip .dot { width: 5px; height: 5px; margin-top: 3px; border-radius: 50%; background: var(--accent); opacity: 0; }
.day-chip.has-items .dot { opacity: 1; }
.day-chip.today .dw { color: var(--accent); }
.day-chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }
.day-chip[aria-pressed="true"] .dw, .day-chip[aria-pressed="true"] .wx { color: rgba(255, 255, 255, 0.75); }
.day-chip[aria-pressed="true"] .dot { background: #fff; }
.day-chip.ideas { justify-content: center; gap: 2px; }
.day-chip.ideas .dn { font-size: 1.2rem; }

/* ---------- Tarjetas ---------- */
.card { padding: 16px; }
.card-link { display: block; transition: transform 160ms var(--ease-out), background-color 160ms ease; }
.card-link:active { transform: scale(0.985); }

.trip-card { padding: 16px; display: flex; gap: 14px; align-items: center; }
.trip-emoji {
  width: 58px; height: 58px; flex: none;
  display: grid; place-items: center;
  font-size: 1.85rem;
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(255, 190, 160, 0.7), rgba(200, 180, 255, 0.7));
  border: 1px solid var(--edge);
}
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem; font-weight: 650;
  background: rgba(28, 23, 51, 0.06);
  white-space: nowrap;
}
.badge.live { background: rgba(18, 184, 160, 0.15); color: #087a6a; }
.badge.soon { background: rgba(255, 111, 79, 0.15); color: #c2410c; }

.new-card {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 72px;
  border-radius: var(--r);
  border: 1.5px dashed rgba(28, 23, 51, 0.2);
  color: var(--muted);
  font-weight: 650;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, color 160ms ease;
}
.new-card svg { width: 22px; height: 22px; }
.new-card:active { transform: scale(0.985); background: var(--glass); color: var(--text); }

/* ---------- Siguiente ---------- */
.now-card {
  width: 100%; text-align: left;
  padding: 14px 16px; margin-bottom: 12px;
  display: flex; gap: 12px; align-items: center;
  background: linear-gradient(135deg, rgba(150, 232, 214, 0.65), rgba(255, 255, 255, 0.6));
}
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-3); flex: none; box-shadow: 0 0 0 0 rgba(18, 184, 160, 0.5); animation: pulse 2.4s var(--ease-out) infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(18, 184, 160, 0); } 100% { box-shadow: 0 0 0 0 rgba(18, 184, 160, 0); } }

/* ---------- Línea de tiempo ---------- */
.timeline { display: flex; flex-direction: column; }
.tl-row { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; }
.tl-row > * { min-width: 0; }
.tl-time { padding-top: 15px; text-align: right; font-variant-numeric: tabular-nums; }
.tl-time b { display: block; font-size: 0.98rem; letter-spacing: -0.01em; }
.tl-time span { font-size: 0.74rem; color: var(--faint); }

.item {
  width: 100%;
  padding: 12px;
  display: flex; gap: 12px; align-items: center;
  text-align: left;
  transition: transform 160ms var(--ease-out), opacity 200ms ease, background-color 160ms ease;
}
.item:active { transform: scale(0.985); }
.item.is-done { opacity: 0.6; }
.item.is-done h3 { text-decoration: line-through; text-decoration-color: rgba(28, 23, 51, 0.35); }
.rise { animation: rise 360ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.cat-dot {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  font-size: 1.25rem;
  background: color-mix(in srgb, var(--c, #999) 18%, white);
  border: 1px solid color-mix(in srgb, var(--c, #999) 30%, white);
}
.item-actions { display: flex; gap: 6px; align-items: center; }
.go-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(18, 184, 160, 0.14);
  color: #0a8a78;
  transition: transform 140ms var(--ease-out);
}
.go-btn:active { transform: scale(0.9); }
.go-btn svg { width: 18px; height: 18px; }
.check {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(28, 23, 51, 0.2);
  background: rgba(255, 255, 255, 0.6);
  transition: transform 140ms var(--ease-out), background-color 160ms ease, border-color 160ms ease;
}
.check:active { transform: scale(0.88); }
.check svg { width: 16px; height: 16px; opacity: 0; transition: opacity 160ms ease; }
.check.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.check.on svg { opacity: 1; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 2px; }
.stars-mini { color: #f59e0b; font-size: 0.8rem; letter-spacing: 1px; }
.clip { font-size: 0.78rem; color: var(--muted); }

/* Tramo entre hitos */
.leg {
  grid-column: 2;
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px;
  margin-left: 14px;
  padding: 6px 0 6px 22px;
  position: relative;
}
.leg::before {
  content: ""; position: absolute; left: 6px; top: 0; bottom: 0;
  border-left: 2px dashed rgba(28, 23, 51, 0.16);
}
.leg-pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 12px;
  border-radius: 999px;
  font-size: 0.84rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--edge);
  color: var(--muted);
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.leg-pill:active { transform: scale(0.96); background: #fff; }
.leg-pill b { color: var(--text); font-weight: 700; }
.leg-pill .caret { opacity: 0.5; font-size: 0.7rem; }
.leg-warn { font-size: 0.78rem; font-weight: 650; color: #b45309; }

.section-title { display: flex; align-items: center; gap: 10px; margin: 20px 4px 8px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to right, var(--line), transparent); }

.empty { padding: 28px 20px; text-align: center; }
.empty .big { font-size: 2.4rem; margin-bottom: 6px; }
.empty p { margin: 6px 0 14px; }

/* ---------- Barra inferior ---------- */
.tabbar {
  position: fixed; z-index: 30;
  left: 50%; bottom: calc(var(--safe-b) + 10px);
  transform: translateX(-50%);
  width: min(440px, calc(100% - 20px));
  height: var(--tabbar-h);
  padding: 6px;
  display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; align-items: center;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-lg);
}
.tab {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 22px;
  font-size: 0.72rem; font-weight: 650;
  color: var(--faint);
  transition: color 160ms ease, background-color 160ms ease, transform 140ms var(--ease-out);
}
.tab svg { width: 23px; height: 23px; }
.tab:active { transform: scale(0.94); }
.tab[aria-current="page"] { color: var(--text); background: rgba(28, 23, 51, 0.06); }
.fab {
  justify-self: center;
  width: 60px; height: 60px;
  border-radius: 22px;
  display: grid; place-items: center;
  color: #fff;
  background: var(--accent-grad);
  box-shadow: 0 12px 28px -10px rgba(240, 80, 140, 0.85);
  transition: transform 140ms var(--ease-out);
}
.fab:active { transform: scale(0.92); }
.fab svg { width: 28px; height: 28px; }

/* ---------- Mapa ---------- */
.map-wrap {
  position: relative;
  isolation: isolate; /* Leaflet usa z-index altos: que no se salgan por encima de hojas y barra */
  height: calc(100dvh - var(--safe-t) - 150px - var(--tabbar-h) - var(--safe-b));
  min-height: 340px;
  overflow: hidden;
  padding: 0;
}
#map { width: 100%; height: 100%; border-radius: inherit; background: #eef0f3; }
.leaflet-container { font: inherit; }
.leaflet-tile-pane { filter: saturate(0.8) brightness(1.02); }
.leaflet-control-attribution { background: rgba(255, 255, 255, 0.7) !important; font-size: 10px; }
.leaflet-bar { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 14px !important; overflow: hidden; }
.leaflet-bar a { background: rgba(255, 255, 255, 0.9) !important; color: var(--text) !important; width: 38px !important; height: 38px !important; line-height: 38px !important; }
.leaflet-popup-content-wrapper {
  background: rgba(255, 255, 255, 0.94) !important;
  border-radius: 18px !important;
  box-shadow: var(--shadow-lg) !important;
}
.leaflet-popup-tip { background: rgba(255, 255, 255, 0.94) !important; }
.leaflet-popup-content { margin: 12px 14px !important; min-width: 190px; color: var(--text); }
.pin {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50% 50% 50% 6px;
  transform: rotate(-45deg);
  background: var(--c);
  border: 2.5px solid #fff;
  box-shadow: 0 6px 14px rgba(40, 20, 80, 0.3);
}
.pin > span { transform: rotate(45deg); font-size: 1.05rem; line-height: 1; }
.pin .n {
  position: absolute; top: -8px; right: -8px;
  transform: rotate(45deg);
  min-width: 21px; height: 21px; padding: 0 5px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 800;
  background: var(--text); color: #fff;
  border: 2px solid #fff;
}
.map-summary {
  position: absolute; z-index: 500;
  left: 10px; right: 10px; bottom: 10px;
  padding: 10px 10px 10px 14px;
  display: flex; align-items: center; gap: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
}
.map-summary .totals { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 0.88rem; font-weight: 650; }

/* ---------- Selector de modo (segmented) ---------- */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 5px; border-radius: 18px; background: rgba(28, 23, 51, 0.05); }
.seg button {
  min-height: 66px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 14px;
  font-size: 0.78rem; font-weight: 650; color: var(--muted);
  transition: background-color 160ms ease, color 160ms ease, transform 140ms var(--ease-out);
}
.seg button .e { font-size: 1.35rem; }
.seg button .t { font-size: 0.74rem; font-weight: 600; color: var(--faint); min-height: 1.1em; }
.seg button:active { transform: scale(0.96); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.seg button[aria-pressed="true"] .t { color: var(--accent); }

.steps { display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.7); font-size: 0.9rem; }
.step .e { font-size: 1.2rem; line-height: 1.2; }

/* ---------- Gastos ---------- */
.balance { padding: 18px; text-align: center; background: linear-gradient(140deg, rgba(255, 255, 255, 0.72), rgba(255, 220, 205, 0.6)); }
.balance .total { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.people-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 14px; }
.person { padding: 10px; border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.72); }
.settle { margin-top: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: rgba(28, 23, 51, 0.06); font-weight: 650; font-size: 0.94rem; }
.amount { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Maleta ---------- */
.check-row {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 6px 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.check-row:last-child { border-bottom: 0; }
.check-row .txt { flex: 1; min-width: 0; }
.check-row.done .txt { color: var(--faint); text-decoration: line-through; }
.check-row .del { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--faint); font-size: 1.2rem; }
.check-row .del:active { background: rgba(28, 23, 51, 0.06); }
.progress { height: 8px; border-radius: 4px; background: rgba(28, 23, 51, 0.08); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent-grad); border-radius: inherit; transition: width 300ms var(--ease-out); }

/* ---------- Más ---------- */
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.more-card { padding: 16px; display: flex; flex-direction: column; gap: 2px; min-height: 124px; text-align: left; transition: transform 160ms var(--ease-out); }
.more-card:active { transform: scale(0.97); }
.more-card .e { font-size: 1.9rem; margin-bottom: auto; }

/* ---------- Estrellas ---------- */
.stars { display: flex; gap: 2px; }
.stars button { font-size: 1.9rem; line-height: 1; color: rgba(28, 23, 51, 0.15); transition: transform 140ms var(--ease-out), color 140ms ease; padding: 4px; }
.stars button.on { color: #f59e0b; }
.stars button:active { transform: scale(0.85); }

/* ---------- Adjuntos ---------- */
.attach { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.72); }
.attach .e { font-size: 1.3rem; }
.attach .open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; min-height: 40px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }

/* ---------- Hoja inferior (sheet) ---------- */
.sheet-scrim {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(28, 23, 51, 0.28);
  opacity: 0;
  transition: opacity 260ms ease;
}
.sheet-scrim.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 51;
  left: 0; right: 0; bottom: 0;
  margin: 0 auto;
  max-width: 600px;
  max-height: calc(100dvh - var(--safe-t) - 20px);
  display: flex; flex-direction: column;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  border: 1px solid var(--edge);
  border-bottom: 0;
  transform: translateY(100%);
  transition: transform 420ms var(--ease-drawer);
  background: rgba(250, 248, 255, 0.88);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  box-shadow: var(--shadow-lg);
}
.sheet.open { transform: translateY(0); }
.sheet.closing { transition-duration: 260ms; }
.sheet-grab { padding: 10px 0 6px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.sheet-grab::before { content: ""; width: 40px; height: 5px; border-radius: 3px; background: rgba(28, 23, 51, 0.18); }
.sheet-head { padding: 2px 20px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 20px calc(var(--safe-b) + 24px);
  display: flex; flex-direction: column; gap: 16px;
}

.paste-zone {
  padding: 14px;
  border-radius: var(--r);
  background: linear-gradient(135deg, rgba(150, 232, 214, 0.45), rgba(200, 185, 255, 0.4));
  border: 1px solid var(--edge);
  display: flex; flex-direction: column; gap: 10px;
}
.paste-zone textarea.input { min-height: 58px; }
.found { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.78); font-size: 0.9rem; }
.spinner { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid rgba(28, 23, 51, 0.15); border-top-color: var(--accent); animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
details.more summary { cursor: pointer; font-weight: 650; color: var(--muted); padding: 8px 4px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "＋ "; }
details.more[open] summary::before { content: "－ "; }
details.more > div { display: flex; flex-direction: column; gap: 16px; margin-top: 10px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 80;
  left: 50%; top: calc(var(--safe-t) + 12px);
  max-width: calc(100% - 32px);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 0.92rem; font-weight: 600;
  color: #fff;
  background: rgba(28, 23, 51, 0.88);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 0);
  transition: transform 300ms var(--ease-out), opacity 300ms ease;
}
.toast.hide { transform: translate(-50%, -16px); opacity: 0; transition-duration: 200ms; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--safe-t) + 24px) 20px calc(var(--safe-b) + 24px); }
.login-card { width: 100%; max-width: 400px; padding: 28px 22px; }
.logo-mark { width: 76px; height: 76px; border-radius: 24px; display: block; margin-bottom: 14px; box-shadow: 0 16px 34px -12px rgba(240, 80, 140, 0.7); }
.demo-banner { padding: 10px 14px; border-radius: var(--r-sm); font-size: 0.84rem; background: rgba(255, 196, 80, 0.22); border: 1px solid rgba(245, 158, 11, 0.35); color: #7a4a00; }

.view-enter { animation: viewIn 300ms var(--ease-out) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Accesibilidad ---------- */
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
  .sheet { transition-duration: 1ms; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .sheet, .tabbar, .topbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .sheet, .tabbar { background: rgba(255, 255, 255, 0.94); }
}

/* ---------- Cuenta ---------- */
.avatar {
  width: var(--s, 44px); height: var(--s, 44px); flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 800; font-size: calc(var(--s, 44px) * 0.42); color: #fff;
  background: var(--accent-grad);
  box-shadow: 0 6px 16px -6px rgba(240, 80, 140, 0.7), inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}
.avatar-btn { border-radius: 50%; transition: transform 140ms var(--ease-out); }
.avatar-btn:active { transform: scale(0.92); }
.more-card.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; min-height: 0; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 84px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  min-height: 38px; padding: 0 12px; border-radius: 10px;
  font-size: 0.85rem; font-weight: 650; color: var(--muted);
}
.pw-toggle:active { background: rgba(28, 23, 51, 0.06); }
