/* Rumbo · sistema de diseño en DESIGN.md. Un solo acento (coral, la aguja de la brújula); los colores de proyecto solo etiquetan. */
:root {
  --fondo: #0E1116; --panel: #171B22; --panel-2: #1F242D; --linea: #2A303B;
  --tinta: #F1F2F4; --suave: #9AA3AF; --acento: #FF7A59; --acento-txt: #FF7A59; --sobre-acento: #1B0F0A; --acento-suave: rgba(255, 122, 89, .14);
  --bien: #4FD1A1; --ojo: #FFC24B;
  --r: 22px; --r-in: 14px; --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --sale: cubic-bezier(.23, 1, .32, 1);
  --texto: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --titulo: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
:root[data-tema="claro"] { --fondo: #F6F3EE; --panel: #FFFFFF; --panel-2: #F0ECE5; --linea: #E3DDD3; --tinta: #14171C; --suave: #5B6472; --acento: #E8613F; --acento-txt: #B13F1D; --sobre-acento: #1B0F0A; --acento-suave: rgba(232, 97, 63, .12); --bien: #1F9D6E; --ojo: #B97900; color-scheme: light; }
@media (prefers-color-scheme: light) { :root[data-tema="auto"] { --fondo: #F6F3EE; --panel: #FFFFFF; --panel-2: #F0ECE5; --linea: #E3DDD3; --tinta: #14171C; --suave: #5B6472; --acento: #E8613F; --acento-txt: #B13F1D; --sobre-acento: #1B0F0A; --acento-suave: rgba(232, 97, 63, .12); --bien: #1F9D6E; --ojo: #B97900; color-scheme: light; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font: 16px/1.45 var(--texto); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; border-radius: 8px; }
.saltar { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--acento); color: var(--sobre-acento); padding: 10px 16px; border-radius: 999px; font-weight: 700; }
.saltar:focus { top: 12px; }
.num { font-variant-numeric: tabular-nums; }

.marco { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding: calc(env(safe-area-inset-top) + 18px) 16px calc(env(safe-area-inset-bottom) + 112px); }
main:focus { outline: none; }

/* Cabecera de cada vista */
.cab { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin: 4px 0 var(--s5); }
.cab small { display: block; color: var(--suave); font-size: 14px; font-weight: 600; }
h1 { font: 800 32px/1.05 var(--titulo); letter-spacing: -.02em; margin: 2px 0 0; text-wrap: balance; }
h2 { font: 750 15px/1.2 var(--texto); margin: 0; color: var(--suave); letter-spacing: .01em; }
.sec { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin: var(--s6) 4px var(--s3); }
.sec .plano { margin: -8px -10px; }
.icono { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--panel); display: grid; place-items: center; flex: none; }
.icono svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--panel); font-weight: 700; font-size: 14px; white-space: nowrap; }
.chip.acento { background: var(--acento-suave); color: var(--acento-txt); }

/* Tarjetas */
.tarjeta { background: var(--panel); border-radius: var(--r); padding: var(--s4); }
.tarjeta + .tarjeta { margin-top: var(--s3); }
.vacio { color: var(--suave); text-align: center; padding: var(--s5) var(--s3); margin: 0; }
.nota { color: var(--suave); font-size: 14px; margin: var(--s2) 4px 0; }
.punto { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--c, var(--suave)); }

/* Botones */
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--acento); color: var(--sobre-acento); font-weight: 750; font-size: 16px; text-decoration: none; transition: transform 140ms var(--sale), filter 140ms; }
.boton:active { transform: scale(.97); }
.boton.sec2 { background: var(--panel-2); color: var(--tinta); }
.boton.ancho { width: 100%; }
.boton.peligro { background: transparent; color: #FF6B6B; box-shadow: inset 0 0 0 1.5px currentColor; }
.plano { border: 0; background: none; color: var(--acento-txt); font-weight: 700; padding: 10px; min-height: 44px; border-radius: 12px; }
.fila-botones { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }
.fila-botones .boton { flex: 1 1 140px; }

/* Ahora toca */
.ahora { position: relative; overflow: hidden; background: var(--panel); border-radius: 26px; padding: var(--s5) var(--s4) var(--s4); }
.ahora::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%); pointer-events: none; }
.ahora .eti { font-size: 13px; font-weight: 750; color: var(--suave); text-transform: uppercase; letter-spacing: .08em; margin: 0; }
.ahora .que { display: flex; align-items: center; gap: 10px; font: 800 26px/1.1 var(--titulo); margin: 6px 0 4px; }
.ahora .que .punto { width: 14px; height: 14px; }
.ahora .porque { color: var(--suave); margin: 0 0 var(--s4); }

