/* =====================================================================
   Consciencia · Escuela de Liderazgo Espiritual (ELE)
   Paleta de marca ELE 2025 · Montserrat (títulos) + Inter (texto)
   ===================================================================== */
:root {
  /* Marca */
  --paper: #fafbf6;
  --linen: #f1eee6;
  --sand: #beb5a7;
  --stone: #7a7a72;
  --taupe: #897f73;
  --forest: #18251b;
  --moss: #373c29;
  --olive: #6b692e;
  --bronze: #725918;
  --clay: #c29379;
  --terracotta: #c67e63;

  /* Roles */
  --bg: var(--paper);
  --surface: #ffffff;
  --surface-2: var(--linen);
  --ink: var(--forest);
  --ink-soft: #5c584f;
  --line: #ddd7cb;
  --accent: var(--olive);
  --accent-ink: #fafbf6;
  --strong: var(--forest);
  --strong-ink: #fafbf6;
  --ok: #4f5d2a;
  --ok-soft: #e8ead7;
  --warn: #8a4a2e;
  --warn-soft: #f5e3da;
  --danger: #9b3b26;

  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Montserrat', 'Inter', system-ui, sans-serif;
  --r: 6px;
  color-scheme: light;
}


* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-weight: 300; font-size: clamp(1.75rem, 4.2vw, 2.6rem); text-transform: uppercase; letter-spacing: .04em; }
h2, h3 { font-weight: 500; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--strong); color: var(--strong-ink); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.meta { color: var(--ink-soft); font-size: .86rem; }
.grow { flex: 1; min-width: 0; }
.count { font-family: var(--sans); font-size: 1rem; color: var(--ink-soft); font-weight: 400; letter-spacing: 0; }

