*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root{
  --paper:#F7F3EC;
  --ink:#191917;
  --rust:#C94A1F;
  --sage:#5C7A5E;
  --dust:#A89880;
  --warm:#EDE5D8;
  --line:rgba(25,25,23,0.1);
}

html{scroll-behavior:smooth}

body{
  font-family:'Instrument Sans',sans-serif;
  background:var(--paper);
  color:var(--ink);
  cursor:none;
}

/* custom cursor */
.cursor{
  position:fixed;
  width:10px;height:10px;
  background:var(--rust);
  border-radius:50%;
  pointer-events:none;
  z-index:9999;
  transform:translate(-50%,-50%);
  transition:transform 0.1s, width 0.2s, height 0.2s;
  mix-blend-mode:multiply;
}
.cursor-ring{
  position:fixed;
  width:36px;height:36px;
  border:1.5px solid var(--rust);
  border-radius:50%;
  pointer-events:none;
  z-index:9998;
  transform:translate(-50%,-50%);
  transition:transform 0.18s ease, width 0.25s, height 0.25s, opacity 0.2s;
  opacity:0.5;
}
body:hover .cursor{opacity:1}

/* grain overlay */
body::after{
  content:'';
  position:fixed;
  inset:0;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events:none;
  z-index:9997;
}

/* ── NAV ── */
nav{
  position:fixed;top:0;left:0;right:0;
  z-index:500;
  padding:1.1rem 3rem;
  display:flex;justify-content:space-between;align-items:center;
  border-bottom:1px solid var(--line);
  background:rgba(247,243,236,0.92);
  backdrop-filter:blur(16px);
}
.logo{
  font-family:'Playfair Display',serif;
  font-size:1.35rem;
  letter-spacing:-0.01em;
  color:var(--ink);
  font-weight:400;
}
.logo b{font-weight:900;color:var(--rust)}
.logo i{font-style:italic}

nav ul{
  list-style:none;
  display:flex;gap:2.5rem;
  font-size:0.82rem;
  font-weight:400;
  letter-spacing:0.04em;
  color:var(--dust);
}
nav ul a{color:inherit;text-decoration:none;transition:color 0.2s}
nav ul a:hover{color:var(--ink)}

.nav-right{display:flex;align-items:center;gap:1.2rem}
.nav-btn-student,.nav-btn-family{font-size:.8rem;font-weight:400;letter-spacing:.04em;color:var(--dust);text-decoration:none;transition:color .2s}
.nav-btn-student:hover,.nav-btn-family:hover{color:var(--ink)}
.nav-btn-live{font-size:.78rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--paper);background:var(--ink);padding:.45rem 1.1rem;border-radius:3px;text-decoration:none;transition:opacity .2s}
.nav-btn-live:hover{opacity:.8}
.nav-txt-compact{display:none}  /* versión abreviada de los links del nav (solo mobile) */

/* Mobile: el nav anónimo de 4 links se desbordaba en pantallas chicas */
@media (max-width:600px){
  nav{ padding:.7rem 1rem; }
  .nav-logo-img{ height:26px; }
  .nav-right{ gap:.9rem; }
  .nav-hide-mobile{ display:none; }
}

/* Página pública de la agenda (prospecto): nav solo logo, sin logins */
.agenda-public nav .nav-right{ display:none; }
.nav-tag{
  font-size:0.75rem;
  font-weight:500;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:var(--rust);
  background:rgba(201,74,31,0.08);
  border:1px solid rgba(201,74,31,0.2);
  padding:0.3rem 0.8rem;
  border-radius:3px;
}

/* ── HERO ── */
.hero{
  min-height:100vh;
  padding:8rem 3rem 4rem;
  display:grid;
  grid-template-rows:auto auto auto;
  position:relative;
  overflow:hidden;
}

/* big number watermark */
.hero-watermark{
  position:absolute;
  right:-2rem;top:3rem;
  font-family:'Playfair Display',serif;
  font-size:20vw;
  font-weight:900;
  color:rgba(25,25,23,0.03);
  line-height:1;
  pointer-events:none;
  user-select:none;
  letter-spacing:-0.05em;
}

.hero-eyebrow{
  display:flex;align-items:center;gap:1rem;
  margin-bottom:2.5rem;
  animation:slideIn 0.7s ease both;
}
.eyebrow-line{
  width:40px;height:1px;
  background:var(--rust);
}
.eyebrow-text{
  font-size:0.78rem;
  letter-spacing:0.14em;
  text-transform:uppercase;
  color:var(--dust);
  font-weight:500;
}

.hero-headline{
  font-family:'Playfair Display',serif;
  font-size:clamp(3.2rem,7.5vw,7.5rem);
  font-weight:900;
  line-height:0.95;
  letter-spacing:-0.03em;
  max-width:900px;
  animation:slideIn 0.7s 0.08s ease both;
}
.hero-headline .italic{
  font-style:italic;
  font-weight:400;
  color:var(--rust);
  display:block;
}
.hero-headline .outline{
  -webkit-text-stroke:2px var(--ink);
  color:transparent;
}

.hero-bottom{
  display:grid;
  grid-template-columns:1fr 1fr;
  align-items:end;
  gap:4rem;
  margin-top:4rem;
  padding-top:2.5rem;
  border-top:1px solid var(--line);
  animation:slideIn 0.7s 0.18s ease both;
}
.hero-sub{
  font-size:1.05rem;
  font-weight:300;
  line-height:1.75;
  color:#555;
  max-width:420px;
}
.hero-sub strong{color:var(--ink);font-weight:500}

.hero-cta-block{display:flex;flex-direction:column;gap:1.1rem;align-self:end}
.hero-cta-label{font-size:.72rem;letter-spacing:.1em;text-transform:uppercase;color:var(--dust);opacity:.6}
.hero-cta-main{font-size:1.1rem;font-weight:300;line-height:1.6;color:var(--ink)}
.hero-cta-main em{font-style:italic;color:var(--rust)}

