@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url(../fonts/barlow-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url(../fonts/barlow-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url(../fonts/barlow-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 700; font-display: swap; src: url(../fonts/barlow-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url(../fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url(../fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); }

:root {
  --azul: #2753F6;
  --azul-suave: #E3E9FE;
  --noche: #06065A;
  --celeste: #6A8CF5;
  --fondo: #F3F5F4;
  --blanco: #FFFFFF;
  --borde: #DDE2E0;
  --texto: #06065A;
  --gris: #4A5553;
  --gris-2: #5B6764;
  --gris-3: #E4E8E6;
  --verde: #1E7A4C;
  --verde-suave: #E1F2E8;
  --ambar: #F0B44C;
  --ambar-oscuro: #8A6508;
  --ambar-suave: #FAF0DC;
  --rojo: #B3261E;
  --rojo-suave: #FBE9E7;
  --radio: 20px;
  --cond: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fondo); color: var(--texto);
  font-family: 'Barlow', Arial, sans-serif; font-size: 16px; line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--azul); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding: 20px 16px calc(96px + var(--safe-b)); }

/* ---------- Tipografía ---------- */
.eyebrow { font-family: var(--cond); font-weight: 700; font-size: 15px; letter-spacing: .16em; text-transform: uppercase; color: var(--azul); margin: 0; }
.h1 { font-family: var(--cond); font-weight: 700; font-size: 34px; line-height: 1.05; margin: 2px 0 0; }
.h2 { font-family: var(--cond); font-weight: 700; font-size: 22px; line-height: 1.1; text-transform: uppercase; margin: 0; }
.muted { color: var(--gris); font-size: 14px; }
.small { font-size: 13px; color: var(--gris-2); }
.cond { font-family: var(--cond); font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Encabezado ---------- */
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none;
  background: var(--noche); color: #fff; font-family: var(--cond); font-weight: 700; font-size: 18px;
  display: grid; place-items: center;
}

/* ---------- Tarjetas ---------- */
.card { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); padding: 18px; margin-bottom: 14px; }
.card.navy { background: var(--noche); border-color: var(--noche); color: #fff; }
.card.amber { background: var(--ambar-suave); border-color: #EBD5A6; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }

/* Nivel */
.level { display: flex; gap: 16px; align-items: center; }
.level-badge {
  width: 84px; height: 84px; border-radius: 18px; background: var(--azul); color: #fff; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.level-badge small { font-family: var(--cond); font-weight: 700; font-size: 13px; letter-spacing: .14em; opacity: .85; }
.level-badge b { font-family: var(--cond); font-weight: 700; font-size: 44px; line-height: .9; }
.level-body { flex: 1; min-width: 0; }
.level-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tier { font-family: var(--cond); font-weight: 700; font-size: 24px; text-transform: uppercase; }
.plus { color: var(--azul); font-weight: 600; font-size: 14px; white-space: nowrap; }

.bar { height: 12px; border-radius: 99px; background: var(--azul-suave); overflow: hidden; margin: 8px 0 6px; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--azul); transition: width .6s ease; }
.card.navy .bar { background: rgba(255,255,255,.14); }
.card.navy .bar > i { background: var(--ambar); }
.card.amber .bar { background: #F0DDB5; }
.card.amber .bar > i { background: #C9800F; }

/* Meta */
.goal { display: flex; justify-content: space-between; align-items: flex-end; }
.goal .label { font-family: var(--cond); font-weight: 600; font-size: 15px; letter-spacing: .14em; color: #C9D2FA; text-transform: uppercase; }
.goal .big { font-family: var(--cond); font-weight: 700; font-size: 56px; line-height: .95; }
.goal .days { text-align: right; }
.goal .days b { font-family: var(--cond); font-weight: 700; font-size: 52px; line-height: .9; color: var(--ambar); display: block; }
.goal .days span { color: #C9D2FA; font-size: 14px; }
.goal-foot { display: flex; justify-content: space-between; color: #C9D2FA; font-size: 14px; margin-top: 10px; }

/* Semana */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.week span { font-size: 13px; font-weight: 600; color: var(--gris-2); }
.dot { width: 36px; height: 36px; border-radius: 50%; margin: 6px auto 0; background: var(--gris-3); }
.dot.on { background: var(--verde); }
.dot.today { background: var(--azul-suave); box-shadow: inset 0 0 0 2px var(--azul); }
.dot.today.on { background: var(--verde); box-shadow: inset 0 0 0 3px var(--azul); }

/* Listas */
.list { list-style: none; padding: 0; margin: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--gris-3); }
.item:first-child { border-top: 0; padding-top: 2px; }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 600; }
.item-sub { font-size: 13px; color: var(--gris-2); }
.item-xp { font-family: var(--cond); font-weight: 700; font-size: 20px; color: var(--azul); white-space: nowrap; }
.chip-sport {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center;
  font-family: var(--cond); font-weight: 700; font-size: 13px; color: #fff; background: var(--azul);
}

/* Ranking */
.rank { display: flex; flex-direction: column; gap: 8px; }
.rank-row { background: var(--fondo); border-radius: 14px; padding: 10px 14px; }
.rank-row.me { background: var(--azul-suave); }
.rank-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rank-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-xp { font-family: var(--cond); font-weight: 700; font-size: 20px; white-space: nowrap; }
.rank-row .bar { height: 7px; margin: 6px 0 0; background: var(--gris-3); }
.rank-row .bar > i { background: #7F93D6; }
.rank-row.me .bar > i { background: var(--azul); }

/* Pestañas */
.tabs { display: flex; background: var(--gris-3); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.tabs button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 8px; font-weight: 600; color: var(--gris); }
.tabs button.on { background: #fff; color: var(--noche); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .label-s { font-weight: 600; font-size: 14px; }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--borde); background: #fff; border-radius: 12px;
  padding: 12px 14px; font-size: 16px; outline: none;
}
.input:focus { border-color: var(--azul); }
textarea.input { resize: vertical; min-height: 72px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 13px; color: var(--gris-2); }

.sports { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sport, .seg button {
  border: 1.5px solid var(--borde); background: #fff; border-radius: 12px; padding: 10px 6px;
  font-weight: 600; font-size: 14px; text-align: center; line-height: 1.15;
}
.sport.on, .seg button.on { border-color: var(--azul); background: var(--azul-suave); color: var(--noche); }
.sport small { display: block; font-weight: 500; font-size: 11.5px; color: var(--gris-2); margin-top: 2px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.photo-pick { display: flex; align-items: center; gap: 12px; border: 1.5px dashed #B9C2BF; border-radius: 12px; padding: 12px; background: #fff; }
.photo-pick img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 700; font-size: 16px;
  background: var(--azul); color: #fff;
}
.btn:disabled { opacity: .55; }
.btn.ghost { background: transparent; color: var(--azul); border: 1.5px solid var(--azul); }
.btn.light { background: var(--gris-3); color: var(--noche); }
.btn.danger { background: transparent; color: var(--rojo); border: 1.5px solid #E5B7B3; }
.btn.sm { width: auto; padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--azul); font-weight: 600; }

.preview { display: flex; justify-content: space-between; align-items: center; background: var(--noche); color: #fff; border-radius: 14px; padding: 12px 16px; margin: 4px 0 14px; }
.preview b { font-family: var(--cond); font-size: 28px; color: var(--ambar); }

.msg { border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }
.msg.err { background: var(--rojo-suave); color: var(--rojo); }
.msg.ok { background: var(--verde-suave); color: var(--verde); }

/* ---------- Navegación inferior ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: #fff; border-top: 1px solid var(--borde);
  padding: 6px 8px calc(6px + var(--safe-b));
}
.nav-in { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
  text-decoration: none; color: var(--gris-2); font-weight: 600; font-size: 12.5px; border-radius: 12px;
}
.nav a svg { width: 24px; height: 24px; }
.nav a.on { color: var(--azul); }
.nav a.add { color: #fff; background: var(--azul); }
.nav a.add.on { background: var(--noche); }

/* ---------- Login ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; max-width: 420px; margin: 0 auto; padding: 32px 20px; }
.auth-hero { background: var(--noche); border-radius: 24px; padding: 28px 22px; color: #fff; margin-bottom: 22px; }
.auth-hero img.logo { width: 200px; margin-bottom: 18px; }
.auth-hero p { color: #C9D2FA; margin: 8px 0 0; }
.auth-hero .h1 { color: #fff; }

/* ---------- Modal / celebración ---------- */
.overlay { position: fixed; inset: 0; background: rgba(6,6,90,.55); z-index: 30; display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.sheet { background: #fff; width: 100%; max-width: 480px; border-radius: 24px; padding: 24px 20px calc(20px + var(--safe-b)); animation: up .25s ease; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.celebrate { text-align: center; }
.celebrate .xp { font-family: var(--cond); font-weight: 700; font-size: 64px; line-height: 1; color: var(--azul); }
.bonus { display: flex; justify-content: space-between; background: var(--ambar-suave); border-radius: 12px; padding: 10px 14px; margin-top: 8px; font-weight: 600; }
.bonus b { color: var(--ambar-oscuro); }
.levelup { background: var(--noche); color: #fff; border-radius: 14px; padding: 14px; margin-top: 12px; }
.levelup b { color: var(--ambar); font-family: var(--cond); font-size: 26px; }

.empty { text-align: center; color: var(--gris-2); padding: 18px 8px; font-size: 14px; }
.post-kind { display: inline-block; font-family: var(--cond); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.k-aviso { background: var(--azul-suave); color: var(--azul); }
.k-evento { background: var(--verde-suave); color: var(--verde); }
.k-descuento { background: var(--ambar-suave); color: var(--ambar-oscuro); }
.post-body { white-space: pre-wrap; margin: 8px 0 0; color: var(--gris); }

.tiers .item-title { font-family: var(--cond); font-size: 19px; text-transform: uppercase; }
.tiers .item.cur { background: var(--azul-suave); border-radius: 12px; padding-left: 10px; padding-right: 10px; border-top-color: transparent; }
.rules .item-xp { font-size: 18px; }

table.adm { width: 100%; border-collapse: collapse; font-size: 14px; }
table.adm th { text-align: left; font-size: 12px; color: var(--gris-2); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--borde); }
table.adm td { padding: 8px 4px; border-bottom: 1px solid var(--gris-3); vertical-align: top; }
table.adm td.r, table.adm th.r { text-align: right; }
.warn { color: var(--rojo); font-weight: 600; }
.voided { opacity: .5; text-decoration: line-through; }

.loading { display: grid; place-items: center; min-height: 60vh; color: var(--gris-2); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--azul-suave); border-top-color: var(--azul); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); background: var(--noche); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 40; font-weight: 600; font-size: 14px; max-width: 90vw; }

/* ---------- v2 ---------- */
.nav-in { grid-template-columns: repeat(5, 1fr); gap: 2px; }
.nav a { font-size: 11.5px; padding: 6px 0; }
.msg.info { background: var(--azul-suave); color: var(--noche); }
.pw { position: relative; }
.pw .input { padding-right: 52px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: transparent; color: var(--gris-2); display: grid; place-items: center; border-radius: 10px; }
.pw-eye:focus-visible { outline: 2px solid var(--azul); }
.tag-rev { color: var(--ambar-oscuro); font-weight: 600; }
.photo-pick.req { border-color: var(--ambar); background: var(--ambar-suave); }

.ch-icon { display: inline-grid; place-items: center; border-radius: 16px; flex: none; }
.ch-mini { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.ch-mini .bar { height: 8px; margin: 6px 0 4px; }
.ch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ch-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; background: #fff; border: 1.5px solid var(--borde); border-radius: 18px; padding: 14px; min-height: 176px; }
.ch-card .ch-icon { margin-bottom: 6px; }
.ch-card.on { border-color: var(--azul); background: var(--azul-suave); }
.ch-card.done { opacity: .7; }
.ch-name { font-family: var(--cond); font-weight: 700; font-size: 20px; line-height: 1.05; color: var(--noche); }
.ch-xp { font-family: var(--cond); font-weight: 700; font-size: 18px; color: var(--azul); margin-top: auto; }

.avatar.big { width: 64px; height: 64px; font-size: 26px; background: var(--azul); }
.plan-badge { display: inline-block; background: var(--ambar); color: var(--noche); font-family: var(--cond); font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 10px; border-radius: 8px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
.stats b { display: block; font-family: var(--cond); font-weight: 700; font-size: 28px; line-height: 1; }
.stats span { font-size: 12.5px; color: var(--gris-2); }
.plan-row.cur { background: var(--azul-suave); border-radius: 12px; padding-left: 10px; padding-right: 10px; border-top-color: transparent; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kpis b { display: block; font-family: var(--cond); font-weight: 700; font-size: 36px; line-height: 1; color: #fff; }
.kpis span { color: #C9D2FA; font-size: 13.5px; }
.ocr { font-weight: 600; }
.ocr.ok { color: var(--verde); }
.ocr.warn { color: var(--rojo); }
.ocr.none { color: var(--gris-2); font-weight: 500; }
.rev-btns { display: flex; gap: 6px; width: 100%; justify-content: flex-end; margin-top: 6px; }

.colchart { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; align-items: end; height: 170px; }
.col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.col-track { flex: 1; width: 100%; max-width: 30px; display: flex; align-items: flex-end; border-bottom: 1px solid var(--borde); }
.col-track i { display: block; width: 100%; background: var(--azul); border-radius: 4px 4px 0 0; min-height: 2px; }
.col-v { font-size: 13px; font-weight: 600; color: var(--noche); }
.col-l { font-size: 11px; color: var(--gris-2); }
.col:hover .col-track i { background: var(--noche); }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: 96px 1fr 40px; gap: 8px; align-items: center; font-size: 14px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-t { height: 12px; background: var(--gris-3); border-radius: 4px; overflow: hidden; }
.hb-t i { display: block; height: 100%; background: var(--azul); border-radius: 0 4px 4px 0; }
.hb-v { text-align: right; font-weight: 600; }
.hbar:hover .hb-t i { background: var(--noche); }
table.heat td.r { border-bottom: 2px solid #fff; }
.plan-sel { border: 1px solid var(--borde); border-radius: 8px; padding: 4px 6px; background: #fff; font-size: 13px; }
.sheet { max-height: 90vh; overflow-y: auto; }

/* ---------- v3 ---------- */
.langs { display: inline-flex; gap: 6px; }
.lang { border: 2px solid transparent; background: #fff; padding: 3px; border-radius: 8px; line-height: 0; box-shadow: 0 0 0 1px var(--borde); }
.lang svg { display: block; border-radius: 3px; }
.lang.on { border-color: var(--azul); box-shadow: none; }
.auth-langs { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.auth.ob { justify-content: flex-start; padding-top: 20px; }
.ob-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; min-height: 36px; }
.ob-dots { display: flex; gap: 6px; margin-bottom: 18px; }
.ob-dots i { flex: 1; height: 5px; border-radius: 99px; background: var(--gris-3); }
.ob-dots i.on { background: var(--azul); }
.ob .h1 { margin-bottom: 6px; }
.ob-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.ob-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 1.5px solid var(--borde); background: #fff; border-radius: 14px; padding: 14px 16px; }
.ob-opt b { font-size: 17px; color: var(--noche); }
.ob-opt span { font-size: 14px; color: var(--gris-2); }
.ob-opt.on { border-color: var(--azul); background: var(--azul-suave); }
.ob .sports { margin-top: 16px; }
.ob-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; padding-bottom: 20px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--gris); background: var(--fondo); border: 1px solid var(--borde); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.consent input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--azul); }
.card .consent { background: #F8FAF9; }
.tabs.big button { padding: 10px; font-size: 15px; }
.ben .eyebrow { color: var(--ambar-oscuro); }
.ben.locked { background: #F8FAF9; }
.ben.locked .h1, .ben.locked .post-body { color: var(--gris-2); }
.code-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--azul-suave); border: 1.5px dashed var(--azul); border-radius: 12px; padding: 8px 8px 8px 14px; margin-top: 12px; }
.code { font-family: var(--cond); font-weight: 700; font-size: 22px; letter-spacing: .08em; color: var(--noche); }
.locked-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--gris-2); font-size: 14px; font-weight: 600; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 15px; }
.checks input { accent-color: var(--azul); width: 18px; height: 18px; vertical-align: -3px; }

/* ---------- v4: grupos ---------- */
.scopes { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.scopes::-webkit-scrollbar { display: none; }
.scope { flex: none; border: 1.5px solid var(--borde); background: #fff; border-radius: 99px; padding: 8px 14px; font-weight: 600; font-size: 14px; color: var(--noche); white-space: nowrap; }
.scope.on { background: var(--noche); border-color: var(--noche); color: #fff; }
.scope.add { border-style: dashed; color: var(--azul); }
.grp-card .level-row { align-items: center; }
.big-code { font-family: var(--cond); font-weight: 700; font-size: 48px; letter-spacing: .12em; color: #fff; line-height: 1.1; }
.code-input { font-family: var(--cond); font-weight: 700; font-size: 24px; letter-spacing: .12em; text-transform: uppercase; }

/* ---------- v5: COACHI, avatares, grupos ---------- */
.chat { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--fondo); }
.chat-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--borde); }
.chat-top .coachi-face { width: 44px; height: 44px; }
.chat-title { flex: 1; display: flex; flex-direction: column; line-height: 1.15; }
.chat-title b { font-family: var(--cond); font-size: 20px; letter-spacing: .06em; }
.chat-title span { font-size: 13px; color: var(--gris-2); }
.chat-log { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg-row { display: flex; gap: 8px; align-items: flex-end; animation: up .25s ease; }
.msg-row .coachi-face { width: 32px; height: 32px; flex: none; }
.msg-row.me { justify-content: flex-end; }
.bubble { max-width: 82%; background: #fff; border: 1px solid var(--borde); border-radius: 18px 18px 18px 6px; padding: 10px 14px; font-size: 15.5px; }
.msg-row.me .bubble { background: var(--azul); border-color: var(--azul); color: #fff; border-radius: 18px 18px 6px 18px; }
.chat-input { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--borde); padding: 12px 16px calc(14px + var(--safe-b)); display: flex; flex-direction: column; gap: 0; }
.chat-input .back { align-self: flex-start; font-size: 14px; margin-bottom: 8px; }
.qr { display: flex; flex-direction: column; gap: 8px; }
.qr-btn { text-align: left; border: 1.5px solid var(--azul); color: var(--noche); background: #fff; border-radius: 14px; padding: 10px 14px; font-weight: 700; font-size: 15px; }
.qr-btn small { display: block; font-weight: 500; font-size: 13px; color: var(--gris-2); }
.qr-btn:active { background: var(--azul-suave); }
.qr.chips { flex-direction: row; flex-wrap: wrap; margin-bottom: 10px; }
.chip { border: 1.5px solid var(--borde); background: #fff; border-radius: 99px; padding: 8px 14px; font-weight: 600; font-size: 14px; }
.chip.on { background: var(--azul); border-color: var(--azul); color: #fff; }
.av { display: inline-grid; place-items: center; border-radius: 50%; background: var(--celeste); color: #fff; font-family: var(--cond); font-weight: 700; object-fit: cover; flex: none; vertical-align: middle; }
.rank-name .av { margin-right: 4px; }
.avatar { overflow: hidden; padding: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.photo { position: relative; cursor: pointer; overflow: visible; }
.avatar.photo img { border-radius: 50%; }
.avatar.photo .cam { position: absolute; right: -4px; bottom: -4px; background: #fff; border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; font-size: 13px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.meet { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; background: var(--fondo); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.daypick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.daypick button { border: 1.5px solid var(--borde); background: #fff; border-radius: 10px; padding: 10px 0; font-weight: 700; }
.daypick button.on { background: var(--azul); border-color: var(--azul); color: #fff; }
.big-code.dark { color: var(--noche); text-align: center; margin-top: 6px; }

/* ---------- v6: insignias, maratones y carreras ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px 8px; }
.badge { border: 0; background: transparent; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; font: inherit; color: var(--noche); border-radius: 12px; }
.badge:active { background: var(--gris-3); }
.badge svg { display: block; max-width: 100%; height: auto; filter: drop-shadow(0 2px 3px rgba(6,6,90,.18)); }
.badge span { font-size: 12.5px; font-weight: 600; line-height: 1.2; text-align: center; }
/* Bloqueadas: se ve la silueta y los colores, apagados */
.badge.locked svg, .badge-big.locked svg { filter: saturate(.55) brightness(1.05); opacity: .55; }
.badge.locked span { color: var(--gris); font-weight: 500; }
.badge-big { display: flex; justify-content: center; }
.badge-big svg { filter: drop-shadow(0 4px 8px rgba(6,6,90,.22)); }
.mini-medal { display: inline-flex; flex: none; }
.mini-medal svg { display: block; }
.path-links { display: grid; gap: 8px; }
.path-links a { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--borde); border-radius: 12px; text-decoration: none; color: var(--noche); }
.path-links a span { grid-row: 1 / 3; font-size: 22px; text-align: center; }
.path-links a small { color: var(--gris); font-size: 13px; }
.race-card { border: 1.5px solid #CAD6FF; }
.coachi-tip { display: flex; align-items: flex-end; gap: 8px; margin-top: 12px; }
.coachi-tip img { width: 38px; height: 38px; flex: none; }
.coachi-tip .bubble { max-width: none; flex: 1; font-size: 14.5px; background: #F3F6FF; border-color: #DCE5FF; }
