/* ==========================================================================
   MI AGENDA — estilos. 14 de octubre de 2026

   Colores de ui-ux-pro-max (colors.csv): fila 169, la paleta neutra
   (pizarra + verde de logro), porque Raúl la pidió blanca y gris muy claro.
   El ámbar de la racha sale de la fila 94 (Habit Tracker) y solo se usa en el
   ícono de la flama: como texto no da el contraste de 4.5:1.
   Tipografía: Inter autoalojada (la misma de AI Matic).
   Estilo: micro-interacciones de 150–300 ms (styles.csv), y nada se mueve
   si el teléfono pide reducir el movimiento.
   ========================================================================== */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fuentes/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fuentes/inter-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* colors.csv fila 169 — los 17 tokens */
  --color-primary: #475569;
  --color-on-primary: #FFFFFF;
  --color-secondary: #64748B;
  --color-on-secondary: #FFFFFF;
  --color-accent: #059669;
  --color-on-accent: #FFFFFF;
  --color-background: #F8FAFC;
  --color-foreground: #1E293B;
  --color-card: #FFFFFF;
  --color-card-foreground: #1E293B;
  --color-muted: #EAEFF3;
  --color-muted-foreground: #64748B;
  --color-border: #E2E8F0;
  --color-destructive: #DC2626;
  --color-on-destructive: #FFFFFF;
  --color-ring: #475569;
  /* colors.csv fila 94 (Habit Tracker): racha */
  --color-racha: #D97706;
  --color-racha-fondo: #FFFBEB;

  --radio: 14px;
  --radio-chico: 10px;
  --rapido: 160ms;
  --medio: 260ms;
  --sombra: 0 1px 2px rgb(15 23 42 / 0.04), 0 4px 16px rgb(15 23 42 / 0.05);
  --alto-nav: 64px;
  --alto-dock: 104px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-foreground);
  font: 400 16px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--color-ring); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(var(--alto-nav) + var(--alto-dock) + env(safe-area-inset-bottom) + 16px);
  min-height: 100dvh;
}
.app.sin-dock { padding-bottom: calc(var(--alto-nav) + env(safe-area-inset-bottom) + 16px); }
.cargando { padding: 40vh 0 0; text-align: center; color: var(--color-muted-foreground); }