/* Réplica del chat del Aula en el hero */
.hero-demo{
  background:#fff;
  border:1px solid var(--line);
  border-radius:8px;
  padding:1rem 1rem 1.1rem;
  box-shadow:0 14px 34px rgba(25,25,23,0.07);
  display:flex;flex-direction:column;gap:.55rem;
  max-width:440px;
}
.hero-demo__head{
  display:flex;align-items:center;gap:.45rem;
  font-size:.7rem;letter-spacing:.08em;text-transform:uppercase;
  color:var(--dust);
  padding-bottom:.55rem;
  border-bottom:1px solid var(--line);
}
.hero-demo__dot{width:7px;height:7px;border-radius:50%;background:var(--sage);flex:none}
.hero-demo__msg{
  font-size:.9rem;line-height:1.5;
  padding:.6rem .8rem;border-radius:8px;max-width:90%;
}
.hero-demo__msg--user{
  align-self:flex-end;
  background:rgba(201,74,31,0.08);
  border:1px solid rgba(201,74,31,0.18);
  color:var(--ink);
  border-bottom-right-radius:2px;
}
.hero-demo__msg--tutor{
  align-self:flex-start;
  background:var(--paper);
  border:1px solid var(--line);
  color:#444;
  border-bottom-left-radius:2px;
}
.hero-actions{display:flex;align-items:center;flex-wrap:wrap;gap:1.3rem}

/* Botón flotante persistente al demo */
.floating-demo{
  position:fixed;
  right:0; top:50%;
  transform:translateY(-50%);
  z-index:400;
  background:var(--rust);
  color:#fff;
  writing-mode:vertical-rl;
  padding:1.1rem 0.5rem;
  border-radius:6px 0 0 6px;
  font-size:0.78rem; font-weight:600;
  letter-spacing:0.08em; text-transform:uppercase;
  text-decoration:none;
  box-shadow:-2px 0 14px rgba(25,25,23,0.15);
  transition:background 0.2s, padding-right 0.2s, opacity 0.3s ease, transform 0.3s ease;
}
.floating-demo:hover{ background:var(--ink); padding-right:0.9rem; }
.floating-demo--hidden{ opacity:0; pointer-events:none; transform:translateY(-50%) translateX(110%); }
@media(max-width:600px){ .floating-demo{ font-size:0.7rem; padding:0.8rem 0.4rem; } }
.btn-main{
  background:var(--ink);
  color:var(--paper);
  border:none;
  padding:1rem 2.4rem;
  font-family:'Instrument Sans',sans-serif;
  font-size:0.95rem;
  font-weight:500;
  letter-spacing:0.02em;
  border-radius:3px;
  cursor:none;
  transition:background 0.2s,transform 0.15s;
}
.btn-main:hover{background:var(--rust);transform:translateY(-1px)}

.btn-text{
  font-size:0.82rem;
  color:var(--dust);
  text-decoration:none;
  border-bottom:1px solid var(--line);
  padding-bottom:2px;
  transition:color 0.2s,border-color 0.2s;
  cursor:none;
}
.btn-text:hover{color:var(--ink);border-color:var(--ink)}

/* scroll hint */
.scroll-hint{
  position:absolute;
  bottom:2.5rem;left:3rem;
  display:flex;align-items:center;gap:0.6rem;
  font-size:0.75rem;
  letter-spacing:0.1em;
  text-transform:uppercase;
  color:var(--dust);
  text-decoration:none;
  cursor:pointer;
  transition:color .2s ease;
  animation:fadeIn 1s 0.8s ease both;
}
.scroll-hint:hover{color:var(--ink);}
.scroll-arrow{
  width:20px;height:20px;
  border-right:1px solid var(--dust);
  border-bottom:1px solid var(--dust);
  transform:rotate(45deg) translateY(-4px);
  animation:arrowBounce 1.6s infinite;
}

/* ── MANIFESTO ── */
.manifesto{
  padding:6rem 3rem;
  border-top:1px solid var(--line);
  display:grid;
  grid-template-columns:180px minmax(0, 980px);
  gap:3rem;
  align-items:start;
}
.manifesto-label{
  font-size:0.75rem;
  letter-spacing:0.14em;
  text-transform:uppercase;
  color:var(--dust);
  padding-top:0.5rem;
  position:sticky;top:6rem;
}
.manifesto-body{
  font-family:'Playfair Display',serif;
  font-size:clamp(1.4rem,2.4vw,2rem);
  font-weight:400;
  line-height:1.35;
  color:var(--ink);
}
.manifesto-body em{
  font-style:italic;
  color:var(--rust);
}
.manifesto-body .aside{
  display:block;
  margin-top:2rem;
  font-family:'Instrument Sans',sans-serif;
  font-size:0.95rem;
  font-weight:300;
  color:var(--dust);
  line-height:1.7;
  border-left:2px solid var(--rust);
  padding-left:1.2rem;
}

/* ── FEATURES — HORIZONTAL CARDS ── */
.features{
  border-top:1px solid var(--line);
  overflow:hidden;
}
.features-header{
  padding:4rem 3rem 2rem;
  display:flex;
  justify-content:space-between;
  align-items:baseline;
}
.features-header h2{
  font-family:'Playfair Display',serif;
  font-size:clamp(1.8rem,3vw,2.8rem);
  font-weight:900;
  letter-spacing:-0.02em;
}
.feat-count{
  font-family:'Playfair Display',serif;
  font-size:4rem;
  font-weight:900;
  color:rgba(25,25,23,0.07);
  line-height:1;
}

.features-scroll{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  border-top:1px solid var(--line);
}
.feat{
  padding:2.5rem;
  border-right:1px solid var(--line);
  transition:background 0.25s;
  position:relative;
  overflow:hidden;
}
.feat:last-child{border-right:none}
.feat::before{
  content:'';
  position:absolute;
  bottom:0;left:0;right:0;
  height:0;
  background:var(--rust);
  transition:height 0.3s ease;
}
.feat:hover::before{height:3px}

