/* =====================================================================
   MIS HÁBITOS
   ===================================================================== */
#seccion-habitos-calendario > .btn-volver-inicio { display: none; }
.hb { max-width: 560px; margin: 0 auto; padding: 0 1rem 1rem; box-sizing: border-box; color: var(--a2-texto, #56414A); font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
.hb button { font-family: inherit; -webkit-tap-highlight-color: transparent; }
.hb-cab { text-align: center; margin: 0.2rem 0 1rem; }
.hb-cab h1 { margin: 0; font: 500 1.8rem/1.15 var(--a2-serif, 'Lora', Georgia, serif); color: var(--a2-texto, #56414A); }
.hb-cab p { margin: 4px 0 0; font: italic 0.92rem var(--a2-serif, 'Lora', Georgia, serif); color: var(--a2-suave, #9A8790); }

/* --- calendario --- */
.hb-cal { background: #fff; border-radius: 22px; padding: 14px 12px 12px; box-shadow: 0 6px 22px rgba(139, 71, 137, .10); border: 1px solid #F3E4EB; }
.hb-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hb-cal-nav h2 { margin: 0; font: 500 1.2rem var(--a2-serif, 'Lora', Georgia, serif); color: #8B4789; }
.hb-flecha { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #F0D6E2; background: #FFF7FA; color: #8B4789; font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 0 3px; }
.hb-semana, .hb-dias { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.hb-semana span { text-align: center; font-size: 0.72rem; font-weight: 700; color: #B58AA3; padding: 4px 0; }
.hb-dia {
    position: relative; aspect-ratio: 1; border: 0; border-radius: 50%; cursor: pointer;
    background: transparent; color: #6E4A60; font: 600 0.92rem system-ui, -apple-system, sans-serif;
    display: flex; align-items: center; justify-content: center; transition: transform .15s, background .2s;
}
.hb-dia:active { transform: scale(.9); }
.hb-dia.n1 { background: #FCE7F0; }
.hb-dia.n2 { background: #F6C6DA; color: #7A2E57; }
.hb-dia.n3 { background: linear-gradient(145deg, #C46A9C, #8B4789); color: #fff; }
.hb-dia i { position: absolute; top: -3px; right: -1px; font-style: normal; font-size: 0.7rem; color: #D9AE52; }
.hb-dia.hoy { box-shadow: inset 0 0 0 2px #D9AE52; }
.hb-dia.sel { outline: 2px solid #8B4789; outline-offset: 2px; }
.hb-leyenda { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; font-size: 0.7rem; color: #9A8790; }
.hb-leyenda i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-left: 6px; }
.hb-leyenda .n1 { background: #FCE7F0; } .hb-leyenda .n2 { background: #F6C6DA; } .hb-leyenda .n3 { background: #A44F86; }

/* --- tarjeta de hábitos que se abre --- */
.hb-tarjeta { margin-top: 14px; background: #fff; border-radius: 22px; border: 1px solid #F3E4EB; box-shadow: 0 6px 22px rgba(139, 71, 137, .10); overflow: hidden; }
.hb-tarjeta-cab { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 0; background: linear-gradient(135deg, #FFF4F8 0%, #FBE8F1 100%); cursor: pointer; text-align: left; }
.hb-anillo {
    --p: 0; flex-shrink: 0; width: 54px; height: 54px; border-radius: 50%;
    background: conic-gradient(#A44F86 calc(var(--p) * 1%), #F3DCE7 0);
    display: flex; align-items: center; justify-content: center;
}
.hb-anillo b { width: 42px; height: 42px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; color: #8B4789; }
.hb-tarjeta-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hb-tarjeta-txt b { font: 500 1.05rem var(--a2-serif, 'Lora', Georgia, serif); color: #56414A; }
.hb-tarjeta-txt small { font: italic 0.8rem/1.35 var(--a2-serif, 'Lora', Georgia, serif); color: #9A6B86; }
.hb-chev { font-style: normal; font-size: 1.3rem; color: #B58AA3; transition: transform .3s; }
.hb-tarjeta.abierta .hb-chev { transform: rotate(180deg); }
.hb-tarjeta-cuerpo { display: none; padding: 6px 12px 12px; }
.hb-tarjeta.abierta .hb-tarjeta-cuerpo { display: block; animation: hbAbrir .3s ease; }
@keyframes hbAbrir { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.hb-fila { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #F6ECF1; }
.hb-fila:last-child { border-bottom: 0; }
.hb-fila-toque { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 6px 2px; cursor: pointer; text-align: left; }
.hb-emoji { flex-shrink: 0; width: 38px; height: 38px; border-radius: 12px; background: #FDF0F5; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.hb-nombre { flex: 1; min-width: 0; font-size: 0.95rem; font-weight: 600; color: #5A3D52; }
.hb-check {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #E2B6CB;
    display: flex; align-items: center; justify-content: center; font-size: 0.95rem; font-weight: 700; color: #fff; transition: all .2s;
}
.hb-fila.hecho .hb-check { background: linear-gradient(145deg, #C46A9C, #8B4789); border-color: transparent; transform: scale(1.05); }
.hb-fila.hecho .hb-nombre { color: #A07A90; text-decoration: line-through; text-decoration-color: #D9AACB; }
.hb-fila.hecho .hb-emoji { background: #F6DDE9; }
.hb-hora { flex-shrink: 0; border: 1px dashed #E2C3D2; background: #FFFAFC; color: #A35A80; border-radius: 999px; padding: 5px 9px; font-size: 0.72rem; font-weight: 600; cursor: pointer; }
.hb-hora.puesta { border-style: solid; background: #FBF1E4; border-color: #EBD5AE; color: #8E6420; }
.hb-acciones { text-align: center; margin-top: 8px; }
.hb-editar { border: 0; background: none; color: #8B4789; font-weight: 700; font-size: 0.88rem; cursor: pointer; padding: 8px 12px; }
.hb-vacio-txt { text-align: center; color: #9A8790; font-size: 0.9rem; padding: 1rem 0; }

/* editar */
.hb-sub { margin: 12px 0 6px; font: 500 0.95rem var(--a2-serif, 'Lora', Georgia, serif); color: #56414A; }
.hb-elegir { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid #F3E4EB; background: #fff; border-radius: 14px; padding: 6px 10px; margin-bottom: 6px; cursor: pointer; text-align: left; box-sizing: border-box; }
.hb-elegir .hb-check { border-color: #E2C3D2; color: #B58AA3; }
.hb-elegir.si { background: #FFF6FA; border-color: #EBC3D6; }
.hb-elegir.si .hb-check { background: #A44F86; border-color: transparent; color: #fff; }
.hb-quitar { border: 0; background: #F3DCE7; color: #8B4789; width: 28px; height: 28px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; }
.hb-nuevo { display: flex; gap: 6px; align-items: center; }
.hb-nuevo-emoji { width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; border: 1px solid #F0D6E2; background: #FFF7FA; font-size: 1.3rem; cursor: pointer; }
#seccion-habitos-calendario .hb-nuevo input { flex: 1; min-width: 0; height: 42px; box-sizing: border-box; border: 1px solid #F0D6E2 !important; border-radius: 12px !important; padding: 0 12px !important; font-size: 0.95rem !important; background: #fff !important; box-shadow: none !important; margin: 0 !important; }
.hb-nuevo-btn { flex-shrink: 0; height: 42px; border: 0; border-radius: 12px; padding: 0 14px; background: #8B4789; color: #fff; font-weight: 700; cursor: pointer; }
.hb-emojis { display: none; grid-template-columns: repeat(8, 1fr); gap: 2px; margin-top: 6px; padding: 6px; border-radius: 14px; background: #fff; border: 1px solid #F0D6E2; }
.hb-emojis.abierto { display: grid; }
.hb-emojis button { border: 0; background: none; font-size: 1.35rem; padding: 4px 0; border-radius: 8px; cursor: pointer; }
.hb-emojis button:active { background: #FBF0F5; }

/* recordatorios */
.hb-recordar { margin-top: 14px; text-align: center; font-size: 0.85rem; color: #8E6B7E; line-height: 1.45; }
.hb-recordar p { margin: 0; padding: 10px 14px; background: #FFF8EE; border: 1px solid #F1E0C0; border-radius: 16px; }
.hb-recordar p button { border: 0; background: none; color: #8B4789; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0 2px; }
.hb-activar { border: 0; border-radius: 999px; padding: 12px 22px; cursor: pointer; font-weight: 700; font-size: 0.95rem; color: #fff; background: linear-gradient(135deg, #D9AE52, #C08A2E); box-shadow: 0 6px 16px rgba(192, 138, 46, .3); }

/* ventana para la hora */
.hb-modal { position: fixed; inset: 0; z-index: 10000; background: rgba(60, 30, 50, .45); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.hb-modal-caja {
    width: 100%; max-width: 460px; background: #fff; border-radius: 26px 26px 0 0; padding: 22px 22px calc(22px + env(safe-area-inset-bottom));
    text-align: center; animation: hbSubir .3s ease; box-sizing: border-box;
}
@media (min-width: 600px) { .hb-modal { align-items: center; } .hb-modal-caja { border-radius: 26px; } }
@keyframes hbSubir { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.hb-modal-emoji { font-size: 2rem; }
.hb-modal-caja h3 { margin: 4px 0 2px; font: 500 1.25rem var(--a2-serif, 'Lora', Georgia, serif); color: #56414A; }
.hb-modal-caja p { margin: 0 0 12px; color: #9A8790; font-size: 0.9rem; }
#hbHoraInput { font-size: 1.6rem !important; padding: 10px 14px !important; border: 2px solid #F0D6E2 !important; border-radius: 16px !important; color: #8B4789; background: #FFF7FA !important; text-align: center; min-width: 170px; box-shadow: none !important; }
.hb-modal-botones { display: grid; gap: 8px; margin-top: 16px; }
.hb-modal-botones button { border: 0; border-radius: 14px; padding: 13px; font-size: 1rem; font-weight: 700; cursor: pointer; }
.hb-modal-ok { background: #8B4789; color: #fff; }
.hb-modal-quitar { background: #FBF0F5; color: #A35A80; }
.hb-modal-cerrar { background: none; color: #9A8790; }
.hb-rec-btns button { margin: 4px 4px 0 0; border: 1.5px solid #E7C9D7; background: #fff; color: #8B4789; border-radius: 999px; padding: 6px 12px; font-weight: 600; cursor: pointer; }
.hb-rev { list-style: none; padding: 10px 12px; margin: 8px 0 0; background: #FFF9FB; border: 1px solid #F3E3EA; border-radius: 14px; font-size: .86rem; line-height: 1.5; text-align: left; }