.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Cabecera ─────────────────────────────────────────────────────────── */
.cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cab-fecha { font-size: 13px; color: var(--color-muted-foreground); }
.cab-hola { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.racha { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--color-racha-fondo); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.racha .ico { color: var(--color-racha); }

/* ── Semana ───────────────────────────────────────────────────────────── */
.semana { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 16px; }
.dia { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: var(--radio-chico); background: transparent; font-size: 12px; color: var(--color-muted-foreground); transition: background var(--rapido); }
.dia b { font-size: 16px; font-weight: 600; color: var(--color-foreground); font-variant-numeric: tabular-nums; }
.dia .punto { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.dia .punto.si { background: var(--color-accent); }
.dia.hoy b { color: var(--color-accent); }
.dia[aria-pressed="true"] { background: var(--color-foreground); color: var(--color-on-primary); }
.dia[aria-pressed="true"] b { color: var(--color-on-primary); }
.dia[aria-pressed="true"] .punto.si { background: var(--color-on-primary); }

/* ── Tarjetas ─────────────────────────────────────────────────────────── */
.tarjeta { background: var(--color-card); color: var(--color-card-foreground); border: 1px solid var(--color-border); border-radius: var(--radio); padding: 16px; box-shadow: var(--sombra); }
.heroe { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.anillo { position: relative; width: 112px; height: 112px; flex: none; }
.anillo svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anillo .fondo { stroke: var(--color-muted); }
.anillo .avance { stroke: var(--color-accent); transition: stroke-dashoffset 600ms cubic-bezier(.2,.8,.2,1); }
.anillo-centro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.anillo-pct { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.anillo-cuenta { font-size: 12px; color: var(--color-muted-foreground); }
.anillo.salta { animation: salta 380ms ease; }
@keyframes salta { 50% { transform: scale(1.07); } }
.heroe-lado { flex: 1; min-width: 0; }
.etiqueta { font-size: 12px; font-weight: 500; color: var(--color-muted-foreground); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 4px; }
.heroe-titulo { font-size: 16px; font-weight: 600; line-height: 1.35; margin: 0 0 4px; overflow-wrap: anywhere; }
.heroe-meta { font-size: 13px; color: var(--color-muted-foreground); margin: 0 0 10px; }
.completo { color: var(--color-accent); font-weight: 600; }
.botones { display: flex; gap: 8px; flex-wrap: wrap; }

.b { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-card); font-size: 14px; font-weight: 500; transition: transform var(--rapido), background var(--rapido); }
.b:active { transform: scale(0.97); }
.b-fuerte { background: var(--color-foreground); border-color: var(--color-foreground); color: var(--color-on-primary); }
/* Verde con letra blanca da 3.8:1 (no llega a 4.5:1 en texto de 14 px): el
   botón va oscuro y el verde se queda en la palomita, que es ícono. */
.b-logro { background: var(--color-foreground); border-color: var(--color-foreground); color: var(--color-on-primary); }
.b-logro .ico { color: var(--color-accent); stroke-width: 3; }
.b-peligro { color: var(--color-destructive); }
.b-ancho { width: 100%; }
.b .ico { width: 18px; height: 18px; }

.toca { margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.toca-texto { min-width: 0; }
.toca-texto p { margin: 0; }
.toca-titulo { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }

.banda { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 12px 14px; }
.banda p { margin: 0; flex: 1; font-size: 14px; }

/* ── Chips ────────────────────────────────────────────────────────────── */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; margin: 4px -2px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-card); font-size: 14px; white-space: nowrap; color: var(--color-muted-foreground); }
.chip[aria-pressed="true"] { background: var(--color-foreground); border-color: var(--color-foreground); color: var(--color-on-primary); }

/* ── Listas ───────────────────────────────────────────────────────────── */
.seccion { margin: 18px 0 6px; display: flex; align-items: baseline; justify-content: space-between; }
.seccion h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted-foreground); margin: 0; }
.seccion span { font-size: 13px; color: var(--color-muted-foreground); }
.lista { list-style: none; margin: 0; padding: 0 14px; }
.fila { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.fila:last-child { border-bottom: 0; }
.hora { width: 44px; flex: none; font-size: 13px; color: var(--color-muted-foreground); font-variant-numeric: tabular-nums; }
.palomita { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; background: transparent; padding: 0; }
.palomita i { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--color-border); display: grid; place-items: center; transition: background var(--medio), border-color var(--medio), transform var(--medio); }
.palomita .ico { width: 16px; height: 16px; stroke-width: 3; color: var(--color-on-accent); opacity: 0; transition: opacity var(--rapido); }
.fila.hecho .palomita i { background: var(--color-accent); border-color: var(--color-accent); transform: scale(1.1); }
.fila.hecho .palomita .ico { opacity: 1; }
.reunion-ico { width: 44px; height: 44px; flex: none; display: grid; place-items: center; color: var(--color-primary); }
.reunion-ico .ico { width: 22px; height: 22px; }
.fila-cuerpo { flex: 1; min-width: 0; border: 0; background: transparent; padding: 6px 0; text-align: left; min-height: 44px; }
.fila-titulo { display: block; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.fila.hecho .fila-titulo { text-decoration: line-through; color: var(--color-muted-foreground); }
.fila-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 3px; font-size: 12px; color: var(--color-muted-foreground); }
.tag { padding: 1px 8px; border-radius: 999px; background: var(--color-muted); color: var(--color-foreground); font-size: 12px; }
.espera { display: inline-flex; align-items: center; gap: 4px; }
.espera::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--color-racha); }
.vacio { padding: 18px 4px; color: var(--color-muted-foreground); font-size: 14px; }

