/* Páginas «Mi perfil» y «Mi agenda» (design-system.md). Se carga después de styles.css y solo usa sus variables. */

/* La banda ocupa toda la página, con una columna de 640 px como máximo. */
main.profile { max-width: none; margin: 0; padding: 12px 0 40px; }
.profile .wrap { max-width: 640px; }
.profile h1 { margin: 8px 0 6px; }
.profile-status { margin-top: 14px; }
.profile-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  color: var(--on-band);
  text-decoration: none;
  border-radius: var(--radius-control);
}
/* Igual que «Volver al inicio» de las páginas legales (19/11/26): icono de 20, 15 px, subrayado solo al pasar el ratón. */
.profile-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.profile-back svg { flex: none; }
.profile-back:focus-visible { box-shadow: 0 0 0 1px var(--band), 0 0 0 3px var(--on-band); }

/* Bloques: paneles sueltos sobre la banda, uno debajo de otro. */
.profile .panel { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; border-radius: var(--radius-frame); }
.profile .panel-label { margin: 0; }
.profile .panel .hint { margin: 0; }
.profile-alias { display: flex; flex-direction: column; gap: 2px; }
.profile #profile-out .btn { align-self: flex-start; }

/* Cerrar sesión y borrar la cuenta: al final, en un bloque sin título. */
.profile .profile-actions { padding-block: 14px; }
/* «Borrar mi cuenta» (TA-53, 19/11/26; design-system.md, «Enlace discreto»): pequeño, subrayado, fuera de los paneles. */
.discreet-wrap { margin: 18px 0 0; text-align: center; }
.discreet-link {
  min-height: 44px;
  padding: 0 8px;
  font: inherit;
  font-size: 14px;
  color: var(--on-band);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-control);
  opacity: 0.8;
  cursor: pointer;
}
.discreet-link:hover { opacity: 1; }
.discreet-link:focus-visible { opacity: 1; outline: none; box-shadow: 0 0 0 1px var(--band), 0 0 0 3px var(--on-band); }

/* Ventana de añadir o modificar extraescolares: varias actividades y un solo guardado. */
.xnum { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.xcard.done { background: var(--surface); }
.xgroup {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 14px 14px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-frame);
}
.xgroup > .btn { align-self: flex-start; }

/* Página «Mis exámenes» (16/11/26): un panel por curso escolar con «Próximos» y «Pasados». */
.xyear { display: flex; flex-direction: column; gap: 8px; }
.xyear + .xyear { margin-top: 6px; }
.dialog .btn.del.block { margin-top: 4px; }

/* «Mis exámenes»: vista de calendario (16/11/26, opción 3C). Los días con examen llevan el fondo suave y el borde del
   tono de su asignatura (--subject y --subject-soft, de js/exams-page.js); sin tono, gris. */
.view-seg { margin-top: 14px; color: var(--text); }
.cal { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 3px; text-align: center; font-variant-numeric: tabular-nums; }
.cal th { padding-bottom: 4px; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.cal abbr { text-decoration: none; }
.cal td { height: 40px; padding: 0; font-size: 15px; }
.calday {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  max-width: 100%;
  height: 40px;
  box-sizing: border-box;
  border-radius: 50%;
}
.calday.past { color: var(--text-muted); }
.calday.today { font-weight: 700; border: 2px solid var(--accent); }
.calday.has,
.calmark {
  font-weight: 700;
  color: var(--text);
  background: var(--subject-soft, var(--surface));
  border: 2px solid var(--subject, var(--border-control));
}
.calday.has.today { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
.calmark {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  font-size: 13px;
  border-radius: 50%;
}
/* Cabecera del calendario (16/11/26): flechas a los lados (botón secundario de solo icono, 44 × 44) y el mes en medio. */
.calnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.calnav-title { margin: 0; font-size: 18px; text-align: center; }
.calnav .btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* Día con examen: se pulsa para editar. */
button.calday { padding: 0; font: inherit; font-weight: 700; cursor: pointer; }
button.calday:hover { border-color: var(--text); }
button.calday:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--panel), 0 0 0 3px var(--border-control); }
button.calday.has.today:focus-visible { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent), 0 0 0 5px var(--panel), 0 0 0 7px var(--border-control); }

.xyear .xrows .xrow:last-child, #exams-cal-list .xrow:last-child { border-bottom: 0; }
.xfilter .field { max-width: none; margin-bottom: 0; }

/* ---------- Grupo Familiar (SPEC-001, parte 2; design-system.md) ---------- */

/* Círculo con la inicial (decorativo). Pendiente: discontinuo y apagado. Por debajo de 420 no se muestra. */
.initial-dot {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  background: var(--accent-soft);
  border: 1px solid var(--border-control);
  border-radius: 50%;
}
.initial-dot.pending { color: var(--text-muted); background: var(--surface); border-style: dashed; }
@media (max-width: 420px) { .xrows .initial-dot { display: none; } }
/* Etiquetas de la fila: «Tú» y «Pendiente» (design-system.md, «Etiqueta»). */
.gtag { display: inline-flex; align-items: center; padding: 2px 8px; font-size: 12px; font-weight: 600; border-radius: 999px; vertical-align: 1px; }
.gtag.you { margin-right: 6px; color: var(--text); background: var(--accent-soft); }
.gtag.pending { margin-left: 8px; color: var(--text-muted); background: var(--surface); }
.family-sub { margin: 0; font-size: 14px; color: var(--text-muted); }

