/* Fold · LA PANTALLA «HOY», DISEÑO D («Lo mejor de cada una», David 03/11/2026)  ·  04/11/2026 · prefijo hoyd-
   La pinta hoy-d.js. Colores SOLO de la paleta (paleta.css) salvo los cuatro tonos de las iniciales, que viven aquí con su versión clara y
   oscura (contraste AA medido: texto de las iniciales ≥ 4,5:1 sobre su fondo). Las gráficas de esta pantalla valen solo aquí (David, 03/11).
   Los estados llevan siempre su palabra (Vencido, Por vencer, Caducado, días), nunca solo el color. */

/* ---------------------------------------------------------------- tonos propios (oscuro de partida; claro abajo, en los dos bloques) */
.hoyd {
  --hoyd-porvencer: #5A66A8;
  --hoyd-ini-0-f: rgba(245, 165, 36, 0.18); --hoyd-ini-0-t: #F5C78A;
  --hoyd-ini-1-f: rgba(90, 212, 147, 0.16); --hoyd-ini-1-t: #8FE3B5;
  --hoyd-ini-2-f: rgba(179, 154, 224, 0.20); --hoyd-ini-2-t: #CDB9F0;
  --hoyd-ini-3-f: rgba(111, 168, 220, 0.20); --hoyd-ini-3-t: #A9CBEE;
  --hoyd-prep-punto: #8FB8E6;
}
:root[data-tema="claro"] .hoyd {
  --hoyd-porvencer: #AEBCE0;
  --hoyd-ini-0-f: #F9D9C2; --hoyd-ini-0-t: #7A3510;
  --hoyd-ini-1-f: #DCEBD8; --hoyd-ini-1-t: #255C3B;
  --hoyd-ini-2-f: #E6DDF5; --hoyd-ini-2-t: #4E3580;
  --hoyd-ini-3-f: #D8E4F5; --hoyd-ini-3-t: #23436E;
  --hoyd-prep-punto: #8FB8E6;
}
@media (prefers-color-scheme: light) {
  :root:not([data-tema="oscuro"]) .hoyd {
    --hoyd-porvencer: #AEBCE0;
    --hoyd-ini-0-f: #F9D9C2; --hoyd-ini-0-t: #7A3510;
    --hoyd-ini-1-f: #DCEBD8; --hoyd-ini-1-t: #255C3B;
    --hoyd-ini-2-f: #E6DDF5; --hoyd-ini-2-t: #4E3580;
    --hoyd-ini-3-f: #D8E4F5; --hoyd-ini-3-t: #23436E;
    --hoyd-prep-punto: #8FB8E6;
  }
}

