/* =============================================================
   1. Tokens — estilo "Maggie": tema verde de la marca Mi Índice
      (portada y páginas generales); la página de cada universidad
      usa su propio tema (.tema-utp) y sus tarjetas, su acento
   ============================================================= */
:root {
  /* Marca Mi Índice */
  --brand: #1f7a55;       /* verde esmeralda */
  --brand-deep: #14614a;
  /* Universidades */
  --utp: #681a5d;         /* morado UTP */
  --utp-deep: #50154f;
  /* Tema de la marca */
  --primary: var(--brand);
  --primary-deep: var(--brand-deep);
  --script-color: var(--brand-deep);  /* letra a mano: verde oscuro para que se lea sobre menta y salvia */
  --ink: #10291e;         /* texto y sombras sólidas: verde casi negro */
  --bg: #d3eedd;          /* fondo de la página: menta */
  --panel: #fbf7f2;       /* bloque grande «¿Qué es el índice?»: crema */
  --panel-2: #bfe3cf;     /* bloque de preguntas frecuentes: salvia */
  --card: #ffffff;        /* tarjetas: blancas */
  --tint: #d3eedd;        /* pastel de apoyo: menta */
  --tint-2: #bfe3cf;      /* segundo pastel: salvia */
  /* Pasteles comunes a todos los temas */
  --rose: #f8d5e9;
  --butter: #fff0a3;
  --cream: #fbf7f2;
  --white: #ffffff;
  /* Estados sobre fondo oscuro */
  --good-l: #c3f5d2;
  --warn-l: #fff0a3;
  --bad-l: #ffc2d4;

  --display: "Bagel Fat One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --script: "Homemade Apple", "Segoe Script", cursive;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  /* Separación entre bloques grandes. Cada bloque trae su propio margen:
     nunca depender del recuadro de publicidad, que los bloqueadores ocultan. */
  --gap-bloque: 40px;
  color-scheme: light;
}
/* Página de la UTP: su paleta morada de siempre */
.tema-utp {
  --primary: var(--utp);
  --primary-deep: var(--utp-deep);
  --script-color: var(--utp);
  --ink: #3f0f39;
  --bg: #efcdf5;          /* lila */
  --panel: #fbf7f2;       /* crema */
  --panel-2: #f8d5e9;     /* rosa */
  --card: #fbf7f2;        /* crema */
  --tint: #efcdf5;        /* lila */
  --tint-2: #dcc6f7;      /* lavanda */
}
/* Tarjeta de la UTP dentro de la portada: solo su color de acento */
.acento-utp { --primary: var(--utp); --primary-deep: var(--utp-deep); }
/* Se declaran en cada tema para que tomen su propia tinta */
:root, .tema-utp {
  --shadow: -4px 4px 0 var(--ink);
  --shadow-sm: -3px 3px 0 var(--ink);
  --shadow-lg: -7px 7px 0 var(--ink);
  --line: 2.5px solid var(--ink);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 10px; }
::selection { background: var(--primary); color: var(--cream); }

/* =============================================================
   3. Utilidades
   ============================================================= */
.wrap { width: 100%; max-width: 820px; margin-inline: auto; padding-inline: 16px; }
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--ink); color: var(--cream);
  border-radius: 999px; font-weight: 700;
}
.skip-link:focus { top: 1rem; }
.muted { opacity: .8; }
.opt { font-weight: 500; opacity: .75; font-size: .85em; font-family: var(--sans); text-transform: none; }
.script { font-family: var(--script); font-size: 1rem; color: var(--script-color); line-height: 1.8; }

/* Píldoras con sombra sólida (el botón de Maggie) */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; border-radius: 999px; border: var(--line);
  font-family: var(--display); font-weight: 400; font-size: .9rem; letter-spacing: .03em;
  text-transform: uppercase; text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.pill:hover { transform: translate(1px, -1px); box-shadow: -4px 4px 0 var(--ink); }
.pill:active { transform: translate(-3px, 3px); box-shadow: 0 0 0 var(--ink); }
.pill-sm { padding: 6px 14px; font-size: .78rem; }
.pill-lg { padding: 14px 26px; font-size: 1.05rem; }
.pill-lilac { background: var(--tint); }
.pill-rose { background: var(--rose); }
.pill-white { background: var(--white); }
.pill-butter { background: var(--butter); }
.pill-lavender { background: var(--tint-2); }

/* =============================================================
   4. Header / footer
   ============================================================= */