/* Foco */
.foco { display: grid; grid-template-columns: auto 1fr; gap: var(--s4); align-items: center; }
.anillo { width: 132px; height: 132px; position: relative; }
.anillo svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anillo circle { fill: none; stroke-width: 10; }
.anillo .pista { stroke: var(--panel-2); }
.anillo .avance { stroke: var(--c, var(--acento)); stroke-linecap: round; transition: stroke-dashoffset 900ms linear; }
.anillo .t { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.anillo .t b { font: 800 30px/1 var(--titulo); font-variant-numeric: tabular-nums; }
.anillo .t small { color: var(--suave); font-size: 12px; margin-top: 4px; }
.foco .que { font-weight: 750; font-size: 18px; margin: 0; display: flex; align-items: center; gap: 8px; }
.foco .tarea { color: var(--suave); margin: 2px 0 var(--s3); overflow-wrap: anywhere; }
.foco .fila-botones .boton { flex: 1 1 100px; min-height: 44px; padding: 0 16px; }
.duraciones { display: flex; gap: var(--s2); }
.duraciones button { flex: 1; min-height: 44px; border-radius: 999px; border: 1.5px solid var(--linea); background: none; font-weight: 700; }
.duraciones button[aria-pressed="true"] { border-color: var(--acento-txt); color: var(--acento-txt); background: var(--acento-suave); }

/* Listas de prioridades, fechas y bandeja */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: 6px 0; }
.lista li + li { border-top: 1px solid var(--linea); }
.lista .txt { flex: 1; min-width: 0; }
.lista .txt b { display: block; font-weight: 650; overflow-wrap: anywhere; }
.lista .txt small { color: var(--suave); font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.check { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 2px solid var(--linea); background: none; display: grid; place-items: center; padding: 0; position: relative; }
.check::before { content: ""; position: absolute; inset: -7px; }
.check svg { width: 16px; height: 16px; fill: none; stroke: var(--sobre-acento); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.6); transition: transform 160ms var(--sale), opacity 120ms; }
.check[aria-checked="true"] { background: var(--bien); border-color: var(--bien); }
.check[aria-checked="true"] svg { opacity: 1; transform: none; stroke: #0E1116; }
.hecha .txt b { color: var(--suave); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.mini { border: 0; background: var(--panel-2); border-radius: 999px; padding: 0 14px; min-height: 36px; font-weight: 700; font-size: 14px; position: relative; }
.mini::before { content: ""; position: absolute; inset: -4px 0; }
.cuenta { text-align: center; flex: none; min-width: 44px; }
.cuenta b { display: block; font: 800 22px/1 var(--titulo); font-variant-numeric: tabular-nums; }
.cuenta small { color: var(--suave); font-size: 12px; }
.cuenta.cerca b { color: var(--acento-txt); }
.anadir { display: flex; gap: var(--s2); margin-top: var(--s3); }
.anadir input { flex: 1; min-width: 0; }
.anadir-tarea { display: grid; grid-template-columns: 1fr auto; }
.anadir-tarea input { grid-column: 1 / -1; }
.anadir-tarea select { min-width: 0; }

/* Campos */
input[type=text], input[type=date], input[type=number], select, textarea { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-in); border: 1.5px solid var(--linea); background: var(--panel-2); }
textarea { resize: vertical; min-height: 88px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acento); }
label.campo { display: block; font-weight: 650; font-size: 14px; margin: var(--s3) 0 var(--s1); }
label.campo > input, label.campo > select, label.campo > textarea { margin-top: 6px; font-weight: 400; font-size: 16px; }
.colores { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.colores label { position: relative; }
.colores input { position: absolute; opacity: 0; inset: 0; }
.colores span { display: block; width: 36px; height: 36px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 3px var(--panel); border: 2px solid transparent; }
.colores input:checked + span { border-color: var(--tinta); }
.colores input:focus-visible + span { outline: 3px solid var(--acento); outline-offset: 2px; }
.energia { display: flex; gap: var(--s2); }
.energia button { flex: 1; min-height: 48px; border-radius: 14px; border: 1.5px solid var(--linea); background: none; font-weight: 800; font-size: 18px; }
.energia button[aria-pressed="true"] { background: var(--acento); color: var(--sobre-acento); border-color: var(--acento); }

/* Semana */
.resumen-semana { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.resumen-semana b { font: 800 44px/1 var(--titulo); letter-spacing: -.02em; }
.dias7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 120px; margin-top: var(--s4); }
.dias7 div { display: grid; grid-template-rows: 1fr auto; gap: 6px; height: 100%; text-align: center; }
.dias7 i { align-self: end; display: block; border-radius: 8px 8px 4px 4px; background: var(--panel-2); min-height: 4px; }
.dias7 .con i { background: var(--acento); }
.dias7 .hoy span { color: var(--tinta); font-weight: 800; }
.dias7 span { font-size: 12px; color: var(--suave); }
.proy { padding: 12px 0; }
.proy + .proy { border-top: 1px solid var(--linea); }
.proy .linea1 { display: flex; align-items: center; gap: 10px; }
.proy .linea1 b { flex: 1; font-weight: 700; }
.proy .linea1 span { color: var(--suave); font-size: 14px; }
.barra { height: 8px; border-radius: 999px; background: var(--panel-2); margin-top: 8px; overflow: hidden; }
.barra i { display: block; height: 100%; border-radius: 999px; background: var(--c); transform-origin: left; animation: crece 600ms var(--sale) both; }
@keyframes crece { from { transform: scaleX(0); } }
.alerta { background: color-mix(in srgb, var(--ojo) 14%, var(--panel)); border-radius: var(--r); padding: var(--s3) var(--s4); margin-top: var(--s3); }

/* Barra de pestañas y botón rápido */
.tabs { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 12px); transform: translateX(-50%); width: min(528px, calc(100% - 24px)); display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; align-items: center; padding: 6px; border-radius: 999px; background: color-mix(in srgb, var(--panel) 86%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 10px 30px rgba(0, 0, 0, .25), inset 0 0 0 1px var(--linea); z-index: 10; }
.tabs a { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 999px; text-decoration: none; color: var(--suave); font-size: 12px; font-weight: 700; min-height: 52px; }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--tinta); background: var(--panel-2); }
.tabs a[aria-current="page"] svg { stroke: var(--acento); }
.globo { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--acento); color: var(--sobre-acento); font-size: 11px; line-height: 18px; }
.fab { width: 52px; height: 52px; margin: 0 6px; border-radius: 50%; border: 0; background: var(--acento); color: var(--sobre-acento); display: grid; place-items: center; box-shadow: 0 6px 16px color-mix(in srgb, var(--acento) 40%, transparent); transition: transform 140ms var(--sale); }
.fab:active { transform: scale(.94); }
.fab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }

/* Hoja inferior */
dialog#hoja { border: 0; padding: 0; margin: auto auto 0; width: min(560px, 100%); max-height: 88dvh; background: var(--panel); color: var(--tinta); border-radius: 26px 26px 0 0; }
dialog#hoja::backdrop { background: rgba(5, 7, 10, .55); }
dialog#hoja[open] { animation: sube 240ms var(--sale); }
@keyframes sube { from { transform: translateY(24px); opacity: 0; } }
.hoja-in { padding: var(--s5) var(--s4) calc(env(safe-area-inset-bottom) + var(--s5)); }
.hoja-in h2 { font: 800 22px/1.15 var(--titulo); color: var(--tinta); margin: 0 0 var(--s2); }
.hoja-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.hoja-cab .icono { background: var(--panel-2); width: 40px; height: 40px; margin: -4px -4px 0 0; }

/* Aviso con deshacer */
#aviso { position: fixed; left: 50%; width: max-content; bottom: calc(env(safe-area-inset-bottom) + 160px); transform: translate(-50%, 12px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: var(--s3); background: var(--tinta); color: var(--fondo); padding: 10px 10px 10px 18px; border-radius: 999px; font-weight: 650; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); transition: opacity 180ms, transform 220ms var(--sale); z-index: 30; max-width: calc(100% - 32px); }
#aviso.ver { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#aviso button { border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 3px; font-weight: 800; min-height: 36px; padding: 0 10px; }

.entra { animation: entra 220ms var(--sale) both; }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } }
@media (min-width: 900px) { .marco { padding-top: 40px; } h1 { font-size: 38px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.fila-cab { display: flex; align-items: center; gap: var(--s2); }
.lista li.b { flex-wrap: wrap; padding: 12px 0; }
.b-acc { display: flex; gap: var(--s2); width: 100%; }
.ideas { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.idea { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1.5px dashed var(--linea); background: none; font-size: 14px; font-weight: 600; text-align: left; }
.idea::before { content: "+"; color: var(--acento-txt); font-weight: 800; }
