:root {
  --primario: #5b45e0;
  --primario-2: #7c5cff;
  --fondo: #f6f5fb;
  --tarjeta: #ffffff;
  --texto: #1d1b2e;
  --tenue: #6b6880;
  --borde: #e7e4f2;
  --pista: #ece9f7;
  --ok: #10a37f;
  --pend: #d97706;
  --peligro: #dc2626;
  --radio: 18px;
  --sombra: 0 1px 2px rgba(30, 20, 80, .05), 0 6px 20px rgba(30, 20, 80, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #111019; --tarjeta: #1b1a26; --texto: #f1effa; --tenue: #a19eb8;
    --borde: #2c2a3b; --pista: #2a2838; --sombra: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fondo); color: var(--texto);
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.3rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; }
#vista { max-width: 640px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.tenue { color: var(--tenue); font-size: .88rem; }
.pista { font-size: .8rem; margin-top: 4px; }
.vacio { color: var(--tenue); text-align: center; padding: 24px 8px; }
.principio { color: var(--tenue); text-align: center; font-size: .82rem; font-style: italic; padding: 4px 16px 8px; }
.enlace { background: none; border: 0; color: var(--primario-2); padding: 0; font-weight: 600; font-size: .88rem; text-decoration: underline; }

/* Cabeceras */
.cab { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px; }
.cab-hoy { display: flex; align-items: center; gap: 8px; }
.cab-fecha { flex: 1; text-align: center; }
.cab-fecha small { color: var(--tenue); font-size: .85rem; }
.cab-fecha h1 { font-size: 1.2rem; }
.flecha { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--borde); background: var(--tarjeta); font-size: 1.4rem; line-height: 1; }
.flecha:disabled { opacity: .3; cursor: default; }