.site-header { padding-block: 14px; }
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand {
  display: inline-flex; align-items: center; text-decoration: none;
  font-family: var(--display); font-size: 1.6rem; text-transform: uppercase; letter-spacing: .02em;
  color: var(--primary); white-space: nowrap;
}
/* «MI ÍNDICE» escrito: el birrete del logo hace de tilde sobre la I */
.wm { display: inline-flex; align-items: baseline; white-space: nowrap; }
.wm-i { width: .7em; height: 1.117em; flex: none; overflow: visible; margin: 0 .01em -.017em .06em; }
.logo-cap { transform-box: fill-box; transform-origin: 50% 100%; }
.nav { display: flex; gap: 10px; }
.nav .pill:first-child { display: none; }

.site-footer { margin-top: 56px; background: var(--bg); overflow: hidden; }
/* «MI ÍNDICE» gigante, con el birrete sobre la I (mismas piezas que .wm) */
.wordmark {
  position: relative; display: flex; align-items: baseline; justify-content: center;
  font-family: var(--display); text-transform: uppercase; color: var(--primary);
  font-size: clamp(3rem, 16vw, 13rem); line-height: 1; letter-spacing: -.01em; white-space: nowrap;
  padding: .2em 16px 0; margin-bottom: -.14em;
}

.footer-in {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--primary); color: var(--cream);
  border-radius: 28px 28px 0 0; padding-block: 22px; font-size: .88rem;
  max-width: none; position: relative;
}
.footer-in nav { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-in .pill { color: var(--ink); box-shadow: -3px 3px 0 var(--cream); border-color: var(--cream); }

/* =============================================================
   5. Hero
   ============================================================= */
.hero { padding-top: 10px; padding-bottom: 20px; }
.hero h1 {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(2rem, 8.4vw, 4.2rem); line-height: 1.1; letter-spacing: .005em;
  color: var(--ink); margin-top: 2px;
}
.lead { margin-top: 12px; font-size: 1.02rem; max-width: 56ch; }

/* =============================================================
   6. Tarjeta de la herramienta
   ============================================================= */
.tool-card {
  background: var(--card);
  border: var(--line);
  border-radius: 30px;
  padding: 18px 14px;
  box-shadow: var(--shadow-lg);
}
.notice { background: var(--butter); border: var(--line); padding: 12px; border-radius: 16px; margin-bottom: 12px; }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.mode {
  text-align: left; padding: 12px 14px; border-radius: 20px;
  border: var(--line); background: var(--white);
  display: flex; flex-direction: column; gap: 3px;
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), background .15s;
}
.mode:hover { background: var(--tint); }
.mode[aria-pressed="true"] { background: var(--butter); box-shadow: var(--shadow-sm); transform: translate(1px, -1px); }
.mode-t { font-family: var(--display); text-transform: uppercase; font-size: .95rem; line-height: 1.2; letter-spacing: .02em; }
.mode-s { font-size: .8rem; line-height: 1.35; }

