/* Bento: bloques de color grandes sobre lavanda muy claro, menú en cápsula y Outfit como única voz */
:root {
  --bg: #faf8ff; --sup: #ffffff; --tinta: #1e1a33; --suave: #5f5a78; --linea: #e9e6f4; --acento: #6b4dff; --acento2: #eeeaff;
  --amarillo: #ffd166; --rosa: #ff8fab; --menta: #7be0c3; --azul: #9cc9ff;
  --bien: #177a52; --mal: #c23a3a;
  --font: "Outfit", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 14px; padding: 18px clamp(14px, 2.4vw, 34px) 0; background: var(--bg); color: var(--tinta); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: geometricPrecision; font-synthesis: none; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; border-radius: 6px; }
h1 { font: 800 clamp(38px, 5vw, 66px)/1.03 var(--font); letter-spacing: -.03em; text-wrap: balance; }
h2 { font: 700 26px/1.15 var(--font); letter-spacing: -.02em; }
h3 { font-size: 19px; font-weight: 700; }
.sub { color: var(--suave); font-size: 15px; }
.error { color: var(--mal); font-size: 15px; }
.ok { color: var(--bien); font-size: 15px; }

/* Menú en cápsula */
#menu { display: flex; align-items: center; gap: 16px; padding: 8px 12px 8px 26px; border-radius: 999px; background: var(--sup); box-shadow: 0 6px 24px rgba(70, 50, 160, .08); min-width: 0; }
.marca { font: 800 26px/1 var(--font); color: var(--acento); letter-spacing: -.02em; }
#enlaces { position: relative; display: flex; gap: 2px; flex: 1; justify-content: center; min-width: 0; overflow-x: auto; scrollbar-width: none; }
#enlaces::-webkit-scrollbar { display: none; }
.enlace { position: relative; z-index: 1; padding: 9px 16px; border-radius: 999px; color: var(--suave); white-space: nowrap; transition: color .2s; }
.enlace:hover { color: var(--tinta); }
.enlace.on { color: #fff; }
#tinta { position: absolute; left: 0; top: 0; bottom: 0; width: 80px; border-radius: 999px; background: var(--tinta); transition: transform .5s var(--ease), width .5s var(--ease); }
#abrirAjustes { flex: none; width: auto; color: var(--suave); }

#vista { min-width: 0; overflow-y: auto; padding: 4px 2px 96px; overscroll-behavior: contain; }
.pagina { display: grid; gap: 22px; max-width: 1380px; margin: 0 auto; }
.fila { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.entre { justify-content: space-between; }
.boton { display: inline-flex; align-items: center; min-height: 42px; padding: 0 20px; border-radius: 999px; background: var(--acento); color: #fff; font-weight: 600; transition: transform .25s var(--ease), box-shadow .25s; }
.boton:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(107, 77, 255, .28); }
.boton:active { transform: scale(.97); }
.boton:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.sec { background: var(--acento2); color: var(--tinta); }
.sec:hover { box-shadow: none; background: #e2dcff; }
.tenue { color: var(--suave); font-size: 15px; }
.tenue:hover { color: var(--tinta); }
.campo, select.campo, textarea.campo { min-height: 42px; padding: 8px 14px; border: 1px solid var(--linea); border-radius: 14px; background: var(--sup); min-width: 0; }
textarea.campo { width: 100%; resize: vertical; }
.bloque { position: relative; display: grid; gap: 10px; padding: 24px; border-radius: 28px; background: var(--sup); min-width: 0; transition: transform .45s var(--ease), box-shadow .3s; }
.bloque:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(70, 50, 160, .1); }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.lista { display: grid; gap: 2px; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 11px 2px; border-bottom: 1px solid var(--linea); text-align: left; min-width: 0; }
.item > span:first-child { min-width: 0; overflow-wrap: anywhere; }
button.item:hover { color: var(--acento); }
.cifra { font: 800 58px/1 var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.vacio { padding: 30px 0; color: var(--suave); }

/* Hoy */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(190px, auto); gap: 16px; }
.celda-b { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 24px; border-radius: 30px; min-width: 0; transition: transform .45s var(--ease), box-shadow .3s; }
.celda-b:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(70, 50, 160, .14); }
.c-hero { grid-column: span 2; grid-row: span 2; background: var(--acento); color: #fff; }
.c-hero h1 { margin-top: 4px; }
.c-hero .boton { align-self: flex-start; background: #fff; color: var(--acento); }
.c-repaso { background: var(--amarillo); }
.c-foco { background: var(--rosa); }
.c-aciertos { background: var(--menta); }
.c-semana { background: var(--azul); }
.c-clases { grid-column: span 2; background: var(--sup); }
.c-claude { grid-column: span 2; background: var(--tinta); color: #fff; }
.c-foco select.campo { background: rgba(255, 255, 255, .55); border-color: transparent; }
.c-foco .boton, .c-repaso .boton { background: var(--tinta); color: #fff; align-self: flex-start; }
.c-claude .campo { background: #35304f; border-color: transparent; color: #fff; text-align: left; }
.dias { display: flex; align-items: flex-end; gap: 6px; height: 84px; }
.dias i { flex: 1; min-height: 4px; border-radius: 9px 9px 3px 3px; background: var(--tinta); transform-origin: 50% 100%; animation: crece .8s var(--ease) both; }
@keyframes crece { from { transform: scaleY(0); } }

/* Notas */
.notas { grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
.titulo { width: 100%; border: 0; background: none; outline: 0; font: 800 38px/1.1 var(--font); letter-spacing: -.02em; }
.editor { min-height: 52vh; outline: 0; font-size: 17px; line-height: 1.7; }
.editor:empty::before { content: "Escribe. Usa # para títulos y - para listas."; color: var(--suave); }
.editor h2 { margin: 16px 0 4px; }
.nota-item.on { color: var(--acento); font-weight: 600; }

/* Libros */
.pregunta { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--linea); }
.cita { padding: 10px 14px; border-radius: 14px; background: var(--acento2); font-size: 17px; line-height: 1.5; overflow-wrap: anywhere; }

/* Horario */
.tabla { overflow-x: auto; }
.horario { display: grid; grid-template-columns: 44px repeat(6, minmax(92px, 1fr)); position: relative; min-width: 640px; }
.dia { height: 28px; font-size: 14px; color: var(--suave); text-align: center; }
.hora { height: 44px; font-size: 13px; color: var(--suave); }
.celda { height: 44px; border-top: 1px solid var(--linea); border-left: 1px solid var(--linea); }
.clase { position: absolute; padding: 5px 9px; border-radius: 12px; background: var(--amarillo); font-size: 14px; line-height: 1.25; overflow: hidden; text-align: left; font-weight: 500; transition: transform .25s var(--ease); }
.clase:hover { transform: scale(1.02); }

/* Repaso */
.tarjeta { display: grid; gap: 14px; min-height: 240px; align-content: center; padding: 30px; border-radius: 30px; background: var(--acento); color: #fff; }
.tarjeta .sub { color: rgba(255, 255, 255, .8); }
.tarjeta .boton { background: #fff; color: var(--acento); }
.tarjeta .sec { background: rgba(255, 255, 255, .2); color: #fff; }
.tarjeta .cita { background: rgba(255, 255, 255, .16); }

/* Odontograma */
.arcada { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 4px; min-width: 620px; }
.diente { display: grid; gap: 3px; justify-items: center; padding: 6px 0; border-radius: 12px; transition: background .2s, transform .35s var(--ease); }
.diente:hover { background: var(--acento2); transform: translateY(-4px); }
.diente.on { background: var(--amarillo); }
.diente svg { width: 24px; height: 32px; fill: #fff; stroke: currentColor; stroke-width: 1.4; shape-rendering: geometricPrecision; }
.diente span { font-size: 13px; font-variant-numeric: tabular-nums; }
.diente.marcado span { color: var(--acento); font-weight: 700; }

/* Análisis */
.barras { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 5px; align-items: end; height: 150px; }
.barra { display: grid; align-content: end; gap: 4px; height: 100%; text-align: center; font-size: 12px; color: var(--suave); min-width: 0; }
.barra i { display: block; min-height: 2px; border-radius: 6px 6px 0 0; background: var(--acento); transform-origin: 50% 100%; animation: crece .8s var(--ease) both; }

/* Claude */
#abrirPanel { position: fixed; right: 22px; bottom: 22px; z-index: 5; padding: 12px 20px; border-radius: 999px; background: var(--tinta); color: #fff; font-weight: 600; box-shadow: 0 10px 28px rgba(30, 26, 51, .28); transition: transform .3s var(--ease), opacity .2s; }
#abrirPanel:hover { transform: translateY(-3px); }
.con-panel #abrirPanel { opacity: 0; pointer-events: none; }
#panel { position: fixed; inset: 10px 10px 10px auto; z-index: 6; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(440px, calc(100vw - 20px)); border-radius: 28px; background: var(--sup); box-shadow: 0 20px 60px rgba(30, 26, 51, .24); transform: translate3d(106%, 0, 0); visibility: hidden; overflow: hidden; transition: transform .45s var(--ease), visibility 0s .45s; }
.con-panel #panel { transform: none; visibility: visible; transition: transform .45s var(--ease); }
.pcab { display: grid; gap: 8px; padding: 18px; border-bottom: 1px solid var(--linea); }
#charla { display: grid; align-content: start; gap: 14px; overflow-y: auto; padding: 18px; overscroll-behavior: contain; }
.msg { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.yo { justify-self: end; max-width: 85%; padding: 8px 13px; border-radius: 16px; background: var(--acento2); }
.pie { display: grid; gap: 8px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linea); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.chip { flex: none; padding: 5px 12px; border-radius: 999px; background: var(--acento2); font-size: 14px; color: var(--tinta); transition: background .2s; }
.chip:hover { background: #e2dcff; }

dialog { margin: auto; width: min(460px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: 26px; background: var(--sup); color: var(--tinta); }
dialog::backdrop { background: rgba(30, 26, 51, .4); }

/* Entradas */
.sube { animation: sube .7s var(--ease) both; animation-delay: var(--r, 0ms); }
@keyframes sube { from { opacity: 0; transform: translate3d(0, 24px, 0) scale(.97); } }
#intro { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: var(--acento); pointer-events: none; animation: telon .9s var(--ease) .95s forwards; }
#intro span { font: 800 clamp(90px, 20vw, 210px)/1 var(--font); color: #fff; letter-spacing: -.04em; animation: nombre 1.3s var(--ease) both; }
@keyframes nombre { from { opacity: 0; transform: scale(.82); } }
@keyframes telon { to { transform: translate3d(0, -100%, 0); visibility: hidden; } }

/* Portada */
#puntos { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
body.portada { display: block; padding: 0; overflow-x: hidden; overflow-y: auto; height: auto; min-height: 100%; }
html:has(body.portada) { overflow-y: auto; height: auto; scroll-behavior: smooth; }
.barra-p { position: fixed; inset: 14px clamp(14px, 3vw, 34px) auto; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 8px 24px; border-radius: 999px; background: var(--sup); box-shadow: 0 6px 24px rgba(70, 50, 160, .1); }
.barra-p .boton { text-decoration: none; }
.portada main { position: relative; z-index: 1; display: grid; gap: 16px; padding: 92px clamp(14px, 3vw, 34px) 18px; }
.escena { display: grid; align-content: center; justify-items: start; gap: 16px; min-height: 82vh; padding: clamp(28px, 6vw, 76px); border-radius: 36px; }
.escena:nth-child(1) { background: var(--acento); color: #fff; }
.escena:nth-child(2) { background: var(--amarillo); }
.escena:nth-child(3) { background: var(--menta); }
.escena:nth-child(4) { background: var(--rosa); }
.escena:nth-child(5) { background: var(--azul); min-height: 90vh; justify-items: center; }
.escena > * { max-width: min(760px, 100%); opacity: 0; transform: translate3d(0, 30px, 0); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.escena.vista > * { opacity: 1; transform: none; }
.escena h1 { font-size: clamp(48px, 8vw, 112px); }
.escena h2 { font-size: clamp(40px, 6.2vw, 86px); font-weight: 800; line-height: 1.02; letter-spacing: -.03em; }
.escena:nth-child(1) .sub { color: rgba(255, 255, 255, .9); font-size: 19px; max-width: 34ch; }
.lema { max-width: 46ch; font-size: clamp(18px, 1.7vw, 22px); }
.escena .boton { text-decoration: none; min-height: 52px; padding: 0 28px; font-size: 18px; }
.escena:nth-child(1) .boton { background: #fff; color: var(--acento); }
.caja { display: grid; gap: 14px; width: min(460px, 100%); padding: 28px; border-radius: 28px; background: var(--sup); justify-items: start; }
.caja .boton { justify-content: center; }
.caja h2 { font-size: 40px; }
.caja .bloque { width: 100%; background: var(--acento2); }
.formulario { display: grid; gap: 10px; width: 100%; }
.formulario .campo { width: 100%; min-height: 46px; }
.pie-p { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding: 16px clamp(14px, 3vw, 34px) 28px; color: var(--suave); font-size: 15px; }
.pie-p a { color: var(--acento); }
.texto-legal { position: relative; display: grid; gap: 14px; max-width: 680px; margin: 0 auto; padding: 48px 18px; }
.texto-legal h1 { font-size: clamp(38px, 7vw, 60px); }
.texto-legal h2 { margin-top: 12px; }
.texto-legal a { color: var(--acento); }

@media (max-width: 1000px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c-hero, .c-clases, .c-claude { grid-column: span 2; }
  .c-hero { grid-row: span 1; min-height: 260px; }
  #tinta { display: none; }
  .enlace.on { background: var(--tinta); }
  #enlaces { justify-content: flex-start; }
}
@media (max-width: 760px) {
  body { padding: 10px 10px 0; }
  #menu { padding-left: 16px; gap: 8px; }
  .notas { grid-template-columns: minmax(0, 1fr); }
  .marca { font-size: 22px; }
  .cifra { font-size: 46px; }
  .escena { min-height: 76vh; border-radius: 28px; }
  #abrirPanel { right: 14px; bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
  .escena > * { opacity: 1; transform: none; }
}