.feat-num{
  font-family:'Playfair Display',serif;
  font-size:0.85rem;
  color:var(--dust);
  margin-bottom:3rem;
  font-style:italic;
}
.feat-icon{
  font-size:1.5rem;
  margin-bottom:1.2rem;
  display:block;
  color:var(--rust);
}
.feat h3{
  font-family:'Playfair Display',serif;
  font-size:1.25rem;
  font-weight:700;
  margin-bottom:0.7rem;
  letter-spacing:-0.01em;
}
.feat p{
  font-size:0.875rem;
  color:#666;
  line-height:1.65;
  font-weight:300;
}

/* ── HOW — ALTERNATING ── */
.how{
  padding:3rem 3rem;
  border-top:1px solid var(--line);
  background:var(--ink);
  color:var(--paper);
}
.how-header{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4rem;
  align-items:baseline;
  margin-bottom:2.5rem;
  padding-bottom:2rem;
  border-bottom:1px solid rgba(247,243,236,0.1);
}
.how-header h2{
  font-family:'Playfair Display',serif;
  font-size:clamp(2rem,4vw,3.5rem);
  font-weight:900;
  letter-spacing:-0.02em;
  line-height:1;
}
.how-header h2 i{font-weight:400;color:rgba(247,243,236,0.4)}
.how-intro{
  font-size:0.95rem;
  font-weight:300;
  line-height:1.75;
  color:rgba(247,243,236,0.55);
  align-self:end;
}

.how-steps{display:flex;flex-direction:column;gap:0}
.how-step{
  display:grid;
  grid-template-columns:80px 1fr 1fr;
  gap:3rem;
  align-items:start;
  padding:1.15rem 0;
  border-bottom:1px solid rgba(247,243,236,0.08);
  transition:background 0.2s;
}
.how-step:hover{background:rgba(247,243,236,0.02)}
.how-step:last-child{border-bottom:none}

.step-n{
  font-family:'Playfair Display',serif;
  font-size:2.3rem;
  font-weight:900;
  color:rgba(247,243,236,0.12);
  line-height:1;
}
.step-title{
  font-family:'Playfair Display',serif;
  font-size:1.3rem;
  font-weight:700;
  padding-top:0.5rem;
}
.step-desc{
  font-size:0.875rem;
  color:rgba(247,243,236,0.5);
  line-height:1.7;
  font-weight:300;
  padding-top:0.5rem;
}

/* ── QUOTE / TENSION ── */
.tension{
  padding:7rem 3rem;
  border-top:1px solid var(--line);
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6rem;
  align-items:center;
}
.tension-left{position:relative}
.tension-quote{
  font-family:'Playfair Display',serif;
  font-size:clamp(1.8rem,3.5vw,3rem);
  font-weight:400;
  font-style:italic;
  line-height:1.35;
  color:var(--ink);
}
.tension-quote::before{
  content:'\201C';
  font-size:8rem;
  line-height:0;
  color:rgba(201,74,31,0.12);
  position:absolute;
  top:1.5rem;left:-1rem;
  font-family:'Playfair Display',serif;
}
.tension-attribution{
  margin-top:2rem;
  font-size:0.82rem;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:var(--dust);
  padding-left:2rem;
  position:relative;
}
.tension-attribution::before{
  content:'';
  position:absolute;
  left:0;top:50%;
  width:1.2rem;height:1px;
  background:var(--rust);
}

