/* Marco familiar · estilo iOS. Pensado para una pantalla horizontal de 16:10
   (1280×800, 1920×1200…). Todo va en rem, y 1 rem escala con la pantalla:
   16 px a 1920×1200. Colores del sistema de iOS, en claro y en oscuro. */

:root {
  --fondo: #F2F2F7;
  --tarjeta: #FFFFFF;
  --tarjeta-2: #F7F7FA;
  --texto: #1C1C1E;
  --suave: rgba(60, 60, 67, .62);
  --terciario: rgba(60, 60, 67, .32);
  --separador: rgba(60, 60, 67, .14);
  --relleno: rgba(120, 120, 128, .12);
  --barra: rgba(255, 255, 255, .72);
  --azul: #007AFF;
  --verde: #34C759;
  --naranja: #FF9500;
  --rojo: #FF3B30;
  --morado: #AF52DE;
  --amarillo: #FFCC00;
  --indigo: #5856D6;
  --turquesa: #30B0C7;
  --radio: 1.5rem;
  --radio-p: .9rem;
  font-size: min(0.8333vw, 1.3333vh);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --fondo: #000000; --tarjeta: #1C1C1E; --tarjeta-2: #242426; --texto: #FFFFFF;
    --suave: rgba(235, 235, 245, .6); --terciario: rgba(235, 235, 245, .3); --separador: rgba(84, 84, 88, .55);
    --relleno: rgba(118, 118, 128, .24); --barra: rgba(28, 28, 30, .78);
    --azul: #0A84FF; --verde: #30D158; --naranja: #FF9F0A; --rojo: #FF453A; --morado: #BF5AF2;
    --amarillo: #FFD60A; --indigo: #5E5CE6; --turquesa: #40C8E0;
  }
}
:root[data-tema="oscuro"] {
  --fondo: #000000; --tarjeta: #1C1C1E; --tarjeta-2: #242426; --texto: #FFFFFF;
  --suave: rgba(235, 235, 245, .6); --terciario: rgba(235, 235, 245, .3); --separador: rgba(84, 84, 88, .55);
  --relleno: rgba(118, 118, 128, .24); --barra: rgba(28, 28, 30, .78);
  --azul: #0A84FF; --verde: #30D158; --naranja: #FF9F0A; --rojo: #FF453A; --morado: #BF5AF2;
  --amarillo: #FFD60A; --indigo: #5E5CE6; --turquesa: #40C8E0;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fondo);
  color: var(--texto);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, "Helvetica Neue", sans-serif;
  font-feature-settings: "cv11", "ss01";
  letter-spacing: -.01em;
  display: flex;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; letter-spacing: inherit; }
input { font: inherit; letter-spacing: inherit; }
[hidden] { display: none !important; }

.ico { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.22em; }
.ico-tiempo { width: 1em; height: 1em; flex: none; }

#vistas { flex: 1; position: relative; min-width: 0; }
.vista { position: absolute; inset: 0; padding: 2rem 2rem 2rem 2.2rem; display: none; gap: 1.2rem; }
.vista.activa { display: flex; }

/* ---------------------------------------------------------------- tarjetas */
.tarjeta {
  background: var(--tarjeta);
  border-radius: var(--radio);
  padding: 1.6rem 1.8rem;
  min-height: 0;
}
.cabecera {
  display: flex; align-items: center; gap: .7rem;
  font-size: 1.55rem; font-weight: 600; margin-bottom: 1rem;
}
.cabecera .ico { width: 2rem; height: 2rem; }
.cabecera .cuenta { margin-left: auto; color: var(--suave); font-weight: 500; }
.cabecera.grande-tit { font-size: 2.3rem; font-weight: 700; letter-spacing: -.02em; }
.cabecera.grande-tit .ico { width: 2.5rem; height: 2.5rem; }
.vacio { color: var(--suave); font-size: 1.5rem; padding: .4rem 0; }
.suave { color: var(--suave); }
.rojo { color: var(--rojo) !important; }