/* Títulos de bloque: la firma del cuaderno (mayúsculas finas con barra) */
.block-title, .section-title {
  font-family: var(--display); font-weight: 400; font-size: 1.05rem;
  text-transform: uppercase; letter-spacing: .09em; color: var(--ink);
  margin: 0 0 18px;
}
.block-title::before, .section-title::before {
  content: ''; display: block; width: 36px; height: 3px; background: var(--sand); margin-bottom: 12px;
}
.sub-title { font-family: var(--display); font-weight: 500; font-size: 1rem; margin: 24px 0 10px; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 10px max(20px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 40px; height: 40px; border-radius: 50%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-course { font-family: var(--display); font-weight: 500; text-transform: uppercase; letter-spacing: .12em; font-size: .95rem; }
.brand-school { font-size: .74rem; color: var(--ink-soft); }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav a, .nav-logout {
  position: relative; padding: 8px 12px; color: var(--ink-soft); text-decoration: none;
  font: 500 .93rem var(--sans); background: none; border: 0; cursor: pointer; border-radius: var(--r);
}
.nav a:hover, .nav-logout:hover { color: var(--ink); background: var(--surface-2); }
.nav a.active { color: var(--ink); }
.nav a.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: var(--accent); }
.badge {
  display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; margin-left: 6px;
  border-radius: 10px; background: var(--terracotta); color: #fff; font-size: .72rem; font-weight: 600;
}
.menu-btn { display: none; }

@media (max-width: 980px) {
  .menu-btn {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    margin-left: auto; width: 44px; height: 44px; padding: 0 11px;
    background: none; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer;
  }
  .menu-btn span { height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .topbar.open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .topbar.open .menu-btn span:nth-child(2) { opacity: 0; }
  .topbar.open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .topbar { flex-wrap: wrap; gap: 0; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding: 10px 0 4px; }
  .topbar.open .nav { display: flex; }
  .nav a, .nav-logout { padding: 13px 12px; text-align: left; font-size: 1.02rem; }
  .nav a.active::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; }
}

/* ---------- Estructura ---------- */
.app { min-height: calc(100vh - 62px); outline: none; }
.page { max-width: 1120px; margin: 0 auto; padding: 36px 20px 80px; }
.page.narrow { max-width: 620px; }
.page.narrow-wide { max-width: 820px; }
.page.page-wide { max-width: none; }
.page-head { margin-bottom: 28px; }
.page-head h1 { margin-bottom: 6px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; }
.back { display: inline-block; margin-bottom: 18px; color: inherit; opacity: .8; text-decoration: none; font-size: .92rem; }
.back::before { content: '‹ '; }
.back:hover { opacity: 1; text-decoration: underline; }
.empty { padding: 44px 24px; text-align: center; color: var(--ink-soft); border: 1px dashed var(--line); border-radius: var(--r); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; margin-bottom: 22px; }
.lead { font-size: 1.12rem; font-weight: 300; line-height: 1.6; max-width: 66ch; }
.notice { padding: 14px 16px; border-radius: var(--r); background: var(--ok-soft); color: var(--ok); font-weight: 500; }
.notice-soft { padding: 10px 14px; border-left: 3px solid var(--sand); background: var(--surface-2); font-size: .94rem; }

/* ---------- Botones y formularios ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; min-height: 44px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 .93rem var(--sans); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--ink-soft); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--strong); color: var(--strong-ink); border-color: var(--strong); }
.btn-primary:hover { background: color-mix(in srgb, var(--strong) 85%, var(--olive)); border-color: transparent; }
.btn-light { background: var(--paper); color: var(--forest); border-color: var(--paper); }
.btn-light:hover { background: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: transparent; }
.btn-sm { padding: 6px 14px; min-height: 36px; font-size: .86rem; }
.btn-block { width: 100%; }
.link-btn {
  background: none; border: 0; padding: 4px 0; color: var(--accent); font: 600 .9rem var(--sans);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; align-self: flex-start;
}
.icon-btn { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; color: var(--ink-soft); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--danger); }

.form { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: .92rem; }
label.check { flex-direction: row; align-items: center; gap: 10px; }
label.mini { font-size: .76rem; color: var(--ink-soft); gap: 3px; }
input, textarea, select {
  width: 100%; padding: 11px 13px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 400 1rem var(--sans);
}
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--olive); }
input[type="file"] { padding: 9px; background: var(--surface-2); }
textarea { resize: vertical; line-height: 1.6; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 3px color-mix(in srgb, var(--olive) 22%, transparent); }
.form-error { color: var(--danger); margin: 0; font-size: .92rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end; }
@media (max-width: 700px) { .two, .three { grid-template-columns: 1fr; } }

/* ---------- Chips de estado ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 3px 10px; border-radius: 4px; font-size: .78rem; font-weight: 600;
  background: var(--surface-2); color: var(--ink-soft); text-decoration: none;
}
.chip-pending { background: transparent; border: 1px solid var(--line); }
.chip-entregada, .chip-q-open { background: var(--warn-soft); color: var(--warn); }
.chip-revisada, .chip-q-answered { background: var(--ok-soft); color: var(--ok); }
.chip-rehacer { background: var(--terracotta); color: #fff; }
.chip-draft { background: var(--clay); color: var(--forest); }
.chip-new { box-shadow: 0 0 0 2px var(--terracotta); }

/* ---------- Acceso ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); }
.auth-art { position: relative; overflow: hidden; background: var(--forest); }
.auth-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; opacity: .9; }
.auth-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(24, 37, 27, 0) 50%, rgba(24, 37, 27, .9)); }
.auth-brand { position: absolute; left: 40px; bottom: 36px; z-index: 1; display: flex; align-items: center; gap: 14px; color: var(--paper); }
.auth-brand img { width: 56px; height: 56px; border-radius: 50%; }
.auth-school { margin: 0; font-size: .9rem; opacity: .85; }
.auth-course { margin: 0; font-family: var(--display); font-weight: 300; text-transform: uppercase; letter-spacing: .14em; font-size: 1.6rem; }
.auth-card { position: relative; align-self: center; width: 100%; max-width: 440px; margin: 0 auto; padding: 64px 28px 48px; }
.auth-card h1 { font-size: 1.9rem; }
.auth-links { margin: 14px 0 0; font-size: .95rem; text-align: center; color: var(--ink-soft); }
.lang-switch { position: absolute; top: 20px; right: 28px; display: flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.lang-switch button { border: 0; background: none; padding: 6px 12px; font: 600 .8rem var(--sans); color: var(--ink-soft); cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--strong); color: var(--strong-ink); }
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: 240px auto; }
  .auth-cover { object-position: center 94%; }
  .auth-art::after { background: linear-gradient(180deg, rgba(24, 37, 27, .1) 20%, rgba(24, 37, 27, .92)); }
  .auth-brand { left: 20px; bottom: 18px; }
  .auth-card { padding: 56px 20px 48px; }
}

/* ---------- Inicio: esta semana ---------- */
.week {
  position: relative; color: var(--paper);
  background: var(--forest) var(--banner) center / cover no-repeat;
}
.week::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(24, 37, 27, .94) 0%, rgba(24, 37, 27, .82) 48%, rgba(24, 37, 27, .55) 100%);
}
.week-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; padding-top: 56px; padding-bottom: 56px; align-items: start; }
.week-label { font-size: .92rem; color: var(--clay); margin: 0 0 22px; font-weight: 500; }
.week-num { font-family: var(--display); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; font-size: .9rem; margin: 0 0 6px; opacity: .85; }
.week h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); margin-bottom: 16px; }
.week-desc { max-width: 56ch; opacity: .88; font-weight: 300; font-size: 1.05rem; margin-bottom: 26px; }
.week-side { background: rgba(250, 251, 246, .96); color: var(--forest); border-radius: var(--r); padding: 22px; }
.week-side h3 { font-family: var(--display); font-weight: 500; font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.week-side .muted { color: #5c584f; }
.week-side .tasks .task { background: transparent; border-color: #ddd7cb; color: var(--forest); }
.week-side .task-meta { color: #5c584f; }
.week-stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.week-stats a { display: block; padding: 14px 16px; border: 1px solid #ddd7cb; border-radius: var(--r); color: var(--forest); text-decoration: none; font-weight: 600; }
.week-stats a:hover { border-color: var(--olive); }
@media (max-width: 820px) {
  .week-inner { grid-template-columns: 1fr; gap: 28px; padding-top: 40px; padding-bottom: 32px; }
  .week::before { background: linear-gradient(180deg, rgba(24, 37, 27, .9), rgba(24, 37, 27, .82)); }
}

/* Estante de cuadernos: las 8 clases */
.shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; }
@media (max-width: 900px) { .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) { .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; } }
.book { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
.book-cover {
  position: relative; display: block; aspect-ratio: 910 / 1287; overflow: hidden; border-radius: 3px;
  background: var(--forest); margin-bottom: 10px;
  box-shadow: 0 1px 0 var(--line), 6px 6px 0 -1px var(--surface-2), 6px 6px 0 0 var(--line);
  transition: transform .2s ease;
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-cover .chip { position: absolute; top: 10px; left: 10px; }
.book:hover .book-cover { transform: translateY(-3px); }
.book.is-current .book-cover { outline: 3px solid var(--clay); outline-offset: 3px; }
.book-num { font-family: var(--display); font-weight: 500; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.book-title { font-weight: 600; line-height: 1.35; }
.book-progress { font-size: .84rem; color: var(--accent); }
.home .section-title { margin-top: 8px; margin-bottom: 26px; }
@media (prefers-reduced-motion: reduce) { .book-cover { transition: none; } .book:hover .book-cover { transform: none; } }

/* ---------- Encabezado con franja de imagen ---------- */
.lesson-hero {
  position: relative; color: var(--paper);
  background: var(--forest) var(--banner) center / cover no-repeat;
}
.lesson-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(24, 37, 27, .35), rgba(24, 37, 27, .88)); }
.lesson-hero .page { position: relative; padding-top: 34px; padding-bottom: 34px; min-height: 230px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; }
.lesson-hero h1 { max-width: 24ch; margin-bottom: 14px; }
.hero-num { font-family: var(--display); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; font-size: .88rem; margin: 0 0 6px; opacity: .9; }
.hero-sub { margin: 0; opacity: .85; }
.lesson-hero .back { margin-bottom: auto; padding-bottom: 28px; }

/* ---------- Clase ---------- */
.lesson-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 56px; align-items: start; }
.toc { position: sticky; top: 92px; font-size: .92rem; }
.toc-title { font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; color: var(--ink-soft); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; color: var(--ink-soft); text-decoration: none; margin-left: -1px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); border-left-color: var(--olive); }
.lesson-main { max-width: 760px; }
.block { margin-bottom: 64px; }
@media (max-width: 900px) {
  .lesson-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { min-width: 0; }
  .toc { position: static; margin-bottom: 28px; }
  .toc ol { display: flex; gap: 8px; overflow-x: auto; border: 0; padding-bottom: 4px; }
  .toc li { flex: none; }
  .toc a { border: 1px solid var(--line); border-radius: 4px; padding: 6px 12px; margin: 0; white-space: nowrap; }
  .toc-title { display: none; }
}

.video { aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--forest); }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-empty { height: 100%; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--sand); background: var(--forest) url('/img/banner-programa.webp') center / cover; position: relative; }
.video-empty::before { content: ''; position: absolute; inset: 0; background: rgba(24, 37, 27, .78); }
.video-empty p { position: relative; margin: 0; }
.notebook { display: flex; align-items: center; gap: 20px; margin-top: 22px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.notebook-cover { width: 64px; aspect-ratio: 910 / 1287; object-fit: cover; border-radius: 2px; flex: none; }
.notebook .block-title { margin-bottom: 10px; font-size: .92rem; }
.notebook .block-title::before { display: none; }

.objectives { padding-left: 1.2em; margin: 0; }
.objectives li { margin-bottom: 10px; padding-left: 4px; }

/* Agenda: es una secuencia, así que va numerada */
.agenda { list-style: none; margin: 0; padding: 0; counter-reset: ag; }
.agenda li { counter-increment: ag; display: grid; grid-template-columns: 44px 1fr; column-gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.agenda li:last-child { border-bottom: 1px solid var(--line); }
.agenda li::before { content: counter(ag, decimal-leading-zero); grid-row: span 2; font-family: var(--display); font-weight: 300; font-size: 1.3rem; color: var(--taupe); line-height: 1.2; }
.agenda strong { font-weight: 600; }
.agenda span { color: var(--ink-soft); font-size: .94rem; }

/* Práctica espiritual: panel profundo, como las páginas de práctica del cuaderno */
.practice { background: var(--forest); color: var(--paper); border-radius: var(--r); padding: 32px; }
.practice .block-title { color: var(--paper); }
.practice .block-title::before { background: var(--clay); }
.practice-name { font-family: var(--display); font-weight: 300; font-size: 1.6rem; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 4px; }
.practice-time { color: var(--clay); font-size: .92rem; margin-bottom: 18px; }
.steps { list-style: none; margin: 22px 0 0; padding: 0; counter-reset: st; display: grid; gap: 12px; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; padding: 14px; border: 1px solid rgba(250, 251, 246, .18); border-radius: var(--r); }
.steps li::before { content: counter(st); grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--clay); color: var(--clay); font-family: var(--display); }
.steps span { opacity: .86; font-size: .95rem; }

.readings, .reflection { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.readings li, .reflection li { display: flex; flex-direction: column; gap: 4px; padding-left: 16px; border-left: 3px solid var(--sand); }
.readings span, .reflection span { color: var(--ink-soft); font-size: .95rem; }
.reflection { counter-reset: rf; }

.materials { list-style: none; margin: 0 0 14px; padding: 0; }
.materials li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.file-name { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.file-name small { display: block; font-weight: 400; }

/* ---------- Tareas ---------- */
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.task {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink); text-decoration: none;
}
.task:hover { border-color: var(--olive); }
.task.unseen { box-shadow: inset 3px 0 0 var(--terracotta); }
.task-mark { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--sand); }
.st-entregada .task-mark { border-color: var(--olive); background: radial-gradient(circle, var(--olive) 0 4px, transparent 5px); }
.st-revisada .task-mark { border-color: var(--olive); background: var(--olive); box-shadow: inset 0 0 0 3px var(--surface); }
.st-rehacer .task-mark { border-color: var(--terracotta); background: var(--terracotta); }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.task-title { font-weight: 600; line-height: 1.35; }
.task-meta { font-size: .86rem; color: var(--ink-soft); }
.task-group { margin-bottom: 40px; }
.group-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-weight: 400; font-size: 1.05rem; margin-bottom: 14px; }
.group-title a { font-family: var(--display); font-weight: 500; text-transform: uppercase; letter-spacing: .1em; font-size: .85rem; color: var(--accent); text-decoration: none; }