.tension-right{display:flex;flex-direction:column;gap:1.5rem}
.tension-card{
  background:var(--warm);
  border-radius:4px;
  padding:1.5rem;
  border-left:3px solid transparent;
  transition:border-color 0.2s;
}
.tension-card:hover{border-left-color:var(--rust)}
.tension-card-label{
  font-size:0.72rem;
  letter-spacing:0.1em;
  text-transform:uppercase;
  color:var(--dust);
  margin-bottom:0.5rem;
}
.tension-card p{font-size:0.9rem;line-height:1.6;color:#444;font-weight:300}
.tension-card.good{border-left-color:var(--sage)}
.tension-card.bad{border-left-color:rgba(201,74,31,0.4)}

/* ── CTA ── */
.cta{
  padding:6rem 3rem;
  border-top:1px solid var(--line);
  background:var(--rust);
  color:white;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4rem;
  align-items:center;
}
.cta h2{
  font-family:'Playfair Display',serif;
  font-size:clamp(2.2rem,4vw,3.8rem);
  font-weight:900;
  line-height:1;
  letter-spacing:-0.02em;
}
.cta h2 i{font-weight:400;opacity:0.7}
.cta-right{display:flex;flex-direction:column;gap:1rem}
.cta p{
  font-size:0.95rem;
  font-weight:300;
  line-height:1.7;
  opacity:0.8;
  margin-bottom:0.5rem;
}
.email-form{display:flex;gap:0;border-radius:3px;overflow:hidden;border:1.5px solid rgba(255,255,255,0.3)}
.email-form input{
  flex:1;
  padding:0.9rem 1.2rem;
  background:rgba(255,255,255,0.1);
  border:none;
  color:white;
  font-family:'Instrument Sans',sans-serif;
  font-size:0.9rem;
  outline:none;
}
.email-form input::placeholder{color:rgba(255,255,255,0.45)}
.email-form button{
  background:white;
  color:var(--rust);
  border:none;
  padding:0.9rem 1.4rem;
  font-family:'Instrument Sans',sans-serif;
  font-size:0.85rem;
  font-weight:600;
  cursor:none;
  white-space:nowrap;
  transition:background 0.2s;
}
.email-form button:hover{background:var(--ink);color:white}
.cta-note{font-size:0.75rem;opacity:0.5;letter-spacing:0.04em}

/* ── FOOTER ── */
footer{
  padding:2.5rem 3rem;
  border-top:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:0.8rem;
  color:var(--dust);
}
.footer-logo{
  font-family:'Playfair Display',serif;
  font-size:1.1rem;
  font-weight:400;
  color:var(--ink);
}
.footer-logo b{font-weight:900;color:var(--rust)}

/* ── ANIMATIONS ── */
@keyframes slideIn{
  from{opacity:0;transform:translateY(20px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes fadeIn{
  from{opacity:0}to{opacity:1}
}
@keyframes arrowBounce{
  0%,100%{transform:rotate(45deg) translateY(-4px)}
  50%{transform:rotate(45deg) translateY(2px)}
}

/* intersection observer targets */
.reveal{
  opacity:0;transform:translateY(28px);
  transition:opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible{opacity:1;transform:none}
.reveal-delay-1{transition-delay:0.1s}
.reveal-delay-2{transition-delay:0.2s}
.reveal-delay-3{transition-delay:0.3s}

/* ── RESPONSIVE ── */
@media(max-width:900px){
  nav ul{display:none}
  .hero{padding:6rem 1.5rem 4rem}
  .hero-bottom{grid-template-columns:1fr;gap:2rem}
  .hero-actions{align-items:flex-start}
  .manifesto{grid-template-columns:1fr;gap:2rem;padding:3rem 1.5rem}
  .manifesto-label{position:static}
  .features-scroll{grid-template-columns:1fr 1fr}
  .feat:nth-child(even){border-right:none}
  .how{padding:4rem 1.5rem}
  .how-header{grid-template-columns:1fr}
  .how-step{grid-template-columns:50px 1fr;gap:1.5rem}
  .step-desc{display:none}
  .tension{grid-template-columns:1fr;gap:3rem;padding:4rem 1.5rem}
  .cta{grid-template-columns:1fr;padding:4rem 1.5rem}
  footer{flex-direction:column;gap:0.5rem;text-align:center;padding:1.5rem}
}

/* ── PÁGINAS INTERNAS ── */
.page-main {
  min-height: 100vh;
  padding: 7rem 3rem 4rem;
  max-width: 560px;
  margin: 0 auto;
}

/* Variante ancha para páginas con layout en columnas (Dashboard, Editar perfil) */
.page-main--wide {
  max-width: 920px;
}

/* Grilla de secciones del formulario de edición — 2 columnas en pantallas anchas */
.edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 0 2.5rem;
  align-items: start;
}

/* Sparkline de actividad (barras CSS, sin JS) */
.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 30px;
}
.spark-bar {
  flex: 1;
  background: var(--sage, #5C7A5E);
  border-radius: 1px;
  min-height: 2px;
}
.spark-bar--empty {
  background: var(--line, #ececec);
}
.sparkline-caption {
  font-size: 0.72rem;
  color: #999;
  margin-top: 0.35rem;
  letter-spacing: 0.02em;
}

.page-main h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
}

.form-field label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dust);
}

.form-field input[type="text"],
.form-field select {
  padding: 0.75rem 1rem;
  background: var(--warm);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}

.form-field input[type="text"]:focus,
.form-field select:focus {
  border-color: var(--rust);
}

.form-actions {
  margin-top: 2rem;
}

.form-errors {
  margin-bottom: 1.5rem;
}

.form-errors p {
  font-size: 0.875rem;
  color: var(--rust);
}

/* dashboard interno */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.dashboard-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.dashboard-subtitle {
  font-size: 0.87rem;
  color: var(--dust);
  margin-top: 0.3rem;
}

.dashboard-section {
  margin-bottom: 2.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.section-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
}

.section-meta {
  font-size: 0.78rem;
  color: var(--dust);
}

/* Cards modal */
.cards-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center}
.cards-modal__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.5)}
.cards-modal__box{position:relative;background:#fff;border-radius:16px;padding:2rem 1.5rem 1.5rem;width:min(480px,92vw);box-shadow:0 8px 32px rgba(0,0,0,.18);display:flex;flex-direction:column;gap:1rem}
.cards-modal__close{position:absolute;top:.75rem;right:.75rem;background:none;border:none;font-size:1.1rem;cursor:pointer;color:#888;line-height:1}
.cards-modal__counter{font-size:.8rem;color:#999;text-align:center}
.cards-modal__card{background:#f7f4ef;border-radius:12px;padding:1.5rem;min-height:140px;display:flex;flex-direction:column;gap:1rem;align-items:center;justify-content:center;text-align:center;transition:background .25s}
.cards-modal__card.showing-back{background:var(--sage,#7a9e87);color:#fff}
.cards-modal__face-label{font-size:.65rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;opacity:.5}
.cards-modal__card.showing-back .cards-modal__face-label{opacity:.7;color:#fff}
.cards-modal__card p{font-size:1rem;line-height:1.55;margin:0}
.cards-modal__flip{background:none;border:1.5px solid currentColor;border-radius:20px;padding:.35rem .9rem;font-size:.8rem;cursor:pointer;opacity:.7;transition:opacity .15s}
.cards-modal__flip:hover{opacity:1}
.cards-modal__nav{display:flex;justify-content:space-between}
.cards-modal__nav button{background:none;border:none;color:var(--rust,#c94a1f);font-size:.9rem;cursor:pointer;padding:.3rem .5rem}
.cards-modal__nav button:disabled{opacity:.3;cursor:default}
.exam-modal__question{font-size:1rem;font-weight:500;line-height:1.5;color:var(--ink)}
.exam-modal__options{display:flex;flex-direction:column;gap:.5rem;margin-top:.5rem}
.exam-option{background:#f7f4ef;border:1.5px solid #e5e0d8;border-radius:8px;padding:.7rem 1rem;text-align:left;cursor:pointer;font-size:.9rem;transition:background .15s,border-color .15s}
.exam-option:hover:not(:disabled){background:#eee8de;border-color:#ccc}
.exam-option--correct{background:#d4edda!important;border-color:#5a9e6f!important}
.exam-option--wrong{background:#fde8e8!important;border-color:#c94a1f!important}
.exam-score{text-align:center;padding:.5rem 0;display:flex;flex-direction:column;gap:.5rem}
#exam-result{margin-top:.75rem}

/* Student cards */
.student-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.student-card {
  background: var(--warm);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.student-card--active {
  border-left: 3px solid var(--sage, #4a7c6b);
}

.student-card__top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.student-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--rust);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.student-card__info {
  flex: 1;
  min-width: 0;
}

.student-card__name {
  display: block;
  font-size: 0.97rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-card__last {
  font-size: 0.78rem;
  color: var(--dust);
}

.badge-today {
  font-size: 0.7rem;
  background: var(--sage, #4a7c6b);
  color: #fff;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-streak {
  font-size: 0.75rem;
  background: #ff6b35;
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 600;
}

.sidebar-streak {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ff6b35;
  flex-shrink: 0;
}

.student-card__stats {
  display: flex;
  gap: 0.5rem;
}

.stat {
  flex: 1;
  text-align: center;
  background: #fff;
  border-radius: 4px;
  padding: 0.5rem 0.3rem;
}

.stat__value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.stat__label {
  display: block;
  font-size: 0.68rem;
  color: var(--dust);
  margin-top: 0.2rem;
}

.stat__hint {
  font-size: 0.75rem;
  color: var(--dust);
  text-align: center;
  margin: 0;
}

.student-card__actions {
  display: flex;
  gap: 0.5rem;
}

.student-card__actions .btn-secondary,
.student-card__actions .btn-main {
  flex: 1;
  text-align: center;
}

.empty-card {
  padding: 2rem;
  background: var(--warm);
  border: 1px dashed var(--line);
  border-radius: 6px;
  text-align: center;
  color: var(--dust);
  font-size: 0.92rem;
}

.empty-state {
  padding: 2rem 0;
  font-size: 0.95rem;
  color: var(--dust);
}

/* ── Classroom / Chat ── */
.chat-history {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
  max-height: 60vh;
  overflow-y: auto;
}

.chat-bubble {
  padding: 0.9rem 1.2rem;
  border-radius: 3px;
  max-width: 80%;
}

.chat-bubble--user {
  background: var(--warm);
  border-left: 3px solid var(--rust);
  align-self: flex-end;
}

.chat-bubble--assistant {
  background: var(--paper);
  border-left: 3px solid var(--sage);
  align-self: flex-start;
}

.chat-bubble__role {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dust);
  margin-bottom: 0.4rem;
}

.chat-bubble p {
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.chat-form {
  margin-top: 1rem;
}

.chat-input-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.chat-input-row textarea {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--warm);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  resize: vertical;
}

/* ── Material section ── */
.material-section {
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.material-summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--warm);
  user-select: none;
}

.material-form {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.material-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  resize: vertical;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--dust);
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  border-radius: 2px;
  cursor: pointer;
}

.material-preview {
  font-size: 0.82rem;
  color: var(--sage);
  padding: 0.25rem 0;
}

/* ── Usage dashboard ── */
.usage-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.usage-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1.2rem;
  background: var(--warm);
  border-radius: 3px;
  border-left: 3px solid var(--rust);
  min-width: 130px;
}

.usage-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dust);
}

.usage-card__value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}

.usage-card__sub {
  font-size: 0.8rem;
  color: var(--dust);
}

.chart-container {
  margin-top: 1.25rem;
  background: var(--warm);
  border-radius: 3px;
  padding: 1.25rem;
  max-height: 280px;
}

/* ── Compact summary ── */
.compact-summary {
  padding: 0.9rem 1.2rem;
  background: var(--warm);
  border-left: 3px solid var(--sage);
  border-radius: 3px;
  margin-bottom: 1rem;
}

.compact-summary__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sage);
  margin-bottom: 0.4rem;
}

.compact-summary p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
}

/* ── Credential info ── */
.credential-info {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #f0f7f4;
  border: 1px solid var(--sage, #4a7c6b);
  border-radius: 6px;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.credential-info__icon { font-size: 1.4rem; flex-shrink: 0; }
.credential-info strong { display: block; margin-bottom: 0.3rem; }
.credential-info ul { margin: 0.4rem 0 0 1rem; padding: 0; }
.credential-info li { margin: 0.2rem 0; }

/* ── Tutor explain panel ── */
.tutor-explain-panel {
  margin-top: 1rem;
  background: var(--warm);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.3rem 1.5rem;
  font-size: 0.92rem;
  line-height: 1.65;
}

.tutor-explain-panel p {
  margin: 0 0 0.7rem;
  color: var(--ink);
}

.tutor-explain-panel p:last-child { margin-bottom: 0; }

.tutor-explain__intro {
  margin: 0 0 0.2rem;
  color: var(--sage, #4a7c6b);
  font-size: 0.9rem;
}

/* ── Student edit ── */
.edit-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.edit-section__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--ink);
}

.edit-section__desc {
  font-size: 0.87rem;
  color: var(--dust);
  margin-bottom: 1rem;
}

/* Nivel + Año en fila */
.form-row {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 0.75rem;
}

/* Etiquetas más legibles */
.form-field label {
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.3rem;
  display: block;
  text-transform: none;
  letter-spacing: 0;
}

/* Toggle TDAH */
.tdah-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  background: var(--warm);
  border-radius: 4px;
  border: 1px solid var(--line);
  margin-top: 0.5rem;
}

.tdah-toggle__label {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.tdah-toggle__desc {
  display: block;
  font-size: 0.78rem;
  color: var(--dust);
  margin-top: 0.1rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-switch__track {
  position: absolute;
  inset: 0;
  background: var(--line);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-switch__track::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-switch__track { background: var(--sage, #4a7c6b); }
.toggle-switch input:checked + .toggle-switch__track::before { transform: translateX(20px); }

.pref-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pref-item {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  background: var(--warm);
  border-radius: 3px;
  cursor: pointer;
}

.pref-item input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--rust);
  flex-shrink: 0;
}

.pref-item strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.pref-item span {
  font-size: 0.82rem;
  color: var(--dust);
  line-height: 1.4;
}

.pref-row {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.pref-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--rust);
}

/* ── Demo section ── */
.demo-section {
  padding: 5rem 2rem;
  background: var(--paper);
  color: var(--ink);
  border-top: 1px solid var(--line);
}

/* ── Video de conversación real (facade lite-youtube) ───────────────────── */
.video-section {
  padding: 5rem 2rem;
  background: var(--paper);
  color: var(--ink);
  border-top: 1px solid var(--line);
}
.video-facade,
.video-frame {
  display: block;
  width: 100%;
  max-width: 340px;          /* Short vertical: ancho tipo celular */
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  border: 0;
  border-radius: 14px;
}
.video-facade {
  position: relative;
  cursor: pointer;
  background-color: #000;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.video-facade::after {            /* leve oscurecido para que resalte el play */
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.12);
  transition: background 0.2s;
}
.video-facade:hover::after { background: rgba(0,0,0,0.04); }
.video-facade__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 50px;
  border: 0;
  border-radius: 12px;
  background: rgba(0,0,0,0.65);
  cursor: pointer;
  z-index: 1;
  transition: background 0.2s, transform 0.2s;
}
.video-facade__play::before {     /* triángulo ▶ */
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
}
.video-facade:hover .video-facade__play {
  background: var(--sage);
  transform: translate(-50%, -50%) scale(1.06);
}

.demo-header {
  max-width: 720px;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.demo-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.demo-subtitle {
  font-size: 1rem;
  color: #555;
}

.demo-container {
  max-width: 720px;
  margin: 0 auto;
}

.demo-suggestions {
  margin-bottom: 1.25rem;
}

.demo-suggestions__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--dust);
  margin-bottom: 0.65rem;
}

.demo-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.demo-btn {
  padding: 0.5rem 0.9rem;
  border-radius: 2px;
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}

.demo-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.demo-btn--honest {
  background: rgba(92,122,94,0.12);
  color: #3f5a41;
  border: 1px solid rgba(92,122,94,0.35);
}

.demo-btn--trap {
  background: rgba(201,74,31,0.08);
  color: var(--rust);
  border: 1px solid rgba(201,74,31,0.3);
}

.demo-chat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(25,25,23,0.07);
  padding: 1.25rem;
  min-height: 180px;
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 0.75rem;
}

.demo-bubble {
  max-width: 85%;
  padding: 0.8rem 1rem;
  border-radius: 3px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.demo-bubble--user {
  background: rgba(201,74,31,0.08);
  border: 1px solid rgba(201,74,31,0.18);
  border-left: 3px solid var(--rust);
  align-self: flex-end;
}

.demo-bubble--assistant {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--sage);
  align-self: flex-start;
  color: #444;
}

.demo-bubble p { margin: 0; }

.demo-counter {
  font-size: 0.78rem;
  color: var(--dust);
  text-align: right;
  margin-bottom: 0.75rem;
}

.demo-input-row {
  display: flex;
  gap: 0.6rem;
}

.demo-input-row input {
  flex: 1;
  padding: 0.7rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.92rem;
}

.demo-input-row input::placeholder { color: var(--dust); }

.demo-limit {
  text-align: center;
  padding: 1.5rem;
  background: rgba(92,122,94,0.08);
  border-radius: 8px;
  border: 1px solid rgba(92,122,94,0.25);
}

.demo-limit p { margin-bottom: 0.5rem; color: var(--ink); }

.email-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1rem 0;
}

.email-form input {
  padding: 0.75rem 1rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 2px;
  color: inherit;
  font-family: inherit;
  font-size: 0.95rem;
}

/* ══ CLASSROOM — two-panel layout ══════════════════════════════════════ */

body.classroom-page { overflow: hidden; }

/* Logo imagen */
.nav-logo-img {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Nav contextual del aula */
.classroom-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line, #eee);
  z-index: 200;
  gap: 1rem;
}
.classroom-nav__logo {
  font-size: 1rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.classroom-nav__student {
  font-weight: 600;
  font-size: .95rem;
  color: var(--ink);
  opacity: .75;
}
.classroom-nav__streak {
  font-size: .82rem;
  color: var(--brand, #5b4fcf);
  font-weight: 500;
  text-align: right;
  flex-shrink: 0;
}

.classroom-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100dvh - 58px);
  margin-top: 58px;
}

/* ── Sidebar ── */
.classroom-sidebar {
  border-right: 1px solid var(--line);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--warm);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--warm);
  z-index: 10;
}

.sidebar-title {
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-new-session {
  background: transparent;
  border: none;
  color: var(--dust);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 2px;
  transition: color 0.15s;
}
.sidebar-new-session:hover { color: var(--rust); }

/* ── Toolbar botonera ── */
.chat-toolbar {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 1rem 0;
  flex-shrink: 0;
}

.toolbar-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-family: inherit;
  color: var(--dust);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.toolbar-btn:hover { color: var(--ink); border-color: var(--ink); }
.toolbar-btn--active {
  background: var(--sage, #4a7c6b);
  color: #fff;
  border-color: var(--sage, #4a7c6b);
}
.toolbar-btn--active:hover { opacity: 0.85; }
.toolbar-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.sidebar-summary {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
}
.sidebar-summary__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sage);
  margin-bottom: 0.35rem;
}
.sidebar-summary p { line-height: 1.5; color: var(--ink); opacity: 0.85; }

.sidebar-panel {
  border-bottom: 1px solid var(--line);
}
.sidebar-panel summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 600;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-panel summary::after { content: '›'; color: var(--dust); transition: transform 0.2s; }
.sidebar-panel[open] summary::after { transform: rotate(90deg); }

/* Secciones de material */
.section-progress {
  padding: .5rem 1rem .25rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.section-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  padding: .2rem 0;
}
.section-item--done   { opacity: .55; }
.section-item--current { font-weight: 600; color: var(--brand, #5b4fcf); }
.section-item--pending { opacity: .45; }
.section-icon { font-size: .75rem; width: 1.1rem; text-align: center; flex-shrink: 0; }
.section-title { line-height: 1.3; }
.section-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem 1rem .6rem;
  gap: .5rem;
}
.section-counter {
  font-size: .78rem;
  color: var(--dust);
  white-space: nowrap;
}

.sidebar-form {
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.sidebar-form textarea, .sidebar-form input[type="file"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: inherit;
  font-size: 0.83rem;
  color: var(--ink);
  resize: vertical;
}
.sidebar-label { font-size: 0.75rem; font-weight: 600; color: var(--dust); }
.sidebar-hint { font-size: 0.75rem; color: var(--sage); }
.sidebar-form-actions { display: flex; gap: 0.4rem; margin-top: 0.25rem; }
.btn-sm { padding: 0.4rem 0.9rem !important; font-size: 0.8rem !important; }

/* Track 2: agenda del aula */
.agenda-list { list-style: none; margin: 0; padding: .25rem 1rem .7rem; display: flex; flex-direction: column; gap: .4rem; }
.agenda-item { display: flex; gap: .5rem; align-items: flex-start; padding: .45rem .55rem; border-radius: 6px; background: rgba(25,25,23,0.035); }
.agenda-item--due { background: rgba(201,74,31,0.10); border: 1px solid rgba(201,74,31,0.22); }
.agenda-item__icon { font-size: .95rem; line-height: 1.25; flex: none; }
.agenda-item__body { display: flex; flex-direction: column; min-width: 0; }
.agenda-item__title { font-size: .82rem; font-weight: 600; line-height: 1.25; color: var(--ink); }
.agenda-item__meta { font-size: .72rem; color: var(--dust); line-height: 1.3; }
.agenda-disclaimer { font-size: .68rem; color: var(--dust); line-height: 1.35; padding: .2rem 1rem .6rem; opacity: .85; }
.agenda-check { background: none; border: none; cursor: pointer; font-size: .9rem; line-height: 1.2; padding: 0; flex: none; color: var(--sage); }
.agenda-group { border-top: 1px solid var(--line); }
.agenda-group:first-of-type { border-top: none; }
.agenda-group__title { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--dust); padding: .5rem 1rem .1rem; }
.agenda-group__title--red { color: var(--rust); }
.agenda-group__title--yellow { color: #b07d12; }
.agenda-group__title--info { cursor: pointer; }
details.agenda-anuncios > summary { list-style: none; }
details.agenda-anuncios > summary::-webkit-details-marker { display: none; }
details.agenda-anuncios > summary::after { content: ' ›'; color: var(--dust); }
details.agenda-anuncios[open] > summary::after { content: ' ⌄'; }
.agenda-toolbar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .4rem 1rem .2rem; }
.agenda-mode-btn { background: rgba(92,122,94,0.12); border: 1px solid rgba(92,122,94,0.3); color: #3f5a41; border-radius: 4px; font-size: .76rem; padding: .28rem .6rem; cursor: pointer; }
.agenda-mode-btn:hover { background: rgba(92,122,94,0.2); }
/* Modo foco: solo lo urgente */
body.focus-mode .agenda-group--upcoming,
body.focus-mode .agenda-anuncios { display: none; }
.agenda-item--done { opacity: .5; }
.agenda-item--done .agenda-item__title { text-decoration: line-through; }

/* Track 2: banner urgente arriba del chat */
.aula-banner { display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; background: rgba(201,74,31,0.10); border-bottom: 1px solid rgba(201,74,31,0.25); color: var(--ink); font-size: .85rem; }
.aula-banner__icon { flex: none; }
.aula-banner__text { flex: 1; min-width: 0; }
.aula-banner__text strong { color: var(--rust); margin-right: .3rem; }
.aula-banner__close { background: none; border: none; cursor: pointer; color: var(--dust); font-size: .9rem; flex: none; }
.aula-banner__close:hover { color: var(--ink); }

/* Track 2: calendario del aula en el dashboard del padre */
.dash-calendar { margin: 1.5rem 0; }
.dash-calendar__title { font-size: 1.05rem; margin-bottom: .6rem; }
.dash-calendar__title .dim { font-size: .8rem; font-weight: 400; color: var(--dust); }
.dash-calendar__list { display: flex; flex-direction: column; gap: .5rem; }
.dash-cal-day { display: grid; grid-template-columns: 70px 1fr; gap: .8rem; align-items: start; padding: .55rem .8rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.dash-cal-day__date { font-weight: 600; font-size: .85rem; color: var(--rust); }
.dash-cal-day__events { display: flex; flex-direction: column; gap: .3rem; }
.dash-cal-event { font-size: .88rem; }
.dash-cal-event .dim { color: var(--dust); font-size: .78rem; margin-left: .4rem; }
.dash-calendar__note { font-size: .72rem; color: var(--dust); margin-top: .5rem; }

/* Track 2: mini-calendario en el sidebar del alumno */
.cal-mini { padding: .25rem 1rem .7rem; display: flex; flex-direction: column; gap: .45rem; }
.cal-mini__day { display: grid; grid-template-columns: 48px 1fr; gap: .5rem; align-items: start; }
.cal-mini__date { font-size: .78rem; font-weight: 700; color: var(--rust); padding-top: .05rem; }
.cal-mini__items { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.cal-mini__item { font-size: .8rem; line-height: 1.25; }
.cal-mini__item--done { opacity: .5; text-decoration: line-through; }
.cal-mini__course { display: block; font-size: .7rem; color: var(--dust); }

/* ── Mochila: selector de materia ── */
.sidebar-mochila {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.mochila-select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.mochila-new { font-size: 0.8rem; }
.mochila-new > summary {
  cursor: pointer;
  color: var(--sage, #4a7c6b);
  list-style: none;
  padding: 0.2rem 0;
}
.mochila-new > summary::-webkit-details-marker { display: none; }
.mochila-new input[type="text"] {
  width: 100%;
  padding: 0.5rem 0.7rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.85rem;
}

/* ── Chat area ── */
.classroom-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  position: relative;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* ── Message bubbles ── */
.msg {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  max-width: 78%;
}

.msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg--assistant { align-self: flex-start; }

.msg__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}
.msg__avatar--user      { background: var(--rust); color: #fff; }
.msg__avatar--assistant { background: var(--sage); color: #fff; }

.msg__body { display: flex; flex-direction: column; gap: 0.2rem; }

.msg--user .msg__body { align-items: flex-end; }

.msg__label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dust);
}

.msg__bubble {
  padding: 0.75rem 1rem;
  border-radius: 3px;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.msg--user .msg__bubble {
  background: var(--rust);
  color: #fff;
  border-radius: 12px 3px 12px 12px;
}

.msg--assistant .msg__bubble {
  background: var(--warm);
  color: var(--ink);
  border-radius: 3px 12px 12px 12px;
  border: 1px solid var(--line);
}

/* ── Typing indicator ── */
.typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.6rem 0.9rem;
}
.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dust);
  animation: typing-bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%            { transform: translateY(-6px); opacity: 1; }
}

/* Avatar del tutor animado mientras piensa */
#typing-indicator .msg__avatar--assistant {
  animation: tutor-thinking 1.8s ease-in-out infinite;
}
@keyframes tutor-thinking {
  0%, 100% { background: var(--sage);      box-shadow: 0 0 0 0 transparent; }
  50%       { background: #C1440E;          box-shadow: 0 0 0 5px rgba(193,68,14,.15); }
}

/* ── Input bar ── */
.chat-input-bar {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  background: var(--warm);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
}

.chat-input-row textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.93rem;
  color: var(--ink);
  resize: none;
  max-height: 160px;
  line-height: 1.5;
  padding: 0.3rem 0;
}

.chat-send-btn {
  background: var(--rust);
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.chat-send-btn:hover { opacity: 0.85; }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Drag & drop overlay */
.drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(91, 79, 207, 0.12);
  border: 2.5px dashed var(--brand, #5b4fcf);
  border-radius: 12px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  backdrop-filter: blur(2px);
}
.drop-overlay__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  color: var(--brand, #5b4fcf);
  font-weight: 600;
  font-size: 1.1rem;
}
.drop-overlay__inner svg { opacity: .85; }

/* Botón adjuntar PDF */
.chat-attach-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--dust, #aaa);
  cursor: pointer;
  padding: .4rem .45rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: color .15s, background .15s;
}
.chat-attach-btn:hover { color: var(--ink); background: var(--line, #eee); }
.chat-attach-btn:disabled { opacity: .35; cursor: not-allowed; }

/* Burbuja de carga de PDF */
.upload-thinking {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.upload-icon { font-size: 1.3rem; }
.upload-filename {
  font-size: .75rem;
  opacity: .6;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.upload-msg {
  font-size: .9rem;
  transition: opacity .3s ease;
}

.chat-hint {
  font-size: 0.72rem;
  color: var(--dust);
  margin-top: 0.35rem;
  padding-left: 0.25rem;
}

/* ── Responsive: mobile stack ── */
@media (max-width: 640px) {
  body.classroom-page { overflow: auto; }
  .classroom-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .classroom-chat { height: 70dvh; }
}

/* ── Landing en mobile: fixes de overflow y legibilidad (≤600px) ──────────────
   Corrige: scroll horizontal (watermark + fila del demo), titular que desborda,
   botón "Enviar" cortado, "Acceso familiar" partido en 2 líneas y el botón
   flotante "Probalo en vivo" tapando el hero. */
@media (max-width: 600px) {
  /* Mata cualquier scroll horizontal residual (watermark, etc.). nav es fixed,
     no sticky, así que no se ve afectado. */
  html, body { overflow-x: hidden; }

  /* Titular: que escale por debajo de 51px y no desborde en pantallas chicas */
  .hero-headline { font-size: clamp(2.5rem, 9vw, 3.2rem); }

  /* Watermark "pensar": que no genere ancho extra */
  .hero-watermark { right: 0; font-size: 30vw; }

  /* Nav: links abreviados ("Estudiante" / "Familiar") para que entren sin cortarse */
  .nav-btn-student, .nav-btn-family { white-space: nowrap; font-size: .78rem; }
  .nav-txt-full { display: none; }
  .nav-txt-compact { display: inline; }

  /* Demo: menos padding lateral + fila que no desborda (el botón quedaba cortado) */
  .demo-section { padding: 3.5rem 1.25rem; }
  .video-section { padding: 3.5rem 1.25rem; }
  .demo-input-row { gap: 0.5rem; }
  .demo-input-row input { min-width: 0; }   /* permite que el input encoja en flex */
  .demo-input-row .btn-main { flex: 0 0 auto; padding: 1rem 1.2rem; white-space: nowrap; }

  /* Botón flotante "Probalo en vivo": de barra vertical lateral (tapaba el H1)
     a píldora abajo a la derecha, alcanzable con el pulgar */
  .floating-demo {
    top: auto; bottom: 1rem; right: 1rem;
    transform: none;
    writing-mode: horizontal-tb;
    border-radius: 999px;
    padding: 0.7rem 1.1rem;
    font-size: 0.78rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  }
}