/* ── Metas, links, Claude ─────────────────────────────────────────────── */
.titulo-pest { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0 14px; }
.meta { margin-bottom: 10px; }
.meta-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.meta-nombre { font-weight: 600; margin: 0; }
.meta-num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.meta-sub { font-size: 13px; color: var(--color-muted-foreground); margin: 0 0 10px; }
.barra { height: 8px; border-radius: 4px; background: var(--color-muted); overflow: hidden; margin-bottom: 12px; }
.barra i { display: block; height: 100%; background: var(--color-accent); border-radius: 4px; transition: width 600ms cubic-bezier(.2,.8,.2,1); }
.grupo h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted-foreground); margin: 18px 0 6px; }
.enlace { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--color-border); color: var(--color-foreground); text-decoration: none; }
.enlace:last-child { border-bottom: 0; }
.enlace span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.enlace .ico { color: var(--color-muted-foreground); }
.pregunta { margin-bottom: 10px; }
.pregunta p { margin: 0 0 12px; font-size: 15px; }
.pregunta.respondida p { margin-bottom: 4px; color: var(--color-muted-foreground); }
.respuesta { font-size: 14px; font-weight: 600; color: var(--color-accent); }
.mensaje { padding: 12px 0; border-bottom: 1px solid var(--color-border); font-size: 15px; }
.mensaje:last-child { border-bottom: 0; }
.mensaje small { display: block; color: var(--color-muted-foreground); font-size: 12px; margin-top: 2px; }

/* ── Entrar ───────────────────────────────────────────────────────────── */
.entrar { padding-top: 18vh; text-align: center; }
.entrar h1 { font-size: 28px; letter-spacing: -0.03em; margin: 16px 0 6px; }
.entrar p { color: var(--color-muted-foreground); margin: 0 0 28px; }
.entrar .b { margin-bottom: 12px; }
.logo { width: 72px; height: 72px; }
.campo { display: block; text-align: left; margin-bottom: 14px; }
.campo span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.campo input, .campo select, .campo textarea { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--radio-chico); background: var(--color-card); font-size: 16px; }
.campo textarea { min-height: 96px; resize: vertical; }
.error { color: var(--color-destructive); font-size: 14px; margin: 6px 0 0; min-height: 1.2em; }
.par { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.segmentos { display: flex; gap: 6px; }
.segmentos label { flex: 1; }
.segmentos input { position: absolute; opacity: 0; }
.segmentos span { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid var(--color-border); border-radius: var(--radio-chico); font-size: 14px; background: var(--color-card); }
.segmentos input:checked + span { background: var(--color-foreground); border-color: var(--color-foreground); color: var(--color-on-primary); }
.segmentos input:focus-visible + span { outline: 2px solid var(--color-ring); outline-offset: 2px; }

/* ── Abajo: micrófono y navegación ────────────────────────────────────── */
.dock { position: fixed; left: 0; right: 0; bottom: calc(var(--alto-nav) + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; gap: 28px; padding: 8px 0 18px; background: linear-gradient(to top, var(--color-background) 70%, rgb(248 250 252 / 0)); pointer-events: none; }
.dock > * { pointer-events: auto; }
.mic { width: 68px; height: 68px; border-radius: 50%; border: 0; background: var(--color-foreground); color: var(--color-on-primary); display: grid; place-items: center; box-shadow: 0 6px 20px rgb(15 23 42 / 0.25); transition: transform var(--rapido), background var(--medio); }
.mic .ico { width: 28px; height: 28px; }
.mic:active { transform: scale(0.95); }
.mic.grabando { background: var(--color-destructive); animation: late 1.2s ease-in-out infinite; }
@keyframes late { 50% { box-shadow: 0 0 0 12px rgb(220 38 38 / 0.15); } }
.dock-lado { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--color-border); background: var(--color-card); display: grid; place-items: center; color: var(--color-foreground); }
.mic-estado { position: absolute; bottom: 0; margin: 0; font-size: 12px; color: var(--color-muted-foreground); }

.nav { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--alto-nav) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgb(255 255 255 / 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--color-border); }
.nav-b { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; font-size: 11px; font-weight: 500; color: var(--color-muted-foreground); }
.nav-b[aria-current="page"] { color: var(--color-foreground); }
.nav-b .ico { width: 22px; height: 22px; }
.insignia { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--color-destructive); color: var(--color-on-destructive); font-size: 11px; font-weight: 600; line-height: 18px; }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--alto-nav) + var(--alto-dock) + env(safe-area-inset-bottom) + 8px); max-width: 488px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radio); background: var(--color-foreground); color: var(--color-on-primary); font-size: 14px; box-shadow: 0 8px 24px rgb(15 23 42 / 0.25); animation: sube var(--medio) ease; }
.toast p { flex: 1; margin: 0; }
.toast button { min-height: 44px; padding: 0 10px; border: 0; border-radius: 999px; background: rgb(255 255 255 / 0.14); color: var(--color-on-primary); font-size: 13px; font-weight: 600; }
@keyframes sube { from { transform: translateY(12px); opacity: 0; } }

