/* ============================================================
   GoUp · Sistema de diseño v3 — limpio tipo Apple
   Blanco, gris claro, azul (el color de las ventas).
   ============================================================ */
@font-face { font-family: 'Fraunces'; font-weight: 500; font-style: italic; font-display: swap; src: url('/fonts/fraunces-latin-500-italic.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('/fonts/inter-latin-700-normal.woff2') format('woff2'); }

:root {
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --ink: #1D1D1F;
  --muted: #6E6E73;
  --faint: #AEAEB2;
  --line: #E8E8ED;
  --line-dark: #D9D9DE;
  --blue: #0A84FF;
  --blue-deep: #0071E3;
  --blue-tint: #EAF3FF;
  --indigo: #5E5CE6;
  --orange: #FF9F0A;
  --orange-tint: #FFF4E2;
  --purple: #BF5AF2;
  --green: #34C759;
  --danger: #FF3B30;
  --radius: 16px;
  --radius-sm: 12px;
  --nav-h: 62px;
  --serif-it: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'SF Pro Text', sans-serif;
  font-size: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app { position: relative; z-index: 1; }

svg.ic { display: inline-block; vertical-align: -0.18em; flex: none; }

/* ---------- Tipografía ---------- */
.micro {
  font-size: 0.67rem; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.micro.blue { color: var(--blue); }
.micro.orange { color: #C77700; }
h1 { font-weight: 700; letter-spacing: -0.022em; line-height: 1.15; }
h2 { font-weight: 700; letter-spacing: -0.018em; line-height: 1.2; }
h3 { font-weight: 600; }
.big-num {
  font-size: 2rem; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: -0.03em;
}
.quote-font { font-family: var(--serif-it); font-style: italic; font-weight: 500; }

/* ---------- Layout ---------- */
.shell { max-width: 640px; margin: 0 auto; padding: 22px 16px calc(var(--nav-h) + 36px); }

@media (min-width: 900px) {
  .shell { padding: 92px 24px 70px; }
}

/* ---------- Tarjetas ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(29, 29, 31, 0.045);
}
.card + .card { margin-top: 12px; }
.card.noPad { padding: 0; overflow: hidden; }
.card .pad { padding: 18px 20px 20px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- Botones ---------- */
button { font-family: inherit; cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none;
  background: #F2F2F7; color: var(--ink);
  padding: 13px 18px; border-radius: var(--radius-sm);
  font-size: 0.94rem; font-weight: 600;
  transition: background 0.15s, transform 0.05s, opacity 0.15s;
  user-select: none;
}
.btn:hover { background: #E9E9EE; }
.btn:active { transform: scale(0.985); }
.btn.primary { background: var(--blue-deep); color: #fff; }
.btn.primary:hover { background: #0077ED; opacity: .96; }
.btn.wide { width: 100%; }
.btn.small { padding: 8px 14px; font-size: 0.83rem; border-radius: 10px; }
.btn.ghost { background: transparent; color: var(--blue-deep); font-weight: 500; }
.btn.ghost:hover { background: var(--blue-tint); }
.btn.danger { background: transparent; color: var(--danger); }
.btn.danger:hover { background: #FFF0EF; }
.btn:disabled { opacity: 0.4; cursor: default; pointer-events: none; }

/* ---------- Formularios ---------- */
input, select, textarea {
  font-family: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-dark); border-radius: var(--radius-sm);
  padding: 12px 14px; width: 100%; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3.5px rgba(10, 132, 255, 0.15);
}
label.field { display: block; margin-bottom: 14px; }
label.field .micro { display: block; margin-bottom: 7px; }

/* ---------- Navegación ---------- */
nav.mainnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-top: 1px solid var(--line);
}
nav.mainnav .nav-brand { display: none; }
nav.mainnav button {
  flex: 1; background: none; border: none; color: var(--faint);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 0.6rem; letter-spacing: 0.02em; font-weight: 600;
  transition: color 0.15s;
}
nav.mainnav button.active { color: var(--blue-deep); }

@media (min-width: 900px) {
  nav.mainnav {
    top: 0; bottom: auto; height: 58px;
    justify-content: center; gap: 6px; align-items: center;
    border-top: none; border-bottom: 1px solid var(--line);
    padding: 0 24px;
  }
  nav.mainnav .nav-brand {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em;
    margin-right: auto; color: var(--ink);
  }
  nav.mainnav button {
    flex: none; flex-direction: row; gap: 8px; padding: 8px 14px;
    font-size: 0.84rem; border-radius: 9px;
    font-weight: 500; color: var(--muted);
  }
  nav.mainnav button.active { background: var(--blue-tint); color: var(--blue-deep); font-weight: 600; }
}

/* ---------- Auth / Onboarding ---------- */
.auth-wrap {
  min-height: 100svh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 26px 18px; gap: 22px;
}
.auth-logo { text-align: center; }
.auth-logo h1 { font-size: 2.4rem; }
.auth-logo .tag { color: var(--muted); font-size: 0.94rem; margin-top: 3px; }
.auth-card { width: 100%; max-width: 420px; }
.hero-art { width: 100%; max-width: 420px; }
.tabs { display: flex; gap: 4px; margin-bottom: 20px; background: #F2F2F7; border-radius: var(--radius-sm); padding: 4px; }
.tabs button {
  flex: 1; background: none; border: none; color: var(--muted);
  padding: 9px; border-radius: 9px; font-size: 0.88rem; font-weight: 600;
  transition: 0.15s;
}
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(29, 29, 31, 0.12); }
.error-msg { color: var(--danger); font-size: 0.85rem; margin-top: 10px; min-height: 1.2em; }
.linklike {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--blue-deep); font-size: 0.85rem; font-weight: 500; font-family: inherit;
}
.linklike:hover { text-decoration: underline; }
.forgot-row { text-align: right; margin: -6px 0 14px; }
.reset-sent { text-align: center; padding: 4px 0 6px; }
.reset-emoji { font-size: 42px; line-height: 1; margin-bottom: 8px; }
.terms-row {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 0.8rem; color: var(--muted); line-height: 1.45;
  margin-bottom: 14px; cursor: pointer;
}
.terms-row input[type="checkbox"] {
  width: 17px; height: 17px; min-width: 17px; margin-top: 1px;
  accent-color: var(--blue-deep); cursor: pointer;
}
.terms-row a { color: var(--blue-deep); font-weight: 600; text-decoration: none; }
.step-dots { display: flex; gap: 6px; justify-content: center; }
.step-dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--line-dark); transition: 0.2s; }
.step-dots i.on { background: var(--blue-deep); width: 20px; }

/* ---------- Opciones del cuestionario ---------- */
.opt-list { display: flex; flex-direction: column; gap: 9px; }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  padding: 14px; font-size: 0.95rem; font-weight: 600;
  transition: 0.15s;
}
.opt small { display: block; font-weight: 400; color: var(--muted); font-size: 0.82rem; margin-top: 1px; }
.opt svg { color: var(--muted); }
.opt.sel { border-color: var(--blue-deep); background: var(--blue-tint); }
.opt.sel svg { color: var(--blue-deep); }

/* ---------- Plan de acción ---------- */
.plan-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
  font-size: 0.94rem; font-weight: 500;
}
.plan-item:last-child { border: none; }
.plan-item svg { color: var(--blue-deep); }
.plan-item .p-xp { margin-left: auto; font-size: 0.74rem; color: var(--faint); font-weight: 600; }

/* ---------- Anillo ---------- */
.ring-wrap { position: relative; display: inline-grid; place-items: center; }
.ring-wrap svg.ring { transform: rotate(-90deg); }
.ring-bg { stroke: #EDEDF0; fill: none; }
.ring-fg {
  stroke: var(--blue); fill: none; stroke-linecap: round;
  transition: stroke-dashoffset 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.ring-label { position: absolute; text-align: center; }

/* ---------- Barras ---------- */
.bar { height: 6px; border-radius: 99px; background: #EDEDF0; overflow: hidden; }
.bar > i {
  display: block; height: 100%; border-radius: 99px;
  background: var(--blue);
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Hábitos ---------- */
.habit-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.habit-row:last-child { border-bottom: none; padding-bottom: 4px; }
.habit-ico { color: var(--muted); }
.habit-check {
  width: 28px; height: 28px; min-width: 28px; border-radius: 50%;
  border: 1.5px solid var(--line-dark); background: var(--surface);
  display: grid; place-items: center; color: transparent;
  transition: 0.18s;
}
.habit-check.done { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }
.habit-check.partial {
  border-color: var(--blue-deep); color: var(--blue-deep);
  background: linear-gradient(90deg, var(--blue-tint) 50%, var(--surface) 50%);
}
.slots-chip {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; font-variant-numeric: tabular-nums; vertical-align: 1px;
  background: #F2F2F7; color: var(--muted);
}
.slots-chip.part { background: var(--blue-tint); color: var(--blue-deep); }
.slots-chip.full { background: var(--blue-deep); color: #fff; }

/* ---------- Social ---------- */
.rank-row.tappable { cursor: pointer; transition: background .15s; border-radius: 12px; }
.rank-row.tappable:hover { background: var(--blue-tint); }
.user-card .stat-tile { padding: 10px 6px; }
.wide-chip { width: 100%; justify-content: center; display: flex; padding: 10px; font-size: .85rem; }
.fire-sent { background: #FFF3E8; color: #C77700; border: none; }
.fire-btn { background: linear-gradient(135deg, #FF9500, #FF3B30); border: none; }
.fire-btn:hover { filter: brightness(1.05); }
.today-peek { background: var(--blue-tint); border-radius: 14px; padding: 14px; margin-top: 4px; }
.today-peek .peek-row { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 12px; }
.fires-card { background: linear-gradient(135deg, #FFF6EC, #FFEFE0); border: 1px solid #FFE2C4; }
.tappable-chip { cursor: pointer; border: none; font-family: inherit; }
.tappable-chip:hover { background: var(--blue-tint); }

/* ---------- Desliza para actualizar ---------- */
body { overscroll-behavior-y: contain; }
#ptr {
  position: fixed; top: -46px; left: 50%; margin-left: -21px; z-index: 400;
  opacity: 0; transition: transform .16s ease-out, opacity .16s; pointer-events: none;
}
.ptr-disc {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); color: var(--blue-deep);
  box-shadow: 0 5px 18px rgba(29, 29, 31, 0.18);
  display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.ptr-disc svg { transform: rotate(var(--rot, 0deg)); }
.ptr-disc.ready { background: var(--blue-deep); color: #fff; }
.ptr-disc.spin svg { animation: ptrspin .65s linear infinite; }
@keyframes ptrspin { to { transform: rotate(360deg); } }

/* ---------- Tarjeta ampliada de seguido ---------- */
.uw-dots { display: flex; gap: 10px; }
.uw-day { display: grid; justify-items: center; gap: 3px; }
.uw-day i { width: 13px; height: 13px; border-radius: 5px; background: #E4E9F2; display: block; }
.uw-day i.on { background: var(--blue-deep); }
.uw-day small { font-size: .6rem; color: var(--muted); font-weight: 600; }
.cmp-card { background: var(--surface); border: 1px solid var(--line, #ECECF0); border-radius: 14px; padding: 12px 14px; }
.cmp-head { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.cmp-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-top: 1px solid #F2F2F7; }
.cmp-label { font-size: .72rem; color: var(--faint); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.cmp-val { font-weight: 700; font-variant-numeric: tabular-nums; font-size: .95rem; color: var(--muted); }
.cmp-val.lead { color: var(--blue-deep); }
.cmp-val.right { text-align: right; }
/* ---------- Feed de evidencia ---------- */
.feed-img {
  width: 100%; min-height: 180px; max-height: 440px; object-fit: cover; display: block;
  border-radius: 14px; margin-top: 10px; background: #E4E9F2; cursor: pointer;
}
.card.tappable:hover { background: var(--blue-tint); }

/* ---------- Métricas ---------- */
.metric-nums { display: flex; align-items: baseline; gap: 6px; }
.metric-card.reached { border: 1px solid #FFE1B8; background: #FFFDF6; }

.ev-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.ev-thumb {
  width: 64px; height: 64px; border-radius: 10px; object-fit: cover;
  background: #E4E9F2; cursor: pointer; flex: none; border: 1.5px solid #fff;
  box-shadow: 0 2px 8px rgba(29, 29, 31, 0.12);
}
.habit-name { flex: 1; font-weight: 500; font-size: 0.95rem; }
.habit-row.done .habit-name { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line-dark); }
.habit-pts { font-size: 0.72rem; color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 600; }

.week-dots { display: flex; gap: 5px; }
.week-dots i { width: 9px; height: 9px; border-radius: 3px; background: #EDEDF0; display: block; }
.week-dots i.on { background: var(--blue); }
.week-dots i.off-day { background: transparent; border: 1px dashed var(--line-dark); }

/* ---------- Chart 30 días ---------- */
.chart30 { display: flex; align-items: flex-end; gap: 3px; height: 84px; }
.chart30 i { flex: 1; border-radius: 3px 3px 0 0; min-height: 3px; background: var(--blue); }
.chart30 i.zero { background: #EDEDF0; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 99px; border: none;
  padding: 7px 13px; font-size: 0.8rem; color: var(--muted); font-weight: 500;
  background: #F2F2F7;
}
.chip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.chip.hot { background: var(--orange-tint); }
.chip.hot svg { color: var(--orange); }
.chip.blue { background: var(--blue-tint); color: var(--blue-deep); }

/* ---------- Coach ---------- */
.obj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.obj-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  padding: 16px 12px; text-align: center; font-size: 0.85rem; font-weight: 500;
  display: flex; flex-direction: column; gap: 9px; align-items: center;
  transition: 0.15s; box-shadow: 0 1px 3px rgba(29,29,31,0.04);
}
.obj-card svg { color: var(--blue-deep); }
.obj-card:hover { border-color: var(--blue); }
.coach-answer { font-size: 1.13rem; line-height: 1.55; font-weight: 500; letter-spacing: -0.01em; }
.micro-action {
  border-left: 3px solid var(--blue); padding: 4px 0 4px 14px;
  color: var(--muted); font-size: 0.92rem; border-radius: 2px;
}

/* ---------- Ejercicios ---------- */
.breath-stage { display: grid; place-items: center; padding: 26px 0 10px; }
.breath-circle {
  width: 150px; height: 150px; border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 32% 28%, #BFDCFF, #0A84FF 82%);
  box-shadow: 0 10px 34px -10px rgba(10, 132, 255, 0.5);
  display: grid; place-items: center;
  transition: transform 4s cubic-bezier(0.45, 0, 0.55, 1);
  transform: scale(0.72);
}
.breath-circle .phase { font-size: 0.95rem; font-weight: 600; color: #fff; letter-spacing: 0.02em; }
.timer-display {
  font-size: 3.8rem; font-weight: 700; text-align: center;
  font-variant-numeric: tabular-nums; letter-spacing: -0.03em;
}
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; background: #F2F2F7; border: none; color: var(--muted);
  padding: 11px; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 600; transition: 0.15s;
}
.seg button.active { color: #fff; background: var(--blue-deep); }

/* ---------- Ranking ---------- */
.rank-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.rank-row:last-child { border: none; }
.rank-row.me { background: var(--blue-tint); margin: 0 -20px; padding: 12px 20px; border-radius: 10px; border: none; }
.rank-pos {
  width: 30px; min-width: 30px; text-align: center;
  font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted);
}
.rank-pos.top { color: var(--orange); }
.rank-name { flex: 1; font-weight: 600; font-size: 0.95rem; }
.rank-name small { display: block; font-weight: 500; color: var(--muted); font-size: 0.72rem; }
.rank-xp { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.rank-xp small { font-weight: 500; color: var(--faint); font-size: 0.7rem; }

/* ---------- Logros ---------- */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 9px; }
.ach {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 6px; text-align: center; display: flex; flex-direction: column; gap: 6px;
  min-height: 84px; justify-content: center; align-items: center;
  background: var(--surface);
}
.ach svg { color: var(--faint); }
.ach .a-name { font-size: 0.6rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.ach.locked { opacity: 0.45; }
.ach.unlocked { border-color: #FFE1B8; background: #FFFAF2; }
.ach.unlocked svg { color: var(--orange); }

/* ---------- Atributos ---------- */
.attr-row { margin-bottom: 15px; }
.attr-row:last-child { margin-bottom: 4px; }
.attr-row .bar > i { background: var(--attr-color, var(--blue)); }
.attr-row svg { color: var(--attr-color, var(--blue)); }

/* ---------- Toasts ---------- */
#toasts {
  position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: max-content; max-width: 92vw;
}
@media (min-width: 900px) { #toasts { top: 72px; } }
.toast {
  background: rgba(29, 29, 31, 0.94); color: #fff;
  border-radius: 99px; padding: 10px 19px; font-size: 0.87rem; font-weight: 500;
  animation: toast-in 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 8px 28px -6px rgba(29, 29, 31, 0.4);
  backdrop-filter: blur(10px);
}
.toast.xp { background: var(--blue-deep); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------- Modales ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(29, 29, 31, 0.38);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 22px;
  animation: fade 0.2s;
}
.modal {
  width: 100%; max-width: 420px; max-height: 86svh; overflow-y: auto;
  background: var(--surface);
  border-radius: 20px; padding: 26px; border: none;
  animation: pop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 24px 70px -18px rgba(29, 29, 31, 0.45);
}
.modal h2 { font-size: 1.35rem; }
.modal.celebrate { text-align: center; }
.modal.celebrate .c-ico {
  width: 68px; height: 68px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #FFE3B8, #FF9F0A 85%);
  display: grid; place-items: center; margin: 0 auto 14px; color: #fff;
  box-shadow: 0 10px 30px -8px rgba(255, 159, 10, 0.55);
}
.modal.levelup { text-align: center; }
.modal.levelup .l-num {
  font-size: 4.2rem; font-weight: 700; line-height: 1; margin: 12px 0 4px;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #0A84FF, #5E5CE6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.94) translateY(10px); } }

/* ---------- Frase del día ---------- */
.quote-text {
  font-family: var(--serif-it); font-style: italic; font-weight: 500;
  font-size: 1.3rem; line-height: 1.45;
}

/* ---------- Varios ---------- */
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.muted { color: var(--muted); font-size: 0.9rem; }
.faint { color: var(--faint); }
.blue { color: var(--blue-deep); }
.center { text-align: center; }
.mt { margin-top: 14px; }
.mt-s { margin-top: 8px; }
.mb { margin-bottom: 12px; }
.hidden { display: none !important; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-pick button {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--surface); color: var(--muted);
  display: grid; place-items: center; transition: 0.15s;
}
.icon-pick button.sel { border-color: var(--blue-deep); background: var(--blue-tint); color: var(--blue-deep); }
.day-toggles { display: flex; gap: 6px; }
.day-toggles button {
  flex: 1; aspect-ratio: 1; border-radius: 9px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--faint); font-size: 0.72rem; font-weight: 700;
  transition: 0.15s;
}
.day-toggles button.on { border-color: var(--blue-deep); color: #fff; background: var(--blue-deep); }

.win-item { padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 0.93rem; }
.win-item:last-child { border: none; }
.win-item .w-date { font-size: 0.68rem; color: var(--faint); letter-spacing: 0.05em; font-weight: 600; }

.stat-tile { text-align: center; padding: 15px 8px; }
.stat-tile .big-num { font-size: 1.6rem; }
.stat-tile .micro { margin-top: 2px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.fade-in { animation: view-in 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

::selection { background: rgba(10, 132, 255, 0.2); }

/* ============================================================
   Onboarding inmersivo (pantalla completa, sin look de formulario)
   ============================================================ */
.onb-screen {
  min-height: 100svh; max-width: 560px; margin: 0 auto;
  padding: 18px 22px calc(28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.onb-top { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(26px, 6vh, 60px); }
.onb-back {
  width: 34px; height: 34px; min-width: 34px; border-radius: 50%; border: none;
  background: #EDEDF0; display: grid; place-items: center; color: var(--ink);
  transition: 0.15s;
}
.onb-back:active { transform: scale(0.92); }
.onb-progress { flex: 1; height: 4px; border-radius: 99px; background: #E4E4E9; overflow: hidden; }
.onb-progress i { display: block; height: 100%; border-radius: 99px; background: var(--blue-deep); transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.onb-title { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.032em; line-height: 1.12; }
.onb-sub { color: var(--muted); margin-top: 9px; font-size: 0.96rem; }
.onb-cta { margin-top: auto; padding-top: 26px; }
.btn.big { padding: 16px 20px; font-size: 1rem; border-radius: 14px; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.choice-list { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.choice-card {
  background: var(--surface); border: 1.5px solid transparent; border-radius: 20px;
  padding: 18px 15px; display: flex; flex-direction: column; align-items: flex-start; gap: 11px;
  text-align: left; transition: 0.18s;
  box-shadow: 0 2px 10px rgba(29, 29, 31, 0.06);
}
.choice-card:active { transform: scale(0.965); }
.choice-card.sel { border-color: var(--blue-deep); box-shadow: 0 4px 18px rgba(10, 132, 255, 0.22); }
.choice-card.wide { grid-column: 1 / -1; }
.choice-card.hz { flex-direction: row; align-items: center; }
.c-tile {
  width: 46px; height: 46px; min-width: 46px; border-radius: 14px;
  display: grid; place-items: center; color: #fff;
  box-shadow: inset 0 -2px 6px rgba(0,0,0,0.08);
}
.c-label { font-weight: 700; font-size: 0.97rem; letter-spacing: -0.015em; line-height: 1.25; }
.c-desc { font-size: 0.8rem; color: var(--muted); font-weight: 400; line-height: 1.35; margin-top: -6px; }
.choice-card.hz .c-desc { margin-top: 2px; }

.big-input {
  border: none; border-bottom: 2.5px solid var(--line-dark); border-radius: 0;
  font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em;
  padding: 12px 2px; background: transparent; margin-top: 30px;
}
.big-input:focus { box-shadow: none; border-color: var(--blue-deep); }

.big-time {
  font-size: 2.2rem !important; font-weight: 700 !important; text-align: center;
  border: none !important; background: var(--surface) !important; border-radius: 18px !important;
  padding: 20px !important; margin-top: 30px;
  box-shadow: 0 2px 10px rgba(29, 29, 31, 0.06);
  letter-spacing: -0.02em;
}
.time-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; justify-content: center; }

.build-mark {
  width: 82px; height: 82px; border-radius: 26px;
  background: linear-gradient(135deg, #0A84FF, #5E5CE6);
  color: #fff; display: grid; place-items: center; margin: 0 auto 26px;
  box-shadow: 0 14px 34px -10px rgba(10, 132, 255, 0.5);
  animation: build-pulse 1.3s ease-in-out infinite;
}
@keyframes build-pulse { 50% { transform: scale(1.07); } }
.build-line {
  display: flex; gap: 10px; align-items: center; justify-content: center;
  color: var(--muted); font-weight: 500; padding: 8px 0;
  opacity: 0; animation: view-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.build-line svg { color: var(--green); }

.stagger { opacity: 0; animation: view-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

/* ---------- Foto de perfil (círculo) ---------- */
.avatar {
  border-radius: 50%; object-fit: cover; flex: none;
  display: inline-grid; place-items: center; font-weight: 700;
  border: 2.5px solid var(--surface);
  box-shadow: 0 1px 4px rgba(29, 29, 31, 0.15);
}
.avatar-btn { position: relative; background: none; border: none; padding: 0; cursor: pointer; flex: none; }
.avatar-btn .avatar { border-width: 3px; }
.avatar-cam {
  position: absolute; right: -2px; bottom: 2px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--blue-deep); color: #fff;
  display: grid; place-items: center;
  border: 2.5px solid var(--surface);
}
.rank-row .avatar { border-width: 1.5px; }

/* ---------- Tutorial guiado ---------- */
.tour-layer { position: fixed; inset: 0; z-index: 300; }
.tour-layer.nospot { background: rgba(29, 29, 31, 0.62); animation: fade 0.25s; }
.tour-spot {
  position: fixed; border-radius: 18px; pointer-events: none;
  box-shadow: 0 0 0 200vmax rgba(29, 29, 31, 0.62);
  border: 2.5px solid #fff;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.tour-card {
  position: fixed; left: 50%;
  width: min(92vw, 380px);
  background: var(--surface); border-radius: 18px; padding: 18px 20px;
  box-shadow: 0 20px 60px -14px rgba(29, 29, 31, 0.55);
  animation: pop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   Historias ⚡ · anillo de 24 h sobre el feed
   ============================================================ */
.stories-strip {
  display: flex; gap: 14px; overflow-x: auto; padding: 14px 2px 4px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.stories-strip::-webkit-scrollbar { display: none; }
.stories-strip:empty { display: none; }

.story-ring {
  flex: 0 0 auto; background: none; border: 0; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 5px; width: 68px;
}
.story-ring-img {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, var(--indigo) 55%, var(--purple) 100%);
  padding: 2.5px;
}
.story-ring-img .avatar { border: 2.5px solid var(--bg); }
.story-ring.seen .story-ring-img { background: var(--line-dark); }
.story-ring-name {
  font-size: 0.72rem; color: var(--muted); max-width: 68px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

#story-root { position: fixed; inset: 0; z-index: 400; background: #000; animation: fade 0.2s; }
.story-wrap { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; }

.story-bars { display: flex; gap: 4px; padding: 10px 12px 0; z-index: 3; }
.story-bar { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.story-bar i { display: block; height: 100%; background: #fff; }
.story-bar i.run { animation: storyfill 5.2s linear forwards; }
@keyframes storyfill { from { width: 0 } to { width: 100% } }

.story-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: #fff; z-index: 3; }
.story-head b { font-size: 0.92rem; }
.story-time { font-size: 0.72rem; opacity: 0.75; }
.story-x {
  background: none; border: 0; color: #fff; font-size: 1.3rem; cursor: pointer;
  padding: 4px 8px; line-height: 1;
}

.story-body { flex: 1; display: grid; place-items: center; overflow: hidden; padding: 0 8px; }
.story-body img { max-width: 100%; max-height: 100%; border-radius: 14px; object-fit: contain; }

.story-logro { text-align: center; color: #fff; padding: 26px; max-width: 340px; }
.story-logro-ico { font-size: 4.4rem; line-height: 1; margin-bottom: 14px; }
.story-logro-tag {
  font-size: 0.7rem; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--orange); font-weight: 700; margin-bottom: 6px;
}
.story-logro h3 { font-size: 1.5rem; margin-bottom: 8px; }
.story-logro p { font-size: 0.92rem; opacity: 0.82; line-height: 1.5; }

.story-foot { color: #fff; padding: 14px 18px calc(20px + env(safe-area-inset-bottom)); z-index: 3; }
.story-foot b { font-size: 1rem; }
.story-foot p { font-size: 0.9rem; opacity: 0.9; margin-top: 4px; line-height: 1.45; }
.story-place { font-size: 0.78rem; opacity: 0.72; margin-top: 6px; }

.story-tap {
  position: absolute; top: 56px; bottom: 78px; width: 32%;
  background: none; border: 0; cursor: pointer; z-index: 2;
}
.story-tap.left { left: 0; }
.story-tap.right { right: 0; width: 68%; }

/* Cuenta oficial de GoUp en las historias */
.goup-mark {
  display: grid; place-items: center; width: 100%; height: 100%;
  border-radius: 50%; background: var(--surface); color: var(--blue-deep);
  border: 2.5px solid var(--bg);
}
.goup-mark.small {
  width: 34px; height: 34px; flex: 0 0 34px; border-color: transparent;
  background: rgba(255, 255, 255, 0.14); color: #fff;
}
.story-ring.oficial .story-ring-img {
  background: linear-gradient(135deg, #0071E3 0%, #0A84FF 60%, #5E5CE6 100%);
}
.story-ring.oficial.seen .story-ring-img { background: var(--line-dark); }
.oficial-tag {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  background: rgba(255, 255, 255, 0.2); padding: 2px 6px; border-radius: 5px;
  margin-left: 5px; vertical-align: middle;
}
.story-goup { text-align: center; color: #fff; padding: 24px; max-width: 380px; }
.story-goup-mark { display: grid; place-items: center; margin: 0 auto 20px; width: 74px; height: 74px;
  border-radius: 22px; background: rgba(255, 255, 255, 0.12); color: #fff; }
.story-goup h3 {
  font-family: 'Fraunces', Georgia, serif; font-style: italic; font-weight: 500;
  font-size: 1.6rem; line-height: 1.32; margin-bottom: 26px;
}
.story-goup-reto {
  background: rgba(255, 255, 255, 0.1); border-radius: 16px; padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.story-goup-tag {
  display: inline-block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--orange); margin-bottom: 6px;
}
.story-goup-reto p { font-size: 1rem; line-height: 1.45; }
.story-foot .btn { margin-top: 10px; color: rgba(255, 255, 255, 0.66); }

/* ============================================================
   Mensajes 💬
   ============================================================ */
.chat-entry { position: relative; }
.chat-badge {
  background: var(--danger); color: #fff; font-size: 0.7rem; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 100px; display: grid; place-items: center;
  padding: 0 6px; flex: 0 0 auto;
}
.chat-badge.sm {
  position: absolute; top: -5px; right: -5px; font-size: 0.62rem;
  min-width: 16px; height: 16px; border: 2px solid var(--surface);
}
.chat-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer; font: inherit; color: inherit;
}
.chat-row:active { background: var(--bg); }
.chat-row-mid { flex: 1; min-width: 0; display: block; }
.chat-row-mid b { display: block; font-size: 0.95rem; }
.chat-row-last {
  display: block; font-size: 0.85rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px;
}
.chat-row-last.fuerte { color: var(--ink); font-weight: 600; }
.chat-row-time { font-size: 0.72rem; color: var(--faint); flex: 0 0 auto; }
.goup-mark.chatav { width: 44px; height: 44px; flex: 0 0 44px; border: 0; background: var(--blue-tint); }
.goup-mark.chatav.small2 { width: 32px; height: 32px; flex: 0 0 32px; }
.oficial-tag.dark { background: var(--blue-tint); color: var(--blue-deep); }

.chat-head {
  display: flex; align-items: center; gap: 10px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line); margin-bottom: 10px;
}
.chat-who { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; font-size: 0.95rem; }
.chat-msgs {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  height: calc(100vh - var(--nav-h) - 190px);
  overflow-y: auto; padding: 4px 2px 10px;
}
.chat-msgs > * { flex: 0 0 auto; }
.msg {
  max-width: 80%; align-self: flex-start; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px 16px 16px 5px; padding: 9px 13px;
}
.msg.mine {
  align-self: flex-end; background: var(--blue-deep); border-color: var(--blue-deep);
  color: #fff; border-radius: 16px 16px 5px 16px;
}
.msg span { display: block; font-size: 0.94rem; line-height: 1.45; word-break: break-word; }
.msg i { display: block; font-size: 0.66rem; opacity: 0.6; font-style: normal; margin-top: 3px; }

.chat-compose { display: flex; gap: 8px; align-items: center; padding-top: 8px; }
.chat-compose .input { flex: 1; margin: 0; }
.chat-compose .btn { flex: 0 0 auto; padding: 11px 15px; }
.chat-aviso {
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 15px; font-size: 0.88rem; color: var(--muted); text-align: center;
}
.chat-aviso.espera { background: var(--orange-tint); border-color: transparent; color: var(--ink); }
.admin-sample {
  background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-top: 7px;
  font-size: 0.76rem; white-space: pre-wrap; word-break: break-word; color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 160px; overflow: auto;
}
