/* ---------- Bienvenida ---------- */
.welcome-title { font-size: 32px; text-align: center; margin-top: 24px; }
.welcome-title .underline { background: linear-gradient(transparent 62%, var(--accent) 62%, var(--accent) 92%, transparent 92%); padding: 0 2px; }
.welcome-sub { text-align: center; margin-top: 12px; color: var(--text-body); }
.welcome-badges { display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin-top: 4px; }

/* ---------- Plan ---------- */
.note { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--done-bg); border: 1px solid var(--done-border); color: var(--text-body); }
.note .icon { color: var(--accent-text); margin-top: 1px; }
.group-title { font-size: 15px; color: var(--text-muted); margin: 20px 0 8px; font-family: var(--font-ui); font-weight: 600; }
.plan-card { text-decoration: none; color: inherit; }
.plan-card .chev { color: var(--text-muted); }
.menu { position: absolute; right: 0; top: 46px; z-index: 40; width: 220px; background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.15); overflow: hidden; }
.empty { padding: 8px 0; }

/* ---------- Editar ítem ---------- */
.preview { padding: 16px; border-radius: var(--r-card); background: var(--card); border: 1px solid var(--card-border); }
.icon-tile { width: 100%; padding: 10px; border-radius: var(--r-input); border: 1.5px dashed var(--border-strong); background: var(--card); text-align: left; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; background: var(--ic); border: 3px solid var(--card); box-shadow: 0 0 0 1.5px var(--card-border); }
.swatch.on { box-shadow: 0 0 0 3px var(--text); }
.qty-row { gap: 8px; }
.info-card { padding: 14px; border-radius: 16px; background: var(--done-bg); border: 1px solid var(--done-border); color: var(--text-body); }
.info-card .icon { color: var(--accent-text); }
.info-card b { color: var(--text); }
.impact-row { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }
.search { position: relative; }
.search > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); display: flex; }
.search .input { padding-left: 42px; height: 46px; }
.picker-cats .chip { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.icon-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding-bottom: 12px; }
.icon-cell {
  position: relative; aspect-ratio: 1; max-width: 64px; width: 100%; justify-self: center; border-radius: 14px; border: 2px solid transparent;
  background: var(--chip-bg); color: var(--text-body); display: grid; place-items: center;
}
.icon-cell.on { background: var(--ic-bg); border-color: var(--ic); color: var(--ic); }
.icon-cell .cell-check { position: absolute; right: -4px; top: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--ic); color: #fff; display: grid; place-items: center; }

/* ---------- Inicio ---------- */
.home-head h1 { font-size: 26px; }
.progress-card { position: relative; }
.progress-top { margin-top: 12px; gap: 16px; }
.ring-wrap { position: relative; flex: 0 0 auto; line-height: 0; }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.ring-label .num { font-size: 26px; color: var(--text); }
.xp-now { font-size: 30px; color: var(--text); }
.item-card .item-name { display: block; color: var(--text); font-size: 15px; }
.xp-text { color: var(--accent-text); font-weight: 700; font-family: var(--font-display); }
.banner {
  display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 10px;
  padding: 10px 14px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-family: var(--font-display);
}
.period-sub { margin: -6px 0 10px; }
.resting { opacity: .7; padding: 10px 14px; }
.resting .ibox { width: 32px; height: 32px; }
.next-badge { text-decoration: none; color: var(--text-body); }
.btn.saving, .btn-sm.saving { opacity: .6; pointer-events: none; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.skeleton { height: 220px; border-radius: var(--r-card); background: var(--card); border: 1px solid var(--card-border); opacity: .6; }

/* ---------- Hoja de cantidad ---------- */
.qty-period { text-align: center; color: var(--text-muted); font-weight: 600; }
.qty-value { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.qty-big { font-size: 56px; line-height: 1; color: var(--text); }
.range-wrap { position: relative; margin: 34px 0 0; padding: 0 4px; touch-action: none; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; touch-action: none; }
.range::-webkit-slider-runnable-track {
  height: 12px; border-radius: 99px;
  background: linear-gradient(90deg, var(--ic) 0 var(--fill), var(--track) var(--fill) 100%);
}
.range::-moz-range-track { height: 12px; border-radius: 99px; background: linear-gradient(90deg, var(--ic) 0 var(--fill), var(--track) var(--fill) 100%); }
.range-wrap.reached .range::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--accent) 0 var(--fill), var(--track) var(--fill) 100%); }
.range-wrap.reached .range::-moz-range-track { background: linear-gradient(90deg, var(--accent) 0 var(--fill), var(--track) var(--fill) 100%); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 32px; height: 32px; margin-top: -10px; border-radius: 50%;
  background: #fff; border: 3px solid var(--ic); box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.range::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 3px solid var(--ic); box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.range-mark {
  position: absolute; top: -26px; left: calc(20px + (100% - 40px) * var(--mark)); transform: translateX(-50%);
  font-size: 11px; color: var(--text-muted); text-align: center; pointer-events: none; white-space: nowrap;
}
.range-mark::after { content: ""; display: block; width: 2px; height: 26px; margin: 2px auto 0; background: var(--text); border-radius: 2px; opacity: .6; }
.range-wrap.flash .range-mark::after { background: var(--accent); opacity: 1; box-shadow: 0 0 10px var(--accent); }
.range-ends { display: flex; justify-content: space-between; padding: 0 6px; }
.qty-steppers { display: flex; justify-content: center; gap: 48px; margin-top: 16px; }
.stepper { width: 56px; height: 56px; border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--card); color: var(--text); display: grid; place-items: center; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.stepper:active { transform: scale(.94); }