.h1-task { font-size: clamp(1.4rem, 3.4vw, 2rem); }
.prompt { padding: 22px 24px; background: var(--surface-2); border-radius: var(--r); margin-bottom: 28px; }
.prompt p:last-child, .prompt ul:last-child, .prompt ol:last-child { margin-bottom: 0; }
.prompt ul, .prompt ol { margin: 0 0 1em; padding-left: 1.3em; }
.prompt-details { margin-bottom: 20px; }
.prompt-details summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
.answer { display: flex; flex-direction: column; gap: 10px; }
.answer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.answer-head .block-title { margin: 0; }
.answer textarea { min-height: 320px; font-size: 1.02rem; }
.counter { margin: 0; text-align: right; }
.file-field { margin-top: 6px; }
.file-line { font-size: .94rem; }
.answer-locked { margin-bottom: 28px; }
.answer-text, .answer-locked .msg-text { padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.feedback { padding: 22px 24px; border-radius: var(--r); margin-bottom: 28px; border: 1px solid var(--olive); background: var(--ok-soft); }
.feedback.st-rehacer { border-color: var(--terracotta); background: var(--warn-soft); }
.feedback .block-title::before { display: none; }
.feedback .block-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.score { font-family: var(--sans); text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 1rem; }
.review { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.review-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.review-row label { width: 180px; }
.review-row .btn { margin-left: auto; }

.roster { list-style: none; margin: 0; padding: 0; }
.roster li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }

.sublist, .qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.subitem, .qitem {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink); text-decoration: none;
}
.subitem:hover, .qitem:hover { border-color: var(--olive); }
.subitem.unseen, .qitem.unseen { box-shadow: inset 3px 0 0 var(--terracotta); }
.sub-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sub-task { font-size: .9rem; color: var(--accent); font-weight: 500; }
.sub-preview, .qtext { color: var(--ink-soft); font-size: .95rem; overflow-wrap: anywhere; }