/* ---------------------------------------------------------------- la pantalla: más ancha que las demás, y el saludo hace de cabecera */
@media (min-width: 761px) { #sitio-trabajo.hoyd-activo:not(.charla) { padding-left: max(32px, calc((100% - 1120px) / 2)); padding-right: max(32px, calc((100% - 1120px) / 2)); } }
/* El título «Hoy» queda para el lector de pantalla (el saludo hace de título a la vista); la frase de qué es la pantalla sigue a la vista,
   pequeña, encima del saludo (probar-interfaz-sencilla.js, R5: cada pantalla dice qué es). */
#sitio-trabajo.hoyd-activo > .sp-cabecera { margin-bottom: 6px; }
#sitio-trabajo.hoyd-activo > .sp-cabecera h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#sitio-trabajo.hoyd-activo > .sp-cabecera .sp-frase { margin: 0; font-size: .8125rem; color: var(--texto-3); max-width: none; }
.hoyd { display: flex; flex-direction: column; gap: 18px; margin: 0 0 28px; }
.hoyd[hidden] { display: none; }
.hoyd p { margin: 0; }

/* ---------------------------------------------------------------- saludo */
.hoyd-cab { display: flex; align-items: center; gap: 16px; }
.hoyd-mascota { width: 68px; height: auto; flex: none; margin: -6px -8px -6px -12px; }
html.sin-mascota .hoyd-mascota { display: none; }
.hoyd-cab-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hoyd-fecha { font-size: .8125rem; color: var(--texto-3); }
.hoyd-saludo { font-size: 1.625rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; color: var(--texto); font-variation-settings: 'wdth' 110; }
.hoyd-cosas { font-weight: 800; }
.hoyd-leido { font-size: .8125rem; color: var(--texto-3); white-space: nowrap; }

/* ---------------------------------------------------------------- las hojas */
.hoyd-fila1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; }
.hoyd-fila1.hoyd-sin-prep { grid-template-columns: minmax(0, 1fr); }
.hoyd-fila2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; }
.hoyd-fila2.hoyd-una { grid-template-columns: minmax(0, 1fr); }
.hoyd-hoja { background: var(--superficie); border-radius: 20px; box-shadow: var(--sombra-2); padding: 22px 26px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hoyd-deben { padding: 26px 30px; }
.hoyd-hoja-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hoyd-titulo { margin: 0; font-size: 1.0625rem; font-weight: 700; color: var(--texto); display: flex; align-items: center; gap: 10px; }
.hoyd-etiqueta { display: flex; align-items: center; gap: 10px; font-size: .875rem; font-weight: 600; color: var(--texto-2); }
.hoyd-punto { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.hoyd-punto-verde { background: var(--verde); }
.hoyd-punto-azul { background: var(--acento); }
.hoyd-punto-ambar { background: var(--ambar); }
.hoyd-vacio-titulo { font-size: 1.0625rem; font-weight: 700; color: var(--texto); }
.hoyd-vacio-texto { font-size: .875rem; color: var(--texto-2); max-width: 52ch; }

/* lo que te deben */
.hoyd-cifra-fila { display: flex; align-items: flex-end; gap: 10px 18px; flex-wrap: wrap; }
.hoyd-cifra { font-size: clamp(2.5rem, 4.6vw, 3.75rem); font-weight: 800; letter-spacing: -0.035em; line-height: 0.95; font-variant-numeric: tabular-nums; color: var(--texto); font-variation-settings: 'wdth' 105; }
.hoyd-pildora { font-size: .875rem; font-weight: 600; color: var(--ambar-texto); background: var(--ambar-tenue); padding: 6px 10px; border-radius: 8px; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.hoyd-pildora-ok { color: var(--verde); background: var(--verde-tenue); }
.hoyd-grafico { display: block; width: 100%; height: 70px; }
.hoyd-grafico .hoyd-linea { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.hoyd-baja .hoyd-linea { stroke: var(--verde); }
.hoyd-baja .hoyd-area { fill: var(--verde-tenue); }
.hoyd-sube .hoyd-linea { stroke: var(--ambar); }
.hoyd-sube .hoyd-area { fill: var(--ambar-tenue); }
.hoyd-reparto { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--hundido); }
.hoyd-cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; border-top: 1px solid var(--linea); padding-top: 12px; }
.hoyd-mini { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hoyd-mini-etiqueta { font-size: .75rem; color: var(--texto-2); }
.hoyd-mini-valor { font-size: 1.125rem; font-weight: 800; color: var(--texto); font-variant-numeric: tabular-nums; }
.hoyd-mini-nota { font-size: .8125rem; font-weight: 600; color: var(--texto-2); white-space: nowrap; }
.hoyd-verde { color: var(--verde); }
.hoyd-ambar { color: var(--ambar-texto); }

/* barras vencido / por vencer y su leyenda */
.hoyd-seg { display: block; height: 100%; flex: none; }
.hoyd-seg-vencido { background: var(--ambar); }
.hoyd-seg-porvencer { background: var(--hoyd-porvencer); }
.hoyd-leyenda { display: flex; gap: 14px; font-size: .75rem; color: var(--texto-2); }
.hoyd-leyenda > span { display: inline-flex; align-items: center; gap: 6px; }
.hoyd-marca { width: 10px; height: 10px; border-radius: 3px; }
.hoyd-marca-vencido { background: var(--ambar); }
.hoyd-marca-porvencer { background: var(--hoyd-porvencer); }

/* ---------------------------------------------------------------- «Fold te ha preparado»: tinta con la esquina doblada */
.hoyd-preparado { position: relative; overflow: hidden; background: var(--barra); color: var(--barra-texto); border: 1px solid var(--barra-borde); border-radius: 20px; padding: 26px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hoyd-pliegue { position: absolute; top: -1px; right: -1px; width: 44px; height: 44px; background: linear-gradient(225deg, var(--fondo) calc(50% - 0.5px), var(--barra-borde-fuerte) calc(50% + 0.5px)); }
.hoyd-prep-titulo { font-size: .875rem; font-weight: 700; color: var(--insignia); }
.hoyd-prep-n { font-size: 2.875rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--barra-texto); }
.hoyd-prep-vacio { font-size: .875rem; color: var(--barra-texto-2); }
.hoyd-prep-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: .875rem; color: var(--barra-texto-2); }
.hoyd-prep-lista li { display: flex; gap: 8px; align-items: baseline; min-width: 0; overflow-wrap: anywhere; }
.hoyd-prep-punto { width: 6px; height: 6px; border-radius: 50%; flex: none; transform: translateY(-2px); }
.hoyd-prep-punto-0 { background: var(--hoyd-prep-punto); }
.hoyd-prep-punto-1 { background: var(--insignia); }
.hoyd-prep-mas { padding-left: 14px; }
/* Papel claro sobre la tinta, no un relleno de color: la acción principal de la pantalla es una sola (probar-interfaz-sencilla.js, R2). */
.hoyd-prep-boton { margin-top: auto; min-height: 44px; border: 0; border-radius: 12px; padding: 12px 16px; background: var(--barra-texto); color: var(--barra); font: inherit; font-weight: 700; font-size: .9375rem; cursor: pointer; }
.hoyd-prep-boton:hover { filter: brightness(1.06); }
.hoyd-prep-boton:active { transform: translateY(1px); filter: brightness(0.95); }
.hoyd-prep-boton:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--barra), 0 0 0 5px var(--insignia); }