/* Fila de invitación: 1) nombre, «Pendiente» y papelera; 2) enlace, copiar y compartir; 3) código y caducidad. */
.xrow.invite { flex-direction: column; align-items: stretch; gap: 8px; }
.inv-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.inv-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-size: 15px; }
.inv-line { display: flex; gap: 8px; align-items: center; min-width: 0; }
.inv-line .input { flex: 1 1 0; min-width: 0; min-height: 44px; font-size: 14px; color: var(--text-muted); text-overflow: ellipsis; background: var(--surface); }
.xrow.invite .inv-line, .xrow.invite .inv-when, .xrow.invite .inv-again { margin-left: 52px; }
@media (max-width: 420px) { .xrow.invite .inv-line, .xrow.invite .inv-when, .xrow.invite .inv-again { margin-left: 0; } }
.inv-when { font-size: 14px; color: var(--text-muted); }
.inv-again { align-self: flex-start; }

/* Fila de añadir: campos con borde discontinuo y el principal solo icono, en una línea (dos en el móvil). */
.add-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 0.8fr) auto; gap: 8px; align-items: end; padding-top: 8px; }
.add-row .field { max-width: none; margin: 0; gap: 4px; }
.add-row .field label, .add-row .field .lab { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.input.dashed, select.input.dashed { padding-left: 11px; border: 2px dashed var(--border-control); }
.input.dashed::placeholder { color: var(--text-muted); }
.add-row .add-go { min-width: 44px; width: 44px; padding: 0; }
@media (max-width: 560px) {
  .add-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; }
  .add-row .f-name { grid-column: 1 / -1; }
}

/* Caja de lectura obligada (permiso para menores de 14). */
.readbox {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.5;
  background: var(--surface);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
}
.readbox:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--gap), 0 0 0 3px var(--border-control); }
.readbox h4 { margin: 0; font-family: var(--font-heading); font-size: 16px; }
.readbox p { margin: 0; }
.read-status { margin: 0; font-size: 14px; color: var(--text-muted); }
.read-status.ok { color: var(--status-ok); }

/* Código de una invitación, grande, en dos grupos de 4. */
.invite-code { padding: 10px; font-family: var(--font-heading); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.14em; text-align: center; user-select: all; background: var(--surface); border-radius: var(--radius-control); }


/* «Qué ven tus tutores», desde los 18 (Grupo Familiar, parte 3). */
.family-share { display: flex; flex-direction: column; gap: 8px; }
.family-share[hidden] { display: none; }
.xrows .xrow > .btn.s:not(.xbtn) { flex: none; white-space: nowrap; } /* «No borrar» (parte 5) */

/* «Soy…» en «Tu cuenta» de «Mi familia» (TA-48, 22/11/26): debajo del correo, a 14. */
.family-rel { margin: 14px 0 0; }
#family-as { margin: 0 0 4px; }

/* «Mi familia» (TA-72, 24/11/26). Panel destacado (design-system.md, «Banda, panel y hoja»): panel con borde de 2 en el color
   principal y botón con la flecha detrás. */
.band .panel.next-step { box-shadow: inset 0 0 0 2px var(--accent); }
.next-step .next-text { margin: 0; font-size: 15px; color: var(--text-muted); }
.next-row { display: flex; gap: 8px; }
.next-row .btn.block { flex: 1; width: auto; }
.next-row .xbtn { flex: none; }
.btn.icon-after, .btn.icon-before { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

/* Ventana «De elegir acción» (design-system.md, «Ventana»): una opción por acción; la que quita algo, en color de revisión. */
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  cursor: pointer;
}
.choice svg { flex: none; margin-top: 1px; }
.choice:hover { background: var(--hover-overlay); }
.choice:active { background: var(--pressed-overlay); }
.choice:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--bg), 0 0 0 3px var(--border-control); }
.choice-text { display: flex; flex-direction: column; gap: 2px; }
.choice-name { font-family: var(--font-heading); font-size: 16px; font-weight: 700; }
.choice-help { font-size: 14px; color: var(--text-muted); }
.choice.del { border-color: var(--status-review); }
.choice.del svg, .choice.del .choice-name { color: var(--status-review); }
.choice.del:focus-visible { box-shadow: 0 0 0 1px var(--bg), 0 0 0 3px var(--status-review); }

/* «Cómo empieza tu estudiante» (TA-72): lista de lo que ganáis (la de pasos está en styles.css). */
.gains { display: flex; flex-direction: column; gap: 6px; margin: 0; padding-left: 20px; }