.tabs { display: inline-flex; gap: 4px; margin-bottom: 22px; border-bottom: 1px solid var(--line); width: 100%; }
.tabs button { border: 0; background: none; padding: 10px 14px; font: 600 .92rem var(--sans); color: var(--ink-soft); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--olive); }

/* ---------- Libro de calificaciones ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.gb-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.gb { border-collapse: separate; border-spacing: 0; font-size: .86rem; min-width: 100%; }
.gb th, .gb td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.gb thead th { background: var(--surface-2); font-weight: 600; position: sticky; top: 0; }
.gb .gb-class { font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; border-left: 1px solid var(--line); }
.gb .gb-sub { font-weight: 500; font-size: .74rem; color: var(--ink-soft); }
.gb .gb-name { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; min-width: 190px; font-weight: 600; border-right: 1px solid var(--line); }
.gb thead .gb-name { background: var(--surface-2); z-index: 2; }
.gb .gb-name small { display: block; font-weight: 400; color: var(--ink-soft); }
.gb-att { border-left: 1px solid var(--line); }
.att { width: 30px; height: 30px; border-radius: 4px; border: 1px solid var(--line); background: none; font: 600 .82rem var(--sans); color: var(--ink-soft); cursor: pointer; }
.att-presente { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.att-ausente { background: var(--terracotta); color: #fff; border-color: transparent; }
.att-justificada { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.att-grabacion { background: var(--surface-2); color: var(--ink); }
.sc { display: inline-block; min-width: 30px; padding: 3px 6px; border-radius: 4px; text-decoration: none; font-weight: 600; color: var(--ink); }
.sc-entregada { background: var(--warn-soft); color: var(--warn); }
.sc-revisada { background: var(--ok-soft); color: var(--ok); }
.sc-rehacer { background: var(--terracotta); color: #fff; }
.gb-avg, .gb-letter { font-weight: 600; }
.gb-letter.below { color: var(--danger); }

/* ---------- Conversaciones ---------- */
.ask { display: flex; flex-direction: column; gap: 10px; padding: 24px; border: 1px solid var(--line); border-top: 3px solid var(--clay); border-radius: var(--r); background: var(--surface); margin-bottom: 26px; }
.ask .block-title::before { display: none; }
.ask .block-title, .ask p { margin: 0; }
.thread { max-width: 820px; }
.thread-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0; }
.messages { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.msg { max-width: 88%; padding: 14px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.msg.from-staff { background: var(--surface-2); border-color: transparent; }
.msg.mine { align-self: flex-end; border-bottom-right-radius: 3px; }
.msg:not(.mine) { align-self: flex-start; border-bottom-left-radius: 3px; }
@media (max-width: 600px) { .msg { max-width: 100%; } }
.msg header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: .9rem; }
.msg .role { font-size: .78rem; color: var(--bronze); font-weight: 600; }
.msg time { color: var(--ink-soft); font-size: .82rem; }
.msg-text { overflow-wrap: anywhere; }
.msg-text p:last-child { margin-bottom: 0; }
.translated-now { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.orig { margin-top: 10px; font-size: .9rem; }
.orig summary { cursor: pointer; color: var(--ink-soft); font-weight: 500; }
.orig-text { margin-top: 6px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); color: var(--ink-soft); overflow-wrap: anywhere; }
.orig-text p:last-child { margin-bottom: 0; }
.reply { display: flex; flex-direction: column; gap: 10px; }
.thread-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ---------- Programa ---------- */
.prose-page { max-width: 860px; }
.prose-page .section-title { margin-top: 48px; }
.motto { margin: 28px 0 0; padding: 18px 22px; border-left: 3px solid var(--clay); background: var(--surface-2); font-style: italic; }
.weeks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.weeks a { display: grid; grid-template-columns: 52px 1fr; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 500; }
.weeks a:hover { color: var(--accent); }
.weeks-n { font-family: var(--display); font-weight: 300; font-size: 1.5rem; color: var(--taupe); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.plain-ol, .plain-ul { padding-left: 1.2em; margin: 0 0 1em; }
.plain-ol li, .plain-ul li { margin-bottom: 6px; }
.commit { margin: 0; display: grid; gap: 4px; }
.commit dt { font-weight: 600; margin-top: 12px; }
.commit dd { margin: 0; color: var(--ink-soft); }
.grading { border-collapse: collapse; width: 100%; max-width: 360px; }
.grading td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.grading td:first-child { font-variant-numeric: tabular-nums; color: var(--ink-soft); }

/* ---------- Administración ---------- */
.admin-list, .user-list { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 8px; }
.admin-list li, .user-list li {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.admin-list .meta, .user-list .meta { display: block; }
.pos { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--sand); font-family: var(--display); flex: none; }
.user-list select { width: auto; padding: 7px 9px; font-size: .9rem; }
@media (max-width: 700px) {
  .user-list li { flex-wrap: wrap; }
  .user-list .grow { flex-basis: 100%; }
  .user-list label.mini { flex: 1; }
  .user-list select { width: 100%; }
}
.search { margin-bottom: 14px; }
.sub-form { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r); background: var(--surface-2); }
.sub-form .sub-title { margin: 0; }
.sub-form .btn { align-self: flex-start; }
.ytpreview img { width: 200px; border-radius: 4px; }
.task-details { border-top: 1px solid var(--line); }
.task-details summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.task-edit { display: flex; flex-direction: column; gap: 12px; padding-bottom: 18px; }
.bulk-log { list-style: none; padding: 0; margin: 10px 0 0; }
.bulk-log .error { color: var(--danger); }
#bulkForm { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Avisos y carga ---------- */
.toasts { position: fixed; z-index: 50; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { padding: 12px 18px; border-radius: var(--r); background: var(--forest); color: var(--paper); font-weight: 500; box-shadow: 0 8px 24px rgba(24, 37, 27, .25); animation: rise .25s ease-out; transition: opacity .4s, transform .4s; }
.toast.clickable { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.toast-ok { background: var(--olive); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.center-load { min-height: 50vh; display: grid; place-items: center; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--olive); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .toast, .spinner { animation-duration: 0s; } .spinner { animation: spin 2s linear infinite; } }