/* ---------------------------------------------------------------- «Hoy, reclama a» */
.hoyd-filas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.hoyd-fila { display: grid; grid-template-columns: 34px minmax(120px, 1.2fr) minmax(60px, 1fr) auto auto; gap: 12px; align-items: center; }
.hoyd-ini { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .75rem; }
.hoyd-ini-0 { background: var(--hoyd-ini-0-f); color: var(--hoyd-ini-0-t); }
.hoyd-ini-1 { background: var(--hoyd-ini-1-f); color: var(--hoyd-ini-1-t); }
.hoyd-ini-2 { background: var(--hoyd-ini-2-f); color: var(--hoyd-ini-2-t); }
.hoyd-ini-3 { background: var(--hoyd-ini-3-f); color: var(--hoyd-ini-3-t); }
.hoyd-quien { display: flex; flex-direction: column; min-width: 0; }
.hoyd-nombre { font-weight: 700; font-size: .875rem; color: var(--texto); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hoyd-sub { font-size: .75rem; color: var(--texto-2); }
.hoyd-barra { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--hundido); }
.hoyd-importe { font-size: .875rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; color: var(--texto); white-space: nowrap; }
/* Tintado, no relleno: tres «Reclamar» rellenos serían tres acciones principales (R2 de probar-interfaz-sencilla.js). */
.hoyd-reclamar { min-height: 36px; border: 1px solid var(--acento-tenue); border-radius: 9px; padding: 8px 14px; background: var(--acento-tenue); color: var(--acento-texto); font: inherit; font-size: .8125rem; font-weight: 700; cursor: pointer; }
.hoyd-reclamar:hover { border-color: var(--acento-texto); }
.hoyd-reclamar:active { transform: translateY(1px); border-color: var(--acento-texto); }
.hoyd-reclamar:focus-visible, .hoyd-ver-todos:focus-visible { outline: none; box-shadow: var(--foco); }
.hoyd-reclamar:disabled { opacity: .6; cursor: progress; }
.hoyd-mas { font-size: .8125rem; color: var(--texto-2); }
.hoyd-ver-todos { border: 0; background: none; padding: 4px 2px; min-height: 24px; font: inherit; font-weight: 600; color: var(--acento-texto); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; border-radius: 4px; }
.hoyd-ver-todos:active { color: var(--acento-hover); }
.hoyd-nota { font-size: .8125rem; color: var(--texto-2); }
.hoyd-nota:empty { display: none; }