/* Tarjetas */
.tarjeta, .area, .resumen-hoy { background: var(--tarjeta); border-radius: var(--radio); box-shadow: var(--sombra); padding: 14px; border: 1px solid var(--borde); }
.tarjeta { display: flex; flex-direction: column; gap: 10px; }
.resumen-hoy {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, #5b45e0, #8b5cf6 60%, #c084fc); color: #fff; border: 0;
}
.resumen-hoy .tenue { color: rgba(255, 255, 255, .85); }
.resumen-hoy .anillo circle:first-child { stroke: rgba(255, 255, 255, .25); }
.resumen-hoy .anillo circle:last-child { stroke: #fff; }
.resumen-hoy .anillo-txt { fill: #fff; }
.grande { font-size: 1.25rem; font-weight: 700; }
.anillo { flex: none; }
.anillo-txt { font-weight: 800; font-size: 1.15rem; fill: var(--texto); }

/* Avisos */
.aviso { border-radius: 14px; padding: 10px 12px; font-size: .9rem; border: 1px solid; text-align: left; width: 100%; }
.aviso-noche { background: #eef2ff; border-color: #c7d2fe; color: #312e81; }
.aviso-meta, .aviso-meta-lista { background: #fff7e6; border-color: #fcd9a0; color: #7a4a00; }
.aviso-meta-lista { display: flex; flex-direction: column; gap: 4px; }
@media (prefers-color-scheme: dark) {
  .aviso-noche { background: #1e1b4b; border-color: #3730a3; color: #e0e7ff; }
  .aviso-meta, .aviso-meta-lista { background: #2b1f08; border-color: #6b4a10; color: #fde7b0; }
}

/* Chips y segmentos */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--borde); background: var(--tarjeta); border-radius: 999px; padding: 7px 13px; font-size: .88rem; white-space: nowrap; }
.chip.on { background: var(--texto); color: var(--fondo); border-color: var(--texto); }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px; }
.leyenda .chip { padding: 5px 10px; font-size: .8rem; display: inline-flex; align-items: center; gap: 6px; opacity: .45; }
.leyenda .chip.on { background: var(--tarjeta); color: var(--texto); border-color: var(--c); opacity: 1; }
.leyenda .chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.segmentos { display: flex; background: var(--pista); border-radius: 12px; padding: 3px; gap: 3px; }
.segmentos > button, .segmentos > label { flex: 1; border: 0; background: none; border-radius: 9px; padding: 8px 6px; font-size: .88rem; font-weight: 600; color: var(--tenue); text-align: center; position: relative; }
.segmentos > button.on, .segmentos > label:has(input:checked) { background: var(--tarjeta); color: var(--texto); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.segmentos input { position: absolute; opacity: 0; pointer-events: none; }
.segmentos.mini > button { padding: 5px 8px; font-size: .78rem; }

/* Áreas y hábitos */
.area { padding: 12px 12px 8px; border-top: 4px solid var(--c); }
.area-cab { display: flex; align-items: center; gap: 6px; }
.area-titulo { flex: 1; display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 2px 0; text-align: left; }
.area-ico { font-size: 1.25rem; }
.area-nombre { font-weight: 700; }
.area-cuenta { color: var(--tenue); font-size: .85rem; font-variant-numeric: tabular-nums; }
.btn-mini { border: 1px solid var(--borde); background: var(--tarjeta); border-radius: 10px; padding: 5px 9px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.btn-mini.con-nota { border-color: var(--c); }
.barra { height: 6px; border-radius: 99px; background: var(--pista); overflow: hidden; margin: 8px 0 6px; flex: 1; }
.barra i { display: block; height: 100%; border-radius: inherit; transition: width .3s ease; }
.habitos { list-style: none; margin: 0; padding: 0; }
.habito {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  min-height: 48px; padding: 8px 4px; background: none; border: 0; border-bottom: 1px solid var(--borde);
}
.habitos li:last-child .habito { border-bottom: 0; }
.check {
  flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--borde);
  display: grid; place-items: center; font-weight: 800; font-size: .95rem; transition: transform .15s, background .15s;
}
.habito:active .check { transform: scale(.85); }
.habito.hecho .check { background: var(--c); border-color: var(--c); color: #fff; }
.habito.hecho .hab-nombre { color: var(--tenue); }
.habito.na .check { background: var(--pista); color: var(--tenue); border-style: dashed; }
.habito.na .hab-nombre { color: var(--tenue); text-decoration: line-through; }
.habito.pend .check { border-color: var(--pend); color: var(--pend); }
.hab-nombre { flex: 1; }
.tag { font-size: .72rem; color: var(--tenue); background: var(--pista); border-radius: 6px; padding: 2px 6px; }
.tag-p { color: var(--pend); background: rgba(217, 119, 6, .12); }
.racha { font-size: .8rem; font-weight: 700; color: #ea580c; }
.nota-prev { font-size: .85rem; color: var(--tenue); padding: 6px 2px 2px; white-space: pre-wrap; }

/* Formularios */
.etiqueta { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; font-weight: 600; color: var(--tenue); }
textarea, input:not([type=checkbox]):not([type=radio]):not([type=range]), select {
  width: 100%; border: 1px solid var(--borde); background: var(--fondo); border-radius: 12px; padding: 10px 12px; font-size: 1rem; color: var(--texto); font-weight: 400;
}
textarea { resize: vertical; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--primario-2); outline-offset: 0; border-color: transparent; }
input[type=range] { width: 100%; accent-color: var(--primario); }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dias { display: flex; gap: 6px; }
.dias label { flex: 1; }
.dias input { position: absolute; opacity: 0; pointer-events: none; }
.dias span { display: grid; place-items: center; height: 40px; border-radius: 12px; border: 1px solid var(--borde); font-weight: 700; color: var(--tenue); }
.dias input:checked + span { background: var(--primario); border-color: var(--primario); color: #fff; }
.dias input:focus-visible + span { outline: 2px solid var(--primario-2); }

/* Botones */
.btn { border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 700; font-size: .95rem; }
.btn-pri { background: var(--primario); color: #fff; }
.btn-sec { background: var(--pista); color: var(--texto); }
.btn-peligro { background: rgba(220, 38, 38, .1); color: var(--peligro); }
.btn-chico { padding: 8px 12px; font-size: .85rem; border-radius: 11px; }
.fila-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.fila-btns .btn { flex: 1; }
.fila-btns.izq { justify-content: flex-start; }
.fila-btns.izq .btn { flex: none; }
.botonera { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.barra-cerrar { position: sticky; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 5; }
.barra-cerrar .btn { width: 100%; padding: 15px; font-size: 1rem; box-shadow: 0 8px 24px rgba(91, 69, 224, .35); }
.barra-cerrar .btn-sec { box-shadow: var(--sombra); background: var(--tarjeta); border: 1px solid var(--borde); }

/* Progreso */
.nav-periodo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nav-periodo h2 { text-align: center; flex: 1; text-transform: none; }
.nav-periodo .flecha { width: 34px; height: 34px; font-size: 1.2rem; }
.resumen-periodo { display: flex; align-items: center; gap: 14px; }
.fila-area-top { display: flex; justify-content: space-between; font-weight: 600; }
.fila-area .barra { margin: 5px 0 2px; }
.grafico { width: 100%; height: auto; }
.grafico .rejilla { stroke: var(--borde); stroke-width: 1; }
.grafico .eje { fill: var(--tenue); font-size: 9px; }
.lista-simple { list-style: none; margin: 0; padding: 0; }
.lista-simple li { display: flex; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--borde); font-size: .92rem; }
.lista-simple li:last-child { border-bottom: 0; }
.lista-simple b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* Metas */
.grupo { font-size: .9rem; color: var(--tenue); text-transform: uppercase; letter-spacing: .04em; padding: 6px 2px 0; border-left: 3px solid var(--c); padding-left: 8px; }
.meta { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 12px 14px; box-shadow: var(--sombra); }
.meta-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.meta-txt { font-weight: 600; }
.meta-avance { display: flex; align-items: center; gap: 10px; }
.meta-avance .barra { margin: 0; }
.meta-avance b { font-size: .85rem; min-width: 38px; text-align: right; }
.meta-accion { font-size: .88rem; }
.pill { font-size: .75rem; font-weight: 700; border-radius: 99px; padding: 3px 9px; background: var(--pista); color: var(--tenue); }
.pill-en-progreso { background: rgba(47, 123, 245, .12); color: #2f6fe0; }
.pill-lograda { background: rgba(16, 163, 127, .14); color: var(--ok); }
.pill-en-pausa { background: rgba(107, 104, 128, .15); }
.alertas { display: flex; flex-wrap: wrap; gap: 6px; }
.alerta { font-size: .75rem; font-weight: 700; border-radius: 8px; padding: 3px 8px; }
.alerta-accion { background: rgba(217, 119, 6, .12); color: var(--pend); }
.alerta-pronto { background: rgba(234, 88, 12, .14); color: #c2410c; }
.alerta-vencida { background: rgba(220, 38, 38, .12); color: var(--peligro); }

/* Más */
.conf-area { border-top: 1px solid var(--borde); padding-top: 8px; }
.conf-area summary { cursor: pointer; font-weight: 700; padding: 6px 0; list-style: none; display: flex; gap: 8px; align-items: center; }
.conf-area summary::-webkit-details-marker { display: none; }
.conf-area summary::after { content: '›'; margin-left: auto; transition: transform .2s; font-size: 1.3rem; color: var(--tenue); }
.conf-area[open] summary::after { transform: rotate(90deg); }
.conf-area summary .tenue { font-weight: 400; }
.conf-habitos { list-style: none; margin: 4px 0 8px; padding: 0; }
.conf-habitos li { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--borde); }
.conf-habitos li.inactivo .conf-hab { opacity: .45; }
.conf-hab { flex: 1; display: flex; flex-direction: column; align-items: flex-start; background: none; border: 0; padding: 9px 0; text-align: left; }
.interruptor { position: relative; display: inline-block; width: 46px; height: 28px; flex: none; }
.interruptor input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.interruptor i { position: absolute; inset: 0; border-radius: 99px; background: var(--borde); transition: background .2s; }
.interruptor i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.interruptor input:checked + i { background: var(--ok); }
.interruptor input:checked + i::after { transform: translateX(18px); }
.interruptor input:disabled + i { opacity: .4; }
.fila-interruptor { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; }
.notas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.notas li { border-left: 3px solid var(--primario-2); padding-left: 10px; font-size: .9rem; display: flex; flex-direction: column; gap: 3px; }
.notas p { white-space: pre-wrap; }
.notas .enlace { align-self: flex-start; }
.guia { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: .92rem; }
.lista-sin { padding-left: 4px; list-style: none; max-height: 40vh; overflow: auto; font-size: .92rem; }

/* Barra de pestañas */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center;
  background: color-mix(in srgb, var(--tarjeta) 92%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--borde); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tab { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; padding: 6px 0; font-size: .75rem; font-weight: 600; color: var(--tenue); position: relative; }
.tab-ico { font-size: 1.25rem; filter: grayscale(1); opacity: .6; }
.tab.activa { color: var(--primario-2); }
.tab.activa .tab-ico { filter: none; opacity: 1; }
.insignia { position: absolute; top: 0; left: 55%; background: var(--peligro); color: #fff; font-size: .65rem; border-radius: 99px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; }

/* Hoja inferior */
.hoja { position: fixed; inset: 0; z-index: 20; }
.hoja-fondo { position: absolute; inset: 0; background: rgba(15, 10, 40, .45); animation: aparece .2s; }
.hoja-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto; max-height: 90vh; overflow: auto;
  background: var(--tarjeta); border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px; animation: sube .25s ease;
}
.hoja-panel form { display: flex; flex-direction: column; gap: 12px; }
.celebra { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 8px 0; }
.celebra .btn { width: 100%; margin-top: 6px; }
@keyframes sube { from { transform: translateY(30px); opacity: 0; } }
@keyframes aparece { from { opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  background: #1d1b2e; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: .9rem; max-width: 90vw; text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); animation: sube .2s;
}

/* v3: íconos de hábito, tira semanal, calendarios y ficha de hábito */
.fila-hab { display: flex; align-items: center; border-bottom: 1px solid var(--borde); }
.habitos li.fila-hab:last-child { border-bottom: 0; }
.fila-hab .habito { border-bottom: 0; flex: 1; min-width: 0; gap: 10px; }
.hab-ico { font-size: 1.15rem; width: 24px; text-align: center; flex: none; }
.det { flex: none; width: 34px; height: 40px; border: 0; background: none; color: var(--tenue); font-size: 1.4rem; border-radius: 10px; }
.det:hover { background: var(--pista); }
.tira { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 8px 6px; box-shadow: var(--sombra); }
.tira-dia { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; border-radius: 12px; padding: 4px 0; color: var(--tenue); }
.tira-dia small { font-size: .7rem; font-weight: 700; }
.tira-dia b { font-size: .8rem; color: var(--texto); }
.tira-dia.sel { background: var(--pista); }
.tira-dia.es-hoy b { color: var(--primario-2); }
.tira-dia:disabled { opacity: .35; cursor: default; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cab { text-align: center; font-size: .72rem; font-weight: 700; color: var(--tenue); padding-bottom: 2px; }
.cel { position: relative; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--borde); background: var(--fondo); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 0; font-size: .8rem; color: var(--texto); }
.cel b { font-weight: 700; line-height: 1.1; }
.cel small { font-size: .6rem; color: var(--tenue); }
.cel.claro, .cel.claro small { color: #fff; }
.cel.vacia { border: 0; background: none; }
.cel.fuera { color: var(--tenue); opacity: .35; background: none; }
.cel.hoy { outline: 2px solid var(--primario-2); outline-offset: 1px; }
.cel.sel { box-shadow: 0 0 0 2px var(--texto); }
.estrella { position: absolute; top: 1px; right: 3px; font-size: .55rem; font-style: normal; color: #fbbf24; }
.cal-resumen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.cal-resumen div, .det-stats div { background: var(--pista); border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; }
.cal-resumen b, .det-stats b { font-size: 1.05rem; }
.cal-resumen small, .det-stats small { font-size: .7rem; color: var(--tenue); }
.nav-periodo h2.izq { text-align: left; }
.cal-hab .cel { border-radius: 50%; }
.cal-hab .c-h { background: var(--c); border-color: var(--c); color: #fff; }
.cal-hab .c-p { border: 2px solid var(--pend); color: var(--pend); }
.cal-hab .c-n { border-style: dashed; color: var(--tenue); }
.cal-hab .c-falta { border-color: var(--borde); }
.cal-hab .c-libre { opacity: .35; }
.det-cab { display: flex; gap: 12px; align-items: center; }
.det-ico { font-size: 2rem; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, transparent); flex: none; }
.det-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.ico-nombre { display: grid; grid-template-columns: 70px 1fr; gap: 10px; }
.input-ico { text-align: center; font-size: 1.3rem !important; }

/* v4: tareas, matriz, enfoque, cantidades, notas de hábito y cuenta regresiva */
.titulo-seccion { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tenue); padding: 6px 2px 0; }
.contador { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--pista); color: var(--tenue); font-size: .72rem; vertical-align: middle; }
.lista-tareas { list-style: none; margin: 0; padding: 0; }
.tarea { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--borde); min-height: 46px; }
.tarea:last-child { border-bottom: 0; }
.t-check { flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--borde); background: none; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #fff; padding: 0; }
.tarea.hecha .t-check { background: var(--ok); border-color: var(--ok); }
.t-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; background: none; border: 0; padding: 8px 0; text-align: left; }
.t-txt span { overflow-wrap: anywhere; }
.tarea.hecha .t-txt span { text-decoration: line-through; color: var(--tenue); }
.t-txt small { font-size: .75rem; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.venc { color: var(--peligro); }
.pto { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 2px; }
.tarea-rapida { display: flex; gap: 8px; }
.tarea-rapida input { flex: 1; }
details.tarjeta summary { cursor: pointer; list-style: none; }
details.tarjeta summary::-webkit-details-marker { display: none; }
.matriz { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cuad { background: var(--tarjeta); border: 1px solid var(--borde); border-top: 4px solid var(--q); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 4px; min-height: 140px; box-shadow: var(--sombra); min-width: 0; }
.cuad header { display: flex; flex-direction: column; }
.cuad header b { font-size: .88rem; color: var(--q); }
.cuad header small { font-size: .7rem; color: var(--tenue); }
.cuad .tarea { min-height: 38px; gap: 6px; }
.cuad .t-txt { padding: 5px 0; font-size: .85rem; }
.cuad .t-check { width: 20px; height: 20px; }
.cuad .enlace { align-self: flex-start; margin-top: auto; font-size: .8rem; }
.vacio-cuad { padding: 6px 0; }
.asignar { display: flex; gap: 4px; flex: none; }
.asignar button { width: 30px; height: 30px; border: 0; border-radius: 9px; font-size: .85rem; padding: 0; }
.segmentos.prioridad > label { padding: 7px 2px; font-size: .74rem; }
.segmentos.prioridad > label:has(input:checked) { box-shadow: inset 0 -3px 0 var(--q, var(--primario)); }
.dos-ancho { grid-template-columns: 1.6fr 1fr; }
.cuenta { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cuenta::-webkit-scrollbar { display: none; }
.cr { flex: none; width: 112px; display: flex; flex-direction: column; align-items: flex-start; gap: 0; text-align: left; padding: 8px 10px; border-radius: 14px; border: 1px solid var(--borde); border-left: 4px solid var(--c); background: var(--tarjeta); box-shadow: var(--sombra); }
.cr-num { font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: var(--c); }
.cr small { font-size: .7rem; color: var(--tenue); }
.cr-txt { font-size: .76rem; margin-top: 3px; line-height: 1.25; }
.cr.cerca .cr-num { color: #ea580c; }
.cr.vencida .cr-num { color: var(--peligro); }
.cr-nueva { width: 84px; border-left: 1px dashed var(--borde); border-style: dashed; align-items: center; justify-content: center; background: none; box-shadow: none; }
.cr-nueva .cr-num { color: var(--tenue); }
.enfoque-hoy { flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 14px; }
.enfoque-hoy div { display: flex; flex-direction: column; }
.cant { flex: none; display: flex; align-items: center; gap: 4px; font-size: .8rem; color: var(--tenue); }
.cant b { color: var(--texto); }
.cant button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--c); background: none; color: var(--c); font-weight: 800; font-size: 1rem; padding: 0; line-height: 1; }
.hab-nombre { display: flex; flex-direction: column; min-width: 0; }
.hab-nota { font-size: .74rem; color: var(--tenue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.notas-hab { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; background: var(--pista); border-radius: 12px; padding: 10px; }
.notas-hab h3 { font-size: .85rem; }
.enfoque { position: fixed; inset: 0; z-index: 40; background: var(--fondo); display: flex; align-items: center; justify-content: center; padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); overflow: auto; }
.enf-panel { position: relative; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.enf-panel form { display: flex; flex-direction: column; gap: 12px; }
.enf-cerrar { position: absolute; top: -4px; right: 0; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--borde); background: var(--tarjeta); font-size: 1.1rem; }
.enf-sobre { font-weight: 700; font-size: 1.05rem; padding-right: 44px; }
.enf-activo { align-items: stretch; text-align: center; }
.enf-activo .enf-sobre { padding: 0 44px; }
.enf-reloj { position: relative; width: min(76vw, 300px); aspect-ratio: 1; margin: 8px auto; }
.enf-svg { width: 100%; height: 100%; }
.enf-reloj span { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(2.6rem, 14vw, 4rem); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.enf-emoji { font-size: 3.5rem; }
.enf-otro { font-weight: 400; }
.barra-enfoque { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 15; max-width: 616px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; border: 0; background: #1d1b2e; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: .9rem; }
.barra-enfoque .tenue { color: rgba(255,255,255,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.con-enfoque .barra-cerrar { bottom: calc(136px + env(safe-area-inset-bottom)); }

/* v5: Google Calendar */
.acciones-cab { display: flex; gap: 6px; align-items: center; }
.girando { animation: girar 1s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
code { font-size: .8rem; background: var(--pista); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }

/* ── Mi crecimiento ── */
.crec-intro { margin: -4px 2px 12px; }
.crec-sec { border-top: 4px solid var(--c); }
.crec-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.crec-cab h2 { font-size: 1.02rem; margin: 0; }
.crec-lista { list-style: none; margin: 0; padding: 0; }
.crec-lista li + li { border-top: 1px solid var(--borde, rgba(0,0,0,.07)); }
.crec-item { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; text-align: left;
  background: none; border: 0; padding: 10px 2px; font: inherit; color: inherit; cursor: pointer; }
.crec-item.hecho .crec-txt { opacity: .6; }
.crec-txt { font-weight: 600; line-height: 1.3; }
.crec-plan { color: var(--c); font-weight: 600; }
.crec-falta { color: #b5701a; }
.crec-meta { display: flex; align-items: center; gap: 8px; }
.crec-nivel { display: inline-flex; gap: 3px; }
.crec-nivel i { width: 9px; height: 9px; border-radius: 50%; background: rgba(0,0,0,.12); }
.crec-tend { font-size: .78rem; font-weight: 700; }
.crec-tend.mejor { color: var(--ok, #10a37f); }
.crec-tend.peor { color: #d9480f; }
.crec-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.check-linea { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; font-weight: 600; }
.check-linea input { width: 20px; height: 20px; }
.crec-ev-grupo { border-left: 3px solid var(--c); padding: 4px 0 4px 10px; margin: 10px 0; }
.crec-ev-grupo summary { font-weight: 700; cursor: pointer; padding: 4px 0; }
.crec-ev { padding: 8px 0; border-top: 1px solid var(--borde, rgba(0,0,0,.07)); }
.crec-ev p { margin: 0 0 6px; font-size: .92rem; }
.crec-resumen ul { margin: 4px 0 10px; padding-left: 18px; }
.crec-resumen li { margin: 2px 0; }
