/* ============================================================
   El Cuaderno de Diego — hoja de estilos
   Paleta: paper cálido · tinta verde-petróleo · acento coral
   Tipos: Fraunces (display) · Figtree (texto) · Spline Sans Mono (datos)
   ============================================================ */

/* ---------- Tokens: tema claro (base) ---------- */
:root {
  --paper:      #FAF7F2;
  --surface:    #FFFFFF;
  --surface-2:  #F3EEE4;
  --ink:        #17323A;
  --ink-soft:   #4B5D62;
  --muted:      #7B8A8C;
  --line:       #E6DFD1;
  --line-soft:  #EFEAE0;

  --primary:    #0E7C86;
  --primary-ink:#0A5B63;
  --primary-wash:#E2F0F0;
  --accent:     #E4572E;
  --accent-wash:#FBE7DE;
  --gold:       #D99A28;

  --good:       #2C8A57;
  --good-wash:  #E1F1E7;
  --warn:       #B9791A;
  --warn-wash:  #F7ECD6;
  --bad:        #C0392B;
  --bad-wash:   #F7E1DE;

  --shadow:     0 1px 2px rgba(23,50,58,.06), 0 8px 24px rgba(23,50,58,.07);
  --shadow-sm:  0 1px 2px rgba(23,50,58,.06);
  --radius:     16px;
  --radius-sm:  10px;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ---------- Tokens: tema oscuro por sistema ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #0E1A1C;
    --surface:    #142629;
    --surface-2:  #1B3236;
    --ink:        #ECEAE2;
    --ink-soft:   #AFC2C3;
    --muted:      #7E9092;
    --line:       #22393D;
    --line-soft:  #1B3236;

    --primary:    #35B3AE;
    --primary-ink:#7FD6D0;
    --primary-wash:#123437;
    --accent:     #F0805A;
    --accent-wash:#3A241C;
    --gold:       #E6B450;

    --good:       #48B27C;
    --good-wash:  #12312353;
    --warn:       #D9A441;
    --warn-wash:  #35291259;
    --bad:        #E76A5C;
    --bad-wash:   #3A1E1C;

    --shadow:     0 1px 2px rgba(0,0,0,.3), 0 12px 30px rgba(0,0,0,.35);
    --shadow-sm:  0 1px 2px rgba(0,0,0,.3);
  }
}

/* ---------- Tokens: tema oscuro forzado ---------- */
:root[data-theme="dark"] {
  --paper:      #0E1A1C;
  --surface:    #142629;
  --surface-2:  #1B3236;
  --ink:        #ECEAE2;
  --ink-soft:   #AFC2C3;
  --muted:      #7E9092;
  --line:       #22393D;
  --line-soft:  #1B3236;

  --primary:    #35B3AE;
  --primary-ink:#7FD6D0;
  --primary-wash:#123437;
  --accent:     #F0805A;
  --accent-wash:#3A241C;
  --gold:       #E6B450;

  --good:       #48B27C;
  --good-wash:  #123123;
  --warn:       #D9A441;
  --warn-wash:  #352912;
  --bad:        #E76A5C;
  --bad-wash:   #3A1E1C;

  --shadow:     0 1px 2px rgba(0,0,0,.3), 0 12px 30px rgba(0,0,0,.35);
  --shadow-sm:  0 1px 2px rgba(0,0,0,.3);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; color: var(--ink); }
p { margin: 0; }
a { color: var(--primary-ink); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.view:focus { outline: none; }
.skip-link { position: fixed; left: 10px; top: -60px; z-index: 400; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; text-decoration: none; transition: top .15s; }
.skip-link:focus { top: 10px; }

/* Acceso privado (login gate) */
.login-gate { position: fixed; inset: 0; z-index: 500; background: linear-gradient(150deg, var(--primary), var(--primary-ink)); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-gate.hidden { display: none; }
.login-box { background: var(--surface); border-radius: 20px; padding: 34px 28px; width: min(360px, 100%); box-shadow: var(--shadow); text-align: center; }
.login-logo { width: 64px; height: 64px; margin-bottom: 12px; }
.login-box h1 { font-family: var(--font-display); font-size: 22px; margin-bottom: 2px; }
.login-sub { color: var(--muted); font-size: 12px; margin-bottom: 22px; text-transform: uppercase; letter-spacing: .1em; }
.login-box .field { text-align: left; }
.login-box .btn-block { margin-top: 6px; }
.login-err { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 10px; }

/* ---------- Layout general ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100dvh; }

.sidebar {
  position: sticky; top: 0; height: 100dvh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 14px; }
.brand-mark {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
}
.brand-mark img {
  width: 100%; height: 100%; display: block; border-radius: 50%;
  filter: drop-shadow(0 2px 5px rgba(23,50,58,.22));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.brand-text span { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 11px;
  border: none; background: transparent; color: var(--ink-soft);
  font-size: 14.5px; font-weight: 500; text-align: left; width: 100%;
  transition: background .12s, color .12s;
}
.nav-item svg { width: 20px; height: 20px; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--primary-wash); color: var(--primary-ink); font-weight: 600; }
.nav-item.active svg { color: var(--primary); }

.sidebar-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 8px; border-top: 1px solid var(--line-soft); }
.foot-note { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; display: inline-flex; align-items: center; gap: 6px; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.sync-dot.off { background: #b9b0a0; }
.sync-dot.ok { background: var(--good); }
.sync-dot.pend { background: var(--gold); }
.sync-dot.sync { background: var(--primary); animation: pulse 1s ease infinite; }

/* Estado de la nube en Ajustes */
.cloud-status { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; margin-bottom: 12px; }
.cloud-status .big { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cloud-status .big.ok { background: var(--good); } .cloud-status .big.off { background: #b9b0a0; } .cloud-status .big.pend { background: var(--gold); }

/* Health-check (comprobación de despliegue) */
.health-list { display: flex; flex-direction: column; gap: 8px; }
.health-row { display: flex; gap: 10px; align-items: flex-start; }
.hdot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }
.hdot.ok { background: var(--good); }
.hdot.warn { background: var(--gold); }
.hdot.fail { background: var(--bad); }
.theme-btn, .icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
}
.theme-btn:hover, .icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px clamp(16px, 4vw, 36px);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-date { font-weight: 600; color: var(--ink); text-transform: capitalize; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.menu-btn { display: none; }

.view { padding: clamp(18px, 4vw, 34px); max-width: 1120px; width: 100%; margin: 0 auto; }

/* ---------- Encabezado de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--primary); font-weight: 600; margin-bottom: 6px; }
.page-head h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 700; }
.page-head p.sub { color: var(--ink-soft); margin-top: 6px; max-width: 60ch; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 16px; border-radius: 11px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; background: var(--surface-2); color: var(--ink);
  transition: transform .05s, background .12s, box-shadow .12s;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-ink); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(.95); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--bad-wash); color: var(--bad); }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px; }
.card-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.card-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn.btn-sm { width: 32px; height: 32px; }
.icon-btn.btn-sm svg { width: 18px; height: 18px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.section-title h2 { font-size: 19px; }
.section-title .count { font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 2px 9px; border-radius: 20px; font-family: var(--font-mono); }
.section-title .spacer { margin-left: auto; }

/* ---------- Chips / etiquetas ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--ink-soft);
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip-primary { background: var(--primary-wash); color: var(--primary-ink); }
.chip-accent { background: var(--accent-wash); color: var(--accent); }
.chip-good { background: var(--good-wash); color: var(--good); }
.chip-warn { background: var(--warn-wash); color: var(--warn); }
.chip-bad { background: var(--bad-wash); color: var(--bad); }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
input, select, textarea {
  font-family: inherit; font-size: 14.5px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-wash); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.hint { font-size: 12px; color: var(--muted); }

/* ---------- Dashboard (Hoy) ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-ink));
  color: #fff; border-radius: var(--radius); padding: 24px 26px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 18px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero h1 { color: #fff; font-size: clamp(24px, 4vw, 32px); }
.hero .greet { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; opacity: .85; margin-bottom: 6px; }
.hero p { opacity: .92; margin-top: 8px; }
.hero .hero-stat { text-align: right; }
.hero .hero-stat b { display: block; font-family: var(--font-display); font-size: 40px; font-weight: 900; line-height: 1; }
.hero .hero-stat span { font-size: 12.5px; opacity: .85; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
}
.stat b { font-family: var(--font-display); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); }
.stat.accent b { color: var(--accent); }
.stat.primary b { color: var(--primary); }

/* ---------- Listas (clases, eventos, tareas) ---------- */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 14px; padding: 13px 4px;
  border-bottom: 1px solid var(--line-soft);
}
.list-item:last-child { border-bottom: none; }
.list-item .time { font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); min-width: 92px; }
.list-item .body { flex: 1; min-width: 0; }
.list-item .body strong { display: block; font-weight: 600; }
.list-item .body small { color: var(--muted); }
.list-item .actions { display: flex; gap: 6px; opacity: .0; transition: opacity .12s; }
.list-item:hover .actions { opacity: 1; }
.color-bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--primary); }