.block { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.block legend {
  font-family: var(--display); text-transform: uppercase; font-size: 1.05rem; letter-spacing: .02em;
  margin-bottom: 10px; padding: 0; line-height: 1.3;
}
.num {
  display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%;
  background: var(--primary); color: var(--cream); font-size: .85em; margin-right: 4px; vertical-align: 1px;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lbl { font-size: .86rem; font-weight: 800; }
.hint { font-size: .76rem; opacity: .75; }
input[type="text"] {
  width: 100%; min-width: 0;
  padding: 11px 13px; border-radius: 14px;
  border: var(--line); background: var(--white);
  font-size: 1rem; font-weight: 600;
  transition: box-shadow .15s var(--ease-out), transform .15s var(--ease-out);
}
input::placeholder { color: var(--ink); opacity: .62; font-weight: 500; }
input[type="text"]:focus { outline: none; box-shadow: -3px 3px 0 var(--primary); transform: translate(1px, -1px); }
input[aria-invalid="true"] { border-color: #c2185b; background: #fff0f5; }
.field-goal { max-width: 220px; }

/* Materias */
.course-head, .course-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 82px 36px;
  gap: 7px; align-items: center;
}
.tool-card[data-mode="goal"] .course-head,
.tool-card[data-mode="goal"] .course-main { grid-template-columns: minmax(0, 1fr) 90px 36px; }
.course-head { font-size: .76rem; font-weight: 800; margin-bottom: 5px; }
.courses { display: grid; gap: 8px; margin-bottom: 12px; }
.course .del {
  width: 36px; height: 36px; border-radius: 50%; font-size: 1.25rem; line-height: 1; font-weight: 700;
  border: 2px solid transparent; transition: background .15s, border-color .15s;
}
.course .del:hover { background: var(--rose); border-color: var(--ink); }
.btn-add {
  padding: 9px 18px; border-radius: 999px; border: var(--line); background: var(--tint-2);
  font-family: var(--display); text-transform: uppercase; font-size: .85rem; letter-spacing: .03em;
  box-shadow: var(--shadow-sm);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.btn-add:hover { transform: translate(1px, -1px); box-shadow: -4px 4px 0 var(--ink); }
.btn-add:active { transform: translate(-3px, 3px); box-shadow: 0 0 0 var(--ink); }

[data-only] { display: none; }
.tool-card[data-mode="predict"] [data-only="predict"] { display: revert; }
.tool-card[data-mode="goal"] [data-only="goal"] { display: revert; }
.tool-card[data-mode="predict"] .course-head span[data-only="predict"],
.tool-card[data-mode="predict"] .course input[data-only="predict"] { display: block; }

/* Resultado: panel del color principal (morado en la UTP) */
.result {
  border-radius: 24px; background: var(--primary); color: var(--cream);
  border: var(--line); padding: 18px 16px; margin-bottom: 16px; min-height: 70px;
}
.result-empty { font-size: .95rem; opacity: .9; }
.res-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.res-main { display: flex; flex-direction: column; gap: 2px; }
.res-label { font-size: .84rem; font-weight: 700; opacity: .88; }
.res-num {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.8rem, 13vw, 4rem); line-height: 1; color: var(--butter);
  text-shadow: -3px 3px 0 var(--ink);
}
.bad-num { color: var(--bad-l); }
.delta { font-size: .92rem; font-weight: 800; }
.delta.up { color: var(--good-l); }
.delta.down { color: var(--bad-l); }
.res-msg { margin-top: 12px; font-size: .98rem; font-weight: 700; }
.res-msg.good { color: var(--good-l); }
.res-msg.warn { color: var(--warn-l); }
.res-msg.bad { color: var(--bad-l); }
.res-note { margin-top: 8px; font-size: .86rem; opacity: .85; }
.res-error { color: var(--bad-l); font-weight: 700; }
.res-error + .res-error { margin-top: 4px; }

.res-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: .92rem; }
.res-table th, .res-table td { padding: 8px 6px; text-align: left; border-bottom: 1.5px solid rgba(251, 247, 242, .22); }
.res-table th { font-size: .76rem; font-weight: 800; opacity: .8; }
/* Nombres de materia: una palabra se corta solo si no cabe entera, con guion donde el navegador lo permite */
.res-table td:first-child { overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
.th-short { display: none; }
.letter {
  display: inline-block; min-width: 1.9em; text-align: center; padding: 1px 8px;
  border-radius: 999px; font-family: var(--display); font-weight: 400;
  background: var(--butter); color: var(--ink); border: 2px solid var(--ink);
}

/* Plan de notas (meta): cada letra es un botón que abre un menú con el diseño de la página */
.plan-cell { display: flex; align-items: center; gap: 8px; }
.pick { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 52px; min-height: 40px; }
.pick-btn { position: relative; cursor: pointer; font-size: 1rem; line-height: 1.5; }
.pick-btn::before { content: ""; position: absolute; inset: -9px -11px; } /* área para el dedo más grande que la pastilla */
.pick-btn::after { content: " ▾"; font-size: .7em; vertical-align: 1px; }
.pick-btn:focus-visible { outline: 3px solid var(--butter); outline-offset: 3px; }
.pick-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  width: max-content; min-width: 240px; max-width: calc(100vw - 16px);
  margin: 0; padding: 6px; list-style: none; text-align: left;
  background: var(--cream); color: var(--ink); border: var(--line); border-radius: 18px; box-shadow: var(--shadow);
  font-family: var(--sans); font-size: .9rem; font-weight: 600; line-height: 1.3;
}
.pick-menu.is-up { top: auto; bottom: calc(100% + 6px); }
.pick-opt { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border-radius: 12px; cursor: pointer; }
.pick-opt:hover, .pick-opt:focus { outline: none; background: var(--tint); }
.pick-opt:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
.pick-opt .letter { flex: none; }
.pick-opt-txt small { display: block; font-size: .74rem; font-weight: 600; opacity: .8; }
.pick-opt.is-sel { font-weight: 800; }
.pick-check { margin-left: auto; font-weight: 800; }
.pick-opt.is-off { cursor: not-allowed; }
.pick-opt.is-off .letter, .pick-opt.is-off .pick-opt-txt { opacity: .45; }
.pick-opt.is-off:hover { background: transparent; }
.pick-off {
  margin-left: auto; padding: 1px 8px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--white);
  font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.letter.is-mine { background: var(--cream); box-shadow: -2px 2px 0 var(--ink); }
.letter.is-moved { animation: plan-moved 1.2s var(--ease-out); }
@keyframes plan-moved {
  0% { box-shadow: 0 0 0 6px var(--butter); transform: scale(1.15); }
  100% { box-shadow: 0 0 0 0 transparent; transform: none; }
}
.plan-min { display: flex; flex-direction: column; line-height: 1.25; font-size: .88rem; }
.plan-tag { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.plan-tag.is-mine { color: var(--butter); opacity: 1; }
.plan-final strong { font-family: var(--display); font-weight: 400; font-size: 1.3em; color: var(--butter); }
.plan-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.result .pill { color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .pick-btn:hover { transform: translate(1px, -1px); box-shadow: -2px 2px 0 var(--ink); }
}
/* Dentro del menú, las letras no crecen al pasar el mouse por la fila */
.res-table tbody tr:hover .pick-menu .letter { transform: none; }

.key { font-size: .8rem; margin-bottom: 8px; opacity: .85; }
.badge {
  display: inline-block; font-size: .83rem; font-weight: 700;
  background: var(--tint); border: 2px solid var(--ink); border-radius: 999px; padding: 5px 12px;
}
.limits { font-size: .78rem; margin-top: 8px; opacity: .75; }

/* Anuncios (marcadores) */
.ad-slot {
  margin-block: 32px; min-height: 100px; border: 2.5px dashed var(--ink); border-radius: 24px;
  display: grid; place-items: center; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase;
  opacity: .55;
}

/* Situación actual: puntos o índice */
.tool-card[data-hist="points"] [data-hist-only="index"],
.tool-card[data-hist="index"] [data-hist-only="points"] { display: none; }
.cur-index {
  margin-top: 10px; font-size: .88rem; font-weight: 700;
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px;
  background: var(--butter); border: 2px solid var(--ink); border-radius: 14px; padding: 6px 12px;
}
.cur-index strong { font-family: var(--display); font-weight: 400; font-size: 1.15rem; }
.cur-index span { font-weight: 600; opacity: .75; font-size: .8rem; }
.hist-tools { margin-top: 8px; }
.link-btn {
  font-size: .85rem; font-weight: 700; color: var(--primary);
  text-decoration: underline; text-underline-offset: 3px; padding: 2px 0;
}
.link-btn:hover { color: var(--ink); }
.where { margin-top: 10px; background: var(--white); border: 2px solid var(--ink); border-radius: 16px; padding: 10px 14px; }
.where summary {
  cursor: pointer; font-weight: 800; font-size: .9rem; list-style: none;
  display: flex; align-items: center; gap: 8px;
}
.where summary::-webkit-details-marker { display: none; }
.where summary::before {
  content: "?"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: var(--cream); font-family: var(--display); font-size: .8rem;
}
.where ol { margin: 10px 0 6px; padding-left: 1.2rem; display: grid; gap: 6px; font-size: .88rem; }
.where .hint { display: block; }

/* Materias repetidas */
.course-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
/* Botón No / Sí: cambia de estado al presionarlo (empieza en «No»); el «Sí» resalta en amarillo */
.yn {
  flex: none; min-width: 64px; min-height: 44px; padding: 0 18px; border-radius: 14px;
  border: var(--line); background: var(--tint); box-shadow: var(--shadow-sm);
  font-size: .95rem; font-weight: 800;
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), background-color .15s var(--ease-out);
}
.yn[aria-checked="true"] { background: var(--butter); }
.yn:active { transform: translate(-3px, 3px); box-shadow: 0 0 0 var(--ink); }
.rep-q { font-size: .86rem; font-weight: 800; line-height: 1.3; }
.rep-q .opt { display: block; margin-top: 2px; }
.rep-all { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
/* Con «Sí» en la pregunta general, cada materia lleva su botón No / Sí adelante del nombre.
   En el celular las columnas se achican un poco para que el nombre pierda el menor espacio posible. */
.h-rep, .course .yn { display: none; }
.tool-card[data-rep="on"] .h-rep, .tool-card[data-rep="on"] .course .yn { display: block; }
.course .yn { align-self: stretch; min-width: 0; padding: 0; }
.tool-card[data-rep="on"] .course-head,
.tool-card[data-rep="on"] .course-main { grid-template-columns: 56px minmax(0, 1fr) 52px 68px 28px; gap: 5px; }
.tool-card[data-rep="on"][data-mode="goal"] .course-head,
.tool-card[data-rep="on"][data-mode="goal"] .course-main { grid-template-columns: 56px minmax(0, 1fr) 72px 28px; }
.tool-card[data-rep="on"] .course input[type="text"] { padding-inline: 8px; }
.tool-card[data-rep="on"] .course .del { width: 28px; height: 28px; }
.rep-tag {
  display: inline-block; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  background: var(--tint-2); color: var(--ink); border-radius: 999px; padding: 1px 7px; vertical-align: 1px;
}

/* ¿Te sirvió? (dentro del panel de resultado) */
.feedback {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  margin-top: 14px; padding-top: 12px; border-top: 1.5px dashed rgba(251, 247, 242, .35);
  font-size: .9rem; font-weight: 700;
}
.fb {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 14px; border-radius: 999px;
  background: var(--cream); color: var(--ink); border: 2px solid var(--ink); text-decoration: none;
  box-shadow: -2px 2px 0 var(--ink);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.feedback .hint { font-weight: 600; }
.fb:hover { transform: translate(1px, -1px); box-shadow: -3px 3px 0 var(--ink); }

/* Guardar escenario / copiar enlace (solo cuando hay un resultado) */
.actions { display: none; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.tool-card[data-has-result] .actions { display: flex; }
.actions-note { flex-basis: 100%; font-size: .76rem; opacity: .7; }
.save-form, .link-box {
  background: var(--white); border: 2px solid var(--ink); border-radius: 18px; padding: 12px 14px; margin-bottom: 14px;
}
.save-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.save-form .field { flex: 1 1 200px; }
.save-btns { display: flex; align-items: center; gap: 12px; }
.link-box input { margin-top: 6px; font-size: .8rem; }

/* Mis escenarios: plegable al inicio de la calculadora (solo aparece si hay alguno guardado) */
.scen-box { background: var(--white); border: 2px solid var(--ink); border-radius: 18px; margin-bottom: 16px; }
.scen-sum {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px;
  border-radius: 16px; cursor: pointer; list-style: none;
}
.scen-sum::-webkit-details-marker { display: none; }
.scen-sum::after { content: "▾"; margin-left: auto; font-size: 1.1rem; line-height: 1; transition: transform .2s var(--ease-out); }
.scen-box[open] .scen-sum::after { transform: rotate(180deg); }
.scen-title { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 1rem; letter-spacing: .02em; }
.scen-count { font-size: .8rem; font-weight: 700; opacity: .75; }
.scen-list { list-style: none; margin: 0; padding: 0 12px 12px; display: grid; gap: 8px; }
.scen-box .scen { background: var(--card); }
.scen {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  background: var(--white); border: 2px solid var(--ink); border-radius: 16px; padding: 10px 12px;
}
.scen-info { display: flex; flex-direction: column; min-width: 0; }
.scen-name { font-weight: 800; overflow-wrap: anywhere; }
.scen-meta { font-size: .78rem; opacity: .7; }
.scen-btns { display: flex; align-items: center; gap: 12px; }
.scen-here {
  display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; vertical-align: 2px;
  background: var(--butter); border: 1.5px solid var(--ink);
  font-size: .68rem; font-weight: 800; line-height: 1.5; white-space: nowrap;
}
.scen.is-asking .scen-btns { display: none; }

/* Escenario en el que estás: franja debajo de «Mis escenarios» */
.scen-now {
  display: flex; align-items: center; gap: 10px;
  margin: -6px 0 16px; padding: 6px 6px 6px 14px;
  background: var(--tint-2); border: 2px solid var(--ink); border-radius: 16px;
}
.scen-now-txt { flex: 1; min-width: 0; font-size: .88rem; line-height: 1.4; overflow-wrap: anywhere; }
.scen-dirty {
  display: inline-block; padding: 0 8px; border-radius: 999px; vertical-align: 1px;
  background: var(--butter); border: 1.5px solid var(--ink);
  font-size: .72rem; font-weight: 800; line-height: 1.5; white-space: nowrap;
}
.scen-now-x {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--ink); font-size: .85rem; font-weight: 800; line-height: 1;
}

/* Actualizar «nombre»: si el nombre es largo, se corta con «…» */
.pill-upd { max-width: 100%; }
.upd-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Confirmaciones con el diseño de la página (en vez de la ventana gris del navegador) */
.confirm {
  background: var(--white); border: var(--line); border-radius: 18px; box-shadow: var(--shadow-sm);
  padding: 12px 14px; margin-bottom: 14px;
}
.confirm-q { font-size: .9rem; line-height: 1.45; }
.confirm-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 10px; }
.confirm-in { flex-basis: 100%; margin: 0; border: 2px solid var(--ink); box-shadow: none; }
.limits + .confirm { margin: 12px 0 0; }

/* Enlace compartido */
.shared-banner {
  background: var(--butter); border: var(--line); border-radius: 20px; box-shadow: var(--shadow-sm);
  padding: 12px 14px; margin-bottom: 16px; font-size: .9rem;
}
.shared-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

/* Avisos cortos */
.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 50; transform: translate(-50%, 20px);
  width: max-content; max-width: min(92vw, 440px);
  background: var(--ink); color: var(--cream); border-radius: 16px; padding: 11px 18px;
  font-size: .9rem; font-weight: 700; text-align: center; box-shadow: -4px 4px 0 var(--primary);
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =============================================================
   7. Bandas de contenido (bloques de color)
   ============================================================= */
.band { padding-block: 44px; }
.big {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(1.9rem, 7vw, 3.2rem); line-height: 1.1; letter-spacing: .005em;
  margin-bottom: 20px;
}
h3 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 1.3rem; line-height: 1.15; margin: 28px 0 8px; }

/* Bloques grandes: mismo ancho que la columna de contenido (tarjeta de la UTP,
   calculadora); 772px = 820px de .wrap menos sus 24px de margen a cada lado */
.band-cream, .band-rose { width: calc(100% - 32px); max-width: 772px; margin: var(--gap-bloque) auto 0; }
.band-cream > .wrap, .band-rose > .wrap { padding-inline: 18px; }
.band-cream { background: var(--panel); border-radius: 40px; border: var(--line); }

/* Pasos: tarjetas de colores con sombra sólida */
.steps-list { list-style: none; padding: 0; display: grid; gap: 16px; }
.step {
  position: relative; border: var(--line); border-radius: 26px; box-shadow: var(--shadow);
  padding: 18px 18px 18px 74px; display: flex; flex-direction: column; gap: 8px; min-height: 96px;
}
.step strong { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 1.1rem; line-height: 1.2; letter-spacing: .02em; }
.step-n {
  position: absolute; left: 16px; top: 18px; width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; background: var(--primary); color: var(--cream);
  font-family: var(--display); font-size: 1.4rem; border: 2px solid var(--ink);
}
.step-lilac { background: var(--tint); }
.step-rose { background: var(--rose); }
.step-butter { background: var(--butter); }

/* Cúpula con «MI ÍNDICE» (mismas piezas que el pie: .wm-i y .logo-cap) */
.band-dome { padding-block: 0; margin-top: 56px; }
.dome {
  position: relative; width: 100%; height: clamp(170px, 38vw, 340px);
  background: var(--tint-2); border-radius: 1000px 1000px 0 0;
}
.dome-word {
  position: absolute; left: 50%; top: 56%; transform: translate(-50%, -50%);
  display: flex; align-items: baseline; white-space: nowrap;
  font-family: var(--display); text-transform: uppercase; color: var(--primary);
  font-size: clamp(2.6rem, 14vw, 11rem); line-height: 1;
}
.dome-body { background: var(--tint-2); padding-bottom: 48px; }

.prose p { margin-bottom: 12px; max-width: 65ch; }
.table-wrap {
  overflow-x: auto; margin: 6px 0 16px; background: var(--card);
  border: var(--line); border-radius: 22px; box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: 10px 7px; text-align: left; border-bottom: 1.5px solid color-mix(in srgb, var(--ink) 15%, transparent); }
.table-wrap th:first-child, .table-wrap td:first-child { padding-left: 12px; }
tr:last-child td { border-bottom: 0; }
th { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.tag {
  display: inline-grid; place-items: center; width: 2em; height: 2em; border-radius: 50%;
  font-family: var(--display); border: 2px solid var(--ink);
}
.tag-a { background: var(--butter); }
.tag-b { background: var(--tint); }
.tag-c { background: var(--rose); }
.tag-d { background: var(--white); }
.tag-f { background: var(--primary); color: var(--cream); }

.example {
  background: var(--butter); border: var(--line); border-radius: 26px; box-shadow: var(--shadow);
  padding: 16px 18px; margin: 22px 0 8px;
}
.example p { margin-bottom: 6px; }
.example .table-wrap { box-shadow: none; margin: 8px 0 14px; }
.calc-line { font-family: var(--display); font-size: 1.1rem; line-height: 1.3; }

/* Banda del color principal con titular gigante (el "PARENTING SHOULD FEEL LIGHTER") */
.band-plum { background: var(--primary); color: var(--cream); padding-block: 56px; }
.giant {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(2.4rem, 11vw, 5.6rem); line-height: 1.08; margin-bottom: 22px;
  display: flex; flex-direction: column;
}
.giant-accent { color: var(--butter); text-shadow: -4px 4px 0 var(--ink); }
.band-plum p { max-width: 60ch; margin-bottom: 24px; }
.band-plum .pill { color: var(--ink); }

/* FAQ */
.band-rose { background: var(--panel-2); border-radius: 48px; border: var(--line); }
.band-cream + .band-rose { margin-top: 28px; }
.faq details {
  background: var(--card); border: var(--line); border-radius: 22px; box-shadow: var(--shadow-sm);
  padding: 14px 18px; margin-bottom: 12px;
}
.faq summary {
  font-weight: 800; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--butter); border: 2px solid var(--ink); font-family: var(--display); line-height: 1;
  transition: transform .2s var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin-top: 10px; max-width: 65ch; }

.more { margin-top: 48px; }

/* Opiniones, fuente y regreso */
.idea { margin-top: 48px; }
.idea-card {
  background: var(--card); border: var(--line); border-radius: 32px; box-shadow: var(--shadow-lg);
  padding: 24px 20px;
}
.idea-card p { max-width: 60ch; margin-bottom: 18px; }
.back { margin-top: var(--gap-bloque); }
.source { font-size: .82rem; opacity: .8; }
.source a { color: var(--primary); font-weight: 700; }

/* Portada */
.home-hero .lead { max-width: 52ch; }
.uni-title {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: 1.05rem; letter-spacing: .03em; margin-bottom: 12px;
}
.uni-list { list-style: none; padding: 0; display: grid; gap: 18px; }
.uni-card {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 16px;
  background: var(--card); border: var(--line); border-radius: 30px; box-shadow: var(--shadow-lg);
  padding: 18px; text-decoration: none; color: var(--ink);
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.uni-badge {
  grid-row: span 2; width: 84px; height: 84px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--primary); color: var(--cream); border: 2.5px solid var(--ink);
  font-family: var(--display); font-size: .95rem; line-height: 1; letter-spacing: .04em;
}
.uni-logo { width: 42px; height: auto; overflow: visible; }
.uni-name {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(1.15rem, 4.6vw, 1.5rem); line-height: 1.12; align-self: end;
}
.uni-desc { font-size: .88rem; align-self: start; }
.uni-cta { grid-column: 1 / -1; justify-self: start; margin-top: 10px; }
.suggest {
  margin-top: 22px; background: var(--panel-2); border: var(--line); border-radius: 26px; box-shadow: var(--shadow);
  padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px;
}
.suggest h2 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 1.25rem; line-height: 1.12; }
.suggest p { font-size: .9rem; margin-top: 4px; }

