/* Organizador APINA en el móvil. Tema claro (diurno) u oscuro, y tres tamaños de letra. */
:root {
  --fondo: #f4f5f7; --tarjeta: #ffffff; --texto: #1d2024; --suave: #5f6670; --linea: #e1e4e8;
  --azul: #2683C6; --naranja: #FF6600; --rojo: #d93a3e; --verde: #1f9d63; --ambar: #b7790f; --morado: #8a4fc7;
  --cab: #2683C6; --cab-texto: #ffffff; --sombra: 0 1px 3px rgba(0,0,0,.08);
  --t: 17px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --fondo: #17181b; --tarjeta: #23252a; --texto: #f0f1f3; --suave: #a3a8b0; --linea: #33363c;
    --azul: #5AA9FF; --rojo: #ff6b6e; --verde: #4cc38a; --ambar: #f5b83d; --morado: #c792ea;
    --cab: #1d1f23; --cab-texto: #f0f1f3; --sombra: none;
  }
}
:root[data-tema="oscuro"] {
  --fondo: #17181b; --tarjeta: #23252a; --texto: #f0f1f3; --suave: #a3a8b0; --linea: #33363c;
  --azul: #5AA9FF; --rojo: #ff6b6e; --verde: #4cc38a; --ambar: #f5b83d; --morado: #c792ea;
  --cab: #1d1f23; --cab-texto: #f0f1f3; --sombra: none;
}
:root[data-letra="grande"] { --t: 19px; }
:root[data-letra="muy-grande"] { --t: 22px; }

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); }
body { font-family: "Segoe UI", Roboto, system-ui, sans-serif; font-size: var(--t); line-height: 1.4;
       padding-bottom: calc(68px + env(safe-area-inset-bottom)); -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; }

header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
         padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: var(--cab); color: var(--cab-texto); }
header .logo { width: 34px; height: 34px; border-radius: 8px; background: #fff; }
header .titulos { flex: 1; min-width: 0; }
#titulo { font-weight: 600; font-size: 1.05em; }
.sub { font-size: .78em; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icono { background: none; border: 0; font-size: 1.4em; min-width: 44px; min-height: 44px; color: inherit; cursor: pointer; }

main { padding: 12px 12px 20px; max-width: 760px; margin: 0 auto; }
h2 { font-size: .8em; letter-spacing: .04em; text-transform: uppercase; color: var(--suave); margin: 18px 4px 8px; }
.mensaje { background: var(--tarjeta); border-left: 4px solid var(--azul); border-radius: 10px; padding: 12px 14px; box-shadow: var(--sombra); }

.tarjeta { background: var(--tarjeta); border-radius: 12px; padding: 12px 14px; margin: 8px 0; box-shadow: var(--sombra);
           border: 1px solid var(--linea); }
.tarjeta.hecha { opacity: .55; }
.tarjeta.hecha .tit { text-decoration: line-through; }
.fila { display: flex; gap: 10px; align-items: flex-start; }
.tit { font-weight: 600; }
.det { color: var(--suave); font-size: .88em; margin-top: 3px; }
.prio { font-weight: 700; margin-right: 4px; }
.P1 { color: var(--rojo); } .P2 { color: var(--ambar); } .P3 { color: var(--azul); }
.chip { display: inline-block; font-size: .78em; padding: 1px 8px; border-radius: 10px; background: var(--fondo); color: var(--suave); margin-right: 4px; }
.vencida { color: var(--rojo); } .hoy { color: var(--ambar); } .proyecto { color: var(--morado); }

.acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.acciones button, .boton { min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--linea);
  background: var(--fondo); cursor: pointer; }
.acciones button.primario, .boton.primario { background: var(--azul); color: #fff; border-color: var(--azul); }
.texto { white-space: pre-wrap; background: var(--fondo); border-radius: 8px; padding: 10px; margin-top: 8px; font-size: .92em; }
.vacio { color: var(--suave); text-align: center; padding: 30px 10px; }

nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; background: var(--tarjeta);
      border-top: 1px solid var(--linea); padding-bottom: env(safe-area-inset-bottom); }
nav button { flex: 1; background: none; border: 0; padding: 8px 2px 6px; min-height: 58px; font-size: .72em; color: var(--suave); cursor: pointer; }
nav button span { display: block; font-size: 1.6em; line-height: 1.1; }
nav button.activa { color: var(--azul); font-weight: 600; }

.dialogo { position: fixed; inset: 0; z-index: 10; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.dialogo .caja { background: var(--tarjeta); width: 100%; max-width: 760px; border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.dialogo textarea, .dialogo input { width: 100%; font: inherit; padding: 10px; border-radius: 10px; border: 1px solid var(--linea); background: var(--fondo); color: var(--texto); }
.dialogo textarea { min-height: 120px; }
.opciones { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.opciones button { flex: 1; min-height: 44px; border-radius: 10px; border: 1px solid var(--linea); background: var(--fondo); }
.opciones button.sel { background: var(--azul); color: #fff; border-color: var(--azul); }

.aviso { position: fixed; left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 11;
         background: #222; color: #fff; padding: 12px 14px; border-radius: 10px; text-align: center; }
.portada { text-align: center; padding: 30px 16px; }
.portada img { width: 96px; border-radius: 20px; background: #fff; }
.portada input { font-size: 1.3em; text-align: center; letter-spacing: .15em; text-transform: uppercase; max-width: 280px; }