/* ── Hoja de abajo (editar / escribir) ────────────────────────────────── */
.hoja { width: 100%; max-width: 520px; margin: auto auto 0; padding: 0; border: 0; border-radius: 20px 20px 0 0; background: var(--color-card); color: var(--color-foreground); max-height: 92dvh; }
.hoja::backdrop { background: rgb(15 23 42 / 0.4); }
.hoja[open] { animation: sube var(--medio) ease; }
.hoja form { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
.hoja h2 { font-size: 18px; margin: 0 0 16px; }
.hoja-botones { display: flex; gap: 8px; margin-top: 6px; }
.hoja-botones .b { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (min-width: 640px) {
  .app { padding-top: 32px; }
}
.mensaje.alerta { color: var(--color-destructive); }

/* ── Claude en la agenda (14 oct 2026) ────────────────────────────────── */
.hoja h2 { display: flex; align-items: center; gap: 8px; }
.sobre, .pedido { font-size: 14px; color: var(--color-muted-foreground); margin: -8px 0 14px; overflow-wrap: anywhere; }
.pedido { font-style: italic; }
.ejemplos { font-size: 13px; color: var(--color-muted-foreground); margin: -6px 0 10px; }
.pensando { font-size: 16px; font-weight: 500; margin: 18px 0; }
.pensando span { animation: punto 1.2s infinite; opacity: 0.2; }
.pensando span:nth-child(2) { animation-delay: 0.2s; }
.pensando span:nth-child(3) { animation-delay: 0.4s; }
@keyframes punto { 40% { opacity: 1; } }
.respuesta-claude { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.55; background: var(--color-muted); border-radius: var(--radio-chico); padding: 14px; margin-bottom: 10px; max-height: 46dvh; overflow-y: auto; }
.propuesta, .doc { border: 1px solid var(--color-border); border-radius: var(--radio-chico); padding: 12px 14px; margin: 12px 0; }
.propuesta ul { margin: 0 0 10px; padding-left: 18px; font-size: 14px; }
.propuesta li { margin-bottom: 4px; }
.propuesta[data-estado="aplicada"] .etiqueta { color: var(--color-accent); }
.doc-titulo { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0 0 10px; overflow-wrap: anywhere; }
.pedir-claude { margin-bottom: 10px; }
.conversacion { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--color-border); background: transparent; padding: 12px 0; min-height: 44px; }
.conversacion:last-child { border-bottom: 0; }
.conv-pedido { display: block; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.conv-resp { display: block; font-size: 14px; color: var(--color-muted-foreground); margin-top: 2px; overflow-wrap: anywhere; }
[data-nueva-claude] { margin: 4px 0 6px; }
.mensaje-listo { border: 1px solid var(--color-accent); border-radius: var(--radio-chico); padding: 12px 14px; margin: 12px 0; }
.mensaje-listo .respuesta-claude { background: var(--color-card); padding: 0; max-height: none; }