/* ---------------------------------------------------------------- barra lateral */
#barra {
  width: 9.6rem; background: var(--barra); border-left: 1px solid var(--separador);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 2.2rem .7rem;
}
#barra button {
  width: 100%; padding: 1rem 0 .8rem; border-radius: 1.1rem;
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  font-size: 1.1rem; font-weight: 500; color: var(--suave);
}
#barra button .ico { width: 2.7rem; height: 2.7rem; stroke-width: 1.6; }
#barra button.activa { color: var(--azul); background: color-mix(in srgb, var(--azul) 12%, transparent); }
.mini-reloj { margin-top: auto; font-size: 3.2rem; font-weight: 600; line-height: 1; text-align: center; letter-spacing: -.03em; }

/* ---------------------------------------------------------------- hoy */
#v-hoy { flex-direction: column; }
.fila-arriba { display: flex; gap: 1.2rem; height: 19.5rem; flex: none; }
.cielo {
  flex: 1.25; min-width: 0; overflow: hidden; border-radius: var(--radio); padding: 1.9rem 2.2rem;
  display: flex; align-items: center; gap: 2rem; color: #fff;
  background: linear-gradient(165deg, #2F7FDB 0%, #5BA4EC 100%); transition: background 3s;
}
.cielo.noche { background: linear-gradient(165deg, #0B1530 0%, #1F2E57 100%); }
.cielo.alba { background: linear-gradient(165deg, #5F6FB8 0%, #E99A7C 100%); }
.cielo.ocaso { background: linear-gradient(165deg, #3C4C93 0%, #DA7C6A 100%); }
.reloj { flex: none; }
.tiempo-ahora { display: flex; align-items: center; gap: .6rem; margin-top: .9rem; font-size: 1.4rem; white-space: nowrap; }
.tiempo-ahora .ico-tiempo { font-size: 2.6rem; }
.tiempo-ahora b { font-size: 2.2rem; font-weight: 600; letter-spacing: -.02em; }
.tiempo-ahora span { opacity: .8; }
.reloj .hora { font-size: 8.4rem; font-weight: 600; line-height: .95; letter-spacing: -.045em; }
.reloj .fecha { font-size: 2.1rem; font-weight: 600; margin-top: .5rem; white-space: nowrap; }
.reloj .fecha span { font-weight: 400; opacity: .8; }
.tiempo { margin-left: auto; display: flex; align-items: stretch; gap: .6rem; flex: none; }
.tiempo .ahora { display: flex; flex-direction: column; align-items: center; justify-content: center; padding-right: 1rem; }
.tiempo .ahora .ico-tiempo { font-size: 5rem; }
.tiempo .ahora .t { font-size: 4.4rem; font-weight: 300; line-height: 1; letter-spacing: -.03em; }
.tiempo .ahora .r { font-size: 1.3rem; opacity: .85; margin-top: .3rem; }
.tiempo .dia {
  width: 5.8rem; padding: .9rem 0; border-radius: 1.1rem; text-align: center;
  background: rgba(255, 255, 255, .14); display: flex; flex-direction: column; align-items: center; gap: .15rem;
}
.tiempo .dia .n { font-size: 1.3rem; font-weight: 600; opacity: .9; }
.tiempo .dia .ico-tiempo { font-size: 2.8rem; margin: .2rem 0; }
.tiempo .dia .mx { font-size: 1.7rem; font-weight: 600; }
.tiempo .dia .mn { font-size: 1.35rem; opacity: .7; }
.tiempo .ll { font-size: 1.15rem; color: #9FD4FF; font-weight: 600; min-height: 1.4rem; }

/* Pilas de widgets (como en iOS): varias tarjetas en el mismo sitio; la activa entra desde abajo. */
.pila { position: relative; overflow: hidden; border-radius: var(--radio); background: #1C1C1E; }
.pila .slide {
  position: absolute; inset: 0; width: 100%; border-radius: var(--radio); color: #fff; text-align: left;
  display: flex; flex-direction: column; overflow: hidden; text-shadow: 0 1px 12px rgba(0, 0, 0, .25);
  opacity: 0; transform: translateY(18%) scale(.96); pointer-events: none;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .5s ease;
}
.pila .slide.sale { transform: translateY(-18%) scale(.96); }
.pila .slide.activa { opacity: 1; transform: none; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .pila .slide, .pila .slide.sale { transform: none; } }
.puntos { position: absolute; right: .9rem; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: .45rem; z-index: 2; }
.puntos i { width: .55rem; height: .55rem; border-radius: 50%; background: rgba(255, 255, 255, .4); transition: background .4s; }
.puntos i.on { background: #fff; }

/* «A continuación»: widget cuadrado con lo que queda de hoy. */
.proximo { flex: none; height: 100%; aspect-ratio: 1; }
.proximo .slide { padding: 1.6rem 2.2rem 1.5rem 1.6rem; gap: .3rem; }
.proximo .etq { font-size: 1.25rem; font-weight: 600; opacity: .85; white-space: nowrap; }
.proximo .titulo { font-size: 2.1rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; margin-top: .2rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.proximo .sub { font-size: 1.35rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proximo .abajo { margin-top: auto; display: flex; flex-direction: column; gap: .2rem; }
.proximo .pre { font-size: 1.2rem; opacity: .75; }
.cifra { display: flex; align-items: baseline; gap: .3rem; color: var(--cifra, #fff); line-height: .9; white-space: nowrap; }
.cifra b { font-size: 4.4rem; font-weight: 700; letter-spacing: -.045em; }
.cifra span { font-size: 1.4rem; font-weight: 600; opacity: .85; margin-right: .5rem; }
.barra-cw { height: .5rem; border-radius: 1rem; background: rgba(255, 255, 255, .28); overflow: hidden; margin-top: .7rem; min-width: 4rem; }
.barra-cw i { display: block; height: 100%; border-radius: 1rem; background: #fff; }

/* Cuentas atrás (boda, maratón): una tarjeta grande que se va turnando. */
.cuentas-col { flex: 1; min-width: 0; }
.cuenta-w { padding: 1.8rem 2.6rem 1.7rem 2.2rem; }
.cw-tit { font-size: 2.4rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cw-fecha { font-size: 1.45rem; opacity: .8; margin-top: .2rem; }
.cw-abajo { margin-top: auto; display: flex; align-items: flex-end; gap: 2rem; }
.cuenta-w .cifra b { font-size: 7.4rem; }
.cuenta-w .cifra span { font-size: 2rem; margin-right: 0; }
.cuenta-w .barra-cw { flex: 1; margin-bottom: 1.2rem; height: .6rem; }

.semana { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: .9rem; min-height: 0; }
.dia-col {
  background: var(--tarjeta); border-radius: var(--radio); padding: 1.2rem 1rem;
  display: flex; flex-direction: column; min-height: 0; overflow: hidden; gap: .7rem;
}
.dia-col .cab { display: flex; align-items: center; gap: .6rem; padding: 0 .3rem; min-height: 3.9rem; }
.dia-col .cab .n { font-size: 1.35rem; font-weight: 600; color: var(--suave); text-transform: uppercase; letter-spacing: .02em; }
.dia-col .cab .num { font-size: 2.6rem; font-weight: 600; letter-spacing: -.03em; margin-left: auto; }
.dia-col.hoy .cab .n { color: var(--rojo); }
.dia-col.hoy .cab .num {
  color: #fff; background: var(--rojo); border-radius: 50%; width: 3.9rem; height: 3.9rem;
  display: grid; place-items: center; font-size: 2.2rem;
}
.dia-col.finde .cab .n { color: var(--terciario); }
.pastilla {
  border-radius: .6rem; padding: .25rem .7rem; font-size: 1.25rem; font-weight: 600; width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dia-col .lista { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: .5rem; }
.cita {
  position: relative; width: 100%; border-radius: .7rem; padding: .55rem .7rem .6rem 1.1rem;
  background: var(--tinte, rgba(52, 199, 89, .12));
}
.cita::before { content: ""; position: absolute; left: .35rem; top: .5rem; bottom: .5rem; width: .3rem; border-radius: 1rem; background: var(--c, var(--verde)); }
.cita .h { font-size: 1.2rem; font-weight: 600; color: var(--c, var(--verde)); }
.cita .t { font-size: 1.45rem; font-weight: 500; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cita.pasada { opacity: .45; }
.mas { font-size: 1.25rem; color: var(--suave); padding-left: .4rem; }
.pie {
  margin-top: auto; background: var(--tarjeta-2); border-radius: .8rem; padding: .6rem .8rem;
  font-size: 1.25rem; line-height: 1.35; width: 100%; color: var(--suave);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

.resumenes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; height: 15rem; flex: none; }
.resumen { cursor: pointer; display: flex; flex-direction: column; gap: .5rem; overflow: hidden; padding: 1.4rem 1.5rem; min-width: 0; }
.resumen .cabecera { font-size: 1.4rem; margin-bottom: .2rem; white-space: nowrap; }
.resumen .cabecera span { overflow: hidden; text-overflow: ellipsis; }
.resumen .cabecera .ico { width: 1.8rem; height: 1.8rem; }
.resumen .cabecera .ico.derecha { margin-left: auto; width: 1.5rem; height: 1.5rem; color: var(--terciario); }
.resumen .grande { font-size: 1.9rem; font-weight: 600; line-height: 1.15; letter-spacing: -.015em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resumen .detalle { font-size: 1.4rem; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detalle.multilinea { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fila-rec { display: flex; align-items: center; gap: .7rem; font-size: 1.45rem; padding: .15rem 0; }
.fila-rec .ico { color: var(--suave); width: 1.7rem; height: 1.7rem; }
.fila-rec .txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila-rec .cuando { color: var(--suave); font-size: 1.3rem; white-space: nowrap; }
.fila-rec .cuando.pronto { color: var(--rojo); font-weight: 600; }
.res-luz { display: flex; align-items: flex-end; gap: 1.4rem; flex: 1; min-height: 3.4rem; max-height: 5rem; }
.res-luz .barras { height: 100%; min-width: 7rem; }
.precio { font-size: 2.4rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.precio small { font-size: 1.2rem; font-weight: 500; color: var(--suave); letter-spacing: 0; }
.coches-mini { display: flex; gap: 1.6rem; margin-top: auto; }
.burbuja-coche { width: 9rem; height: 9rem; border-radius: 50%; background: var(--relleno); color: var(--suave); display: grid; place-items: center; flex: none; }
.burbuja-coche .ico { width: 3.6rem; height: 3.6rem; }
.burbuja-coche.peq { width: 3rem; height: 3rem; }
.burbuja-coche.peq .ico { width: 1.6rem; height: 1.6rem; }
.recs-coche { display: flex; flex-direction: column; gap: .3rem; }
.km-semanas { display: flex; align-items: flex-end; gap: .5rem; margin-top: auto; height: 4.6rem; }
.kms { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .2rem; }
.kms i { width: 100%; border-radius: .4rem; background: color-mix(in srgb, var(--verde) 35%, transparent); }
.kms.actual i { background: var(--verde); }
.kms span { font-size: 1.05rem; color: var(--suave); line-height: 1; }
.kms-etq { font-size: 1rem; color: var(--suave); line-height: 1.1; padding-bottom: .1rem; }
.coche-mini { display: flex; align-items: center; gap: .6rem; font-size: 1.2rem; color: var(--suave); line-height: 1.2; }
.coche-mini b { color: var(--texto); font-size: 1.35rem; }

/* anillos (batería, depósito) */
.anillo { position: relative; flex: none; }
.anillo svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anillo .pista { stroke: var(--relleno); }
.anillo .centro { position: absolute; inset: 0; display: grid; place-items: center; }
.anillo .centro .ico { width: 45%; height: 45%; }

/* personas */
.chips { display: flex; gap: .6rem; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: .55rem; padding: .3rem 1rem .3rem .3rem;
  border-radius: 2rem; font-size: 1.45rem; font-weight: 500; background: var(--relleno);
}
.ini {
  width: 2.4rem; height: 2.4rem; border-radius: 50%; color: #fff; display: grid; place-items: center;
  font-size: 1.1rem; font-weight: 600; flex: none;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(0, 0, 0, .08));
}
.chip.solo { padding: 0; background: none; }
.chip.solo .ini { width: 3.4rem; height: 3.4rem; font-size: 1.4rem; }
.chip.hecha { opacity: .5; }
.chip.solo.hecha { opacity: 1; }
.chip.solo.hecha .ini { background-color: var(--verde) !important; }

/* gráfica de la luz */
.barras { display: flex; align-items: flex-end; gap: 3px; flex: 1; height: 100%; min-height: 0; }
.barras .b { flex: 1; border-radius: 4px; min-height: 4px; position: relative; opacity: .78; }
.barras .b.ahora { opacity: 1; box-shadow: 0 0 0 2px var(--tarjeta), 0 0 0 3.5px var(--texto); }
.barras .b .lbl { position: absolute; bottom: -2rem; left: 50%; transform: translateX(-50%); font-size: 1.15rem; color: var(--suave); }

/* ---------------------------------------------------------------- calendario */
#v-calendario { flex-direction: column; gap: .7rem; }
.cal-titulo { display: flex; align-items: baseline; gap: 1rem; flex: none; padding: 0 .4rem; }
.cal-titulo h1 { margin: 0; font-size: 3rem; font-weight: 700; letter-spacing: -.03em; }
.cal-titulo span { font-size: 2rem; color: var(--suave); font-weight: 500; }
.cal-cabecera { display: grid; grid-template-columns: repeat(7, 1fr); gap: .6rem; font-size: 1.25rem; font-weight: 600; color: var(--suave);
  text-transform: uppercase; letter-spacing: .04em; padding: 0 .8rem; flex: none; }
.cal-rejilla { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: .6rem; min-height: 0; }
.celda {
  background: var(--tarjeta); border-radius: 1.1rem; padding: .6rem .7rem; overflow: hidden;
  display: flex; flex-direction: column; gap: .3rem; min-height: 0;
}
.celda.otro-mes { background: var(--tarjeta-2); }
.celda.pasado { opacity: .45; }
.celda .cab { display: flex; align-items: center; gap: .5rem; font-size: 1.5rem; font-weight: 600; min-height: 2.6rem; }
.celda.hoy .cab .num { background: var(--rojo); color: #fff; border-radius: 50%; width: 2.6rem; height: 2.6rem; display: grid; place-items: center; font-size: 1.35rem; }
.celda .cab .mes { color: var(--rojo); font-size: 1.2rem; text-transform: uppercase; letter-spacing: .04em; }
.celda .cab .t { margin-left: auto; font-size: 1.2rem; color: var(--suave); font-weight: 500; display: flex; align-items: center; gap: .3rem; }
.celda .cab .t .ico-tiempo { font-size: 1.7rem; }
.celda .ev { flex: none; font-size: 1.15rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-radius: .45rem; padding: .1rem .5rem; background: var(--tinte); }
.celda .ev b { font-weight: 600; color: var(--c); }
.celda .pastilla { font-size: 1.05rem; padding: .1rem .5rem; border-radius: .45rem; }

/* ---------------------------------------------------------------- casa */
#v-casa { flex-direction: column; }
.luz-grande { height: 37%; display: flex; flex-direction: column; flex: none; }
.luz-grande .datos { display: flex; gap: 3.4rem; align-items: flex-end; margin-bottom: 1.4rem; }
.dato .etq { font-size: 1.3rem; color: var(--suave); font-weight: 500; }
.dato .v { font-size: 2.6rem; font-weight: 700; letter-spacing: -.02em; }
.dato .v small { font-size: 1.3rem; color: var(--suave); font-weight: 500; letter-spacing: 0; }
.luz-grande .barras { padding-bottom: 2.3rem; }
.coches { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 1.2rem; flex: none; }
.coche { display: flex; align-items: center; gap: 2rem; padding: 1.4rem 1.8rem; }
.coche .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .4rem; }
.coche .nombre-coche { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: .8rem; }
.estado-pill { font-size: 1.2rem; font-weight: 600; padding: .2rem .8rem; border-radius: 2rem; background: var(--relleno); color: var(--suave); letter-spacing: 0; }
.estado-pill.azul { background: color-mix(in srgb, var(--azul) 14%, transparent); color: var(--azul); }
.estado-pill.rojo { background: color-mix(in srgb, var(--rojo) 14%, transparent); color: var(--rojo); }
.coche-extra { display: flex; gap: 1.6rem; flex-wrap: wrap; font-size: 1.4rem; color: var(--suave); }
.coche-extra span { display: inline-flex; align-items: center; gap: .4rem; }
.coche-extra .ico { width: 1.6rem; height: 1.6rem; }
.casa-rejilla { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 1.2rem; min-height: 0; }
.mando { display: flex; flex-direction: column; gap: .3rem; overflow: hidden; padding: 1.4rem 1.6rem; }
.mando .cab-mando { display: flex; align-items: center; justify-content: space-between; margin-bottom: auto; padding-bottom: .8rem; }
.mando .segmentado { margin-top: auto; }
.mando .burbuja { width: 3.6rem; height: 3.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--relleno); color: var(--suave); }
.mando .burbuja .ico { width: 2rem; height: 2rem; }
.mando.on .burbuja { background: var(--naranja); color: #fff; }
.mando.alerta { background: var(--rojo); color: #fff; }
.mando.alerta .burbuja { background: rgba(255, 255, 255, .25); color: #fff; }
.mando.alerta .nombre { color: rgba(255, 255, 255, .85); }
.mando .nombre { font-size: 1.4rem; font-weight: 600; color: var(--suave); }
.mando .valor { font-size: 2.2rem; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.mando .valor small { font-size: 1.4rem; font-weight: 500; color: var(--suave); }
.mando .sub { font-size: 1.3rem; color: var(--suave); }
.no-disp { opacity: .55; }

/* botones */
.boton {
  background: var(--relleno); color: var(--azul); border-radius: var(--radio-p); padding: .75rem 1.3rem;
  font-size: 1.5rem; font-weight: 600; text-align: center; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
.boton .ico { width: 1.8rem; height: 1.8rem; stroke-width: 2.2; }
.boton.primario { background: var(--azul); color: #fff; }
.segmentado { display: flex; background: var(--relleno); border-radius: var(--radio-p); padding: .25rem; gap: .25rem; margin-top: .8rem; }
.segmentado button { flex: 1; border-radius: .7rem; padding: .6rem 0; display: grid; place-items: center; color: var(--texto); }
.segmentado button:active { background: var(--tarjeta); }
.segmentado .ico { width: 2rem; height: 2rem; stroke-width: 2; }
.boton:active, .chip:active, .cita:active, .mando:active, .celda:active, .resumen:active { opacity: .6; }

/* ---------------------------------------------------------------- tareas */
#v-tareas { gap: 1.2rem; }
.columna { flex: 1; display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; }
#v-tareas > .columna:first-child { flex: 1.15; }
.crece { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.desplaza { overflow-y: auto; min-height: 0; flex: 1; }
.fila {
  display: flex; align-items: center; gap: 1.2rem; padding: .85rem 0; position: relative; width: 100%;
}
.fila + .fila::before { content: ""; position: absolute; top: 0; left: 4.4rem; right: 0; border-top: 1px solid var(--separador); }
.fila.sin-icono + .fila.sin-icono::before { left: 3.6rem; }
.fila .burbuja { width: 3.2rem; height: 3.2rem; border-radius: .8rem; display: grid; place-items: center; color: #fff; flex: none; }
.fila .burbuja .ico { width: 1.9rem; height: 1.9rem; }
.fila .txt { flex: 1; min-width: 0; font-size: 1.65rem; line-height: 1.25; }
.fila .txt small { display: block; font-size: 1.3rem; color: var(--suave); margin-top: .1rem; }
.fila.hecha .txt { color: var(--suave); }
.fila.hecha .burbuja { opacity: .45; }
.fila .cuando { font-size: 1.35rem; color: var(--suave); white-space: nowrap; }
.fila .cuando.pronto { color: var(--rojo); font-weight: 600; }
/* círculo de «hecho», como en Recordatorios */
.circulo { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 2px solid var(--terciario); flex: none; display: grid; place-items: center; color: #fff; }
.circulo .ico { width: 1.5rem; height: 1.5rem; stroke-width: 3; opacity: 0; }
.fila.tachado .circulo { background: var(--tinta, var(--azul)); border-color: var(--tinta, var(--azul)); }
.fila.tachado .circulo .ico { opacity: 1; }
.fila.tachado .txt { color: var(--suave); text-decoration: line-through; }
.recompensa { padding: .7rem 0; }
.recompensa .fila { padding: .3rem 0; }
.progreso { display: flex; gap: 1rem; flex-wrap: wrap; padding-left: 4.4rem; }
.progreso .chip { font-size: 1.3rem; }
.barra-prog { width: 6rem; height: .5rem; border-radius: 1rem; background: var(--relleno); overflow: hidden; }
.barra-prog i { display: block; height: 100%; border-radius: 1rem; }
.anadir { display: flex; gap: .7rem; margin-top: 1rem; flex-wrap: wrap; }
.anadir input {
  flex: 1; min-width: 0; font-size: 1.6rem; padding: .8rem 1.2rem; border-radius: var(--radio-p); border: 0;
  background: var(--relleno); color: var(--texto); outline: none;
}
.anadir input::placeholder { color: var(--suave); }
.anadir:has(.fecha-input) input[name="texto"] { flex-basis: 100%; }
.anadir .fecha-input { flex: 1; font-size: 1.4rem; }
.anadir .boton { flex: none; }
.habituales { margin-top: 1.4rem; }
.habituales .etq { font-size: 1.25rem; font-weight: 600; color: var(--suave); text-transform: uppercase; letter-spacing: .03em; margin-bottom: .7rem; }
.habituales .fila-h { display: flex; gap: .7rem; flex-wrap: wrap; }
.habituales button {
  background: var(--relleno); border-radius: 2rem; padding: .55rem 1.2rem .55rem .9rem; font-size: 1.45rem; font-weight: 500;
  display: inline-flex; align-items: center; gap: .4rem;
}
.habituales button .ico { color: var(--azul); width: 1.6rem; height: 1.6rem; stroke-width: 2.4; }

/* ---------------------------------------------------------------- noche, avisos */
#noche {
  position: fixed; inset: 0; background: #000; color: rgba(235, 235, 245, .62); z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem;
}
#noche .hora { font-size: 24rem; font-weight: 600; line-height: .9; letter-spacing: -.05em; color: rgba(235, 235, 245, .78); }
#noche .fecha { font-size: 2.8rem; font-weight: 600; }
#noche .siguiente { font-size: 2rem; opacity: .75; margin-top: 1.2rem; display: flex; gap: 2.4rem; }
#noche .siguiente span { display: inline-flex; align-items: center; gap: .6rem; }

#capa {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 30; display: grid; place-items: center;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.aviso {
  background: var(--tarjeta); border-radius: 2.2rem; padding: 2.6rem 2.8rem 2rem; width: min(60rem, 90vw);
  max-height: 85vh; overflow-y: auto; box-shadow: 0 2.4rem 6rem rgba(0, 0, 0, .25);
}
.aviso .calnombre { font-size: 1.4rem; font-weight: 600; color: var(--c, var(--azul)); display: flex; align-items: center; gap: .6rem; }
.aviso .calnombre i { width: 1rem; height: 1rem; border-radius: 50%; background: var(--c, var(--azul)); }
.aviso h2 { margin: .4rem 0 1.2rem; font-size: 3rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.aviso .meta { font-size: 1.7rem; color: var(--suave); margin-bottom: .7rem; display: flex; align-items: center; gap: .8rem; }
.aviso .meta .ico { width: 2rem; height: 2rem; }
.aviso .desc { font-size: 1.6rem; white-space: pre-wrap; line-height: 1.45; margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--separador); }
.aviso .acciones { display: flex; gap: 1rem; margin-top: 2.2rem; }
.aviso .acciones .boton { flex: 1; padding: 1rem; font-size: 1.7rem; }
.aviso .lista-dia { display: flex; flex-direction: column; gap: .6rem; }
.pin-puntos { display: flex; justify-content: center; gap: 1.4rem; margin: 1.6rem 0 .6rem; }
.pin-puntos i { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid var(--texto); }
.pin-puntos i.lleno { background: var(--texto); }
.teclado { display: grid; grid-template-columns: repeat(3, 7.2rem); gap: 1.2rem 2rem; justify-content: center; margin-top: 1rem; }
.teclado button { background: var(--relleno); border-radius: 50%; width: 7.2rem; height: 7.2rem; font-size: 2.8rem; font-weight: 400; display: grid; place-items: center; }
.teclado button.texto { background: none; font-size: 1.6rem; font-weight: 600; color: var(--azul); }
.error-txt { color: var(--rojo); text-align: center; font-size: 1.5rem; min-height: 2rem; }

#estado {
  position: fixed; left: 50%; top: 1.6rem; transform: translateX(-50%); z-index: 40;
  background: var(--barra); color: var(--texto); padding: .9rem 1.8rem; border-radius: 2rem; font-size: 1.45rem; font-weight: 600;
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 .6rem 2.4rem rgba(0, 0, 0, .14);
}

/* ---------------------------------------------------------------- pantallas pequeñas o en vertical */
@media (max-aspect-ratio: 1/1) {
  :root { font-size: max(8.5px, min(2.5vw, 1.2vh)); }
  body { flex-direction: column; overflow: auto; }
  #barra {
    width: 100%; flex-direction: row; justify-content: space-around; border-left: 0; border-top: 1px solid var(--separador);
    position: sticky; bottom: 0; z-index: 10; padding: .6rem max(.6rem, env(safe-area-inset-right, 0px)) max(.6rem, env(safe-area-inset-bottom, 0px)) max(.6rem, env(safe-area-inset-left, 0px));
  }
  #barra button { width: auto; flex: 1; }
  .mini-reloj { display: none; }
  .vista { position: static; padding: 16px; flex-direction: column; }
  .vista.activa { display: flex; }
  #vistas { overflow-y: auto; }
  .fila-arriba { flex-direction: column; height: auto; }
  .cielo { flex-direction: column; align-items: stretch; gap: 1.4rem; }
  .tiempo { margin-left: 0; justify-content: space-between; }
  .tiempo .dia { flex: 1; width: auto; }
  .proximo { height: auto; width: 100%; aspect-ratio: 1.4; }
  .cuentas-col { height: 17rem; flex: none; }
  .semana { grid-template-columns: 1fr; }
  .dia-col { min-height: 14rem; }
  .resumenes, .casa-rejilla, .coches { grid-template-columns: 1fr !important; height: auto; }
  .reloj .hora { font-size: 7rem; }
  #v-tareas { flex-direction: column; }
}

/* En los resúmenes de Hoy, los botones de las personas caben en una línea. */
.resumen .chips { flex-wrap: nowrap; gap: .5rem; }
.resumen .chip { font-size: 1.3rem; padding: .25rem .8rem .25rem .25rem; }
.resumen .chip .ini { width: 2.2rem; height: 2.2rem; }

/* Ficha de una cuenta atrás (al tocar la boda o la maratón). */
.ficha-cab {
  margin: -2.6rem -2.8rem 1.6rem; padding: 2.4rem 2.8rem 2rem; color: #fff; border-radius: 2.2rem 2.2rem 0 0;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; min-height: 14rem;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .25);
}
.ficha-cab .cw-tit { -webkit-line-clamp: 3; font-size: 2.8rem; line-height: 1.1; align-self: flex-start; }
.ficha-cab .cifra b { font-size: 7rem; }
.ficha-cab .cifra span { font-size: 2rem; margin-right: 0; }
.ficha-datos { display: flex; flex-direction: column; }
.fila-ficha { display: flex; align-items: center; gap: 1rem; font-size: 1.6rem; padding: .75rem 0; border-bottom: 1px solid var(--separador); }
.fila-ficha .ico { width: 1.9rem; height: 1.9rem; color: var(--suave); }
.fila-ficha span { color: var(--suave); white-space: nowrap; }
.fila-ficha b { margin-left: auto; font-weight: 600; text-align: right; }
.ficha-sec { font-size: 1.25rem; font-weight: 600; color: var(--suave); text-transform: uppercase; letter-spacing: .03em; margin: 1.8rem 0 .6rem; }
.km-semanas.grande { height: 9rem; margin: 0; }
.km-semanas.grande .kms span { font-size: 1.25rem; }
.boton.ancho { display: flex; width: 100%; margin-top: 1.8rem; padding: 1rem; font-size: 1.6rem; text-decoration: none; }