/* =============================================================
   7b. Hover sutil (solo con mouse; en táctil no se queda "pegado")
   ============================================================= */
.step, .example, .faq details, .logo-cap, .tag, .letter,
.table-wrap tbody tr, input[type="text"] {
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out),
              background-color .2s var(--ease-out), border-color .2s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  /* Tarjetas: se levantan un poco y crece la sombra */
  .step:hover, .example:hover { transform: translate(2px, -2px); box-shadow: -6px 6px 0 var(--ink); }
  .faq details:hover { transform: translate(1px, -1px); box-shadow: var(--shadow); }
  .faq summary:hover::after { background: var(--tint); }

  /* Modos y campos */
  .mode:not([aria-pressed="true"]):hover { transform: translate(1px, -1px); box-shadow: var(--shadow-sm); }
  .scen-sum:hover { background: var(--tint); }
  .scen-now-x:hover { background: var(--tint); }
  .yn:hover { transform: translate(1px, -1px); box-shadow: -4px 4px 0 var(--ink); }
  input[type="text"]:hover:not(:focus) { border-color: var(--primary); }

  /* Tablas: resalta la fila y la letra */
  .table-wrap tbody tr:hover { background: var(--tint); }
  .table-wrap tbody tr:hover .tag { transform: scale(1.12) rotate(-6deg); }
  .res-table tbody tr:hover .letter { transform: scale(1.1); }

  /* Logo y caritas: un pequeño guiño de vida (el birrete se levanta) */
  .brand:hover .logo-cap { transform: translateY(-1.5px) rotate(-10deg); }
  .wordmark:hover .logo-cap { transform: translateY(-.03em) rotate(-10deg); }
  .dome:hover .logo-cap { transform: translateY(-.03em) rotate(-10deg); }

  /* Tarjeta de universidad */
  .uni-card:hover { transform: translate(2px, -2px); box-shadow: -9px 9px 0 var(--ink); }
}
.uni-card:active { transform: translate(-3px, 3px); box-shadow: -2px 2px 0 var(--ink); }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .wrap { padding-inline: 24px; }
  .tool-card { padding: 24px; }
  .res-grid { grid-template-columns: 1fr 1fr; }
  .nav .pill:first-child { display: inline-flex; }
  .course-head, .course-main { grid-template-columns: minmax(0, 1fr) 84px 110px 36px; }
  .tool-card[data-rep="on"] .course-head,
  .tool-card[data-rep="on"] .course-main { grid-template-columns: 64px minmax(0, 1fr) 84px 110px 36px; gap: 7px; }
  .tool-card[data-rep="on"][data-mode="goal"] .course-head,
  .tool-card[data-rep="on"][data-mode="goal"] .course-main { grid-template-columns: 64px minmax(0, 1fr) 90px 36px; }
  .tool-card[data-rep="on"] .course input[type="text"] { padding-inline: 13px; }
  .tool-card[data-rep="on"] .course .del { width: 36px; height: 36px; }
  .band-cream, .band-rose { width: calc(100% - 48px); }
  .band-cream > .wrap, .band-rose > .wrap { padding-inline: 28px; }
  .brand { font-size: 2.2rem; }
  table { font-size: .95rem; }
  th, td { padding: 11px 12px; }
}
@media (min-width: 720px) {
  .hero { padding-top: 28px; }
  .steps-list { grid-template-columns: repeat(3, 1fr); }
  .step { padding: 74px 18px 20px; }
  .step-n { top: 18px; }
  .band-cream > .wrap, .band-rose > .wrap { padding-inline: 40px; }
  .footer-in { flex-direction: row; justify-content: space-between; align-items: center; }
}
@media (max-width: 340px) {
  .modes { grid-template-columns: 1fr; }
}
/* Celular: las columnas de números con ancho fijo y todo el resto para el nombre de la materia.
   Así los nombres comunes caben enteros y, aunque una palabra sea muy larga, la tabla no se sale del panel. */
