:root {
  --navy: #0D2240;
  --burg: #7B303E;
  --gold: #D2AF57;
  --bg: #F7F5F1;
  --text: #1A1A2E;
  --muted: #6B7280;
  --card: #FFFFFF;
  --radius: 14px;
  --ok: #166534;
  --warn: #92400e;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
}

body::before {
  content: '';
  position: fixed;
  left: 0; top: 0;
  width: 5px; height: 100%;
  background: linear-gradient(180deg, var(--gold), var(--burg), var(--navy));
  z-index: 50;
}

.lab-topbar {
  background: var(--navy);
  min-height: 60px;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--gold);
}

.lab-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lab-brand .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--gold);
}

.lab-topbar-sub {
  color: rgba(255,255,255,0.55);
  font-size: 0.75rem;
}

.lab-link {
  color: var(--gold);
  font-size: 0.75rem;
  text-decoration: none;
  letter-spacing: 0.06em;
}

.lab-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 2rem) 4rem;
}

.lab-wrap-narrow { max-width: 480px; }
.lab-wrap-wide { max-width: 1400px; }

.lab-hero { margin-bottom: 1.5rem; }

.eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--burg);
  margin-bottom: 0.5rem;
}

.lab-hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  color: var(--navy);
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.lead {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 42ch;
}

.lab-card {
  background: var(--card);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 12px rgba(13,34,64,0.05);
}

.lab-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
}

.lab-form input[type="text"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--navy);
  text-align: center;
}

.lab-form input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(210,175,87,0.25);
}

.hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.45rem 0 1.1rem;
  text-align: center;
}

.btn-primary {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: var(--navy);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary:hover { background: #16355f; }

.privacy {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  border-top: 1px solid #eee;
  padding-top: 1rem;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.resumen-ids {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.resumen-ids .label,
.promedio-inner .label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.tareas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: stretch;
}

.tareas-grid-2 {
  grid-template-columns: 1fr 1fr;
  gap: 1.35rem;
}

.tarea-panel {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.tarea-head {
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #eee;
}

.tarea-head h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.tarea-score {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--navy);
  line-height: 1;
}

.tarea-score small {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
}

.tarea-nota {
  display: block;
  margin-top: 0.45rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--burg);
}

.pendiente {
  color: var(--warn);
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Inter', system-ui, sans-serif;
}

.informe-frame-wrap {
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  min-height: 560px;
}

.tareas-grid-2 .informe-frame-wrap {
  min-height: 620px;
}

.informe-frame {
  width: 100%;
  height: 640px;
  border: 0;
  display: block;
  background: #fff;
}

.tareas-grid-2 .informe-frame {
  height: 680px;
}

.tarea-vacia {
  flex: 1;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px dashed #d1d5db;
  background: #fafafa;
  color: var(--muted);
  font-size: 0.9rem;
}

.promedio-c1 {
  border: 2px solid rgba(210,175,87,0.45);
  background: linear-gradient(180deg, #fffef8 0%, #fff 100%);
}

.promedio-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.promedio-inner strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  color: var(--navy);
}

.promedio-body {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1.25rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}

.notas-parciales {
  display: flex;
  gap: 0.85rem;
  flex: 1 1 280px;
  align-items: stretch;
}

.nota-chip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  text-align: center;
  flex: 1;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.nota-chip .label {
  display: block;
  margin-bottom: 0.35rem;
}

.nota-chip strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.55rem;
  color: var(--navy);
  line-height: 1;
}

.nota-c1-destacada {
  flex: 0 0 auto;
  min-width: 200px;
  text-align: center;
  padding: 1rem 1.6rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #7B303E 0%, #5a1f2a 100%);
  color: #fff;
  box-shadow: 0 8px 22px rgba(123,48,62,0.28);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.nota-c1-destacada .label {
  color: rgba(255,255,255,0.72);
  margin-bottom: 0.35rem;
}

.nota-c1-destacada strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  font-weight: 900;
  color: #D2AF57;
  line-height: 1;
  display: block;
}

.nota-c1-destacada .c1-sub {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}

.promedio-vacio {
  margin-top: 0.75rem;
  text-align: center;
}

.promedio-hint {
  margin-top: 0.85rem;
  font-size: 0.88rem;
  color: var(--warn);
  font-weight: 600;
  background: #fff8e6;
  border-left: 4px solid #dfa300;
  padding: 0.65rem 0.85rem;
  border-radius: 0 8px 8px 0;
}

@media (max-width: 960px) {
  .tareas-grid,
  .tareas-grid-2 {
    grid-template-columns: 1fr;
  }

  .informe-frame,
  .tareas-grid-2 .informe-frame {
    height: 480px;
  }

  .tareas-grid-2 .informe-frame-wrap {
    min-height: 420px;
  }

  .promedio-body {
    flex-direction: column;
  }

  .nota-c1-destacada {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .promedio-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .notas-parciales {
    width: 100%;
  }
}