/* ---------- Diálogo de temporada ---------- */
.season-rows .row { align-items: flex-start; }
.season-rows .icon { color: var(--text-muted); }

/* ---------- Temporada ---------- */
.season-title { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 0; color: var(--text); }
.streak-card { flex-wrap: wrap; }
.pill-streak.big { font-size: 17px; padding: 10px 14px; }
.streak-stats { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.streak-stats .num { color: var(--text); }
.heatmap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
.hm-month { min-width: 0; }
.hm-label { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.hm-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 12px)); gap: 2px; }
.hm-grid > * { display: block; width: 100%; aspect-ratio: 1; border-radius: 3px; }
.hm-blank, .hm-out { background: transparent; }
.hm-perfect { background: var(--day-perfect); }
.hm-partial { background: var(--day-partial); }
.hm-missed { background: var(--day-missed); }
.hm-free { background: var(--day-free); }
.hm-pending { background: var(--day-free); }
.hm-future { background: transparent; box-shadow: inset 0 0 0 1px var(--day-future); }
.hm-wild { box-shadow: inset 0 0 0 2px var(--streak); }
.hm-today { box-shadow: 0 0 0 1.5px var(--day-ring); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.week-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.wdot { width: 14px; height: 14px; border-radius: 50%; background: var(--day-missed); display: block; }
.wdot.done { background: var(--ic); }
.wdot.future { background: transparent; box-shadow: inset 0 0 0 1.5px var(--day-future); }
.wdot.current { background: transparent; box-shadow: inset 0 0 0 2px var(--ic); }
.month-boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(22px, 1fr)); gap: 4px; }
.mbox { height: 26px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 700; text-decoration: none; background: var(--day-missed); color: var(--text-muted); }
.mbox.done { background: var(--ic); color: #fff; }
.mbox.future { background: transparent; box-shadow: inset 0 0 0 1.5px var(--day-future); }
.mbox.current { background: linear-gradient(0deg, var(--ic) 0 var(--fill), var(--track) var(--fill) 100%); color: var(--text); }
.item-progress { display: block; text-decoration: none; color: var(--text); }
.item-progress .chev { color: var(--text-muted); }

/* ---------- Detalle de ítem ---------- */
.mini-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.mc-head { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.mc { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; font-size: 12px; color: var(--text-muted); text-decoration: none; }
.mc.sched { background: var(--chip-bg); color: var(--text); }
.mc.done { background: var(--ic); color: #fff; font-weight: 700; }
.mc.future { background: transparent; box-shadow: inset 0 0 0 1px var(--day-future); }
.mc.today { box-shadow: 0 0 0 2px var(--day-ring); }
.period-row { padding: 8px 0; border-bottom: 1px solid var(--card-border); }
.period-row:last-child { border-bottom: 0; }
.period-state { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--chip-bg); color: var(--text-muted); }
.period-state.on { background: var(--accent); color: var(--accent-ink); }
.period-list { max-height: 360px; overflow-y: auto; }

/* ---------- Insignias ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.badge-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; min-width: 0;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; box-shadow: var(--card-shadow); color: var(--text);
}
.badge-name { font-size: 13px; font-weight: 700; text-align: center; line-height: 1.2; overflow-wrap: anywhere; }
.level-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.level-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 16px; }
.level-cell.current { box-shadow: 0 0 0 3px var(--accent); background: var(--card); }

/* ---------- Logro ---------- */
.achievement { position: fixed; inset: 0; z-index: 70; background: var(--card); display: flex; align-items: center; justify-content: center; overflow: hidden; animation: fade-in .2s; }
.achievement .rays {
  position: absolute; width: 900px; height: 900px; left: 50%; top: 38%; margin: -450px 0 0 -450px; opacity: .35;
  background: repeating-conic-gradient(var(--accent-soft) 0 10deg, transparent 10deg 20deg); animation: rays 40s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 60%); mask: radial-gradient(circle, #000 20%, transparent 60%);
}
.achievement-inner { position: relative; width: 100%; max-width: 380px; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.achievement-badge { margin-top: 12px; }
.achievement h1 { font-size: 26px; }

/* ---------- Perfil ---------- */
.avatar-big { position: relative; display: inline-block; margin-top: 8px; }
.avatar-big .cam { position: absolute; right: 2px; bottom: 6px; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; border: 3px solid var(--bg); }
.prestige { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stats .card { padding: 12px 8px; }
.stats .num { font-size: 22px; color: var(--text); }
.trophy-empty { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; border: 2px dashed var(--border-strong); text-align: left; }
.trophy-row { display: flex; flex-wrap: wrap; gap: 12px; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.avatar-cell { border: 0; background: transparent; padding: 4px; border-radius: 50%; display: grid; place-items: center; }
.avatar-cell.on { box-shadow: 0 0 0 3px var(--accent); }
.crop-preview { width: 200px; height: 200px; margin: 0 auto; border-radius: 50%; overflow: hidden; background: var(--chip-bg); }
.crop-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Ajustes ---------- */
.time-row { padding: 4px 0; }

/* ---------- Cierre ---------- */
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; min-width: 0; }
.big-num { font-size: 40px; color: var(--text); }
.dots { display: flex; justify-content: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; border: 0; background: var(--border-strong); padding: 0; }
.dot.on { background: var(--accent-text); width: 20px; border-radius: 99px; }

/* ---------- Galería ---------- */
.gal-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