.check {
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line);
  background: var(--surface); display: grid; place-items: center; flex: none; color: transparent;
}
.check.done { background: var(--good); border-color: var(--good); color: #fff; }
.check svg { width: 14px; height: 14px; stroke-width: 3; }
.done-text { text-decoration: line-through; color: var(--muted); }

/* ---------- Horario semanal ---------- */
.timetable-wrap { overflow-x: auto; }
.timetable { width: 100%; border-collapse: separate; border-spacing: 6px; min-width: 640px; }
.timetable th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding-bottom: 4px; }
.timetable td { vertical-align: top; }
.tt-slot {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--primary);
  border-radius: 9px; padding: 8px 10px; font-size: 12.5px; margin-bottom: 6px;
}
.tt-slot .t { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.tt-slot strong { display: block; font-size: 13px; }
.tt-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 8px; }

/* ---------- Estudio de IA ---------- */
.ai-panel { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.ai-output {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  min-height: 340px; padding: 20px; box-shadow: var(--shadow-sm);
  white-space: pre-wrap; font-size: 14.5px; line-height: 1.6;
}
.ai-output.empty { display: grid; place-items: center; text-align: center; color: var(--muted); }
.ai-output .ph { max-width: 34ch; }
.ai-output .ph svg { width: 40px; height: 40px; color: var(--line); margin-bottom: 10px; }
.ai-toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.ai-toolbar .spacer { margin-left: auto; }

/* Markdown renderizado dentro de la salida de IA */
.ai-output.md { white-space: normal; }
.ai-output.md.empty { white-space: normal; }
.ai-output.md h4 { font-family: var(--font-display); font-size: 16px; margin: 16px 0 6px; color: var(--primary-ink); }
.ai-output.md h4:first-child { margin-top: 0; }
.ai-output.md p { margin: 8px 0; }
.ai-output.md ul, .ai-output.md ol { margin: 8px 0; padding-left: 22px; }
.ai-output.md li { margin: 3px 0; }
.ai-output.md code { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.ai-output.md strong { color: var(--ink); }
/* Modo dislexia (lectura más accesible) */
.ai-output.md.dys { font-size: 17px; line-height: 2.1; letter-spacing: 0.04em; word-spacing: 0.14em; text-align: left; }
.ai-output.md.dys p, .ai-output.md.dys li { margin: 10px 0; }
.ai-output.md.dys h4 { margin-top: 20px; }
.btn.active-toggle { background: var(--primary-wash); color: var(--primary-ink); }
/* Wizard de configuración inicial */
.wz-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; font-size: 14px; }
.wz-opt input { width: auto; margin-top: 3px; flex: none; }
.wz-opt:hover { background: var(--surface-2); }
.ai-output.md table { border-collapse: collapse; margin: 10px 0; width: 100%; font-size: 13px; }
.ai-output.md th, .ai-output.md td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; }
.ai-output.md th { background: var(--surface-2); font-weight: 600; }
.badge-ai { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--primary-ink); background: var(--primary-wash); padding: 3px 10px; border-radius: 20px; font-weight: 600; }

.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Guía del profe ---------- */
.guide-card { padding: 18px; }
.guide-card h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; margin-bottom: 4px; }
.guide-card .tag { font-size: 11px; }
.guide-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 4px; }
.guide-list li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 6px; border-radius: 8px; font-size: 13.5px; color: var(--ink-soft); }
.guide-list li:hover { background: var(--surface-2); }
.guide-list .check { width: 20px; height: 20px; flex: none; }
.guia-ai-btn { flex: none; color: var(--primary); opacity: .55; transition: opacity .12s; }
.guide-list li:hover .guia-ai-btn { opacity: 1; }

