/* ═══════════════════════════════════════════════════════════════════
   IronQx — Inicio: Estado del plan, Adherencia y Resumen semanal
   Misma familia que «Tu día» y el ranking: panel negro con filo dorado,
   rótulos pequeños, cifras grandes en Barlow Condensed e íconos de línea.
   Las hojas antiguas (04/05) usan !important en .adh-d y .week-sum: aquí
   todo va acotado a #scr-home para ganarles sin tocar otras pantallas.
   ═══════════════════════════════════════════════════════════════════ */
#scr-home .hp-plan, #scr-home .hp-adh, #scr-home .hp-ws {
  position: relative; overflow: hidden; border-radius: 24px !important;
  background: radial-gradient(90% 70% at 0% 0%, rgba(201,168,76,.08), transparent 60%),
              linear-gradient(165deg, rgba(255,255,255,.05), rgba(255,255,255,.012) 55%), var(--bg2) !important;
  border: 1px solid rgba(255,255,255,.075) !important;
  box-shadow: 0 18px 44px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.05) !important;
}
#scr-home .hp-plan::before, #scr-home .hp-adh::before, #scr-home .hp-ws::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(242,203,104,.35), transparent) !important;
}
#scr-home .hp-plan .iq-ic, #scr-home .hp-adh .iq-ic, #scr-home .hp-ws .iq-ic { width: 16px; height: 16px; }
.hp-lbl, .hp-kicker { display: block; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--txt2); }
.hp-kicker { font: 400 9px/1.2 var(--iq-brand, Inter); letter-spacing: .26em; color: var(--gold); }
.hp-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; font: 700 11px/1 Inter, sans-serif; color: var(--txt2); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); white-space: nowrap; }
.hp-chip.is-ok { color: var(--gold3); background: rgba(201,168,76,.12); border-color: rgba(201,168,76,.3); }