/* ---------------------------------------------------------------- «Caduca en 30 días» */
.hoyd-tl { display: block; width: 100%; height: 58px; overflow: visible; }
.hoyd-tl-eje { stroke: var(--folio-canto); stroke-width: 2; }
.hoyd-tl-hoy { fill: var(--texto); }
.hoyd-tl-fin { fill: var(--folio-canto); }
.hoyd-tl-caducado { fill: var(--rojo); }
.hoyd-tl-pronto { fill: var(--ambar); }
.hoyd-tl-luego { fill: var(--texto-3); }
.hoyd-tl-texto { font-size: 11px; font-weight: 600; fill: var(--texto); font-family: inherit; }
.hoyd-cad-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hoyd-cad-lista li { display: flex; align-items: center; gap: 12px; }
.hoyd-cad-dias { width: 48px; height: 48px; border-radius: 12px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hoyd-cad-n { font-size: 1.125rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.hoyd-cad-u { font-size: .6875rem; }
.hoyd-cad-pronto { background: var(--ambar-tenue); color: var(--ambar-texto); }
.hoyd-cad-luego { background: var(--hundido); color: var(--texto-2); }
.hoyd-cad-luego .hoyd-cad-n { color: var(--texto); }
.hoyd-cad-caducado { background: var(--rojo-tenue); color: var(--rojo); }
.hoyd-cad-palabra { font-size: .625rem; font-weight: 800; text-align: center; line-height: 1.1; }
.hoyd-cad-que { display: flex; flex-direction: column; font-size: .875rem; font-weight: 600; color: var(--texto); min-width: 0; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- la foto del día 1: «Desde que usas Fold» (1.1.1, central/lib/foto-dia-1.js)
   Una hoja más, con el borde verde a la izquierda (es una buena noticia, y solo sale si lo es). Vale también fuera de «Hoy» («Lo que Fold ha
   hecho por ti»): solo usa colores de la paleta. */
.hoyd-foto { background: var(--superficie); border-radius: 20px; box-shadow: var(--sombra-2); padding: 18px 26px; display: flex; flex-direction: column; gap: 10px; min-width: 0; border-left: 4px solid var(--verde); }
.hoyd-foto .hoyd-etiqueta { margin: 0; }
.hoyd-foto-dias { font-weight: 500; color: var(--texto-3); }
.hoyd-foto-lineas { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.hoyd-foto-lineas li { font-size: 1.125rem; font-weight: 700; color: var(--texto); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hoyd-foto-como { font-size: .875rem; color: var(--texto-2); }
.hoyd-foto-como summary { cursor: pointer; font-weight: 600; color: var(--acento-texto); width: fit-content; min-height: 24px; border-radius: 4px; }
.hoyd-foto-como summary:focus-visible { outline: none; box-shadow: var(--foco); }
.hoyd-foto-como[open] summary { margin-bottom: 8px; }
.hoyd-foto-como p { margin: 0 0 8px; max-width: 72ch; }
.hoyd-foto-tabla-caja { overflow-x: auto; margin: 0 0 8px; }
.hoyd-foto-tabla { border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 100%; }
.hoyd-foto-tabla th, .hoyd-foto-tabla td { text-align: left; padding: 6px 12px 6px 0; border-bottom: 1px solid var(--linea); white-space: nowrap; }
.hoyd-foto-tabla thead th { font-size: .75rem; font-weight: 600; color: var(--texto-3); }
.hoyd-foto-tabla tbody th { font-weight: 600; color: var(--texto); white-space: normal; }
.hoyd-foto-tabla td { color: var(--texto); }
.hoyd-foto-tabla td.hoyd-verde { color: var(--verde); font-weight: 700; }
.uso-bloque .hoyd-foto { margin: 0 0 14px; box-shadow: none; border: 1px solid var(--linea); border-left: 4px solid var(--verde); }

/* ---------------------------------------------------------------- el móvil: una columna; en cada cliente, la barra debajo y el botón grande */
@media (max-width: 900px) {
  .hoyd-fila1, .hoyd-fila2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .hoyd { gap: 14px; }
  .hoyd-cab { gap: 12px; align-items: flex-start; }
  .hoyd-mascota { width: 52px; margin: -4px -6px -4px -10px; }
  .hoyd-saludo { font-size: 1.3125rem; }
  .hoyd-leido { display: none; }
  .hoyd-hoja, .hoyd-deben, .hoyd-preparado, .hoyd-foto { padding: 18px; border-radius: 16px; }
  .hoyd-foto-lineas li { font-size: 1rem; }
  .hoyd-cifras { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hoyd-fila { grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "ini quien importe" "ini barra boton"; row-gap: 6px; }
  .hoyd-ini { grid-area: ini; align-self: start; }
  .hoyd-quien { grid-area: quien; }
  .hoyd-barra { grid-area: barra; }
  .hoyd-importe { grid-area: importe; }
  .hoyd-reclamar { grid-area: boton; min-height: 44px; min-width: 104px; font-size: .875rem; }
  .hoyd-filas { gap: 18px; }
}
@media (prefers-reduced-motion: reduce) { .hoyd-prep-boton:active, .hoyd-reclamar:active { transform: none; } }