/* ---------- Estado vacío ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state svg { width: 44px; height: 44px; color: var(--line); margin-bottom: 12px; }
.empty-state h3 { color: var(--ink-soft); font-size: 17px; margin-bottom: 6px; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,26,28,.5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal-overlay[hidden] { display: none; }

/* Botón flotante del Copiloto (v7 · F5) */
.copi-fab { position: fixed; right: 24px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: #fff; border: none; box-shadow: 0 6px 20px rgba(0,0,0,.28); display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 60; transition: transform .12s, filter .12s; }
.copi-fab svg { width: 26px; height: 26px; }
.copi-fab:hover { filter: brightness(1.06); transform: translateY(-2px); }
@media (max-width: 860px) { .copi-fab { bottom: 78px; right: 16px; width: 52px; height: 52px; } }
@media print { .copi-fab { display: none !important; } }
.to-top { position: fixed; left: 20px; bottom: 24px; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); cursor: pointer; z-index: 55; display: none; align-items: center; justify-content: center; font-size: 20px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.to-top.show { display: flex; }
.to-top:hover { background: var(--surface-1); }
@media (max-width: 860px) { .to-top { bottom: 78px; left: 16px; } }
.net-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 210; background: #dc2626; color: #fff; text-align: center; padding: 8px 12px; font-size: 13px; font-weight: 600; transform: translateY(-100%); transition: transform .2s; }
.net-banner.show { transform: translateY(0); }
.kbd { display: inline-block; background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 2px 8px; font-family: var(--font-mono); font-size: 12px; color: var(--ink); }
.seat-grid { display: grid; gap: 8px; margin: 10px 0; }
.seat { min-height: 54px; border: 1.5px solid var(--line); border-radius: 10px; display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; padding: 6px 18px 6px 6px; text-align: center; font-size: 13px; }
.seat.filled { background: var(--primary-wash); border-color: var(--primary); font-weight: 600; color: var(--primary-ink); }
.seat.target { border-style: dashed; border-color: var(--primary); }
.seat.target .seat-empty { color: var(--primary); }
.seat-empty { color: var(--muted); font-size: 20px; }
.seat-x { position: absolute; top: 2px; right: 4px; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; }
.seat-front { text-align: center; background: #334155; color: #fff; border-radius: 8px; padding: 5px; font-size: 12px; letter-spacing: .12em; }
.seat-print { border-collapse: collapse; width: 100%; margin-top: 10px; }
.seat-print td { border: 1px solid #999; height: 46px; text-align: center; font-size: 13px; padding: 4px; }
.beh-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.beh-tab { flex: 1; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.beh-tab.on { border-color: var(--primary); color: var(--primary-ink); background: var(--primary-wash); }
.beh-list { display: flex; flex-direction: column; gap: 4px; max-height: 52vh; overflow: auto; }
.beh-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.beh-name { flex: 1; font-size: 14px; }
.beh-tally { display: flex; gap: 6px; font-weight: 700; font-size: 13px; }
.beh-pos { color: var(--ok, #2C8A57); }
.beh-neg { color: var(--danger, #E4572E); }
.beh-acts { display: flex; gap: 2px; }
.beh-moods { display: flex; gap: 2px; flex-wrap: wrap; }
.mood-btn { border: 1.5px solid transparent; background: none; font-size: 20px; cursor: pointer; border-radius: 8px; padding: 2px 4px; line-height: 1; filter: grayscale(1) opacity(.55); }
.mood-btn.on { filter: none; border-color: var(--primary); background: var(--primary-wash); }
.beh-mood-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.mood-pill { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600; }
.beh-hist { display: flex; flex-direction: column; gap: 4px; max-height: 56vh; overflow: auto; }
.beh-hrow { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.beh-x { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.sf-emerg-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 6px 0 2px; background: var(--surface-2); font-size: 13px; }
.sf-emerg-text { margin: 6px 0; line-height: 1.5; }
.sf-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.sf-table th, .sf-table td { border: 1px solid #bbb; padding: 5px 8px; font-size: 13px; text-align: left; }
.sf-box { border: 1px solid #ccc; border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.sf-group { margin: 10px 0; padding-top: 6px; border-top: 1px dashed #ccc; page-break-inside: avoid; }
.sf-roster { columns: 2; margin: 4px 0; }
.sf-sub { font-weight: 700; margin: 8px 0 4px; }
.wb-lbl { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 10px 0 4px; }
.wb-faces { display: flex; gap: 6px; }
.wb-face { font-size: 26px; line-height: 1; background: none; border: 2px solid transparent; border-radius: 12px; padding: 4px 6px; cursor: pointer; filter: grayscale(1) opacity(.5); transition: transform .1s; }
.wb-face:hover { transform: scale(1.1); }
.wb-face.on { filter: none; border-color: var(--primary); background: var(--primary-wash); }
.wb-trend { display: flex; gap: 8px; font-size: 22px; }
.wb-load { display: inline-block; font-weight: 800; font-size: 15px; padding: 4px 14px; border-radius: 999px; margin: 4px 0 12px; }
.wb-load-ligera { background: #e6f5ec; color: #1e7a45; }
.wb-load-media { background: #fff3e0; color: #b3701a; }
.wb-load-alta { background: #fdecea; color: #c0392b; }
.wb-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.wb-metrics div { background: var(--surface-2); border-radius: 10px; padding: 10px 6px; text-align: center; }
.wb-metrics b { display: block; font-size: 22px; color: var(--ink); }
.wb-metrics span { font-size: 11.5px; color: var(--muted); }
.wb-tip { font-size: 15px; line-height: 1.6; font-style: italic; color: var(--ink-soft); margin: 0; }
.wb-notes { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.wb-note { position: relative; background: var(--surface-2); border-radius: 10px; padding: 8px 30px 8px 10px; font-size: 13.5px; }
.wb-note > div { margin-top: 2px; }
.wb-x { position: absolute; top: 6px; right: 8px; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.breath-wrap { padding: 10px 0 4px; }
.breath-circle { width: 130px; height: 130px; border-radius: 50%; background: var(--primary-wash); border: 3px solid var(--primary); display: flex; align-items: center; justify-content: center; margin: 24px auto; transition: transform 4s ease-in-out; font-weight: 700; color: var(--primary-ink); }
.breath-circle.big { transform: scale(1.32); }
.breath-circle.small { transform: scale(.72); }
/* v12 · Speaking */
.spk-card { display: flex; flex-direction: column; gap: 6px; cursor: pointer; transition: border-color .12s, transform .12s; }
.spk-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.spk-card h2 { margin: 0; font-size: 17px; }
.spk-card .btn { align-self: flex-start; margin-top: 6px; }
.spk-ico { font-size: 30px; line-height: 1; }
.pron-card { text-align: center; padding: 8px 0 4px; }
.pron-count { font-size: 12px; color: var(--muted); }
.pron-word { font-size: 40px; font-weight: 800; color: var(--ink); margin: 6px 0; }
.pron-contrast { color: var(--muted); font-size: 15px; }
.pron-ipa { font-size: 20px; color: var(--primary-ink); font-family: var(--font-mono, monospace); margin: 4px 0; }
.pron-tip { font-size: 14px; color: var(--ink-soft); font-style: italic; margin: 6px auto; max-width: 320px; }
.pron-actions { display: flex; gap: 10px; justify-content: center; margin: 14px 0 8px; }
.pron-feedback { min-height: 24px; }
.pron-said { font-size: 14px; color: var(--ink-soft); }
.pron-score { font-weight: 800; font-size: 16px; margin-top: 4px; }
.pron-score.ok { color: #16a34a; }
.pron-score.no { color: #ea580c; }
.dlg-lines { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow: auto; margin-bottom: 12px; }
.dlg-line { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: baseline; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.dlg-role { font-weight: 800; font-size: 13px; }
.dlg-text { cursor: pointer; }
.dlg-text:hover { text-decoration: underline dotted; }
.dlg-es { grid-column: 2; font-size: 12.5px; color: var(--muted); }
.dlg-practice { text-align: center; padding: 10px 0; }
.dlg-prog { font-size: 12px; color: var(--muted); }
.dlg-cur { margin: 14px 0; padding: 16px; border: 2px solid var(--line); border-radius: 12px; }
.dlg-cur.mine { border-color: var(--primary); background: var(--primary-wash); }
.dlg-cur-text { font-size: 22px; font-weight: 700; margin-top: 4px; }
.kk-lines { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow: auto; margin-bottom: 12px; text-align: center; }
.kk-line { font-size: 17px; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--muted); transition: all .15s; }
.kk-line.cur { color: var(--ink); font-weight: 800; background: var(--primary-wash); transform: scale(1.04); }
.se-rec-row { display: flex; align-items: center; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.se-transcript { border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 44px; background: var(--surface-2); font-size: 14px; margin-bottom: 8px; }
.se-rubric { display: flex; flex-direction: column; gap: 6px; }
.se-crit { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.se-levels { display: flex; gap: 4px; }
.se-lv { width: 34px; height: 34px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 8px; cursor: pointer; font-weight: 700; color: var(--ink-soft); }
.se-avg { margin: 10px 0; font-size: 15px; }
.se-fb { margin: 6px 0; }
/* v13 · Pizarra y recursos visuales */
.board-overlay { position: fixed; inset: 0; z-index: 330; background: #f8fafc; }
.board-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; background-color: #f8fafc; }
.board-bg-grid { background-image: linear-gradient(#dbe3ea 1px, transparent 1px), linear-gradient(90deg, #dbe3ea 1px, transparent 1px); background-size: 32px 32px; }
.board-bg-lined { background-image: linear-gradient(#dbe3ea 1px, transparent 1px); background-size: 100% 40px; }
.board-tools { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; background: #0b1416; padding: 8px 10px; border-radius: 14px; z-index: 2; flex-wrap: wrap; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.board-colors, .board-sizes { display: flex; gap: 4px; }
.board-color { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); cursor: pointer; padding: 0; }
.board-color.on { border-color: #fff; box-shadow: 0 0 0 2px #0b1416, 0 0 0 4px #fff; }
.board-size { width: 34px; height: 30px; border-radius: 8px; border: none; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.board-size.on { background: rgba(255,255,255,.32); }
.board-size span { display: block; background: #fff; border-radius: 50%; }
.board-tools .proj-btn { padding: 7px 10px; font-size: 14px; }
.board-tools .proj-btn.on { background: #E4572E; }
.sflash-stage { gap: 24px; }
.sflash-card { background: #fff; color: #111827; border-radius: 22px; padding: min(10vh,80px) min(10vw,120px); font-family: var(--font-display); font-size: clamp(40px, 11vw, 130px); font-weight: 700; box-shadow: 0 20px 60px rgba(0,0,0,.4); min-width: 40vw; text-align: center; }
.sflash-card.back { background: #7FD6D0; color: #06302e; }
.sflash-hint { color: rgba(255,255,255,.5); font-size: 15px; }
.org-preview { overflow: auto; }
.org { padding: 10px; }
.org-web { text-align: center; }
.web-center { display: inline-block; background: var(--primary); color: #fff; font-weight: 800; font-size: 22px; padding: 16px 26px; border-radius: 999px; margin-bottom: 16px; }
.web-branches { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.web-node { background: var(--primary-wash); color: var(--primary-ink); border: 2px solid var(--primary); border-radius: 14px; padding: 10px 16px; font-weight: 600; }
.org-seq { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.org-step { flex: 1; min-width: 130px; border: 2px solid var(--line); border-radius: 12px; padding: 12px; display: flex; gap: 10px; align-items: center; }
.org-num { background: var(--primary); color: #fff; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.org-arrow { color: var(--primary); font-size: 20px; }
.org-venn, .org-kwl, .org-sort { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
.org-sort { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.venn-col, .kwl-col, .sort-col { border: 2px solid var(--line); border-radius: 12px; padding: 10px; }
.venn-both { border-color: var(--primary); background: var(--primary-wash); }
.org h4 { margin: 0 0 6px; text-align: center; font-size: 15px; }
.org ul { margin: 0; padding-left: 18px; }
.org li { margin: 3px 0; }
.org-proj-inner { width: 90vw; color: #fff; }
.org-proj-inner .web-node, .org-proj-inner .org-step, .org-proj-inner .venn-col, .org-proj-inner .kwl-col, .org-proj-inner .sort-col { font-size: 22px; }
.org-proj-inner h4 { font-size: 24px; color: #7FD6D0; }
.wheel-wrap { position: relative; display: inline-block; }
.wheel-pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 34px; z-index: 2; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
#wheelCanvas { max-width: min(70vh, 90vw); max-height: 70vh; }
.wheel-winner { font-size: clamp(24px, 5vw, 48px); font-weight: 800; color: #7FD6D0; min-height: 1.2em; }
@media print { .board-overlay { display: none !important; } }
/* v14 · Juegos y gamificación */
.qs-board { flex: 1; display: grid; gap: 8px; padding: 16px; align-content: start; }
.qs-cat { background: #1d3a56; color: #fff; font-weight: 800; text-align: center; padding: 12px 6px; border-radius: 8px; font-size: clamp(13px, 2vw, 20px); text-transform: uppercase; }
.qs-cell { background: #0e63b3; color: #ffd54a; font-weight: 800; font-size: clamp(20px, 4vw, 40px); border: none; border-radius: 8px; cursor: pointer; min-height: 54px; }
.qs-cell:hover:not(.used) { filter: brightness(1.25); }
.qs-cell.used { background: #16232e; color: transparent; cursor: default; }
.qs-teams { display: flex; gap: 10px; justify-content: center; padding: 14px; flex-wrap: wrap; }
.qs-team { background: rgba(255,255,255,.1); border-radius: 12px; padding: 8px 18px; font-size: 18px; display: flex; gap: 10px; align-items: center; }
.qs-team.lead { background: #ffd54a; color: #0b1416; font-weight: 800; }
.qs-team b { font-size: 24px; }
.qs-qpanel { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 30px; text-align: center; }
.qs-q { font-size: clamp(28px, 5vw, 60px); font-weight: 700; max-width: 90%; }
.qs-a { font-size: clamp(24px, 4vw, 46px); color: #7FD6D0; font-weight: 700; }
.qs-award { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.bingo-preview { display: flex; justify-content: center; margin: 10px 0; }
.bingo-card { display: grid; gap: 4px; }
.bingo-preview .bingo-card { max-width: 340px; }
.bingo-cell { border: 2px solid var(--line); border-radius: 8px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; font-weight: 600; padding: 3px; }
.bingo-cell.free { background: var(--primary-wash); color: var(--primary); font-size: 22px; }
.bingo-current { font-family: var(--font-display); font-size: clamp(50px, 15vw, 180px); font-weight: 700; color: #ffd54a; }
.bingo-called { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 80%; margin-top: 20px; }
.bingo-called span { background: rgba(255,255,255,.12); border-radius: 8px; padding: 4px 10px; font-size: 16px; }
.bingo-doc .bingo-wrap { page-break-inside: avoid; margin-bottom: 22px; }
.bingo-doc .bingo-title { text-align: center; font-weight: 800; margin-bottom: 6px; letter-spacing: .06em; }
.bingo-doc .bingo-cell { border-color: #333; font-size: 14px; }
.bingo-doc .bingo-name { margin-top: 8px; color: #444; }
.rosco-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 10px; }
.rosco-ring { position: relative; width: min(72vh, 92vw); height: min(72vh, 92vw); }
.rosco-letter { position: absolute; width: clamp(30px, 5.5vw, 50px); height: clamp(30px, 5.5vw, 50px); transform: translate(-50%, -50%); border-radius: 50%; background: #17324a; color: #cbd5e1; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: clamp(15px, 2.6vw, 24px); border: 2px solid transparent; }
.rosco-letter.cur { background: #ffd54a; color: #0b1416; border-color: #fff; transform: translate(-50%, -50%) scale(1.18); }
.rosco-letter.ok { background: #16a34a; color: #fff; }
.rosco-letter.wrong { background: #dc2626; color: #fff; }
.rosco-letter.pass { background: #d97706; color: #fff; }
.rosco-centre { position: absolute; inset: 22% 18%; display: flex; align-items: center; justify-content: center; text-align: center; }
.rosco-big { font-family: var(--font-display); font-size: clamp(40px, 9vw, 90px); font-weight: 800; color: #ffd54a; }
.rosco-cluetext { font-size: clamp(16px, 2.6vw, 26px); margin-top: 8px; }
.rosco-answer { font-size: clamp(22px, 3.4vw, 36px); color: #7FD6D0; font-weight: 700; margin-top: 12px; }
.rosco-result { font-size: clamp(28px, 5vw, 54px); font-weight: 800; }
.rosco-score { font-size: 22px; color: #7FD6D0; margin-top: 10px; }
.liga-list { display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow: auto; }
.liga-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.liga-medal { width: 28px; text-align: center; font-size: 18px; }
.liga-rank { color: var(--muted); font-weight: 700; }
.liga-name { flex: 1; font-weight: 600; }
.liga-badges { font-size: 16px; letter-spacing: 2px; }
.liga-pts { display: flex; align-items: center; gap: 6px; }
.liga-pts b { min-width: 26px; text-align: center; }
.liga-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.ligaboard { width: min(700px, 90vw); }
.lb-row { display: flex; align-items: center; gap: 14px; padding: 10px 6px; border-bottom: 1px solid rgba(255,255,255,.12); font-size: clamp(18px, 3vw, 30px); }
.lb-medal { width: 44px; text-align: center; }
.lb-name { flex: 1; }
.lb-badges { font-size: 20px; letter-spacing: 3px; }
.lb-pts { font-weight: 800; color: #ffd54a; }
@media print { .to-top, .net-banner { display: none !important; } }
.modal { background: var(--surface); border-radius: var(--radius); width: min(560px, 100%); max-height: 90dvh; overflow: auto; box-shadow: var(--shadow); border: 1px solid var(--line); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: var(--surface); }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 12px; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow); animation: rise .25s ease; max-width: 90vw; }
.toast.good { background: var(--good); color: #fff; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Barra inferior móvil ---------- */
.tabbar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .menu-btn { display: grid; }
  .ai-panel { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .view { padding-bottom: 90px; }
  .hero { flex-direction: column; }
  .hero .hero-stat { text-align: left; }

  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: none; border: none; color: var(--muted); font-size: 10.5px; font-weight: 600;
    padding: 4px 8px; border-radius: 10px; flex: 1;
  }
  .tab svg { width: 22px; height: 22px; }
  .tab.active { color: var(--primary); }
}

/* Sidebar como panel deslizante en móvil cuando se abre */
.sidebar.open {
  display: flex; position: fixed; inset: 0 auto 0 0; z-index: 120; width: 260px;
  box-shadow: var(--shadow); animation: slidein .2s ease;
}
@keyframes slidein { from { transform: translateX(-100%); } }
.scrim { position: fixed; inset: 0; background: rgba(15,26,28,.4); z-index: 110; }
.scrim[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================================================
   Componentes nuevos (Clase, Notas, Asistente, búsqueda…)
   ============================================================ */
.roster { display: flex; flex-direction: column; }
.roster-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line-soft); }
.roster-row:last-child { border-bottom: none; }
.rname { flex: 1; font-weight: 500; min-width: 0; }
.att-btns { display: flex; gap: 5px; }
.att-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 700; font-size: 12px; }
.att-btn:hover { background: var(--surface-2); }
.att-btn.on.p { background: var(--good); border-color: var(--good); color: #fff; }
.att-btn.on.a { background: var(--bad); border-color: var(--bad); color: #fff; }
.att-btn.on.r { background: var(--warn); border-color: var(--warn); color: #fff; }
.att-btn.on.j { background: var(--primary); border-color: var(--primary); color: #fff; }
.pts { display: flex; align-items: center; gap: 10px; }
.points-num { font-family: var(--font-display); font-size: 20px; min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }

.timer-wrap { text-align: center; }
.timer-display { font-family: var(--font-mono); font-size: 64px; font-weight: 500; letter-spacing: 2px; padding: 10px 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.timer-display.done { color: var(--accent); animation: pulse 1s ease infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.timer-presets { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.timer-controls { display: flex; gap: 10px; justify-content: center; }

.picker { text-align: center; }
.big-name { font-family: var(--font-display); font-size: 40px; font-weight: 700; padding: 22px 10px; min-height: 60px; color: var(--primary-ink); word-break: break-word; }
.big-name.pop { animation: pop .35s ease; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.pick-opt { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.pick-opt input { width: auto; }

.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.team-card { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; }
.team-card h4 { font-size: 13px; color: var(--primary-ink); margin-bottom: 6px; }
.team-card div { font-size: 13.5px; padding: 2px 0; }

.gradebook { border-collapse: collapse; min-width: 520px; }
.gradebook th, .gradebook td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; font-size: 13px; }
.gradebook th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.gradebook .gb-name { text-align: left; position: sticky; left: 0; background: var(--surface); font-weight: 500; white-space: nowrap; }
.gradebook thead .gb-name { background: var(--surface-2); }
.gb-input { width: 54px; text-align: center; padding: 5px; border-radius: 7px; }
.gb-avg { font-weight: 700; font-family: var(--font-mono); background: var(--surface-2); }
.gb-del { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.gb-del:hover { color: var(--bad); }

.ai-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-size: 13.5px; font-weight: 600; }
.ai-tab svg { width: 17px; height: 17px; }
.ai-tab:hover { background: var(--surface-2); }
.ai-tab.active { background: var(--primary-wash); color: var(--primary-ink); border-color: transparent; }
.ai-tab.active svg { color: var(--primary); }

.search-results { margin-top: 10px; max-height: 52vh; overflow: auto; display: flex; flex-direction: column; gap: 3px; }
.search-hit { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; border: none; background: transparent; text-align: left; width: 100%; color: var(--ink); }
.search-hit:hover, .search-hit.sel { background: var(--surface-2); }
.search-hit.sel { box-shadow: inset 0 0 0 2px var(--primary); }
.accent-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; transition: transform .1s; }
.accent-swatch:hover { transform: scale(1.1); }
.accent-swatch.sel { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.changelog { display: flex; flex-direction: column; gap: 14px; }
.cl-entry { display: flex; gap: 12px; }
.cl-ver { flex: 0 0 56px; font-weight: 700; color: var(--primary-ink); font-size: 13px; }
.cl-new { display: inline-block; background: var(--primary); color: #fff; font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; margin-left: 4px; vertical-align: middle; }
.cl-body { flex: 1; min-width: 0; border-left: 2px solid var(--line); padding-left: 12px; }
.cl-body strong { font-size: 14px; }
.cl-body ul { margin: 5px 0 0; padding-left: 18px; }
.cl-body li { font-size: 13px; color: var(--muted); margin: 3px 0; line-height: 1.5; }
.lp-text { max-height: 40vh; overflow-y: auto; line-height: 1.9; font-size: 15px; padding: 4px 2px; }
.lp-s { cursor: pointer; border-radius: 4px; padding: 1px 3px; }
.lp-s:hover { background: var(--surface-2); }
.lp-s.cur { background: var(--primary-wash); color: var(--primary-ink); font-weight: 600; }
.lp-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.projector { position: fixed; inset: 0; z-index: 320; background: #0b1416; color: #fff; display: flex; flex-direction: column; }
.proj-top { display: flex; align-items: center; gap: 12px; padding: 14px 20px; }
.proj-title { flex: 1; text-align: center; font-weight: 600; opacity: .65; }
.proj-count { font-variant-numeric: tabular-nums; opacity: .65; font-size: 14px; min-width: 60px; }
.proj-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; gap: 18px; padding: 20px; text-align: center; }
.proj-en { font-family: var(--font-display); font-size: clamp(40px, 12vw, 150px); font-weight: 700; line-height: 1.05; }
.proj-es { font-size: clamp(24px, 6vw, 66px); color: #7FD6D0; min-height: 1.1em; }
.proj-nav { display: flex; gap: 10px; justify-content: center; padding: 20px; flex-wrap: wrap; }
.proj-btn { background: rgba(255,255,255,.1); color: #fff; border: none; border-radius: 12px; padding: 12px 18px; font-size: 18px; cursor: pointer; }
.proj-btn.wide { min-width: 130px; }
.proj-btn:hover { filter: brightness(1.4); }
@media print { .projector { display: none !important; } }
.bank-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 2px 0 14px; }
.bank-filters input, .bank-filters select { max-width: 240px; }
.ws-preview { overflow-x: auto; }
.wordsearch { border-collapse: collapse; margin: 10px auto; }
.wordsearch td { border: 1px solid #94a3b8; width: 26px; height: 26px; text-align: center; font-family: var(--font-mono); font-weight: 600; font-size: 15px; text-transform: uppercase; color: #111; }
.ws-words { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin-top: 12px; font-weight: 600; }
.ws-words span { text-transform: uppercase; letter-spacing: .04em; }
.dip-preview { overflow-x: auto; }
.diploma { padding: 8mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.dip-inner { border: 8px double #0f766e; border-radius: 14px; padding: 32px 28px; text-align: center; background: #f2fbf8; color: #123; }
.dip-star { font-size: 46px; line-height: 1; }
.dip-title { font-family: var(--font-display); font-size: 42px; color: #0f766e; font-weight: 700; }
.dip-sub { color: #555; margin-top: 8px; }
.dip-name { font-family: var(--font-display); font-size: 30px; margin: 10px 0; font-weight: 700; color: #0e7490; }
.dip-reason { font-size: 16px; color: #333; }
.dip-foot { display: flex; justify-content: space-between; gap: 20px; margin-top: 30px; font-size: 13px; color: #444; }
.dip-foot span { border-top: 1px solid #999; padding-top: 4px; flex: 1; }
.rubric-grid { display: flex; flex-direction: column; gap: 6px; }
.rub-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px solid var(--line); }
.rub-crit { flex: 1 1 110px; font-weight: 600; font-size: 14px; min-width: 90px; }
.rub-levels { display: flex; gap: 5px; flex-wrap: wrap; }
.rub-lvl { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; }
.rub-lvl.sel { background: var(--primary); color: #fff; border-color: var(--primary); }
.sa-preview { overflow-x: auto; }
.selfassess th:not(:first-child) { text-align: center; font-size: 16px; width: 46px; }
.selfassess td:not(:first-child) { text-align: center; font-size: 20px; width: 46px; color: #64748b; }
.sh-label { flex: 1; font-weight: 500; min-width: 0; }
.search-hit small { color: var(--muted); white-space: nowrap; }

.present-overlay { position: fixed; inset: 0; z-index: 300; background: var(--paper); overflow: auto; padding: 5vh 6vw; }
.present-overlay:focus { outline: none; }
.present-close { position: fixed; top: 16px; right: 16px; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.present-inner { max-width: 900px; margin: 0 auto; }
.present-inner h1 { font-size: clamp(28px, 5vw, 44px); margin-bottom: 20px; color: var(--primary-ink); }
.present-body { font-size: clamp(18px, 2.4vw, 26px); line-height: 1.6; }
.present-body h4 { font-size: clamp(20px, 3vw, 30px); margin: 22px 0 8px; color: var(--primary-ink); }
.present-body ul, .present-body ol { padding-left: 28px; }
.present-body li { margin: 8px 0; }
.present-body table { border-collapse: collapse; font-size: .8em; }
.present-body th, .present-body td { border: 1px solid var(--line); padding: 6px 10px; }
.present-bar { position: fixed; top: 16px; right: 16px; display: flex; gap: 8px; z-index: 2; }
.present-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.present-btn:hover { background: var(--surface-2); }

/* Streaming: el área de IA hace scroll cuando crece */
.ai-output { max-height: 62vh; overflow: auto; }
.ai-output.empty { overflow: hidden; }

/* Chat del Asistente */
.chat-wrap { display: flex; flex-direction: column; height: calc(100dvh - 250px); min-height: 380px; }
.chat { flex: 1; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm); }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 15px; font-size: 14.5px; line-height: 1.5; }
.bubble.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.bubble.assistant { align-self: flex-start; background: var(--surface-2); color: var(--ink); border-bottom-left-radius: 4px; }
.bubble.assistant h4 { font-family: var(--font-display); font-size: 15px; margin: 8px 0 4px; }
.bubble.assistant p { margin: 5px 0; }
.bubble.assistant ul, .bubble.assistant ol { margin: 5px 0; padding-left: 18px; }
.bubble.assistant code { font-family: var(--font-mono); font-size: 12px; background: var(--surface); padding: 1px 4px; border-radius: 4px; }
.chat-input { display: flex; gap: 8px; margin-top: 10px; }
.chat-input input { flex: 1; }

/* Examen: casillas de destrezas */
.checks { display: flex; flex-direction: column; gap: 7px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink-soft); cursor: pointer; }
.chk input { width: auto; }

/* Uso / gasto de IA */
.usage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.usage { background: var(--surface-2); border-radius: 10px; padding: 12px; text-align: center; }
.usage b { display: block; font-family: var(--font-display); font-size: 19px; font-variant-numeric: tabular-nums; }
.usage span { font-size: 11px; color: var(--muted); }
.usage.accent b { color: var(--accent); }
@media (max-width: 700px) { .usage-grid { grid-template-columns: repeat(2, 1fr); } }

/* Evaluación LOMLOE */
.qual { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; margin-left: 4px; vertical-align: middle; }
.q-in { background: var(--bad-wash); color: var(--bad); }
.q-su { background: var(--warn-wash); color: var(--warn); }
.q-bi { background: var(--surface-2); color: var(--gold); }
.q-nt { background: var(--primary-wash); color: var(--primary-ink); }
.q-sb { background: var(--good-wash); color: var(--good); }
.col-comp { display: inline-block; font-size: 9.5px; font-weight: 700; color: var(--primary-ink); background: var(--primary-wash); padding: 1px 4px; border-radius: 4px; }
.col-w { font-size: 10px; color: var(--muted); font-family: var(--font-mono); }
.dist { display: flex; flex-direction: column; gap: 6px; }
.dist-row { display: flex; align-items: center; gap: 10px; }
.dist-lbl { width: 26px; font-weight: 700; font-size: 12px; color: var(--ink-soft); }
.dist-bar { flex: 1; height: 14px; background: var(--surface-2); border-radius: 7px; overflow: hidden; }
.dist-bar > div { height: 100%; border-radius: 7px; min-width: 2px; }
.dist-n { width: 24px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.boletin-prev { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; }
.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th, .mini-table td { border: 1px solid var(--line); padding: 5px 8px; text-align: center; font-size: 13px; }
.mini-table th:first-child, .mini-table td:first-child { text-align: left; }

/* Analítica (gráficos) */
.chart { width: 100%; height: auto; max-height: 270px; display: block; }
.cbar-val { fill: var(--ink); font-size: 12px; font-weight: 700; font-family: var(--font-body); }
.cbar-lbl { fill: var(--muted); font-size: 10px; font-family: var(--font-body); }
.radar-lbl { fill: var(--ink-soft); font-size: 10px; font-weight: 600; font-family: var(--font-body); }
.att-bar { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.att-bar > span { display: block; height: 100%; }

/* Calendario mensual */
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-head > div { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell { min-height: 76px; border: 1px solid var(--line); border-radius: 9px; padding: 5px 6px; background: var(--surface); display: flex; flex-direction: column; gap: 3px; cursor: pointer; overflow: hidden; }
.cal-cell.empty { border: none; background: transparent; cursor: default; }
.cal-cell:hover:not(.empty) { border-color: var(--primary); }
.cal-cell.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cal-cell.today .cal-num { color: var(--primary-ink); font-weight: 800; }
.cal-cell.holiday { background: var(--accent-wash); }
.cal-num { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-chips { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-chip { font-size: 9.5px; line-height: 1.3; padding: 1px 4px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.hol { background: var(--accent); color: #fff; }
.cal-chip.ev { background: var(--primary-wash); color: var(--primary-ink); }
.cal-chip.hw { background: var(--warn-wash); color: var(--warn); }
.cal-chip.tut { background: var(--surface-2); color: var(--ink-soft); }
@media (max-width: 700px) { .cal-cell { min-height: 46px; } .cal-chips { display: none; } .cal-cell.holiday::after { content: '•'; color: var(--accent); font-weight: 700; } }

/* Ficha interactiva (quiz) */
.quiz-item { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.quiz-item:last-child { border-bottom: none; }
.quiz-q { font-weight: 600; margin-bottom: 8px; }
.quiz-opts { display: flex; flex-direction: column; gap: 6px; }
.quiz-opt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 14px; }
.quiz-opt:hover { background: var(--surface-2); }
.quiz-opt.sel { border-color: var(--primary); background: var(--primary-wash); }
.quiz-opt.ok { border-color: var(--good); background: var(--good-wash); }
.quiz-opt.bad { border-color: var(--bad); background: var(--bad-wash); }
.quiz-gap { max-width: 220px; }
.quiz-score { text-align: center; font-family: var(--font-display); font-size: 28px; font-weight: 800; padding: 12px; }
.speak-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.speak-target { font-size: 15px; color: var(--ink); }
.speak-heard { margin-top: 8px; font-size: 13.5px; color: var(--ink-soft); min-height: 16px; }

/* Flashcards ilustradas */
.fc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.fc-card { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-align: center; }
.fc-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.fc-noimg { aspect-ratio: 1 / 1; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.fc-word { padding: 8px 4px; font-weight: 700; font-size: 14px; }
.fc-dl { position: absolute; top: 6px; right: 6px; background: var(--surface); }
.fc-print-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8mm; }
.fc-print-card { border: 1px solid #999; border-radius: 8px; padding: 6mm; text-align: center; page-break-inside: avoid; break-inside: avoid; }
.fc-print-card img { width: 100%; max-width: 72mm; }
.fc-print-word { font-size: 20pt; font-weight: 700; margin-top: 3mm; }

/* Cuento ilustrado */
.story { display: flex; flex-direction: column; gap: 14px; }
.story-page { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.story-page img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.story-page p { padding: 12px 16px; font-size: 16px; font-weight: 500; margin: 0; }
.story-print-page { text-align: center; page-break-inside: avoid; break-inside: avoid; }
.story-print-page:not(:last-child) { page-break-after: always; break-after: page; }
.story-print-page img { width: 100%; max-width: 130mm; }
.story-print-page p { font-size: 18pt; font-weight: 600; margin-top: 4mm; }

/* Programación didáctica */
.prog-term { margin-bottom: 16px; }
.prog-term h4 { font-family: var(--font-display); font-size: 15px; color: var(--primary-ink); margin-bottom: 8px; }
.prog-unit { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.prog-unit-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.prog-actions { display: flex; gap: 4px; flex: none; }
.prog-meta { font-size: 12.5px; color: var(--muted); margin: 4px 0 6px; }
.prog-unit p { font-size: 13px; margin: 3px 0; }

/* ============================================================
   Impresión / PDF
   ============================================================ */
#printArea { display: none; }

.print-doc { color: #1f2430; font-family: var(--font-body); font-size: 13.5px; line-height: 1.6; padding: 14mm 13mm; }

/* Cabecera alegre con franja de colores y mascota */
.print-head { position: relative; border: 2px solid #0f766e; border-radius: 14px; padding: 15px 18px 16px; margin-bottom: 18px; background: #f2fbf8; overflow: hidden; }
.print-head .ph-bar { position: absolute; top: 0; left: 0; right: 0; height: 8px; background: linear-gradient(90deg,#14b8a6 0 25%,#facc15 25% 50%,#fb7185 50% 75%,#60a5fa 75% 100%); }
.print-head .ph-row { display: flex; justify-content: flex-end; align-items: center; margin-top: 2px; }
.print-head .ph-brand { display: flex; align-items: center; gap: 7px; }
.print-head .ph-brand .ph-glasses { font-size: 19px; }
.print-head .school { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: #0f766e; font-weight: 700; }
.print-head .ph-score { display: flex; align-items: center; border: 2px dashed #f59e0b; border-radius: 999px; padding: 3px 13px; font-weight: 800; color: #b45309; font-size: 14px; white-space: nowrap; }
.print-head .ph-score .star { font-size: 15px; }
.print-head h1 { font-family: var(--font-display); font-size: 24px; color: #0f766e; margin: 8px 0 5px; line-height: 1.15; }
.print-head .meta { display: inline-block; font-size: 11.5px; color: #fff; background: #14b8a6; padding: 2px 11px; border-radius: 999px; font-weight: 600; }
.print-head .nameline { display: flex; gap: 18px; margin-top: 14px; }
.print-head .nameline .nl { flex: 1; border-bottom: 2px dotted #94a3b8; padding-bottom: 3px; font-size: 12px; color: #334155; }
.print-head .nameline .nl.short { flex: .6; }
.print-head .nameline b { color: #0f766e; margin-right: 6px; font-weight: 700; }

/* Cuerpo */
.print-body h4 { font-family: var(--font-display); font-size: 16px; margin: 16px 0 7px; color: #0e7490; display: flex; align-items: center; gap: 8px; }
.print-body h4::before { content: ""; width: 12px; height: 12px; border-radius: 4px; background: #fb7185; flex: none; }
.print-body p { margin: 7px 0; line-height: 1.6; }
.print-body ul, .print-body ol { margin: 8px 0; padding-left: 24px; }
.print-body li { margin: 6px 0; }
.print-body ul li::marker { color: #14b8a6; }
.print-body ol li::marker { color: #0e7490; font-weight: 700; }
.print-body strong { color: #b45309; }
.print-body code { font-family: var(--font-mono); font-size: 12px; background: #f1f5f9; padding: 1px 5px; border-radius: 4px; }
.print-body table { border-collapse: separate; border-spacing: 0; margin: 10px 0; width: 100%; border: 1.5px solid #cbd5e1; border-radius: 10px; overflow: hidden; }
.print-body th { background: #14b8a6; color: #fff; padding: 6px 9px; font-size: 12px; text-align: left; }
.print-body td { border-top: 1px solid #dbe3ec; padding: 6px 9px; font-size: 12.5px; }
.print-body tbody tr:nth-child(even) td { background: #f8fafc; }

/* Líneas de puntos para escribir (solo fichas de trabajo) */
.print-doc.worksheet .print-body ol > li { margin: 9px 0; }
.print-doc.worksheet .print-body ol > li::after { content: ""; display: block; border-bottom: 1.5px dotted #cbd5e1; margin: 12px 0 2px; }

.print-foot { display: flex; justify-content: center; margin-top: 26px; padding-top: 9px; border-top: 2px dashed #cbd5e1; font-size: 11px; color: #64748b; font-weight: 600; }

@media print {
  .app, .modal-overlay, .toast-wrap, .scrim, .copi-fab { display: none !important; }
  #printArea { display: block !important; }
  body { background: #fff !important; zoom: 1 !important; }
  .print-doc { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-multi .print-doc:not(:last-child) { page-break-after: always; break-after: page; }
  @page { margin: 0; }
}