/* ── Estado del plan ── */
#scr-home .hp-plan { margin: 0 0 16px; padding: 16px 16px 14px; }
.hp-plan-top { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-bottom: 30px; }
.hp-w { position: relative; z-index: 1; display: grid; gap: 4px; }
.hp-w.is-goal { justify-items: end; text-align: right; }
.hp-w-n { display: flex; align-items: baseline; gap: 4px; }
.hp-w-n b { font: 800 44px/.95 'Barlow Condensed', sans-serif; letter-spacing: -.01em; font-variant-numeric: tabular-nums; background: var(--iq-champagne, var(--grad-gold)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hp-w.is-goal .hp-w-n b { background: var(--iq-platinum, #fff); -webkit-background-clip: text; background-clip: text; }
.hp-w-n small { font: 700 13px/1 Inter, sans-serif; color: var(--muted); }
.hp-w-delta { min-height: 22px; }
.hp-spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 28px; opacity: .45; pointer-events: none; z-index: 0; }

.hp-goal:empty { display: none; }
.hp-goal { margin-top: 10px; }
.hp-goal-track { position: relative; height: 8px; border-radius: 99px; background: rgba(255,255,255,.07); }
.hp-goal-track i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--grad-gold); transform-origin: left; animation: hp-grow 1s .2s cubic-bezier(.22,1,.36,1) both; }
.hp-goal-track b { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #FFF6D8; border: 3px solid var(--gold); box-shadow: 0 0 0 4px rgba(201,168,76,.16), 0 2px 8px rgba(0,0,0,.4); }
@keyframes hp-grow { from { transform: scaleX(0); } }
.hp-goal-legend { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11px; color: var(--muted); }
.hp-goal-legend strong { font: 800 13px/1 'Barlow Condensed', sans-serif; letter-spacing: .04em; color: var(--gold3); }

.hp-plan-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.hp-tile { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 16px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06); min-width: 0; }
.hp-tile-ic { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: var(--silver); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.hp-tile-ic.is-cp { color: var(--gold3); background: rgba(201,168,76,.1); border-color: rgba(201,168,76,.22); }
.hp-tile > div { display: grid; gap: 1px; min-width: 0; }
.hp-tile b { font: 800 22px/1 'Barlow Condensed', sans-serif; color: var(--txt); font-variant-numeric: tabular-nums; }
.hp-tile b small { font: 700 11px/1 Inter, sans-serif; color: var(--txt2); }
.hp-tile > div > span { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Adherencia de la semana ── */
#scr-home .hp-adh .card-bd { padding: 16px 14px 14px !important; }
.hp-adh-head { display: flex; align-items: center; gap: 14px; padding: 0 2px; }
.hp-adh-ring { position: relative; flex: 0 0 62px; width: 62px; height: 62px; }
.hp-adh-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hp-adh-ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.hp-adh-ring .bg { stroke: rgba(255,255,255,.08); }
.hp-adh-ring .fg { stroke: var(--gold); transition: stroke-dasharray .8s cubic-bezier(.22,1,.36,1); }
.hp-adh-ring.is-good .fg { stroke: var(--green); filter: drop-shadow(0 0 4px rgba(46,171,101,.45)); }
.hp-adh-ring.is-low .fg { stroke: #e06a6a; }
.hp-adh-ring > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 800 18px/1 'Barlow Condensed', sans-serif; color: var(--txt); }
.hp-adh-ring > span small { font-size: 10px; color: var(--txt2); }
.hp-adh-copy { flex: 1; min-width: 0; display: grid; gap: 4px; }
#scr-home .hp-adh-copy > #adh-pct { padding: 0; border: 0; background: none; font: 800 16px/1.15 Inter, sans-serif !important; letter-spacing: -.01em; text-transform: none; color: var(--txt) !important; }
.hp-adh-sum { font-size: 12px; color: var(--txt2); }
#streak-wrap:empty { display: none; }
.hp-streak { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 11.5px; color: var(--txt2); background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
.hp-streak .iq-ic { width: 14px !important; height: 14px !important; }
.hp-streak b { font-weight: 800; color: var(--txt); }
.hp-streak em { font-style: normal; color: var(--muted); }
.hp-streak.is-on { color: var(--gold3); border-color: rgba(201,168,76,.28); background: rgba(201,168,76,.08); }
.hp-streak.is-warm, .hp-streak.is-hot { color: #f6a54a; border-color: rgba(246,165,74,.35); background: rgba(246,165,74,.1); }
.hp-streak.is-hot { box-shadow: 0 0 14px rgba(246,165,74,.2); }

#scr-home .hp-week { display: grid !important; grid-template-columns: repeat(7, 1fr) !important; gap: 6px !important; margin: 16px 0 10px !important; }
#scr-home .hp-week .adh-d {
  aspect-ratio: auto !important; height: auto; padding: 8px 0 7px !important; gap: 4px !important; border-radius: 14px !important;
  background: rgba(255,255,255,.03) !important; border: 1px solid rgba(255,255,255,.06) !important; box-shadow: none !important;
  opacity: 1 !important; cursor: default; color: var(--muted);
}
#scr-home .hp-week .adh-d:active { transform: none; }
.hp-week .hp-wd { font-size: 9px; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
#scr-home .hp-week .adh-n { font: 800 17px/1 'Barlow Condensed', sans-serif !important; color: var(--txt2); }
.hp-week .hp-st { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.04); }
.hp-week .hp-st .iq-ic { width: 12px !important; height: 12px !important; }
#scr-home .hp-week .adh-d.done { background: linear-gradient(170deg, rgba(46,171,101,.2), rgba(46,171,101,.04)) !important; border-color: rgba(46,171,101,.3) !important; }
.hp-week .adh-d.done .adh-n { color: var(--green) !important; }
.hp-week .adh-d.done .hp-st { color: #08130d; background: var(--green); }
#scr-home .hp-week .adh-d.part { background: linear-gradient(170deg, rgba(201,168,76,.2), rgba(201,168,76,.04)) !important; border-color: rgba(201,168,76,.3) !important; }
.hp-week .adh-d.part .adh-n { color: var(--gold3) !important; }
.hp-week .adh-d.part .hp-st { color: #120e04; background: var(--gold); }
#scr-home .hp-week .adh-d.miss { background: linear-gradient(170deg, rgba(221,68,68,.16), rgba(221,68,68,.03)) !important; border-color: rgba(221,68,68,.26) !important; }
.hp-week .adh-d.miss .adh-n { color: #e98282 !important; }
.hp-week .adh-d.miss .hp-st { color: #fff; background: #d44; }
.hp-week .adh-d.free .hp-st::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.25); }
#scr-home .hp-week .adh-d.future { opacity: .35 !important; }
#scr-home .hp-week .adh-d.is-today { border-color: var(--gold) !important; box-shadow: 0 0 0 1px rgba(201,168,76,.35), 0 0 16px rgba(201,168,76,.18) !important; }
.hp-week .adh-d.is-today .hp-wd { color: var(--gold); }

.hp-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0 2px; font-size: 11px; color: var(--muted); }
.hp-legend span { display: inline-flex; align-items: center; gap: 5px; }
.hp-legend i { width: 8px; height: 8px; border-radius: 3px; }
.hp-legend .is-done { background: var(--green); } .hp-legend .is-part { background: var(--gold); }
.hp-legend .is-miss { background: #d44; } .hp-legend .is-free { background: rgba(255,255,255,.2); }
#scr-home .hp-adh #adh-30-btn { margin-top: 12px !important; border-radius: 12px !important; border-color: rgba(255,255,255,.08) !important; padding: 9px 12px !important; }

/* ── Resumen semanal ── */
#scr-home .hp-ws { padding: 16px !important; }
.hp-ws-hd b { display: block; margin-top: 6px; font: 800 17px/1.15 Inter, sans-serif; letter-spacing: -.02em; color: var(--txt); }
.hp-ws-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.hp-ws-t { display: grid; justify-items: center; gap: 3px; padding: 11px 4px 10px; border-radius: 16px; text-align: center; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06); }
.hp-ws-t .iq-ic { color: var(--silver2); }
.hp-ws-t b { font: 800 24px/1.05 'Barlow Condensed', sans-serif; color: var(--txt); font-variant-numeric: tabular-nums; }
.hp-ws-t b small { font-size: 13px; color: var(--muted); }
.hp-ws-t span { font-size: 10px; font-weight: 600; color: var(--muted); }
.hp-ws-t.is-good { border-color: rgba(46,171,101,.25); } .hp-ws-t.is-good b, .hp-ws-t.is-good .iq-ic { color: var(--green); }
.hp-ws-t.is-mid b, .hp-ws-t.is-mid .iq-ic { color: var(--gold3); }
.hp-ws-t.is-low b, .hp-ws-t.is-low .iq-ic { color: #e98282; }
.hp-ws-msg { display: flex; gap: 11px; align-items: flex-start; margin-top: 10px; padding: 12px; border-radius: 16px; background: rgba(201,168,76,.05); border: 1px solid rgba(201,168,76,.14); }
.hp-ws-msg-ic { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; color: var(--gold3); background: rgba(201,168,76,.1); }
.hp-ws-msg p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--txt2); }

@media (max-width: 360px) {
  .hp-w-n b { font-size: 38px; }
  .hp-plan-foot { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .hp-goal-track i { animation: none; } }