@media (max-width: 480px) {
  .res-table { table-layout: fixed; }
  .res-table th:nth-child(2) { width: 4.2em; }
  .res-table:not(.plan-table) th:nth-child(3) { width: 3.9em; }
  .res-table:not(.plan-table) th:nth-child(4) { width: 3.4em; }
  .plan-table th:nth-child(3) { width: 6em; }
  .plan-cell { flex-direction: column; align-items: flex-start; gap: 4px; }
  .th-long { display: none; }
  .th-short { display: inline; }
}
/* Celulares muy angostos: las tablas del resultado caben sin salirse del panel */
@media (max-width: 359px) {
  .result { padding-inline: 12px; }
  .res-table { font-size: .84rem; }
  .res-table th, .res-table td { padding-inline: 3px; }
  .res-table th { font-size: .7rem; }
  .pick { min-width: 46px; }
  .plan-min { font-size: .8rem; }
}

/* =============================================================
   9. Reduced motion / print
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .pill, .btn-add, .mode, input[type="text"], .step, .example, .faq details,
  .logo-cap, .tag, .letter, .table-wrap tbody tr, .uni-card, .fb, .toast, .yn { transition: none; }
  .letter.is-moved { animation: none; }
}
@media print {
  .site-header, .ad-slot, .modes, .band, .more, .site-footer, #add-course, .del,
  .actions, .save-form, .link-box, .scen-box, .scen-now, .confirm, .shared-banner, .feedback, .toast, .idea, .back,
  .hist-tools, .where, .course-tools { display: none !important; }
  body { background: #fff; }
  .tool-card { box-shadow: none; }
}
