/* ========================================
   The questionnaires' own components.
   It leans on the variables and typography of style.css: only what the main
   site did not have goes here (choice cards, feedback, progress, summary).
   ======================================== */

:root {
  --color-ok: #2f7d4f;
  --color-ok-bg: rgba(47, 125, 79, 0.10);
  --color-bad: #a83232;
  --color-bad-bg: rgba(168, 50, 50, 0.10);
  /* The middle verdict of an essay (plan 0042): neither of the two above. */
  --color-partial: #8a5a00;
  --color-partial-bg: rgba(138, 90, 0, 0.10);
  --color-card-bg: rgba(192, 151, 39, 0.06);
  --color-card-bg-hover: rgba(192, 151, 39, 0.14);
  /* How strongly `backdrop.js` lights the grid under the pointer: the lines
     and the halo. Over white the gold reads much heavier than over black,
     so the light theme gets far less of both. */
  --backdrop-line-alpha: 0.16;
  --backdrop-halo-alpha: 0.025;
  /* The cards, the notice and the topic boxes share one shape: rounded and
     a hairline instead of the 2px frame. The surface is the same faint tint
     as the question rows, so the grid behind shows through. The hard offset
     shadow stays, but only on the one card that is the main entrance
     (`--all`), as in the navigation. A hover swaps `--color-surface` on the
     card itself for the stronger tint. */
  --radius-card: 0.9rem;
  /* Buttons, inputs and rows: a smaller radius than the cards they sit in. */
  --radius-control: 0.55rem;
  --color-surface: var(--color-card-bg);
  --color-line: color-mix(in srgb, var(--color-border) 70%, transparent);
  --color-line-hover: color-mix(in srgb, var(--color-header-accent) 65%, transparent);
  /* The separators between the rows inside an open topic: with no card
     around them they are the only structure, so a step firmer than a card's
     hairline. */
  --color-rule: var(--color-border);
  --color-glow: color-mix(in srgb, var(--color-header-accent) 16%, transparent);
  --shadow-lift: 0 14px 32px -16px color-mix(in srgb, var(--color-header-accent) 45%, transparent);
  /* For the code blocks in the prompts. It does not change with the theme. */
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  /* «Continuar con Google» in the colours of Google's own sign-in button,
     which its branding guidelines fix for each theme. */
  --google-btn-bg: #ffffff;
  --google-btn-border: #747775;
  --google-btn-text: #1f1f1f;
  /* The roadmap's colours, the few that live beside the gold. Mid tones that
     read on both themes, so they do not change with it. The roadmap gives
     one to each area, and the home page uses the same ones for the same
     areas (`.home-accent--*`). */
  --hue-gold: #c09727;
  --hue-green: #39935c;
  --hue-purple: #9b72cf;
  --hue-blue: #478bd3;
  --hue-teal: #269ca6;
  --hue-orange: #c47a1c;
  --hue-gray: #7b8494;
  --hue-pink: #c65a8c;
  /* The updates of /news: a muted teal. Unlike the hues above it changes
     with the theme, like the site's gold: deeper on white so it still reads,
     lighter on the dark page. Both are kept at about a third of full
     saturation: the brighter #16949a / #62d4d6 of the first version shouted
     over the gold on the home page (softened on 2026-12-02). */
  --news-update: #3a8085;
}

:root[data-theme='dark'] {
  --news-update: #86c3c5;
  --color-ok: #6fcf97;
  --color-ok-bg: rgba(111, 207, 151, 0.12);
  --color-bad: #e07a7a;
  --color-bad-bg: rgba(224, 122, 122, 0.12);
  --color-partial: #e8b04a;
  --color-partial-bg: rgba(232, 176, 74, 0.12);
  --color-card-bg: rgba(242, 207, 102, 0.05);
  --color-card-bg-hover: rgba(242, 207, 102, 0.12);
  --backdrop-line-alpha: 0.4;
  --backdrop-halo-alpha: 0.06;
  --google-btn-bg: #131314;
  --google-btn-border: #8e918f;
  --google-btn-text: #e3e3e3;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --news-update: #86c3c5;
    --color-ok: #6fcf97;
    --color-ok-bg: rgba(111, 207, 151, 0.12);
    --color-bad: #e07a7a;
    --color-bad-bg: rgba(224, 122, 122, 0.12);
    --color-partial: #e8b04a;
    --color-partial-bg: rgba(232, 176, 74, 0.12);
    --color-card-bg: rgba(242, 207, 102, 0.05);
    --color-card-bg-hover: rgba(242, 207, 102, 0.12);
    --backdrop-line-alpha: 0.4;
    --backdrop-halo-alpha: 0.06;
    --google-btn-bg: #131314;
    --google-btn-border: #8e918f;
    --google-btn-text: #e3e3e3;
  }
}

/* --- The header's navigation ---
   «Sesión grupal» carries an icon that stays when its label goes on a narrow
   phone, and a signed-in account is one button —initial, name and caret—
   that opens a small menu with the profile and signing out. The menu is a
   <details>, so it works without JavaScript and with the keyboard. Nothing
   in the header ever wraps to a second row: on a phone the name goes and
   only the initial stays. */

.site-nav {
  align-items: center;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.site-nav__icon {
  flex: 0 0 auto;
}

.account-menu {
  position: relative;
  flex-shrink: 0;
}

.account-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 16rem;
  padding: 0.25rem 0.6rem 0.25rem 0.3rem;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  color: var(--color-text);
  background: var(--color-surface);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.2;
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.account-menu__trigger::-webkit-details-marker {
  display: none;
}

.account-menu__trigger:hover,
.account-menu__trigger:focus-visible,
.account-menu[open] > .account-menu__trigger,
.account-menu__trigger.is-active {
  border-color: var(--color-line-hover);
  background: var(--color-card-bg-hover);
  outline: none;
}

.account-menu__trigger:focus-visible {
  box-shadow: 0 0 0 3px var(--color-glow);
}

.account-menu__avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  /* Dark on the gold in both themes: the light theme's background, white,
     would read at about 2:1 on its darker gold. */
  color: #1a1405;
  background: var(--color-header-accent);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.account-menu__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu__caret {
  flex: 0 0 auto;
  color: var(--color-muted);
  transition: transform 0.2s ease;
}

.account-menu[open] .account-menu__caret {
  transform: rotate(180deg);
}

.account-menu__panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 0.15rem;
  width: max-content;
  min-width: 15rem;
  max-width: min(20rem, calc(100vw - 2rem));
  padding: 0.4rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--color-bg);
  box-shadow: var(--shadow-lift), 0 2px 6px rgba(0, 0, 0, 0.12);
  animation: account-menu-in 0.14s ease-out;
}

@keyframes account-menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .account-menu__panel {
    animation: none;
  }
}

.account-menu__who {
  display: grid;
  gap: 0.1rem;
  margin: 0 0 0.3rem;
  padding: 0.55rem 0.7rem 0.7rem;
  border-bottom: 1px solid var(--color-line);
  line-height: 1.3;
}

.account-menu__who strong,
.account-menu__who span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu__who strong {
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

.account-menu__who span {
  color: var(--color-muted);
  font-size: 0.82rem;
}

.account-menu__form {
  margin: 0;
}

.account-menu__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: none;
  border-radius: var(--radius-control);
  color: var(--color-text);
  background: transparent;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-menu__item svg {
  flex: 0 0 auto;
  color: var(--color-muted);
}

.account-menu__item:hover,
.account-menu__item:focus-visible {
  color: var(--color-text);
  background: var(--color-card-bg-hover);
  outline: none;
}

.account-menu__item:hover svg,
.account-menu__item:focus-visible svg,
.account-menu__item[aria-current] svg {
  color: var(--color-header-accent);
}

.account-menu__item[aria-current] {
  font-weight: 600;
}

.account-menu__item--logout:hover,
.account-menu__item--logout:focus-visible,
.account-menu__item--logout:hover svg,
.account-menu__item--logout:focus-visible svg {
  color: var(--color-bad);
}

/* A phone: one row always. style.css scrolls the header sideways there, and
   a scrolling box would clip the menu, so it goes back to visible and the
   pieces shrink instead —the name first, then «Sesión grupal»'s label—. */
@media (max-width: 600px) {
  .site-header__inner {
    flex-wrap: nowrap;
    overflow: visible;
  }

  .site-header__actions,
  .site-nav {
    gap: 0.4rem;
  }

  .account-menu__trigger {
    gap: 0.3rem;
    padding: 0.2rem 0.4rem 0.2rem 0.2rem;
  }

  .account-menu__name {
    display: none;
  }

  .theme-toggle {
    flex-shrink: 0;
  }
}

/* Below 420 px «Sesión grupal» does not fit with its label next to the brand
   and the account, signed in or out (measured: about 380 and 390 px), so it
   keeps the icon; the label stays for screen readers and in the title. */
@media (max-width: 420px) {
  .site-nav__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* --- Breadcrumbs --- */

.breadcrumb {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

.breadcrumb a {
  color: var(--color-muted);
}

.breadcrumb a:hover {
  color: var(--color-link);
}

.breadcrumb__separator {
  opacity: 0.5;
  margin: 0 0.35rem;
}

.question-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.55rem 0 1rem;
  padding: 0.48rem 0.75rem;
  border: 2px solid var(--color-notes-link);
  color: var(--color-notes-link);
  background: transparent;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--color-notes-shadow);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.question-back:hover,
.question-back:focus-visible {
  border-color: var(--color-text);
  color: var(--color-text);
  transform: translateX(-2px);
  box-shadow: 5px 3px 0 var(--color-notes-shadow);
  outline: none;
}

/* --- Buttons --- */

.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.5rem;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0.6rem 0.7rem;
  border: 2px solid var(--color-notes-link);
  color: var(--color-notes-link);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover,
.btn:focus-visible {
  color: var(--color-text);
  border-color: var(--color-text);
  outline: none;
}

.btn--primary {
  color: var(--color-bg);
  background: var(--color-notes-link);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  color: var(--color-bg);
  background: var(--color-text);
  border-color: var(--color-text);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: var(--spacing);
}

/* --- Scope cards (Todo / Tema N) --- */

/* Two columns on a wide screen, one on mobile. `auto-fill` decides on its own
   from the available space: with --max-width at 720px exactly two fit. */
.scope-list {
  list-style: none;
  padding-left: 0;
  margin: var(--spacing) 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
}

.scope-list__item {
  /* Anchor for the stretched link further down, and its own stacking context
     so the spotlight (::before, z-index -1) sits between the surface and the
     text instead of behind the page. */
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--color-header-accent) 4%, transparent), transparent 60%),
    var(--color-surface);
  padding: 1.2rem 1.3rem;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.scope-list__item:hover,
.scope-list__item:focus-within,
.notes-topic:hover,
.notes-topic[open],
.document-card:hover,
.document-card:focus-within {
  --color-surface: var(--color-card-bg-hover);
}

.scope-list__item:hover,
.scope-list__item:focus-within {
  border-color: var(--color-line-hover);
  box-shadow: var(--shadow-lift);
}

/* A cursor-following light inside the card. `backdrop.js` writes where the
   pointer is; without it the light sits centred above the card and only the
   border reacts. */
.scope-list__item::before,
.document-card::before,
.notes-topic::before,
.home-feature-card::before,
.roadmap-step::before,
.roadmap-entry__card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(
    260px circle at var(--spot-x, 50%) var(--spot-y, -30%),
    var(--color-glow),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.scope-list__item:hover::before,
.scope-list__item:focus-within::before,
.document-card:hover::before,
.document-card:focus-within::before,
.notes-topic:hover::before,
.home-feature-card:hover::before,
.roadmap-step:hover::before,
.roadmap-entry__card:hover::before {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .scope-list__item:not(.scope-list__item--empty, .home-subject--soon):hover,
  .scope-list__item:not(.scope-list__item--empty, .home-subject--soon):focus-within {
    transform: translateY(-3px);
  }
}

/* The arrow in the top right corner: it says the whole card is a door, and
   slides a notch on hover. */
.scope-list__arrow {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  color: var(--color-notes-link);
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0.55;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.scope-list__item:hover .scope-list__arrow,
.scope-list__item:focus-within .scope-list__arrow {
  opacity: 1;
  transform: translateX(4px);
}

.scope-list__arrow ~ .scope-list__title {
  padding-right: 1.6rem;
}

/* On the home page the subjects accompany the title's entrance with a brief,
   staggered appearance. The modifier keeps these same cards from animating on
   the inner screens. */
@media (prefers-reduced-motion: no-preference) {
  .home-subjects .scope-list__item {
    opacity: 0;
    animation: home-subject-pop 0.32s ease-out forwards;
    animation-delay: calc(0.18s + var(--home-subject-index) * 65ms);
  }

  /* Only opacity and `translate`: `transform` stays free for the hover lift,
     which an animation with `forwards` would otherwise pin. */
  @keyframes home-subject-pop {
    from {
      opacity: 0;
      translate: 0 0.4rem;
    }
    to {
      opacity: 1;
      translate: 0 0;
    }
  }
}

/* --- Home page: one row per degree --- */

/* The degrees stack as a single panel split by hairlines, so a folded one
   takes one line and the block stays short however many there are. */
.home-degrees {
  max-width: 64rem;
  margin: 0 auto;
  border-top: 1px solid var(--color-line);
}

.home-degree {
  position: relative;
  border-bottom: 1px solid var(--color-line);
}

.home-degree--plain {
  padding: 0.6rem 0 0;
}

.home-degree__header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  /* Room on the right for the controls, which sit over this line. */
  padding: 1.05rem 15rem 1.05rem 0.25rem;
  list-style: none;
  cursor: pointer;
  border-radius: 0.4rem;
}

.home-degree__header::-webkit-details-marker {
  display: none;
}

.home-degree__header:focus-visible {
  outline: 2px solid var(--color-notes-link);
  outline-offset: 2px;
}

/* A chevron that points right when folded and down when open. */
.home-degree__chevron {
  align-self: center;
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.15rem;
  border-right: 2px solid var(--color-muted);
  border-bottom: 2px solid var(--color-muted);
  transform: rotate(-45deg);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.home-degree[open] .home-degree__chevron {
  transform: translateY(-0.15rem) rotate(45deg);
}

.home-degree__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text);
  transition: color 0.2s ease;
}

.home-degree__header:hover .home-degree__title {
  color: var(--color-notes-link);
}

.home-degree__header:hover .home-degree__chevron {
  border-color: var(--color-notes-link);
}

.home-degree__meta {
  font-size: 0.82rem;
  color: var(--color-muted);
}

.home-degree--soon .home-degree__title {
  color: var(--color-muted);
}

/* «Ver todas» and the two arrows, on the header's line at the right. They
   live outside the <summary> because a button there would fold the degree,
   and inside the <details> so they go away with its content. */
.home-degree__controls {
  position: absolute;
  top: 0.8rem;
  right: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.home-degree__controls[hidden],
.home-degree__controls [hidden] {
  display: none;
}

.home-degree__all,
.home-degree__arrow {
  border: 1px solid var(--color-line);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.home-degree__all {
  height: 2.1rem;
  padding: 0 0.95rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-notes-link);
}

.home-degree__arrow {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
}

.home-degree__all:hover,
.home-degree__arrow:hover:not(:disabled),
.home-degree__all:focus-visible,
.home-degree__arrow:focus-visible {
  border-color: var(--color-notes-link);
  color: var(--color-notes-link);
  outline: none;
}

.home-degree__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

/* The row itself: cards side by side, sliding, each one snapping to the
   start. The padding gives the hover lift and its shadow room inside the
   scroll box, which clips everything outside it. */
.home-degree .home-degree__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(19rem, 82%);
  grid-template-columns: none;
  justify-content: start;
  gap: 1rem;
  margin: 0;
  padding: 0.35rem 0.25rem 1.4rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0.25rem;
  scrollbar-width: thin;
}

.home-degree .home-degree__track > .scope-list__item {
  scroll-snap-align: start;
}

/* With the arrows there, the scrollbar is noise; the fade says where more
   is waiting instead. */
.home-degree.is-enhanced .home-degree__track {
  scrollbar-width: none;
}

.home-degree.is-enhanced .home-degree__track::-webkit-scrollbar {
  display: none;
}

.home-degree .home-degree__track[data-more-end] {
  mask-image: linear-gradient(to right, #000 calc(100% - 4rem), transparent);
}

.home-degree .home-degree__track[data-more-start] {
  mask-image: linear-gradient(to right, transparent, #000 4rem);
}

.home-degree .home-degree__track[data-more-start][data-more-end] {
  mask-image: linear-gradient(to right, transparent, #000 4rem, #000 calc(100% - 4rem), transparent);
}

/* «Ver todas»: the same cards, wrapped into a grid. */
.home-degree.is-expanded .home-degree__track {
  grid-auto-flow: row;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  overflow: visible;
  mask-image: none;
}

/* Three lines of description at most, so the row keeps one height and the
   page stays short; «Ver todas» and the subject's own page have it whole. */
.home-degree:not(.is-expanded) .home-degree__track .scope-list__meta {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

@media (max-width: 600px) {
  /* On a phone the finger slides the row: the arrows go and «Ver todas»
     keeps its place on the title's line, which needs less room. */
  .home-degree__header {
    padding-right: 7.5rem;
  }

  .home-degree__arrow {
    display: none;
  }
}

/* A subject announced but still empty: it is not a door, so no arrow, no
   lift and no light; the dashed border says «on its way». */
.home-subject--soon {
  border-style: dashed;
  background: color-mix(in srgb, var(--color-surface) 55%, transparent);
}

.home-subject--soon:hover,
.home-subject--soon:focus-within {
  --color-surface: inherit;
  border-color: var(--color-line);
  box-shadow: none;
}

.home-subject--soon::before {
  display: none;
}

.home-subject--soon .scope-list__title {
  color: var(--color-muted);
}

.essay-tag--soon {
  --tag-color: var(--color-muted);
  border-style: dashed;
}

/* The "todo" card is the main entrance to the full catalogue. It stands apart
   with the same device the site navigation uses, the hard shadow. */
.scope-list__item--all {
  grid-column: 1 / -1;
  border-color: var(--color-notes-link);
  background:
    linear-gradient(110deg, color-mix(in srgb, var(--color-header-accent) 16%, transparent), transparent 70%),
    var(--color-surface);
  box-shadow: 4px 4px 0 var(--color-notes-shadow);
  margin-bottom: 0.6rem;
}

.scope-list__item--all:hover,
.scope-list__item--all:focus-within {
  border-color: var(--color-notes-link);
  box-shadow: 6px 6px 0 var(--color-notes-shadow);
}

.scope-list__item--all .scope-list__title {
  font-size: 0.85rem;
  color: var(--color-notes-link);
}

.scope-list__title {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-header-accent);
  text-decoration: none;
}

.scope-list__tags {
  margin-top: 0.35rem;
}

/* The whole card is clickable, not just the title: the link stretches over it
   with a transparent layer. It is still a real <a>, so the keyboard, focus and
   "open in a new tab" work just the same. */
a.scope-list__title::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

a.scope-list__title:focus-visible {
  outline: none;
}

.scope-list__item:has(a.scope-list__title:focus-visible) {
  outline: 2px solid var(--color-notes-link);
  outline-offset: 3px;
}

/* --- Choosing how many questions --- */

.quiz-lengths {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--color-header-accent) 4%, transparent), transparent 60%),
    var(--color-surface);
  padding: 1.2rem 1.3rem 1.3rem;
}

.progress-filters + .quiz-lengths {
  margin-top: 2.25rem;
}

.progress-login + .quiz-lengths {
  margin-top: 1.4rem;
}

.quiz-lengths__title {
  margin: 0 0 0.25rem;
  color: var(--color-text);
  font-size: 1.15rem;
}

.quiz-lengths__description {
  margin-bottom: 1rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.quiz-lengths__controls {
  display: flex;
  align-items: flex-end;
  gap: 0.8rem;
}

.quiz-lengths__field {
  display: grid;
  gap: 0.35rem;
  color: var(--color-text);
  font-size: 0.82rem;
  font-weight: 600;
}

.quiz-lengths__reveal {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.quiz-lengths__reveal legend {
  padding: 0;
  margin-bottom: 0.35rem;
  color: var(--color-text);
  font-size: 0.82rem;
  font-weight: 600;
}

/* The row of radios takes the select's box —same font, padding and a
   border, transparent— so the two fields line up side by side. */
.quiz-lengths__reveal > span {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.9rem;
  padding: 0.48rem 0;
  border: 1px solid transparent;
  color: var(--color-text);
  font-size: 0.82rem;
  line-height: normal;
}

.quiz-lengths__option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 400;
  cursor: pointer;
}

.quiz-lengths select {
  min-width: 8.5rem;
  padding: 0.48rem 2rem 0.48rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 0.4rem;
  color: var(--color-text);
  background: var(--color-bg);
  font: inherit;
  cursor: pointer;
}

@media (max-width: 480px) {
  .quiz-lengths__controls {
    align-items: stretch;
    flex-direction: column;
  }

  .quiz-lengths select,
  .quiz-lengths .btn {
    width: 100%;
  }
}

.scope-list__meta {
  display: block;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 0.3rem;
}

/* Pinned to the bottom so the count lines up across cards in the same row,
   even when one has a description and the other does not. */
.scope-list__count {
  margin-top: auto;
  padding-top: 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-notes-link);
}

/* The resources of a subject: an icon tile, the text and the count, in a row
   on a wide screen. */
.subject-resources {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 30rem));
  justify-content: center;
}

.subject-resource {
  flex-direction: row;
  align-items: center;
  gap: 1.15rem;
  min-height: 7.5rem;
  padding: 1.35rem 1.5rem;
}

.subject-resource__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 0.8rem;
  border: 1px solid color-mix(in srgb, var(--color-notes-link) 40%, transparent);
  background: color-mix(in srgb, var(--color-notes-link) 12%, transparent);
  color: var(--color-notes-link);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.subject-resource:hover .subject-resource__icon,
.subject-resource:focus-within .subject-resource__icon {
  background: color-mix(in srgb, var(--color-notes-link) 22%, transparent);
  transform: rotate(-6deg) scale(1.05);
}

.subject-resource__body {
  flex: 1;
  min-width: 0;
}

.subject-resource__description {
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
}

.subject-resource__count {
  display: inline-block;
  margin-top: 0.7rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-muted);
  white-space: nowrap;
}

@media (max-width: 520px) {
  .subject-resource {
    align-items: flex-start;
  }
}

/* --- Notes --- */

.notes-topic {
  position: relative;
  isolation: isolate;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.notes-topic + .notes-topic,
.scope-list + .notes-topic {
  margin-top: 1.4rem;
}

.notes-topic:hover,
.notes-topic:focus-within,
.notes-topic[open] {
  border-color: var(--color-line-hover);
}

.notes-topic[open] {
  box-shadow: var(--shadow-lift);
}

.notes-topic__summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 1.25rem;
  align-items: center;
  gap: 0.8rem;
  min-height: 6rem;
  box-sizing: border-box;
  padding: 1.3rem 1.35rem;
  color: var(--color-header-accent);
  cursor: pointer;
  list-style: none;
}

.notes-topic__summary::-webkit-details-marker {
  display: none;
}

.notes-topic__summary:hover,
.notes-topic__summary:focus-visible {
  outline: none;
}

.notes-topic--empty {
  opacity: 0.55;
}

.notes-topic--empty .notes-topic__summary {
  cursor: default;
}

.notes-topic__heading {
  font-family: var(--font-heading);
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 700;
}

.notes-topic__count {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.notes-topic__toggle {
  width: 0.65rem;
  height: 0.65rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-0.15rem, -0.15rem);
  transition: transform 0.18s ease;
}

/* Its own summary only: a closed subtopic inside an open topic is a
   descendant of `[open]` too, and would point up while closed. */
.notes-topic[open] > .notes-topic__summary .notes-topic__toggle {
  transform: rotate(225deg) translate(-0.1rem, -0.1rem);
}

.notes-topic__content {
  padding: 0 1.35rem 1.35rem;
  border-top: 1px solid var(--color-line);
}

.notes-topic__description {
  margin: 0;
  padding-top: 0.9rem;
  color: var(--color-muted);
}

/* A subtopic inside an open topic: not a second card inside the first, only a
   row between two lines. Neighbours share the line between them, and its
   content opens under the summary without a line of its own. */
.notes-topic--nested {
  margin-top: 0.9rem;
  border-width: 1px 0;
  border-radius: 0;
  background: transparent;
}

.notes-topic--nested::before {
  content: none;
}

.notes-topic--nested + .notes-topic--nested {
  margin-top: 0;
  border-top-width: 0;
}

/* The lines stay the same colour when open or hovered: neighbours share
   them, so lighting one row's would light only one of its two lines. */
.notes-topic--nested,
.notes-topic--nested:hover,
.notes-topic--nested:focus-within,
.notes-topic--nested[open] {
  border-color: var(--color-rule);
  box-shadow: none;
}

.notes-topic--nested .notes-topic__summary {
  min-height: 0;
  padding: 0.9rem 0;
}

/* Without side borders, a brighter line would be the only sign of focus. */
.notes-topic--nested > .notes-topic__summary:focus-visible {
  outline: 2px solid var(--color-notes-link);
  outline-offset: 2px;
}

.notes-topic--nested .notes-topic__heading {
  font-size: 0.95rem;
}

.notes-topic--nested .notes-topic__content {
  padding: 0 0 1.1rem;
  border-top: 0;
}

.notes-topic--nested .notes-topic__description {
  padding-top: 0;
}

.notes-topic--nested .notes-topic__page:first-child {
  margin-top: 0;
}

/* The subtopics of an open topic in the questionnaires: links in rows
   between lines, the same rows as the nested subtopics of the other sections
   (`.notes-topic--nested`). The whole row is the link. */
.scope-rows {
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.scope-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 1.25rem;
  align-items: center;
  gap: 0.2rem 0.8rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--color-rule);
}

.scope-row:first-child {
  border-top: 1px solid var(--color-rule);
}

.scope-row__title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  line-height: 1.5;
  font-weight: 700;
  color: var(--color-header-accent);
  text-decoration: none;
}

a.scope-row__title::after {
  content: '';
  position: absolute;
  inset: 0;
}

a.scope-row__title:focus-visible {
  outline: none;
}

.scope-row:focus-within {
  outline: 2px solid var(--color-notes-link);
  outline-offset: 2px;
}

.scope-row__count {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.scope-row__arrow {
  color: var(--color-header-accent);
  text-align: center;
  transition: transform 0.2s ease;
}

.scope-row:hover .scope-row__arrow,
.scope-row:focus-within .scope-row__arrow {
  transform: translateX(3px);
}

.scope-row__meta {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.scope-row--empty {
  opacity: 0.55;
}

.document-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0.9rem 0 0;
  list-style: none;
}

.notes-topic__description + .document-list {
  padding-top: 0.7rem;
}

.document-card {
  position: relative;
  isolation: isolate;
  border: 1px solid var(--color-line);
  border-radius: calc(var(--radius-card) - 0.25rem);
  background: var(--color-surface);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.document-card:hover,
.document-card:focus-within {
  border-color: var(--color-line-hover);
  transform: translateX(3px);
}

.document-card__arrow {
  transition: transform 0.2s ease;
}

.document-card:hover .document-card__arrow,
.document-card:focus-within .document-card__arrow {
  transform: translateX(3px);
}

.document-card__link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0.95rem;
  color: var(--color-text);
  text-decoration: none;
}

.document-card__title {
  display: block;
  font-family: var(--font-heading);
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 700;
}

.document-card__description {
  display: block;
  margin-top: 0.25rem;
  color: var(--color-muted);
  font-size: 0.88rem;
}

.document-card__arrow {
  color: var(--color-notes-link);
  font-size: 1.25rem;
  line-height: 1;
}

@media (max-width: 520px) {
  .notes-topic__summary,
  .scope-row {
    grid-template-columns: minmax(0, 1fr) 1.25rem;
  }

  .notes-topic__count,
  .scope-row__count {
    display: none;
  }
}

.document-content {
  margin-top: 1.75rem;
  line-height: 1.7;
}

.document-content h2 {
  margin-top: 2.25rem;
}

/* Discreet navigation between the notes of the same topic. It only appears
   when there is enough desktop margin not to narrow the article. */
.document-rail {
  display: none;
}

@media (min-width: 1400px) {
  .document-rail {
    position: fixed;
    top: 17rem;
    left: max(1.5rem, calc(50% - 670px));
    z-index: 8;
    display: grid;
    gap: 2rem;
    padding: 0.35rem 0;
  }

  .document-rail__line {
    position: absolute;
    top: 0.85rem;
    bottom: 0.85rem;
    left: calc(0.5rem - 1px);
    width: 2px;
    background: repeating-linear-gradient(
      to bottom,
      var(--color-border) 0 2px,
      transparent 2px 6px
    );
  }

  .document-rail__item {
    position: relative;
    display: block;
    width: 1rem;
    height: 1rem;
    border: 0;
    color: var(--color-text);
  }

  .document-rail__dot {
    --document-rail-dot-color: color-mix(in srgb, var(--color-border) 70%, var(--color-bg));
    position: absolute;
    top: 0.225rem;
    left: 0.1rem;
    z-index: 1;
    width: 0.8rem;
    height: 0.55rem;
    box-sizing: border-box;
    border: 2px solid var(--document-rail-dot-color);
    background: var(--document-rail-dot-color);
    box-shadow: 0 0 0 0.2rem var(--color-bg);
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
  }

  .document-rail__item:hover .document-rail__dot,
  .document-rail__item:focus-visible .document-rail__dot,
  .document-rail__item.is-current .document-rail__dot {
    --document-rail-dot-color: var(--color-notes-link);
    transform: scale(1.25);
  }

  .document-rail__item:focus-visible {
    outline: none;
  }

  .document-rail__label {
    position: absolute;
    top: 50%;
    left: 1.35rem;
    width: max-content;
    max-width: 16rem;
    padding: 0.38rem 0.55rem;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    background: var(--color-bg);
    box-shadow: 3px 3px 0 var(--color-notes-shadow);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.35;
    opacity: 0;
    pointer-events: none;
    transform: translate(0.25rem, -50%);
    transition: opacity 0.15s ease, transform 0.15s ease;
  }

  .document-rail__item:hover .document-rail__label,
  .document-rail__item:focus-visible .document-rail__label {
    opacity: 1;
    transform: translate(0, -50%);
  }
}

.change-history {
  display: grid;
  gap: 0;
  margin-top: 1.75rem;
  padding: 0;
  list-style: none;
}

.change-history__item {
  position: relative;
  padding: 0 0 1.5rem 1.4rem;
  border-left: 1px solid var(--color-border);
}

.change-history__item::before {
  content: '';
  position: absolute;
  top: 0.35rem;
  left: -0.3rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--color-notes-link);
}

.change-history__item time {
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.change-history__item p {
  margin: 0.25rem 0 0;
}

.scope-list__item--empty {
  opacity: 0.55;
}

/* --- Question filters --- */

.question-filters {
  margin: var(--spacing) 0 0;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.question-filters summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.question-filters summary::-webkit-details-marker {
  display: none;
}

.question-filters summary::after {
  content: '+';
  color: var(--color-notes-link);
  font-size: 1rem;
}

.question-filters[open] summary::after {
  content: '−';
}

.question-filters__count {
  margin-left: auto;
  padding: 0.18rem 0.4rem;
  border-radius: 999px;
  color: var(--color-notes-link);
  background: color-mix(in srgb, var(--color-notes-link) 12%, transparent);
  font-family: var(--font-body);
  font-size: 0.75rem;
}

.question-filters__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.7rem 0.8rem;
  border-top: 1px solid var(--color-border);
}

.question-filter-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  min-width: 0;
}

.question-filter-group--topics {
  flex: 1 0 100%;
  align-items: flex-start;
}

.question-filter-group legend {
  float: left;
  margin-right: 0.1rem;
  color: var(--color-muted);
  font-size: 0.78rem;
}

.question-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.question-filter-option {
  position: relative;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 0.34rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.2rem;
  color: var(--color-muted);
  cursor: pointer;
}

.question-filter-option:hover,
.question-filter-option:focus-within,
.question-filter-option:has(input:checked) {
  border-color: var(--color-notes-link);
  color: var(--color-notes-link);
}

.question-filter-option:has(input:checked) {
  background: color-mix(in srgb, var(--color-notes-link) 10%, transparent);
}

.question-filter-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.question-filters__actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-left: auto;
}

.question-filters__form .btn {
  padding-block: 0.45rem;
}

.question-filters__clear {
  align-self: center;
  font-size: 0.85rem;
}

/* --- Progress filters --- */

.progress-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.8rem 0 0;
}

.progress-filter {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--color-border);
  color: var(--color-muted);
  text-decoration: none;
}

.progress-filter:hover,
.progress-filter:focus-visible,
.progress-filter--active {
  border-color: var(--color-notes-link);
  color: var(--color-notes-link);
}

.progress-filter--active {
  background: var(--color-card-bg-hover);
}

.progress-filter__count {
  margin-left: 0.2rem;
}

.progress-login {
  border-left: 4px solid var(--color-notes-link);
  padding: 0.2rem 0 0.2rem 1rem;
  margin: 1.25rem 0;
  color: var(--color-muted);
  font-size: 0.93rem;
  line-height: 1.5;
}

.progress-login a {
  color: var(--color-notes-link);
  font-weight: 600;
  text-decoration: underline;
}

.progress-login a:hover,
.progress-login a:focus-visible {
  color: var(--color-text);
}

.question-list-title {
  margin-top: 1.5rem;
  margin-bottom: 0.35rem;
}

.question-list-intro {
  color: var(--color-muted);
  margin: 0 0 1.2rem;
}

/* --- Pagination of a question listing --- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin: 1.2rem 0 0;
}

.pagination__range {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.pagination__pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.pagination__link {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  min-width: 2.2rem;
  padding: 0.5rem 0.65rem;
  text-align: center;
  border: 2px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  text-decoration: none;
}

a.pagination__link:hover,
a.pagination__link:focus-visible,
.pagination__link--current {
  border-color: var(--color-notes-link);
  color: var(--color-notes-link);
}

.pagination__link--current {
  background: var(--color-card-bg-hover);
}

.pagination__gap {
  color: var(--color-muted);
}

.pagination__toggle {
  color: var(--color-notes-link);
  font-size: 0.9rem;
  text-decoration: underline;
}

.pagination__toggle:hover,
.pagination__toggle:focus-visible {
  color: var(--color-text);
}

/* --- Question --- */

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-heading);
  font-size: 0.5rem;
  text-transform: uppercase;
  color: var(--color-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.quiz-progress__label {
  margin: 0;
  white-space: nowrap;
}

/* The same square ends as everything else: no rounding, a hard fill. */
.quiz-progress__bar {
  flex: 1;
  height: 0.45rem;
  appearance: none;
  border: 1px solid var(--color-border);
  background: var(--color-card-bg);
  color: var(--color-notes-link);
}

.quiz-progress__bar::-webkit-progress-bar {
  background: var(--color-card-bg);
}

.quiz-progress__bar::-webkit-progress-value {
  background: var(--color-notes-link);
}

.quiz-progress__bar::-moz-progress-bar {
  background: var(--color-notes-link);
}

/* The hard shadow is the one the "todo" card and the back button wear: here it
   marks the box as the thing to work on. */
.question {
  border: 2px solid var(--color-border);
  box-shadow: 4px 4px 0 var(--color-notes-shadow);
  padding: 1.4rem 1.6rem 1.6rem;
  margin-top: 1rem;
}

.question__ref {
  font-family: var(--font-heading);
  font-size: 0.5rem;
  color: var(--color-muted);
  text-transform: uppercase;
}

.question__name {
  font-family: var(--font-heading);
  font-size: 0.76rem;
  line-height: 1.6;
  color: var(--color-header-accent);
  margin: 0.4rem 0 0.6rem;
}

/* Header of the single-question page. */
.question__header {
  padding-bottom: 0.9rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.question__header .essay-tags--list {
  margin-bottom: 0;
}

@media (max-width: 520px) {
  .question {
    padding: 1.1rem 1rem 1.2rem;
  }

  .choice__label {
    gap: 0.7rem;
    padding: 0.6rem 0.7rem;
  }
}

/* The prompt is what gets read slowly, so it is set a notch above the body. */
.question__prompt {
  font-size: 1.08rem;
  line-height: 1.7;
}

.question__prompt > *:first-child {
  margin-top: 0;
}

.question__prompt > *:last-child {
  margin-bottom: 0;
}

/* --- What arrives from the Markdown in content/ ---
   Tables, code blocks and diagrams come out the same in the prompt as in the
   explanation, so the rules are written once for both places. style.css did not
   bring them because the main site did not use them. */

.question__prompt table,
.feedback__explanation table {
  /* `display: block` is what lets a wide table scroll inside its own box
     instead of stretching the page on a phone. */
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1.1rem 0;
}

.question__prompt th,
.question__prompt td,
.feedback__explanation th,
.feedback__explanation td {
  border: 1px solid var(--color-border);
  padding: 0.35rem 0.75rem;
  text-align: left;
}

.question__prompt thead th,
.feedback__explanation thead th {
  background: var(--color-card-bg);
  color: var(--color-subheading);
}

.question__prompt pre,
.feedback__explanation pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-left-width: 3px;
  padding: 0.7rem 0.9rem;
  margin: 1.1rem 0;
  overflow-x: auto;
}

.question__prompt code,
.feedback__explanation code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.question__prompt pre code,
.feedback__explanation pre code {
  font-size: inherit;
}

/* The diagrams in content/ are drawn entirely with `currentColor`, so they
   inherit the text colour and work the same in the light and dark themes
   without duplicating anything. They tell curves apart by stroke, not colour. */
.diagram {
  display: block;
  width: 100%;
  max-width: 30rem;
  height: auto;
  margin: 1.2rem auto;
  color: var(--color-text);
}

/* The images in `content/<subject>/media/`: photos, scans and figures exported
   from another program. A PNG cannot inherit `currentColor`, so for black line
   drawings there is `.figura--papel`, just below. */
.question__prompt img,
.feedback__explanation img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.2rem auto;
  border-radius: 3px;
}

/* A choice can carry a figure too, and there it must not overflow the row. */
.choice__text img {
  max-width: 100%;
  height: auto;
}

.question__prompt figure,
.feedback__explanation figure {
  margin: 1.2rem 0;
}

.question__prompt figure img,
.feedback__explanation figure img {
  margin-bottom: 0.5rem;
}

.question__prompt figcaption,
.feedback__explanation figcaption {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--color-muted);
  text-align: center;
}

/* For a figure with a transparent or near-white background: it puts it on its
   own sheet of paper in both themes, instead of vanishing in the dark one. */
.figura--papel img {
  background: #fff;
  padding: 0.8rem;
}

/* KaTeX does not bound the width of its block formulas: without this, a long
   equation stretches the whole page on narrow screens. */
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.2rem 0;
}

/* --- Answer ---
   Separated from the prompt by a rule and a small heading, so question and
   answer read as two parts of the box and not as one run of text. */

.answer {
  margin-top: 1.6rem;
  padding-top: 1.3rem;
  border-top: 1px dashed var(--color-border);
}

.answer__heading {
  margin: 0 0 0.75rem;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-muted);
}

/* --- Choices --- */

.choices {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.choice {
  margin: 0;
}

.choice__label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border: 2px solid var(--color-border);
  background: var(--color-card-bg);
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.choice:not(.choice--disabled) .choice__label:hover {
  border-color: var(--color-notes-link);
  background: var(--color-card-bg-hover);
}

.choice:not(.choice--disabled) .choice__label:has(.choice__input:checked) {
  border-color: var(--color-notes-link);
  background: var(--color-card-bg-hover);
}

/* The radio stays in the form and in the tab order; what is seen is the
   marker right after it. */
.choice__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.choice__marker {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border: 2px solid var(--color-notes-link);
  color: var(--color-notes-link);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.choice__input:checked + .choice__marker {
  background: var(--color-notes-link);
  color: var(--color-bg);
}

.choice__input:focus-visible + .choice__marker {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

.choice__text {
  flex: 1;
  min-width: 0;
}

.choice__text > *:first-child {
  margin-top: 0;
}

.choice__text > *:last-child {
  margin-bottom: 0;
}

/* States after grading: the choice stops being interactive, and the ones that
   are neither right nor chosen step back. */
.choice--correct .choice__label {
  border-color: var(--color-ok);
  background: var(--color-ok-bg);
}

.choice--wrong .choice__label {
  border-color: var(--color-bad);
  background: var(--color-bad-bg);
}

.choice--disabled .choice__label {
  cursor: default;
}

.choice--disabled:not(.choice--correct):not(.choice--wrong) .choice__label {
  opacity: 0.6;
}

/* Also when chosen, or the selection fill would paint over it. */
.choice--correct .choice__marker,
.choice--correct .choice__input:checked + .choice__marker {
  border-color: var(--color-ok);
  background: var(--color-ok);
  color: var(--color-bg);
}

.choice--wrong .choice__marker,
.choice--wrong .choice__input:checked + .choice__marker {
  border-color: var(--color-bad);
  background: var(--color-bad);
  color: var(--color-bg);
}

/* Drawn like an .essay-tag, so it reads as a label and not as part of the
   choice's text. */
.choice__mark {
  margin-left: auto;
  font-family: var(--font-heading);
  font-size: 0.5rem;
  line-height: 1;
  white-space: nowrap;
  padding: 0.25rem 0.45rem;
  border: 1px solid currentColor;
  border-radius: 0.2rem;
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.choice--correct .choice__mark {
  color: var(--color-ok);
}

.choice--wrong .choice__mark {
  color: var(--color-bad);
}

/* --- Numeric answer --- */

.numeric-answer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.numeric-answer__input {
  font-family: var(--font-body);
  font-size: 1.15rem;
  color: var(--color-text);
  background: var(--color-card-bg);
  border: 2px solid var(--color-border);
  padding: 0.6rem 0.8rem;
  width: 13rem;
  max-width: 100%;
}

.numeric-answer__input:focus-visible {
  border-color: var(--color-notes-link);
  outline: none;
}

.numeric-answer__unit {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.numeric-answer__tolerance,
.btn-row__aside {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.answer .btn--primary {
  padding-inline: 1.3rem;
}

/* --- Sign in --- */

/* The sign-in, sign-up and join-a-session pages: the page header and then
   the form in a single card centred under it, with the same shape as the
   rest of the cards and a gold rule along its top edge. */
.auth-card {
  position: relative;
  max-width: 27rem;
  margin: 0 auto;
  padding: 1.7rem 1.8rem 1.8rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--color-header-accent) 6%, transparent), transparent 55%),
    var(--color-surface);
  box-shadow: var(--shadow-lift);
}

.auth-card--wide {
  max-width: 34rem;
}

@media (max-width: 520px) {
  .auth-card {
    padding: 1.4rem 1.2rem 1.4rem;
  }
}

.auth-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 12%;
  right: 12%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--color-header-accent), transparent);
}

/* The messages go first inside the card, so they lose the top margin they
   carry everywhere else. */
.auth-card > .auth-error:first-child,
.auth-card > .contribution-success:first-child {
  margin-top: 0;
}

.auth-card > .auth-error,
.auth-card > .contribution-success {
  margin-bottom: 1.2rem;
}

.auth-card__note {
  margin: 1.4rem 0 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  margin-top: var(--spacing);
  max-width: 24rem;
}

.auth-card .auth-form {
  margin-top: 0;
  max-width: none;
}

.auth-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-form__label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
}

.auth-form__optional {
  font-weight: 400;
}

/* Inputs and the session code share one look: rounded, a hairline and a
   gold ring on focus instead of a heavier border. */
.auth-form__input,
.group-code-form input {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-bg) 65%, transparent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  padding: 0.65rem 0.85rem;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form__input:hover,
.group-code-form input:hover {
  border-color: var(--color-line-hover);
}

.auth-form__input:focus-visible,
.group-code-form input:focus-visible {
  border-color: var(--color-notes-link);
  box-shadow: 0 0 0 3px var(--color-glow);
  outline: none;
}

.auth-form__hint,
.auth-form__optional {
  font-size: 0.82rem;
  color: var(--color-muted);
}

.auth-form__hint {
  line-height: 1.45;
}

.auth-form__check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--color-muted);
}

.auth-form__check input {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  accent-color: var(--color-notes-link);
}

/* The submit spans the card: it is the only thing to do on the page. */
.auth-card .btn-row {
  margin-top: 0.4rem;
}

.auth-card .btn--primary {
  flex: 1;
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

/* Between the password form and the way in with Google: a hairline either
   side of «o». */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.4rem 0 0;
  font-size: 0.82rem;
  color: var(--color-muted);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-line);
}

.auth-divider + .btn-row {
  margin-top: 1rem;
}

/* Google's sign-in button: its «G», the white (or near-black) fill, the grey
   hairline and medium-weight text, centred. Two classes because
   `typography.css` comes later and resets the padding and size of `.btn`.
   In a sign-in card it spans the card, like the submit above it. */
.btn.btn--google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 2.6rem;
  padding: 0.6rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--google-btn-text);
  background: var(--google-btn-bg);
  border: 1px solid var(--google-btn-border);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn.btn--google svg {
  flex: 0 0 auto;
}

.btn.btn--google:hover,
.btn.btn--google:focus-visible {
  color: var(--google-btn-text);
  border-color: var(--google-btn-border);
  background: color-mix(in srgb, var(--google-btn-text) 8%, var(--google-btn-bg));
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.btn.btn--google:focus-visible {
  box-shadow: 0 0 0 3px var(--color-glow);
}

.auth-card .btn--google {
  flex: 1;
}

.auth-switch {
  margin: 1.4rem auto 0;
  text-align: center;
  font-size: 0.92rem;
  color: var(--color-muted);
}

.auth-switch a {
  color: var(--color-notes-link);
  font-weight: 600;
}

/* What the sign-up page promises about the password and Google, under the
   card: the detail lives in /privacy#security, which it links. On /login it
   is a single line. */
.auth-trust {
  max-width: 34rem;
  margin: 1.6rem auto 0;
  padding: 1.1rem 1.3rem;
  border: 1px dashed var(--color-line);
  border-radius: var(--radius-card);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-muted);
}

.auth-trust__title {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: var(--color-text);
}

.auth-trust__list {
  margin: 0;
  padding-left: 1.2rem;
}

.auth-trust__list li + li {
  margin-top: 0.4rem;
}

.auth-trust__list strong {
  color: var(--color-text);
}

.auth-trust a,
.auth-trust__line a {
  color: var(--color-notes-link);
}

.auth-trust__more {
  margin: 0.8rem 0 0;
  font-weight: 600;
}

.auth-trust__line {
  max-width: 27rem;
  margin: 1rem auto 0;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-muted);
}

.auth-error {
  border-left: 4px solid var(--color-bad);
  border-radius: 0 0.5rem 0.5rem 0;
  background: var(--color-bad-bg);
  color: var(--color-bad);
  padding: 0.6rem 0.8rem;
  margin-top: var(--spacing);
}

/* The home page's notice, right under the subtitle: the newest item of
   `content/news/` (plan 0056), drawn by `index.html`. Shaped like
   `.progress-login` —a left rule and muted text— because a notice is not an
   error, with the rounded corners of the cards. Its colour is the item's
   type, `--news-color`, which `.news--update` and `.news--notice` set below.

   It is the only text on the page set in `--font-mono`, and the rule is dashed
   instead of solid: both say «this is temporary» without spending a word on
   it. The pulsing dot before the title says «live». No new font is
   downloaded — the stack is whatever the system has. */

/* The colour of each news type, shared by the home box, the cards of /news
   and the page of an item: a light teal for an update (`--news-update`, one
   shade per theme, at the top of this file) and the roadmap's orange of
   «Herramientas» for a notice. The values are `news.TYPES`' keys: renaming
   one there is renaming it here. */
.news--update { --news-color: var(--news-update); }
.news--notice { --news-color: var(--hue-orange); }

.home-notice {
  /* Inset from the column and centred under the title. In rem so it tracks
     the root size, which typography.css moves between 16 and 18px. */
  max-width: 38rem;
  /* Negative top so it sits right under the subtitle: the margin collapses
     with the 2.75rem that `.home-intro` reserves for the block below it. */
  margin: -1.25rem auto 2.75rem;
  border: 1px solid color-mix(in srgb, var(--news-color) 22%, transparent);
  border-left: 4px dashed var(--news-color);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  /* A wash of the accent itself, so it lands warm in both themes without a
     colour of its own, fading towards the right. */
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--news-color) 10%, transparent), transparent 75%),
    var(--color-surface);
  padding: 0.8rem 1.1rem;
  color: var(--color-muted);
  font-family: var(--font-mono);
  /* Mono faces run large at the same size, so this sits under the 0.93rem of
     `.progress-login` to match its optical weight. */
  font-size: 0.84rem;
  line-height: 1.6;
}

.home-notice__title {
  display: flex;
  align-items: center;
  margin: 0 0 0.25rem;
  color: var(--news-color);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* The dot that says «live». */
.home-notice__title::before {
  content: '';
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  /* A margin and not a flex gap: a gap would also open between the label and
     its subject, whose dash brings its own spacing. */
  margin-right: 0.65rem;
  border-radius: 50%;
  background: currentColor;
}

@media (prefers-reduced-motion: no-preference) {
  .home-notice__title::before {
    animation: home-notice-pulse 1.8s ease-out infinite;
  }

  @keyframes home-notice-pulse {
    from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--news-color) 70%, transparent); }
    to { box-shadow: 0 0 0 0.55rem transparent; }
  }
}

/* The title takes an optional subject after the «Aviso» label, so it can read
   «AVISO — MANTENIMIENTO» instead of just «AVISO». The dash is drawn here and
   not written in the template: a notice without a subject then cannot leave a
   dangling one. */
.home-notice__subject {
  /* Lighter and less tracked than the label so a whole sentence stays
     readable in caps; the label keeps being the part that reads as a tag. */
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* The date, on the right of the title line and in its colour, but not bold:
   it says when, and the title stays what reads first. */
.home-notice__date {
  flex: none;
  margin-left: auto;
  padding-left: 1rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.home-notice__subject::before {
  content: "—";
  /* The title is a flex row, so the space before the subject collapses and
     the margin has to give it back. */
  margin: 0 0.4em 0 0.5em;
  font-weight: 700;
}

/* On a phone the title does not fit beside the label: it broke after the
   dash, with the label centred against two lines and the dash hanging on its
   own. There the line becomes two rows: «● NOVEDAD · 1 DIC 2026» and the
   chevron on the first, which always fits, and the title alone on the
   second, under the label and without its dash —the row break already
   separates them—. The label is a bare text node, so it cannot be placed by
   name: the title, the date and the chevron are placed, and the dot and the
   label fill the first two cells of the first row in order. */
@media (max-width: 40rem) {
  .home-notice__title {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
  }

  .home-notice__subject {
    grid-row: 2;
    grid-column: 2 / -1;
    margin-top: 0.3rem;
  }

  .home-notice__subject::before {
    content: none;
  }

  .home-notice__date {
    grid-row: 1;
    grid-column: 3;
    margin-left: 0;
    padding-left: 0;
  }

  /* The separator is drawn here, like the dash: on a wide screen the date
     sits at the far right and needs none. */
  .home-notice__date::before {
    content: "·";
    margin: 0 0.6em;
  }

  .home-notice__disclosure > summary.home-notice__title::after {
    grid-row: 1;
    grid-column: 4;
  }
}

/* On a phone the notice ate the first screen, so it folds: closed it is one
   line —the title already says what it is about— and it opens on tap. It is a
   `<details>` with the title as its `<summary>`, so the browser does the whole
   job of toggling it: no JavaScript, and it works with it switched off.

   It starts folded at every width: on a wide screen too it pushed the
   subjects down for a notice most visitors had already read. */
.home-notice__disclosure > summary {
  cursor: pointer;
  /* Drops the default triangle: the property covers Chrome and Firefox, the
     pseudo-element below is Safari's. The chevron replaces it, after the
     title and in the box's own colour. */
  list-style: none;
}

.home-notice__disclosure > summary::-webkit-details-marker {
  display: none;
}

.home-notice__disclosure > summary::after {
  content: "▾";
  display: inline-block;
  margin-left: 0.4em;
  /* The title's tracking applies to the chevron too and would leave it
     floating away from the word. */
  letter-spacing: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .home-notice__disclosure > summary::after {
    transition: transform 0.15s ease;
  }
}

.home-notice__disclosure[open] > summary::after {
  transform: rotate(180deg);
}

/* Closed, the title is the last thing in the box: its bottom margin would
   read as padding that does not match the top. */
.home-notice__disclosure:not([open]) > summary {
  margin-bottom: 0;
}

/* A short dashed rule under the title, open only: closed, the title is the
   only line and does not need one under it. A `border-bottom` would run the
   full width of the box *and* only comes solid, so this is a repeating
   background clipped down to a small notch on the left instead, dashed like
   the box's own left border and in the same colour. */
.home-notice__disclosure[open] > summary {
  padding-bottom: 0.5rem;
  margin-bottom: 0.85rem;
  background-image: repeating-linear-gradient(
    to right,
    var(--news-color) 0,
    var(--news-color) 6px,
    transparent 6px,
    transparent 12px
  );
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 6rem 2px;
}

.home-notice__disclosure > summary:focus-visible {
  outline: 2px solid var(--news-color);
  outline-offset: 3px;
}

/* The unfold itself, for this box and the cards of /news, only where the
   browser can animate a <details> at all: `interpolate-size` is what lets
   `height` transition to and from `auto`, and `::details-content` is the
   pseudo-element the box's body lives in. Neither
   is universal yet, so a browser missing either just opens and closes as it
   always did — instant, and not broken. */
@supports selector(details::details-content) {
  .home-notice__disclosure,
  .news-card__disclosure {
    interpolate-size: allow-keywords;
  }

  .home-notice__disclosure::details-content,
  .news-card__disclosure::details-content {
    height: 0;
    overflow: hidden;
  }

  .home-notice__disclosure[open]::details-content,
  .news-card__disclosure[open]::details-content {
    height: auto;
  }

  @media (prefers-reduced-motion: no-preference) {
    .home-notice__disclosure::details-content,
    .news-card__disclosure::details-content {
      /* `content-visibility` is what keeps the content painted for the length
         of the transition on the way out; without it the browser would hide
         it the instant `open` is removed and the height change would have
         nothing left to animate. */
      transition: height 0.25s ease, content-visibility 0.25s ease allow-discrete;
    }
  }
}

/* The description, rendered from Markdown: paragraphs and lists in
   whatever order the item needs. The air goes *between* blocks and never
   after the last one: what closes the box is its own padding. */
.home-notice__body > * {
  margin: 0;
}

.home-notice__body > * + * {
  margin-top: 0.5rem;
}

.home-notice__body ul,
.home-notice__body ol {
  padding-left: 1.2rem;
}

.home-notice__body li:last-child {
  margin-bottom: 0;
}

.home-notice__body li::marker {
  /* The header accent by default; here it follows the rule and the title, so
     the box keeps a single colour. */
  color: var(--news-color);
}

/* «Leer más» (only when the item has a page) follows the last paragraph on
   its own line of text: that paragraph turns inline. An inline box drops its
   vertical margin, so the block before it keeps the gap with a bottom one.
   If the description ends in a list, the link simply goes below it. */
.home-notice__body > p:has(+ .home-notice__more) {
  display: inline;
}

.home-notice__body > :has(+ p + .home-notice__more) {
  margin-bottom: 0.5rem;
}

.home-notice__more {
  white-space: nowrap;
}

/* «Ver más noticias», at the bottom right of the box. */
.home-notice__actions {
  display: flex;
  justify-content: flex-end;
  margin: 0.75rem 0 0;
}

.home-notice__link {
  color: var(--news-color);
  font-weight: 700;
  text-decoration: none;
}

.home-notice__link:hover,
.home-notice__link:focus-visible {
  text-decoration: underline;
}

/* --- News (plan 0056) ---
   `/news`, one card per row, and the page of an item with a long text. The
   colour of each is its type's `--news-color` (`.news--update`,
   `.news--notice`, above with the home box). The filters are the listings'
   own `.progress-filter` chips. */

/* The chips and the pages sit in the same centred column as the cards, so
   all three start on the same edge. */
.news-filters,
.news-list,
.news-pagination {
  max-width: 46rem;
  margin-right: auto;
  margin-left: auto;
}

.news-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.6rem;
  margin-bottom: 0;
  padding: 0;
  list-style: none;
}

.news-card {
  margin: 0;
  border: 1px solid var(--color-line);
  border-left: 4px solid var(--news-color);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  background: var(--color-surface);
}

.news-card:hover,
.news-card:focus-within {
  border-color: var(--news-color);
}

/* Folded, a card is its summary: the type and the date over the title, and
   a chevron on the right in the type's colour. The browser does the
   toggling; the unfold is animated with the home box's rules, above. */
.news-card__summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 1rem;
  padding: 1rem 1.2rem;
  cursor: pointer;
  /* Drops the default triangle: the property covers Chrome and Firefox, the
     pseudo-element below is Safari's. */
  list-style: none;
}

.news-card__summary::-webkit-details-marker {
  display: none;
}

.news-card__summary::after {
  content: "▾";
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--news-color);
  font-size: 1.1rem;
}

@media (prefers-reduced-motion: no-preference) {
  .news-card__summary::after {
    transition: transform 0.15s ease;
  }
}

.news-card__disclosure[open] > .news-card__summary::after {
  transform: rotate(180deg);
}

.news-card__summary:focus-visible {
  outline: 2px solid var(--news-color);
  outline-offset: 2px;
}

.news-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-muted);
  font-size: 0.85rem;
}

/* Like the area of a roadmap entry, in the type's colour. */
.news-tag {
  padding: 0.14rem 0.45rem;
  border: 1px solid color-mix(in srgb, var(--news-color) 60%, transparent);
  border-radius: 0.2rem;
  color: var(--news-color);
  background: color-mix(in srgb, var(--news-color) 12%, transparent);
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.news-card__title {
  margin: 0.4rem 0 0;
  font-size: 1.15rem;
}

.news-card__body {
  padding: 0 1.2rem 1rem;
}

.news-card__description {
  color: var(--color-muted);
  line-height: 1.6;
}

.news-card__description > *,
.news-hero .page-hero__lead > * {
  margin: 0;
}

.news-card__description > * + * {
  margin-top: 0.5rem;
}

.news-hero .page-hero__lead > * + * {
  margin-top: 0.6rem;
}

.news-card__description ul,
.news-card__description ol {
  padding-left: 1.2rem;
}

.news-card__description li::marker {
  color: var(--news-color);
}

.news-card__more {
  display: inline-block;
  margin-top: 0.6rem;
  color: var(--news-color);
  font-weight: 700;
  text-decoration: none;
}

.news-card__more:hover,
.news-card__more:focus-visible {
  text-decoration: underline;
}

.news-hero .page-hero__eyebrow,
.news-hero .page-hero__eyebrow::before {
  color: var(--news-color);
}

.news-back {
  margin-top: 2rem;
  text-align: center;
}

/* --- Contributions --- */

.home-contribute {
  margin: 3rem auto 0;
  max-width: 34rem;
  color: var(--color-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Under a question's box and at the end of a note: the same link in both
   places. */
.contribute-link {
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
  text-align: right;
}

.contribution-form {
  display: grid;
  gap: 1.35rem;
  margin-top: var(--spacing);
}

.contribution-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.contribution-form__field,
.contribution-form__group {
  display: grid;
  gap: 0.35rem;
}

.contribution-form__field > span,
.contribution-form__group legend {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.contribution-form__group {
  border: 1px solid var(--color-border);
  padding: 0.8rem 1rem;
}

.contribution-form__group label + label {
  margin-top: 0.3rem;
}

.contribution-form select,
.contribution-form textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 2px solid var(--color-border);
  color: var(--color-text);
  background: var(--color-bg);
  font: inherit;
}

.contribution-form textarea {
  resize: vertical;
  line-height: 1.5;
}

.contribution-form select:focus-visible,
.contribution-form textarea:focus-visible {
  border-color: var(--color-notes-link);
  outline: none;
}

.contribution-form__hint {
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* The basic data-protection layer under a form that collects personal data
   (`data_notice` in _macros.html): it has to be there, not to stand out. */
.data-notice {
  margin: 0;
  max-width: 44rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--color-muted);
}

.data-notice__label {
  font-weight: 600;
}

.data-notice a {
  color: inherit;
  text-decoration: underline;
}

/* Under «Continuar con Google», centred like the button above it. */
.data-notice--google {
  margin-top: 0.75rem;
  text-align: center;
  text-wrap: pretty;
}

.contribution-success {
  margin-top: var(--spacing);
  padding: 0.8rem 1rem;
  border-left: 4px solid var(--color-ok);
  background: var(--color-ok-bg);
}

@media (max-width: 640px) {
  .contribution-form__grid {
    grid-template-columns: 1fr;
  }
}

/* --- Profile --- */

.profile-section {
  margin-top: 2.6rem;
}

.profile-section h2 {
  margin-bottom: 0.3rem;
}

.profile-section__lead {
  margin: 0 0 1rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.profile-stats > div {
  display: grid;
  align-content: start;
  gap: 0.15rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.profile-stats strong {
  color: var(--color-header-accent);
  font-size: 1.7rem;
  line-height: 1.15;
}

.profile-stats strong small {
  color: var(--color-muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.profile-stats span {
  color: var(--color-muted);
  font-size: 0.8rem;
}

.profile-stats--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.activity-card {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  background: var(--color-card-bg);
  scroll-margin-top: 6rem;
}

.activity-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.activity-card__header h3,
.activity-card__header p {
  margin: 0;
}

.activity-card__header p,
.activity-card__empty {
  color: var(--color-muted);
  font-size: 0.82rem;
}

.activity-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.activity-periods a {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.78rem;
  text-decoration: none;
}

.activity-periods a:hover,
.activity-periods a[aria-current="true"] {
  border-color: var(--color-header-accent);
  color: var(--color-header-accent);
  background: var(--color-bg);
}

.activity-chart-scroll {
  margin-top: 1.1rem;
  overflow-x: auto;
}

.activity-chart {
  min-width: 28rem;
}

.activity-chart__body {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
}

.activity-chart__y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 11rem;
  padding-right: 0.5rem;
  color: var(--color-muted);
  font-size: 0.7rem;
  line-height: 1;
  text-align: right;
}

.activity-chart__plot {
  display: grid;
  grid-template-columns: repeat(var(--activity-columns), minmax(1px, 1fr));
  align-items: end;
  gap: 2px;
  height: 11rem;
  padding-top: 0.5rem;
  border-bottom: 1px solid var(--color-border);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(25% - 1px),
    var(--color-border) 25%
  );
}

.activity-chart__bar {
  display: block;
  height: max(2px, var(--activity-height));
  background: var(--color-border);
}

.activity-chart__bar--active {
  background: var(--color-header-accent);
}

.activity-chart__bar:hover {
  filter: brightness(1.25);
}

.activity-chart__axis {
  position: relative;
  height: 1.2rem;
  margin-left: 2.2rem;
  margin-top: 0.4rem;
  color: var(--color-muted);
  font-size: 0.72rem;
}

.activity-chart__tick {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}

.activity-chart__tick--start {
  transform: none;
}

.activity-chart__tick--end {
  transform: translateX(-100%);
}

.activity-card__empty {
  margin: 0.7rem 0 0;
}

.profile-settings {
  margin-top: 3rem;
}

.profile-panel {
  margin-top: 0.8rem;
  border: 1px solid var(--color-border);
  padding: 0.8rem 1rem;
}

/* The panel's own summary, not the folded forms inside it: a chevron on the
   right that turns when it opens, instead of the browser's triangle. */
.profile-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--color-text);
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.profile-panel > summary::-webkit-details-marker {
  display: none;
}

.profile-panel > summary::after {
  content: '';
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.2rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.6;
  transform: translateY(-0.15rem) rotate(45deg);
  transition: transform 0.2s ease;
}

.profile-panel[open] > summary::after {
  transform: translateY(0.1rem) rotate(-135deg);
}

.profile-panel > summary:focus-visible {
  outline: 2px solid var(--color-notes-link);
  outline-offset: 4px;
  border-radius: 0.2rem;
}

.profile-panel__lead {
  margin: 0.6rem 0 0;
  color: var(--color-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* --- Métodos de acceso: one row per method --- */

.access-methods {
  display: grid;
  gap: 0.7rem;
  margin: 1rem 0 0.2rem;
  padding: 0;
  list-style: none;
}

.access-method {
  padding: 0.9rem 1rem;
  border: 1px solid var(--color-line);
  border-radius: calc(var(--radius-card) - 0.25rem);
  background: var(--color-surface);
}

.access-method__head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.access-method__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  color: var(--color-header-accent);
  background: var(--color-bg);
}

/* Google's «G» sits on the colour of Google's own button. */
.access-method__icon--google {
  background: var(--google-btn-bg);
  border-color: var(--google-btn-border);
}

.access-method__info {
  min-width: 0;
}

.access-method__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.6rem;
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
}

.access-method__detail {
  margin: 0.25rem 0 0;
  color: var(--color-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.access-method__detail--email {
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.access-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.5;
}

.access-status::before {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.access-status--on {
  border-color: color-mix(in srgb, var(--color-ok) 45%, transparent);
  color: var(--color-ok);
  background: var(--color-ok-bg);
}

/* What can be done with a method, folded under its row and lined up with
   its text, past the icon. */
.access-method__manage,
.access-method__step {
  margin: 0.8rem 0 0 3.25rem;
}

.access-method__step {
  display: grid;
  justify-items: start;
  gap: 0.6rem;
}

.access-method__step .contribution-form__hint {
  margin: 0;
}

.access-method__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-control);
  color: var(--color-notes-link);
  font-size: 0.88rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.access-method__toggle::-webkit-details-marker {
  display: none;
}

.access-method__toggle::after {
  content: '';
  width: 0.38rem;
  height: 0.38rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.1rem) rotate(45deg);
  transition: transform 0.2s ease;
}

.access-method__manage[open] > .access-method__toggle::after {
  transform: translateY(0.1rem) rotate(-135deg);
}

.access-method__toggle:hover,
.access-method__toggle:focus-visible {
  border-color: var(--color-line-hover);
  background: var(--color-card-bg-hover);
  outline: none;
}

.access-method__toggle--primary {
  border-color: var(--color-notes-link);
}

.access-method__manage .profile-form {
  margin-top: 0.8rem;
}

.access-method__manage .contribution-form__hint {
  margin: 0;
}

@media (max-width: 480px) {
  .access-method__manage,
  .access-method__step {
    margin-left: 0;
  }
}

.profile-form {
  display: grid;
  gap: 1rem;
  max-width: 28rem;
  margin-top: 1rem;
}

.profile-form input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 2px solid var(--color-border);
  color: var(--color-text);
  background: var(--color-bg);
  font: inherit;
}

.profile-form input:focus-visible {
  border-color: var(--color-notes-link);
  outline: none;
}

.profile-form small {
  color: var(--color-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.profile-confirmation {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.35rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--color-header-accent);
  background: var(--color-card-bg);
}

.profile-confirmation > strong {
  color: var(--color-header-accent);
}

.profile-confirmation > p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.82rem;
}

.profile-form .btn {
  justify-self: start;
}

/* --- Sesiones: each way out with what it closes ---
   Set apart from the panels above and from the destructive ones below: these
   are the everyday exits, so each one is a whole box you press, hollow with
   a yellow frame, with its name on the left and what it closes on the
   right. */

.profile-sessions {
  display: grid;
  gap: 0.7rem;
  margin: 2.4rem 0 2.4rem;
}

.profile-logout,
.profile-close-others,
.profile-close-sessions {
  margin: 0;
}

/* The open sessions, above the exits: a quiet list, one line each. */

.session-list {
  margin-bottom: 0.5rem;
}

.session-list__title {
  margin: 0 0 0.7rem;
  font-size: 1rem;
}

.session-list__items {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.7rem;
  padding: 0;
  list-style: none;
}

.session-list__item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  align-items: baseline;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.session-list__name {
  font-weight: 700;
}

.session-list__detail {
  color: var(--color-muted);
  font-size: 0.88rem;
}

.session-action {
  display: grid;
  grid-template-columns: minmax(10rem, 15rem) 1fr;
  align-items: center;
  gap: 0.4rem 1.6rem;
  width: 100%;
  padding: 1.05rem 1.25rem;
  border: 2px solid var(--color-header-accent);
  border-radius: var(--radius-card);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 0 0 transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.session-action:hover {
  background: var(--color-card-bg-hover);
  box-shadow: 4px 4px 0 var(--color-shadow);
  transform: translate(-2px, -2px);
}

.session-action:active {
  box-shadow: 0 0 0 transparent;
  transform: none;
}

.session-action:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 3px;
}

.session-action__title {
  color: var(--color-header-accent);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.session-action__detail {
  color: var(--color-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .session-action {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .session-action {
    transition: none;
  }

  .session-action:hover {
    transform: none;
  }
}

.profile-panel--danger {
  border-color: var(--color-bad);
}

.profile-panel--danger summary,
.profile-delete {
  color: var(--color-bad);
}

.profile-delete {
  border-color: var(--color-bad);
}

@media (max-width: 640px) {
  .profile-stats,
  .profile-stats--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-card__header {
    display: grid;
  }
}

/* --- How it went last time ---
   It only appears while signed in, and only before answering. */

.question-state {
  font-size: 0.9rem;
  margin-top: 0.8rem;
  padding-left: 0.7rem;
  border-left: 3px solid currentColor;
}

.question-state--ok {
  color: var(--color-ok);
}

.question-state--bad {
  color: var(--color-bad);
}

/* --- Feedback ---
   A tinted card with the verdict up top and, when it went wrong, the two
   answers side by side: what you said and what it was. */

.feedback {
  border: 1px solid var(--color-border);
  border-left-width: 5px;
  padding: 1rem 1.2rem 1.1rem;
  margin-top: 1.6rem;
}

.feedback--ok {
  border-color: color-mix(in srgb, var(--color-ok) 45%, transparent);
  border-left-color: var(--color-ok);
  background: var(--color-ok-bg);
}

.feedback--bad {
  border-color: color-mix(in srgb, var(--color-bad) 45%, transparent);
  border-left-color: var(--color-bad);
  background: var(--color-bad-bg);
}

.feedback__verdict {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-family: var(--font-heading);
  font-size: 0.62rem;
  line-height: 1.5;
  text-transform: uppercase;
}

.feedback__icon {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  color: var(--color-bg);
  font-size: 1rem;
  line-height: 1;
}

.feedback--ok .feedback__verdict {
  color: var(--color-ok);
}

.feedback--bad .feedback__verdict {
  color: var(--color-bad);
}

.feedback--ok .feedback__icon {
  background: var(--color-ok);
}

.feedback--bad .feedback__icon {
  background: var(--color-bad);
}

.feedback__detail {
  display: grid;
  gap: 0.45rem;
  margin: 0.9rem 0 0;
}

.feedback__row {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 0.9rem;
  align-items: baseline;
}

.feedback__row dt {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-muted);
}

.feedback__row dd {
  margin: 0;
  color: var(--color-text);
}

.feedback__row--correct dd,
.feedback__row--correct strong {
  color: var(--color-ok);
}

@media (max-width: 520px) {
  .feedback__row {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

.feedback__choice-explanation {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-bad);
  background: var(--color-bg);
}

.feedback__choice-heading {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.feedback__choice-explanation > *:last-child,
.feedback__choice-explanation > *:last-child > *:last-child,
.feedback__explanation-content > *:last-child {
  margin-bottom: 0;
}

/* The resolution is the long part: it gets the page background back so tables,
   formulas and diagrams do not sit on the tint. */
.feedback__explanation {
  margin-top: 1rem;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
}

.feedback__explanation summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.9rem;
  color: var(--color-link);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.feedback__explanation summary::-webkit-details-marker {
  display: none;
}

.feedback__explanation summary::after {
  content: '+';
  color: var(--color-notes-link);
  font-size: 1.1rem;
}

.feedback__explanation[open] summary::after {
  content: '−';
}

.feedback__explanation summary:hover,
.feedback__explanation summary:focus-visible {
  color: var(--color-text);
}

.feedback__explanation-content {
  padding: 0.9rem;
  border-top: 1px solid var(--color-border);
}

/* --- Question listing ---
   One row per question, and the rows share their columns (subgrid), so the
   reference, the name, the tags and the last result line up down the list and
   it can be skimmed by column. On a phone each row folds into a small card. */

.question-list-title__count {
  margin-left: 0.4rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: 0.55em;
  font-weight: 500;
  vertical-align: middle;
}

.question-grid {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  column-gap: 1rem;
  row-gap: 0.45rem;
}

/* Nobody signed in, or nothing answered yet: no fourth column, or its gap
   would leave the tags short of the edge. */
.question-grid:not(:has(.question-card__state)) {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.question-card {
  position: relative;
  grid-column: 1 / -1;
  display: grid;
  /* The fallback first: a browser without subgrid keeps the columns, just not
     shared between rows. */
  grid-template-columns: 4.5rem minmax(0, 1fr) auto auto;
  grid-template-columns: subgrid;
  align-items: center;
  column-gap: 1rem;
  margin: 0;
  border: 2px solid var(--color-border);
  background: var(--color-card-bg);
  padding: 0.7rem 1rem;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.question-card:hover,
.question-card:focus-within {
  border-color: var(--color-notes-link);
  background: var(--color-card-bg-hover);
}

/* How it went last time, also as an edge: inset, so the row does not move. */
.question-card--ok {
  box-shadow: inset 4px 0 0 var(--color-ok);
}

.question-card--bad {
  box-shadow: inset 4px 0 0 var(--color-bad);
}

.question-card__ref {
  grid-column: 1;
  font-family: var(--font-heading);
  font-size: 0.45rem;
  color: var(--color-muted);
  white-space: nowrap;
}

.question-card__name {
  grid-column: 2;
  color: var(--color-text);
  font-weight: 500;
  text-decoration: none;
  line-height: 1.35;
}

.question-card:hover .question-card__name,
.question-card:focus-within .question-card__name {
  color: var(--color-notes-link);
}

/* The same stretched link as in the scope cards: click anywhere in the row. */
.question-card__name::after {
  content: '';
  position: absolute;
  inset: 0;
}

.question-card__tags {
  grid-column: 3;
  justify-content: flex-end;
}

.question-card__state {
  grid-column: 4;
  font-family: var(--font-heading);
  font-size: 0.45rem;
  text-align: right;
  white-space: nowrap;
}

.question-card__state--ok {
  color: var(--color-ok);
}

.question-card__state--bad {
  color: var(--color-bad);
}

@media (max-width: 640px) {
  .question-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .question-card {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 0.35rem;
    padding: 0.65rem 0.8rem;
  }

  .question-card__ref {
    grid-column: 1;
    grid-row: 1;
  }

  .question-card__state {
    grid-column: 2;
    grid-row: 1;
  }

  .question-card__name,
  .question-card__tags {
    grid-column: 1 / -1;
  }

  .question-card__tags {
    justify-content: flex-start;
  }
}

/* --- Summary --- */

.summary-score {
  font-family: var(--font-heading);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-header-accent);
  margin: var(--spacing) 0 0.4rem;
}

.summary-list {
  list-style: none;
  padding-left: 0;
  margin-top: var(--spacing);
}

.summary-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.summary-list__mark {
  font-family: var(--font-heading);
  font-size: 0.5rem;
  flex: 0 0 1.6rem;
}

.summary-list__mark--ok {
  color: var(--color-ok);
}

.summary-list__mark--bad {
  color: var(--color-bad);
}

.summary-list__ref {
  font-family: var(--font-heading);
  font-size: 0.5rem;
  color: var(--color-muted);
  flex: 0 0 auto;
}

.summary-list__name {
  flex: 1 1 12rem;
}

.empty-note {
  color: var(--color-muted);
  margin-top: var(--spacing);
}

/* --- Legal pages ---
   /privacy and /legal-notice. Long, numbered text read in two incompatible
   ways: top to bottom the first time, and by jumping —"what did it say about
   cookies?"— every other time. Hence what is here: air between sections for the
   first, and a summary, an index and anchors for the second.

   style.css's headings only carry a bottom margin, which on a page this long
   leaves every section glued to the previous one. */

/* `typography.css` raises --max-width to 980px, and to 1180px on a wide
   screen: comfortable for a prompt and far too long for two screens of legal
   articles, where the eye loses the line on the way back. It is applied to the
   text and not to the container, so the tables can still be wide. */
.legal > p,
.legal > ul,
.legal > ol,
.legal > h2,
.legal > h3,
.legal-summary,
.legal-toc {
  max-width: 42rem;
}

.legal h2 {
  margin-top: var(--spacing);
}

.legal h3 {
  margin-top: 1.4rem;
}

/* The header is sticky: without this, jumping to an anchor hides the title. */
.legal h2[id],
.legal h3[id] {
  scroll-margin-top: 5rem;
}

.legal__updated {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.legal code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--color-strong);
}

.legal__related {
  margin-top: var(--spacing);
  padding-top: 1.1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.95em;
}

.legal-contact {
  list-style: none;
  padding-left: 0;
}

/* --- The first-layer summary ---
   What the AEPD calls "layered information": the essentials at a glance, with
   the articles below for whoever needs them. It stands out as a card so it is
   read before the text, not for decoration. */

.legal-summary {
  margin-top: var(--spacing);
  border: 2px solid var(--color-border);
  background: var(--color-card-bg);
  box-shadow: 4px 4px 0 var(--color-notes-shadow);
  padding: 1.2rem 1.3rem 1.3rem;
}

/* The sizes in this block are in sans proportions and not in the pixel fonts'.
   It is the same calculation `typography.css` does with what was inherited from
   web_pablo: Press Start 2P fills almost the whole em and Space Grotesk does
   not, so a 0.6rem that was legible there comes out tiny here. These components
   were born with the new fonts, so the right size is written here directly and
   there is nothing to re-dress afterwards. */

.legal-summary__title {
  /* It is an h2 by hierarchy, but it is not a numbered section: it must not
     compete with them nor drag their top margin. */
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.15rem;
  color: var(--color-notes-link);
}

.legal-summary__list {
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.legal-summary__row {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.3rem 1.2rem;
}

.legal-summary__row dt {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-muted);
}

.legal-summary__row dd {
  margin: 0;
}

/* --- The index --- */

.legal-toc {
  margin-top: var(--spacing);
  border-left: 4px solid var(--color-border);
  padding: 0.2rem 0 0.2rem 1.1rem;
}

.legal-toc__title {
  margin-top: 0;
  margin-bottom: 0.7rem;
  font-size: 1.05rem;
  color: var(--color-muted);
}

.legal-toc__list {
  margin: 0;
  padding-left: 1.2rem;
  columns: 2;
  column-gap: 2rem;
}

.legal-toc__list li {
  margin-bottom: 0.3rem;
  /* So a section does not break across the two columns. */
  break-inside: avoid;
}

/* --- Cookie and retention tables ---
   The table rules further up belong to .question__prompt and
   .feedback__explanation: they do not reach here, and these tables have a
   different job. */

.legal-table-wrap {
  margin-top: 1.2rem;
  /* A little wider than the prose —four columns appreciate it— but not the
     whole page: cut loose from the text, the table stops looking like part of
     the section. */
  max-width: 52rem;
  /* Four columns of text do not fit on a phone however much they are squeezed:
     rather than blowing up the page width, let the table scroll. It carries a
     `tabindex` in the template because a scrolling region that cannot take
     focus leaves the off-screen columns unreachable by keyboard. */
  overflow-x: auto;
}

.legal-table-wrap:focus-visible {
  outline: 2px solid var(--color-notes-link);
  outline-offset: 3px;
}

.legal-table {
  width: 100%;
  /* Below this the cells drop to one word per line and the table stops being
     readable. Before that, let it scroll inside .legal-table-wrap. */
  min-width: 33rem;
  border-collapse: collapse;
  font-size: 0.95em;
  text-align: left;
}

/* Without sharing it out, the browser gives each column what its longest word
   asks for and "Vigencia" ends up one word per line. The purpose is what has to
   be read, so it takes half. */
.legal-table--cookies th:nth-child(1) { width: 20%; }
.legal-table--cookies th:nth-child(2) { width: 46%; }
.legal-table--cookies th:nth-child(3) { width: 20%; }
.legal-table--cookies th:nth-child(4) { width: 14%; }

.legal-table--plazos th:nth-child(1) { width: 38%; }

.legal-table caption {
  caption-side: top;
  text-align: left;
  margin-bottom: 0.5rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.legal-table th,
.legal-table td {
  border: 1px solid var(--color-border);
  padding: 0.55rem 0.7rem;
  vertical-align: top;
}

.legal-table thead th {
  background: var(--color-card-bg);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-muted);
  white-space: nowrap;
}

.legal-table tbody th {
  font-weight: 600;
  color: var(--color-text);
}

@media (max-width: 600px) {
  .legal-summary__row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .legal-toc__list {
    columns: 1;
  }
}

/* --------------------------------------------------------- group sessions */

.group-code-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.group-code-form label {
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
}

/* The code is the whole form, so it goes large, centred and in the pixel
   face of the brand, where every character reads apart from the next. */
.group-code-form input {
  padding: 1rem 0.8rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
}

.group-code-form input::placeholder {
  color: var(--color-muted);
  opacity: 0.35;
}

.group-session__code {
  color: var(--color-muted);
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
}

.group-review { list-style: none; padding: 0; }

.group-review__item {
  margin: 2rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

@media (max-width: 600px) {
  .question {
    padding: 1rem 0.9rem 1.1rem;
  }

  .question-filter-group {
    flex-wrap: wrap;
  }

  .numeric-answer__input {
    width: 100%;
  }
}

/* --- The tags that classify a question ---
   The colour depends on the value the question carries in `content/` (`type`,
   `difficulty`, `kind`), so these rules live here and not in `style.css`: that
   one is a literal copy of web_pablo and gets overwritten whole on every
   update, which would take with it rules that do not exist upstream. Rename a
   value in `app/question_metadata.py` and you rename it here too.
*/
.essay-tag--type-multiple { --tag-color: #478bd3; }
.essay-tag--type-tf       { --tag-color: #9b72cf; }
.essay-tag--type-numeric  { --tag-color: #269ca6; }

.essay-tag--difficulty-easy   { --tag-color: #39935c; }
.essay-tag--difficulty-medium { --tag-color: #c47a1c; }
.essay-tag--difficulty-hard   { --tag-color: #c65353; }

.essay-tag--kind-theory   { --tag-color: #9b65b0; }
.essay-tag--kind-practice { --tag-color: #278f82; }

/* --- Progreso en el listado de problemas (plan 0035) ---
   Un rótulo como .essay-tag: el color de la letra y del borde sale de
   --tag-color, así que vale en los dos temas. El texto dice el estado; el
   color solo añade que está resuelto. */
.problem-badge,
.artifact-badge {
  --tag-color: var(--color-muted);
  display: inline-block;
  margin-left: 0.5rem;
  vertical-align: middle;
  font-family: var(--font-heading);
  /* The size .essay-tag ends up with after typography.css: the 0.5rem of
     style.css was sized for the pixel font and is unreadable in a sans. */
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  padding: 0.15rem 0.35rem;
  border: 1px solid var(--tag-color);
  border-radius: 0.2rem;
  color: var(--tag-color);
  background: color-mix(in srgb, var(--tag-color) 12%, transparent);
}

.problem-badge--solved {
  --tag-color: var(--color-ok);
}

/* --- Los widgets interactivos de los apuntes ---
   El HTML del <details> lo emite el importador (`app/widgets.py`) y lo de
   dentro lo dibuja `/static/js/widgets/<id>.js`. Estas reglas están aquí y no
   en una hoja aparte por lo mismo que las etiquetas de arriba: `style.css` es
   copia literal de web_pablo y se sobrescribe entera.

   El texto de reserva se ve hasta que el widget se monta, que es lo que deja
   el apunte completo cuando no hay JavaScript.
*/
.widget {
  margin: 2rem 0;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-card-bg);
}

.widget:hover,
.widget:focus-within,
.widget[open] {
  border-color: var(--color-notes-link);
}

.widget__summary {
  padding: 0.7rem 1rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  cursor: pointer;
}

.widget__summary::marker { color: var(--color-link); }

.widget__summary:focus-visible {
  outline: 2px solid var(--color-notes-link);
  outline-offset: -2px;
}

.widget__body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--color-border);
}

.widget__fallback {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.widget.is-mounted .widget__fallback { display: none; }

/* Presentations. The frame breaks out of the 720px reading column and is
   centred on it with a negative margin, never with a transform: Firefox
   counts the untransformed box as scrollable overflow, and a frame laid out
   from the column's middle let the whole page scroll sideways by half its
   width. 16:9 is the deck's own stage. It has the shape of the cards.
   A deck that listens to presentation.js follows the site's theme, so the
   frame takes the page's background; one that does not stays white on it. */
.presentation-frame {
  width: min(80rem, calc(100vw - 2rem));
  margin: 1.5rem 0 0.75rem calc(50% - min(40rem, 50vw - 1rem));
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lift);
}

.presentation-frame__deck {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  transition: opacity 0.3s ease;
}

/* presentation.js shows the notice and hides the deck until the frame has
   loaded; without it the notice keeps its `hidden`. */
.presentation-frame.is-loading .presentation-frame__deck { opacity: 0; }

.presentation-frame__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.presentation-frame__loading[hidden] { display: none; }

.presentation-frame__loading::before {
  content: "";
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--color-line);
  border-top-color: currentColor;
  border-radius: 50%;
}

@media (prefers-reduced-motion: no-preference) {
  .presentation-frame__loading::before {
    animation: presentation-loading-spin 0.9s linear infinite;
  }

  @keyframes presentation-loading-spin {
    to { transform: rotate(360deg); }
  }
}

/* An artifact (a 3D viewer) is not a 16:9 stage: it takes the screen's
   height, with a floor for a short window. */
.presentation-frame--app {
  aspect-ratio: auto;
  height: min(52rem, calc(100vh - 6rem));
  min-height: 30rem;
}

/* A desktop-only artifact on a phone (plan 0054): presentation.js hides the
   frame and shows this notice instead, in the frame's place and width. */
.presentation-frame[hidden] { display: none; }

.artifact-gate {
  width: min(80rem, calc(100vw - 2rem));
  margin: 1.5rem 0 0.75rem calc(50% - min(40rem, 50vw - 1rem));
  padding: 1.25rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.artifact-gate[hidden] { display: none; }

.artifact-gate__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
}

.artifact-gate__text {
  margin: 0 0 1rem;
  color: var(--color-muted);
}

/* The «Versión» picker of a presentation (plan 0055): the pills of the
   progress filters, a dashed border and a padlock for a version the visitor
   cannot open, and the notice of the sign-in hint when one was asked for.
   Both take the width and the centring of the frame, like the hint below. */
.variant-picker,
.variant-notice {
  width: min(80rem, calc(100vw - 2rem));
  margin-left: calc(50% - min(40rem, 50vw - 1rem));
  box-sizing: border-box;
}

.variant-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.variant-picker__label {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.variant-picker__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.variant-picker__option {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--color-border);
  color: var(--color-muted);
  text-decoration: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.variant-picker__option:hover,
.variant-picker__option:focus-visible,
.variant-picker__option[aria-current="page"] {
  border-color: var(--color-notes-link);
  color: var(--color-notes-link);
}

.variant-picker__option[aria-current="page"] {
  background: var(--color-card-bg-hover);
}

.variant-picker__option--locked {
  border-style: dashed;
}

.variant-picker__lock {
  flex: none;
}

.variant-notice {
  border-left: 4px solid var(--color-notes-link);
  padding: 0.2rem 0 0.2rem 1rem;
  margin-top: 1rem;
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: 0.93rem;
  line-height: 1.5;
}

.variant-notice a {
  color: var(--color-notes-link);
  font-weight: 600;
  text-decoration: underline;
}

/* The dialog a padlock opens (variant-picker.js): the card of the artifact
   gate, centred over a dimmed page. `margin: auto` is what centres a modal
   dialog, and the `*` reset of style.css takes it away; the card colour is
   translucent, so it goes over the page's own background. */
.variant-dialog {
  width: min(28rem, calc(100vw - 2rem));
  box-sizing: border-box;
  margin: auto;
  padding: 1.25rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: linear-gradient(var(--color-surface), var(--color-surface)), var(--color-bg);
  color: var(--color-text);
}

.variant-dialog::backdrop {
  background: rgb(0 0 0 / 0.5);
}

.variant-dialog__title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
}

.variant-dialog__text {
  margin: 0 0 1rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.variant-dialog__text a {
  color: var(--color-notes-link);
  font-weight: 600;
  text-decoration: underline;
}

.variant-dialog__close {
  padding: 0.3rem 0.8rem;
  font: inherit;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  cursor: pointer;
}

.variant-dialog__close:hover,
.variant-dialog__close:focus-visible { border-color: var(--color-muted); }

/* Sits right above the frame and takes its width and centring: the keyboard
   hint on the left, its keys on the right and «Pantalla completa» in the
   middle. The two outer columns share the rest equally, so the button stays
   centred on the frame whatever the text on each side. */
.presentation-hint {
  width: min(80rem, calc(100vw - 2rem));
  margin: 1.5rem 0 0 calc(50% - min(40rem, 50vw - 1rem));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "lead full keys";
  align-items: center;
  gap: 0.75rem 1.5rem;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.presentation-hint__lead { grid-area: lead; }
.presentation-hint__keys {
  grid-area: keys;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem 1rem;
}
.presentation-fullscreen { grid-area: full; justify-self: center; }

/* Without room for three columns, the hint takes the first row and the
   button a row of its own, centred right above the frame. */
@media (max-width: 1150px) {
  .presentation-hint {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "lead keys" "full full";
  }
}

@media (max-width: 700px) {
  .presentation-hint {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "lead" "keys" "full";
  }
  .presentation-hint__keys { justify-self: start; justify-content: flex-start; }
}

.presentation-hint + .presentation-frame { margin-top: 0.75rem; }
.variant-picker + .presentation-hint,
.variant-notice + .presentation-hint { margin-top: 1rem; }

/* A touch screen has no keyboard to explain, so only the button is left. */
@media (hover: none) and (pointer: coarse) {
  .presentation-hint {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "full";
  }
  .presentation-hint__lead,
  .presentation-hint__keys { display: none; }
  /* Where the frame cannot go fullscreen (an iPhone) nothing is left at all. */
  .presentation-hint:not(:has(.presentation-fullscreen:not([hidden]))) { display: none; }
  .presentation-hint + .presentation-frame { margin-top: 1.5rem; }
  .presentation-hint:has(.presentation-fullscreen:not([hidden])) + .presentation-frame { margin-top: 1rem; }
}

/* The site's yellow, filled, with the offset shadow of «Volver atrás». The
   ink is dark in both themes: the light theme's yellow is too dark for white
   text, so a hover lifts the button instead of swapping its colours. */
.presentation-fullscreen {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  color: #1a1a1a;
  background: var(--color-notes-link);
  border: 2px solid var(--color-notes-link);
  border-radius: var(--radius-control);
  box-shadow: 3px 3px 0 var(--color-notes-shadow);
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.presentation-fullscreen:hover,
.presentation-fullscreen:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 4px 6px 0 var(--color-notes-shadow);
}

.presentation-fullscreen:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 3px;
}

.presentation-fullscreen:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0 var(--color-notes-shadow);
}

.presentation-fullscreen__icon {
  flex: none;
  transition: transform 0.2s ease;
}

.presentation-fullscreen:hover .presentation-fullscreen__icon,
.presentation-fullscreen:focus-visible .presentation-fullscreen__icon {
  transform: scale(1.15);
}

@media (prefers-reduced-motion: reduce) {
  .presentation-fullscreen,
  .presentation-fullscreen__icon { transition: none; }
  .presentation-fullscreen:hover,
  .presentation-fullscreen:focus-visible,
  .presentation-fullscreen:active,
  .presentation-fullscreen:hover .presentation-fullscreen__icon,
  .presentation-fullscreen:focus-visible .presentation-fullscreen__icon { transform: none; }
}

.presentation-fullscreen[hidden] { display: none; }

.artifact-gate__open {
  padding: 0.3rem 0.8rem;
  font: inherit;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  cursor: pointer;
}

.artifact-gate__open:hover { border-color: var(--color-muted); }

/* The artifacts of a deck's subtopic, or the decks of an artifact's. */
.related-items { margin: 2rem 0 1rem; }
.related-items__title { font-size: 1.1rem; margin: 0 0 0.75rem; }

.presentation-hint kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.45em;
  margin-right: 0.25em;
  text-align: center;
  font: inherit;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-bottom-width: 2px;
  border-radius: 0.35rem;
}

/* --- Problems: the parts of a multi-part exercise and their progress --- */

.problem-progress {
  margin: 1rem 0;
  font-family: var(--font-heading);
  color: var(--color-muted);
}

.problem-part {
  margin: 2rem 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.problem-part__heading {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.problem-part__actions {
  margin-top: 0.75rem;
}

.problem-part__error {
  color: var(--color-bad);
}

.problem-part__result {
  margin: 0.75rem 0;
  padding: 0.6rem 0.9rem;
  border-left: 3px solid var(--color-notes-link);
  background: var(--color-card-bg);
}

.problem-part__solution {
  margin-top: 0.75rem;
}

/* --- The background ---
   `backdrop.js` redraws the grid of style.css on a canvas that bends around
   the pointer. When it runs it marks <html> with `has-backdrop`, and only then
   does the CSS grid step aside: everywhere else (no JavaScript, touch screens,
   reduced motion) it stays as it was. The canvas goes under everything and
   lets every click through. */
.site-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.has-backdrop body {
  background-image: none;
}

/* --- Page header ---
   The listings open with an eyebrow (where you are), the heading and a
   standfirst, centred over a warm glow: the same voice as the home title,
   so going into a subject does not feel like leaving the site. The pages you
   read or answer on keep their left-aligned heading. */
.page-hero {
  position: relative;
  isolation: isolate;
  margin: 1.4rem auto 2.4rem;
  max-width: 46rem;
  text-align: center;
}

.page-hero::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: min(100%, 34rem);
  aspect-ratio: 2 / 1;
  translate: -50% -50%;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--color-header-accent) 16%, transparent),
    transparent 70%
  );
  filter: blur(14px);
  pointer-events: none;
}

/* The eyebrow reads like a code comment: `// SISTEMAS DE PROPULSIÓN`, the
   slashes in gold and the words in the muted ink, with no box around it. The
   slashes are drawn by CSS, so the templates and screen readers keep only
   the words. */
.page-hero__eyebrow {
  margin: 0 0 1rem;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-hero__eyebrow::before,
.page-hero__eyebrow::after {
  content: '//' / '';
  margin-right: 0.7em;
  color: var(--color-notes-link);
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* An invisible twin of the slashes on the right, so it is the words, not
   the whole line, that sit centred under the heading. The negative margin
   takes back the letter-spacing the last letter carries after it. */
.page-hero__eyebrow::after {
  visibility: hidden;
  margin: 0 -0.16em 0 0.7em;
}

.page-hero h1 {
  margin: 0 0 0.9rem;
  text-wrap: balance;
}

/* A short gradient rule under the heading, gold fading out on both sides. */
.page-hero h1 + *::before,
.page-hero:not(:has(.page-hero__lead))::after {
  content: '';
  display: block;
  width: 5rem;
  height: 2px;
  margin: 0 auto 1.1rem;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--color-header-accent), transparent);
}

.page-hero:not(:has(.page-hero__lead))::after {
  margin-bottom: 0;
}

.page-hero__lead {
  margin: 0 auto;
  max-width: 40rem;
  color: var(--color-muted);
  font-size: 1.1rem;
  line-height: 1.65;
  text-wrap: pretty;
}

/* The button from a group of a listing to the page of its topic or subtopic:
   the site's `.btn`, with the arrow of the cards nudging on hover. */
.notes-topic__page {
  margin: 0.9rem 0 0;
}

.notes-topic__page .btn {
  font-weight: 600;
}

.notes-topic__page-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.notes-topic__page .btn:hover .notes-topic__page-arrow,
.notes-topic__page .btn:focus-visible .notes-topic__page-arrow {
  transform: translateX(3px);
}

/* `.btn` drops its outline on focus and only changes colour; on its own row
   inside a card it needs the ring the cards have. */
.notes-topic__page .btn:focus-visible {
  outline: 2px solid var(--color-notes-link);
  outline-offset: 3px;
}

/* The title under the heading, when the heading is the item's topic or
   subtopic (a note or a presentation, `item_hero`). The gold rule sits
   between the two. */
.page-hero__subtitle {
  margin: 0 0 0.9rem;
  color: var(--color-notes-link);
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  text-wrap: balance;
}

/* Only one rule per header: under the heading, never again at the end. */
.page-hero:has(.page-hero__subtitle)::after {
  content: none;
}

.page-hero .essay-tags--list {
  justify-content: center;
  margin: 1rem 0 0;
}

/* The rule is a block before whatever follows the heading; inside the tags'
   flex row it would become one more tag, so there it closes the header. */
.page-hero h1 + .essay-tags::before {
  content: none;
}

@media (prefers-reduced-motion: no-preference) {
  .page-hero > * {
    animation: page-hero-rise 0.5s ease-out both;
  }

  .page-hero > :nth-child(2) { animation-delay: 0.06s; }
  .page-hero > :nth-child(3) { animation-delay: 0.12s; }

  @keyframes page-hero-rise {
    from { opacity: 0; translate: 0 0.5rem; }
    to { opacity: 1; translate: 0 0; }
  }
}

/* --- Rounded controls ---
   One place for the corners of everything you press or type into, so the
   questionnaires match the cards and the sign-in forms. They keep their
   borders, colours and hard shadows; only the corners change. */
.btn,
.question-back,
.site-nav__link,
.numeric-answer__input,
.profile-form input,
.contribution-form textarea,
.quiz-lengths select {
  border-radius: var(--radius-control);
}

/* The filters are toggles, so they take the pill of the tags. */
.question-filter-option,
.progress-filter {
  border-radius: 999px;
}

/* Rows and boxes inside a page: between a control and a card. */
.choice__label,
.question-card,
.feedback {
  border-radius: calc(var(--radius-card) - 0.25rem);
}

.question,
.activity-card,
.profile-panel {
  border-radius: var(--radius-card);
}

.feedback__explanation {
  border-radius: var(--radius-control);
}

/* The letter of a choice and the verdict icon: small tiles, small corners. */
.choice__marker,
.feedback__icon {
  border-radius: 0.3rem;
}

/* --- The course assistant (plan 0041) ---
   The round button at the bottom right of a subject's pages and the chat
   panel it opens. The `[hidden]` rules come first and are not decoration:
   quiz.css has no global one, and the `display` of the rules below would
   otherwise show the widget —and every hidden part of it— without
   JavaScript, which is what reveals it. Above the backdrop canvas and the
   page, below nothing. */

.assistant[hidden],
.assistant__panel[hidden],
.assistant__notice[hidden],
.assistant__status[hidden] {
  display: none;
}

.assistant {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.75rem;
  max-width: calc(100vw - 32px);
}

.assistant__launcher {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 2px solid var(--color-notes-link);
  border-radius: 50%;
  color: var(--color-bg);
  background: var(--color-notes-link);
  box-shadow: var(--shadow-lift);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.assistant__launcher:hover,
.assistant__launcher:focus-visible {
  background: var(--color-text);
  border-color: var(--color-text);
  transform: translateY(-2px);
  outline: none;
}

.assistant--open .assistant__launcher {
  background: var(--color-bg);
  color: var(--color-notes-link);
}

/* The size of the conversation's text: smaller in the floating panel,
   which is narrow, and a little bigger in full screen and on a phone,
   where the panel takes the whole width. */
.assistant__panel {
  --assistant-text: 0.85rem;
  position: relative;
  display: flex;
  flex-direction: column;
  /* --assistant-width and --assistant-height are the size dragged with the
     mouse (assistant.js); without them, the default one. The maximums still
     win, so a size saved on a big screen never overflows a smaller one. */
  width: var(--assistant-width, 380px);
  max-width: calc(100vw - 32px);
  height: var(--assistant-height, 70vh);
  max-height: calc(100vh - 6rem);
  max-height: calc(100dvh - 6rem);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  /* The faint tint of the cards over an opaque page colour: the panel floats
     over the content and must not let it show through. */
  background: linear-gradient(var(--color-surface), var(--color-surface)), var(--color-bg);
  color: var(--color-text);
  box-shadow: var(--shadow-lift), 0 2px 10px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  animation: assistant-in 0.16s ease-out;
}

.assistant__panel--full {
  --assistant-text: 0.92rem;
  position: fixed;
  inset: 0;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  border-radius: 0;
}

.assistant__panel--full .assistant__notice,
.assistant__panel--full .assistant__messages,
.assistant__panel--full .assistant__status,
.assistant__panel--full .assistant__form,
.assistant__panel--full .assistant__footer {
  width: 100%;
  max-width: 52rem;
  margin-inline: auto;
}

@keyframes assistant-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.assistant__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.5rem 0.55rem 0.9rem;
  border-bottom: 1px solid var(--color-line);
}

.assistant__title {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.2;
}

/* The window controls: icons only, at the top right, never wrapping under
   the title. */
.assistant__controls {
  flex-shrink: 0;
  display: flex;
  gap: 0.15rem;
}

.assistant__control {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--color-muted);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.assistant__control:hover,
.assistant__control:focus-visible {
  border-color: var(--color-line);
  color: var(--color-text);
  background: var(--color-card-bg-hover);
  outline: none;
}

.assistant__close:hover,
.assistant__close:focus-visible {
  color: var(--color-bad);
}

.assistant__expand[aria-pressed="true"] .assistant__icon--expand,
.assistant__expand:not([aria-pressed="true"]) .assistant__icon--shrink {
  display: none;
}

.assistant__notice {
  margin: 0.75rem 0.9rem 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--color-line-hover);
  border-radius: var(--radius-control);
  font-size: 0.8rem;
  line-height: 1.45;
}

.assistant__notice p {
  margin: 0 0 0.6rem;
}

/* What scrolls, so the header and the form always fit: with the notice
   open, a short screen would otherwise push the form out of the panel. */
.assistant__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.assistant__messages {
  margin: 0;
  padding: 0.9rem;
  list-style: none;
}

.assistant__message {
  display: flex;
  margin: 0 0 0.75rem;
}

.assistant__message--user {
  justify-content: flex-end;
}

.assistant__bubble {
  max-width: 92%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--color-line);
  border-radius: calc(var(--radius-card) - 0.25rem);
  font-size: var(--assistant-text);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.assistant__message--user .assistant__bubble {
  border-color: var(--color-line-hover);
  background: var(--color-card-bg-hover);
  white-space: pre-wrap;
}

.assistant__message--assistant .assistant__bubble {
  background: var(--color-bg);
}

.assistant__message--error .assistant__bubble {
  border-color: var(--color-bad);
  color: var(--color-bad);
  background: var(--color-bad-bg);
}

/* While it arrives the answer is plain text: keep its line breaks. Before
   its first word there is only the status line below, so no empty bubble. */
.assistant__bubble--streaming {
  white-space: pre-wrap;
}

.assistant__message--assistant:has(.assistant__bubble--streaming:empty) {
  display: none;
}

.assistant__bubble > :first-child {
  margin-top: 0;
}

.assistant__bubble > :last-child {
  margin-bottom: 0;
}

.assistant__bubble p,
.assistant__bubble ul,
.assistant__bubble ol {
  margin: 0 0 0.6rem;
}

.assistant__bubble table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.92em;
}

.assistant__bubble th,
.assistant__bubble td {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--color-line);
}

.assistant__bubble pre {
  max-width: 100%;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.assistant__bubble .math--block {
  display: block;
  overflow-x: auto;
}

.assistant__sources {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-line);
  font-size: 0.88em;
}

.assistant__sources-title {
  margin: 0 0 0.2rem;
  color: var(--color-muted);
}

.assistant__sources ul {
  margin: 0;
  padding-left: 1.1rem;
}

.assistant__status {
  margin: 0 0.9rem 0.5rem;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-style: italic;
}

.assistant__login {
  margin: 0;
  padding: 0.9rem;
  border-top: 1px solid var(--color-line);
  font-size: var(--assistant-text);
}

.assistant__form {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem 0.35rem;
  border-top: 1px solid var(--color-line);
}

/* The box, its label and the «!» that explains it. The row is the anchor
   of the tooltip, which opens upwards over the conversation: the panel
   hides its overflow, so it has to stay inside it. */
.assistant__use-page-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.assistant__use-page {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-muted);
  font-size: 0.78rem;
  cursor: pointer;
}

.assistant__info {
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--color-line-hover);
  border-radius: 50%;
  color: var(--color-notes-link);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.assistant__info:hover,
.assistant__info:focus-visible {
  color: var(--color-bg);
  background: var(--color-notes-link);
  border-color: var(--color-notes-link);
  outline: none;
}

.assistant__tooltip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.45rem);
  z-index: 1;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--color-line-hover);
  border-radius: var(--radius-control);
  color: var(--color-text);
  background: var(--color-bg);
  box-shadow: var(--shadow-lift);
  font-size: 0.8rem;
  line-height: 1.45;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
  pointer-events: none;
}

.assistant__info:hover + .assistant__tooltip,
.assistant__info:focus-visible + .assistant__tooltip {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.assistant__input {
  width: 100%;
  min-height: 3.5rem;
  max-height: 10rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-control);
  color: var(--color-text);
  background: var(--color-bg);
  font: inherit;
  font-size: var(--assistant-text);
  resize: vertical;
}

.assistant__input:focus {
  border-color: var(--color-line-hover);
  outline: 2px solid var(--color-glow);
}

.assistant__form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.assistant__hint {
  margin-left: auto;
  color: var(--color-muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

/* At the panel's normal width the row holds the two buttons and nothing
   else; the hint only fits in full screen. */
.assistant__panel:not(.assistant__panel--full) .assistant__hint {
  display: none;
}

/* The one text button left: quieter than «Enviar», which is the action. */
.assistant__new {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-control);
  color: var(--color-muted);
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  white-space: nowrap;
  cursor: pointer;
}

.assistant__new:hover,
.assistant__new:focus-visible {
  border-color: var(--color-line-hover);
  color: var(--color-text);
  outline: none;
}

.assistant__footer {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem 0.55rem;
  color: var(--color-muted);
  font-size: 0.72rem;
}

.assistant__footer a {
  color: var(--color-muted);
}

.assistant__footer a:hover,
.assistant__footer a:focus-visible {
  color: var(--color-notes-link);
}

/* The grips that resize the panel from its free sides —the left, the top
   and the corner between them— since it is anchored at the bottom right.
   Only with a mouse and room to spare (the same query as assistant.js):
   a phone's panel already takes the width, and a finger has the full
   screen button. Never in full screen, which has no size to drag. */
.assistant__resize {
  display: none;
}

@media (hover: hover) and (pointer: fine) and (min-width: 601px) {
  .assistant__panel:not(.assistant__panel--full) .assistant__resize {
    display: block;
    position: absolute;
    z-index: 2;
    touch-action: none;
  }
}

.assistant__resize--left {
  top: 18px;
  bottom: 0;
  left: 0;
  width: 6px;
  cursor: ew-resize;
}

.assistant__resize--top {
  top: 0;
  left: 18px;
  right: 0;
  height: 6px;
  cursor: ns-resize;
}

/* The corner is the visible one: two short diagonal strokes, like the
   grip of a textarea turned towards the top left, drawn clear of the
   panel's rounded corner, which would clip them. */
.assistant__resize--corner {
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  background: linear-gradient(135deg,
    transparent 0 8px, var(--color-line-hover) 8px 9.5px,
    transparent 9.5px 11.5px, var(--color-line-hover) 11.5px 13px,
    transparent 13px);
}

.assistant__resize--corner:hover {
  background: linear-gradient(135deg,
    transparent 0 8px, var(--color-notes-link) 8px 9.5px,
    transparent 9.5px 11.5px, var(--color-notes-link) 11.5px 13px,
    transparent 13px);
}

/* While dragging, no text is selected along the way. */
.assistant--resizing,
.assistant--resizing * {
  user-select: none;
}

@media (max-width: 600px) {
  .assistant__panel {
    --assistant-text: 0.92rem;
    width: calc(100vw - 32px);
    height: 75vh;
    height: 75dvh;
  }

  .assistant__hint {
    display: none;
  }

  /* The round launcher sits over the bottom right of the screen, which on a
     phone is where the footer ends and «Aviso legal» was under it. The pages
     that carry it say so on <body> (no `:has()`), and the footer makes room. */
  .has-assistant .site-footer {
    padding-bottom: 5rem;
  }
}

/* iOS and iPadOS zoom into a text box whose letters are under 16px, and
   leave the page zoomed after sending. On a touch screen the box keeps
   16px whatever the size of the conversation. */
@media (pointer: coarse) {
  .assistant__input {
    font-size: max(16px, var(--assistant-text));
  }
}

@media (prefers-reduced-motion: reduce) {
  .assistant__panel {
    animation: none;
  }

  .assistant__launcher,
  .assistant__control,
  .assistant__tooltip {
    transition: none;
  }

  .assistant__launcher:hover,
  .assistant__launcher:focus-visible {
    transform: none;
  }
}

/* --- The home page's «Propósito» and «Funcionalidades» ---
   The look of /assistant: the cards' surface and hairline, icons in a tinted
   square in the gold of the links, and the gold of the headings for the
   claim. Both run the width of the page; the purpose stays short by putting
   the claim beside the text instead of above it. */

.home-purpose {
  position: relative;
  display: grid;
  gap: 1.1rem;
  padding: 1.6rem 1.5rem;
  border: 1px solid var(--color-line);
  border-left: 3px solid var(--color-notes-link);
  border-radius: var(--radius-card);
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--color-header-accent) 7%, transparent), transparent 55%),
    var(--color-surface);
}

.home-purpose__claim {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.home-purpose__accent {
  color: var(--color-header-accent);
}

.home-purpose__text p {
  margin: 0 0 0.75rem;
  color: var(--color-muted);
  line-height: 1.6;
  text-wrap: pretty;
}

.home-purpose__text p:last-child {
  margin-bottom: 0;
}

.home-purpose__text strong {
  color: var(--color-text);
}

@media (min-width: 760px) {
  .home-purpose {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 2.5fr);
    align-items: center;
    gap: 2.25rem;
    padding: 1.9rem 2.2rem;
  }

  .home-purpose__claim {
    font-size: 2.2rem;
  }
}

/* A row that slides at every width, like the subjects' rows, with the next
   card peeking in at the edge so it reads as more to come: most of the
   width on a phone, a little over two cards on a tablet and a little over
   three on a wide screen. The padding gives the hover lift room inside the
   scroll box, which clips everything outside it. */
.home-capabilities {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 82%;
  gap: 1rem;
  margin: 0;
  padding: 0.35rem 0.25rem 0.9rem;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0.25rem;
  scrollbar-width: none;
}

.home-capabilities::-webkit-scrollbar {
  display: none;
}

.home-capabilities > .home-capability {
  scroll-snap-align: start;
}

@media (min-width: 560px) {
  .home-capabilities {
    grid-auto-columns: calc((100% - 2rem) / 2.25);
  }
}

@media (min-width: 1000px) {
  .home-capabilities {
    grid-auto-columns: calc((100% - 3rem) / 3.3);
  }
}

/* Under the row: the arrows and one dot per position the row can reach,
   the current one drawn long. */
.home-capabilities__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.home-capabilities__controls[hidden] {
  display: none;
}

.home-capabilities__dots {
  display: flex;
  justify-content: center;
  gap: 0.15rem;
}

.home-capabilities__dot {
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.home-capabilities__dot::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--color-line-hover);
  transition: width 0.2s ease, background-color 0.2s ease;
}

.home-capabilities__dot[aria-current='true']::before {
  width: 1.1rem;
  background: var(--color-notes-link);
}

.home-capabilities__arrow {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.home-capabilities__arrow:hover,
.home-capabilities__arrow:focus-visible {
  border-color: var(--color-notes-link);
  color: var(--color-notes-link);
  outline: none;
}

.home-capability {
  margin: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.home-capability .home-feature-card__text {
  text-wrap: pretty;
}

.home-capability .home-feature-card__text strong {
  color: var(--color-text);
  font-weight: 600;
}

@media (prefers-reduced-motion: no-preference) {
  .home-capability:hover {
    transform: translateY(-3px);
  }
}

.home-capability__icon {
  display: inline-grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  margin-bottom: 0.95rem;
  border-radius: 0.8rem;
  color: var(--home-accent, var(--color-notes-link));
  background: color-mix(in srgb, var(--home-accent, var(--color-notes-link)) 12%, transparent);
}

.home-capability__link {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--home-accent, var(--color-notes-link));
  text-decoration: none;
}

.home-capability__link:hover,
.home-capability__link:focus-visible {
  text-decoration: underline;
}

/* Not built yet: dashed, like the next model on /assistant, and its tag at
   the foot of the card. Two classes again, to win over the card's own border
   and background in `typography.css`. */
.home-feature-card.home-capability--soon {
  border-style: dashed;
  background: transparent;
}

.home-capability--soon .home-capability__icon {
  color: var(--color-muted);
  background: var(--color-card-bg-hover);
}

/* The accents of «¿Qué es esta web?» and «Funcionalidades»: each pillar and
   each card names its area, with the same names and colours as the
   roadmap's (`app/roadmap.py`, AREAS), and `typography.css` paints the
   number, the rule, the title, the border and the top stripe with
   `--home-accent`. Content has no class: it keeps the site's gold, brighter
   than the roadmap's, which is what keeps the gold the dominant colour. */
.home-accent--study     { --home-accent: var(--hue-green); }
.home-accent--ai        { --home-accent: var(--hue-purple); }
.home-accent--classroom { --home-accent: var(--hue-blue); }
.home-accent--accounts  { --home-accent: var(--hue-teal); }

/* Not built yet, in its area's colour but dimmed: a dashed border in the
   accent, the icon in grey (above) and no stripe, not even on hover. */
.home-feature-card.home-capability--soon,
.home-feature-card.home-capability--soon:hover {
  border-color: color-mix(in srgb, var(--home-accent, var(--color-line-hover)) 45%, transparent);
  box-shadow: none;
}

.home-capability .home-capability__tags {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 0.85rem;
}

/* --- The assistant's page (/assistant) ---
   Why it exists, how it answers, the model and the roadmap. Built from the
   same pieces as the rest: the cards' surface and hairline, the gold of the
   links as the accent, and icons in `currentColor` so both themes work. */

.ai-page {
  max-width: 56rem;
  margin: 0 auto;
}

.ai-page__section {
  margin: 0 0 3rem;
}

.ai-page__heading {
  margin: 0 0 1.2rem;
  text-align: center;
}

.ai-page__note {
  max-width: 40rem;
  margin: 1.4rem auto 0;
  color: var(--color-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  text-align: center;
}

.ai-reasons,
.ai-flow,
.ai-roadmap {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-reasons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
}

.ai-reason {
  padding: 1.4rem 1.3rem 1.2rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-reason:hover {
  border-color: var(--color-line-hover);
  box-shadow: var(--shadow-lift);
  transform: translateY(-3px);
}

.ai-reason__icon {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.9rem;
  border-radius: 0.8rem;
  color: var(--color-notes-link);
  background: color-mix(in srgb, var(--color-notes-link) 12%, transparent);
}

.ai-reason__title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.ai-reason p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.55;
}

/* Three steps joined by a gold line: a row on a wide screen, a column on a
   phone. The line runs behind the numbers. */
.ai-flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.ai-flow::before {
  content: '';
  position: absolute;
  top: 1.25rem;
  left: 16.6%;
  right: 16.6%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-header-accent) 15%, var(--color-header-accent) 85%, transparent);
  opacity: 0.6;
}

.ai-flow__step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

.ai-flow__step span:last-child {
  color: var(--color-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.ai-flow__number {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.4rem;
  border: 2px solid var(--color-notes-link);
  border-radius: 50%;
  color: var(--color-notes-link);
  background: var(--color-bg);
  font-family: var(--font-heading);
  font-weight: 700;
}

.ai-models {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}

.ai-model {
  padding: 1.3rem 1.3rem 1.1rem;
  border: 1px dashed var(--color-line-hover);
  border-radius: var(--radius-card);
}

.ai-model--current {
  border-style: solid;
  border-color: var(--color-notes-link);
  background: var(--color-surface);
  box-shadow: var(--shadow-lift);
}

.ai-model__state {
  display: inline-block;
  margin: 0 0 0.7rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  color: var(--color-muted);
  background: var(--color-card-bg-hover);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ai-model--current .ai-model__state {
  color: var(--color-bg);
  background: var(--color-notes-link);
}

.ai-model__name {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}

.ai-model p:last-child {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.55;
}

.ai-page__subheading {
  margin: 2.4rem 0 0.8rem;
  font-size: 1.15rem;
  text-align: center;
}

.ai-page__heading + .ai-page__subheading {
  margin-top: 0;
}

.ai-page__intro {
  max-width: 40rem;
  margin: 0 auto 1.4rem;
  color: var(--color-muted);
  line-height: 1.6;
  text-align: center;
}

/* The benchmark: one card per configuration, the score as a hero number and
   a bar out of 20. The bars are SVG so their length is an attribute, not a
   style= value. Only the assistant's bar wears the accent; the baselines
   stay in muted ink. */
.ai-bench {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
}

/* One configuration alone, centred: wider than the chat's, for its grid. */
.ai-bench--single {
  grid-template-columns: minmax(0, 28rem);
  justify-content: center;
}

.ai-bench__card {
  padding: 1.2rem 1.3rem 1.3rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.ai-bench__card--current {
  border-color: var(--color-notes-link);
  box-shadow: var(--shadow-lift);
}

.ai-bench__tag {
  display: inline-block;
  margin: 0 0 0.7rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  color: var(--color-muted);
  background: var(--color-card-bg-hover);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ai-bench__card--current .ai-bench__tag {
  color: var(--color-bg);
  background: var(--color-notes-link);
}

.ai-bench__name {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
}

.ai-bench__setup {
  margin: 0.25rem 0 0.8rem;
  color: var(--color-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.ai-bench__score {
  margin: 0 0 0.6rem;
  color: var(--color-muted);
}

.ai-bench__score strong {
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 2.2rem;
  line-height: 1;
}

.ai-bench__bar {
  display: block;
  width: 100%;
  height: 0.5rem;
}

.ai-bench__track {
  fill: var(--color-card-bg-hover);
}

.ai-bench__fill {
  fill: var(--color-muted);
}

.ai-bench__card--current .ai-bench__fill {
  fill: var(--color-notes-link);
}

/* The figures under each benchmark: a list of tiles, the number big and its
   meaning under it. */
.ai-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.ai-stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  text-align: center;
}

.ai-stat__value {
  color: var(--color-notes-link);
  font-family: var(--font-heading);
  font-size: 1.8rem;
  line-height: 1.1;
}

.ai-stat__label {
  line-height: 1.4;
}

.ai-stat__detail {
  color: var(--color-muted);
  font-size: 0.85rem;
}

/* The grading benchmark: a column per answer, the verdict fixed beforehand
   above and the grader's below, both in the verdict badges' colours. Where
   it got it right the column is one colour; a failed grading is a dashed
   empty cell. */
.ai-match {
  display: grid;
  grid-template-columns: auto repeat(20, minmax(0, 1fr));
  align-items: center;
  gap: 0.3rem 0.2rem;
  margin: 1rem 0 0.9rem;
}

.ai-match__label {
  padding-right: 0.4rem;
  color: var(--color-muted);
  font-size: 0.78rem;
  text-align: right;
}

.ai-match__cell {
  height: 1.1rem;
  border-radius: 0.2rem;
  background: var(--cell-color);
}

.ai-match__cell--correct,
.ai-match__key--correct { --cell-color: var(--color-ok); }
.ai-match__cell--partial,
.ai-match__key--partial { --cell-color: var(--color-partial); }
.ai-match__cell--incorrect,
.ai-match__key--incorrect { --cell-color: var(--color-bad); }

.ai-match__cell--failed {
  border: 1px dashed var(--color-muted);
  background: transparent;
}

.ai-match__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.ai-match__key::before {
  content: '';
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.4rem;
  border-radius: 0.2rem;
  background: var(--cell-color);
  vertical-align: -0.05rem;
}

/* A vertical timeline: a check for what is out, an empty ring for what is
   coming, and the line between them dashed from the first pending step. */
.ai-roadmap {
  max-width: 40rem;
  margin: 0 auto;
}

.ai-roadmap__item {
  position: relative;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 1rem;
  padding-bottom: 1.6rem;
}

.ai-roadmap__item:last-child {
  padding-bottom: 0;
}

.ai-roadmap__item:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 2rem;
  bottom: 0;
  left: calc(1rem - 1px);
  border-left: 2px dashed var(--color-line-hover);
}

.ai-roadmap__item--done:not(:last-child)::before {
  border-left-style: solid;
  border-left-color: var(--color-notes-link);
}

.ai-roadmap__mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--color-line-hover);
  border-radius: 50%;
  background: var(--color-bg);
}

.ai-roadmap__item--done .ai-roadmap__mark {
  border-color: var(--color-ok);
  color: var(--color-bg);
  background: var(--color-ok);
}

.ai-roadmap__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.2rem 0 0.35rem;
  font-size: 1.1rem;
}

.ai-roadmap__tag {
  padding: 0.12rem 0.55rem;
  border: 1px solid var(--color-line-hover);
  border-radius: 999px;
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
}

.ai-roadmap__item--done .ai-roadmap__tag {
  border-color: var(--color-ok);
  color: var(--color-ok);
  background: var(--color-ok-bg);
}

.ai-roadmap__body p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.55;
}

@media (max-width: 640px) {
  .ai-flow {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  /* Stacked, a line would run through the text. */
  .ai-flow::before {
    content: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-reason {
    transition: none;
  }

  .ai-reason:hover {
    transform: none;
  }
}

/* --- Preguntas de desarrollo (plan 0042) ---
   The page of an essay: a notice, the box, its counter and busy line, and the
   result of a grading. Named `essay-result`, `essay-box`… and never
   `essay-tag`, which is web_pablo's generic tag and has nothing to do with
   these essays. The verdict colours reuse the feedback's: ok, bad and the
   partial in between. */
.essay-tag--length {
  --tag-color: var(--color-muted);
}

.essay-notice {
  margin: 1.4rem 0 0;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  font-size: 0.92rem;
}

.essay-notice--privacy {
  color: var(--color-muted);
}

.essay-form {
  margin-top: 1.2rem;
}

.essay-box {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 7rem;
  resize: vertical;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-card-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-control);
  padding: 0.7rem 0.85rem;
}

.essay-box:focus-visible {
  border-color: var(--color-notes-link);
  outline: none;
}

.essay-box[readonly] {
  opacity: 0.85;
  margin-top: 0.4rem;
}

.essay-counter {
  margin: 0.35rem 0 0;
  text-align: right;
  font-size: 0.8rem;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}

.essay-error {
  margin: 0.7rem 0 0;
  padding-left: 0.7rem;
  border-left: 3px solid var(--color-bad);
  color: var(--color-bad);
}

.essay-busy {
  margin: 0.6rem 0 0;
  color: var(--color-muted);
  font-size: 0.92rem;
}

.essay-last {
  margin: 0.8rem 0 0;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.essay-result {
  --verdict-color: var(--color-muted);
  --verdict-bg: var(--color-surface);
  margin-top: 1.6rem;
  padding: 1rem 1.2rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--verdict-color) 45%, transparent);
  border-left: 5px solid var(--verdict-color);
  border-radius: calc(var(--radius-card) - 0.25rem);
  background: var(--verdict-bg);
}

.essay-result--correct {
  --verdict-color: var(--color-ok);
  --verdict-bg: var(--color-ok-bg);
}

.essay-result--partial {
  --verdict-color: var(--color-partial);
  --verdict-bg: var(--color-partial-bg);
}

.essay-result--incorrect {
  --verdict-color: var(--color-bad);
  --verdict-bg: var(--color-bad-bg);
}

.essay-result__verdict {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--verdict-color);
}

.essay-result__summary {
  margin-top: 0.5rem;
}

.essay-result__summary > :last-child {
  margin-bottom: 0;
}

.essay-result__heading {
  margin: 1rem 0 0.35rem;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-muted);
}

.essay-result__list {
  margin: 0;
  padding-left: 1.2rem;
}

.essay-result__list li + li {
  margin-top: 0.3rem;
}

.essay-result .feedback__explanation {
  margin-top: 1rem;
}

.essay-result__note {
  margin: 0.9rem 0 0;
  font-size: 0.8rem;
  color: var(--color-muted);
}

/* The verdict on a card and in «Última corrección»: like .problem-badge. */
.verdict-badge {
  --tag-color: var(--color-muted);
  display: inline-block;
  margin-left: 0.5rem;
  vertical-align: middle;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  padding: 0.15rem 0.35rem;
  border: 1px solid var(--tag-color);
  border-radius: 0.2rem;
  color: var(--tag-color);
  background: color-mix(in srgb, var(--tag-color) 12%, transparent);
}

.essay-last .verdict-badge {
  margin-left: 0.15rem;
}

.verdict-badge--correct {
  --tag-color: var(--color-ok);
}

.verdict-badge--partial {
  --tag-color: var(--color-partial);
}

.verdict-badge--incorrect {
  --tag-color: var(--color-bad);
}

/* The close of «¿Qué es esta web?»: an invitation to the roadmap. */
.home-roadmap {
  max-width: 40rem;
  margin: 1.8rem auto 0;
  color: var(--color-muted);
  font-size: 0.98rem;
  line-height: 1.6;
  text-align: center;
  text-wrap: pretty;
}

.home-roadmap a {
  color: var(--color-notes-link);
  font-weight: 600;
  text-decoration: none;
}

.home-roadmap a:hover,
.home-roadmap a:focus-visible {
  text-decoration: underline;
}

/* --- The roadmap (/roadmap) ---
   A vertical line from «Ahora» down to the first day, with the milestones
   hanging from it: on a phone the line runs down the left edge, on a wide
   screen down the middle with the cards alternating sides. Each milestone
   takes the colour of its area (`app/roadmap.py`, AREAS), mid tones that
   read in both themes like the tags'. Above «Ahora», a dashed stretch leads
   up to «Próximos pasos», the part of the line not drawn yet.

   Nothing is hidden without JavaScript: `roadmap.js` adds `.is-animated` to
   the root only when it is about to bring each entry in (`.is-visible`), and
   with movement reduced it adds nothing. */

.roadmap {
  --roadmap-axis: 1.1rem;
  --roadmap-gap: 1.9rem;
  --roadmap-line-top: 1.6rem;
  max-width: 64rem;
  margin: 0 auto;
}

.roadmap-entry--content   { --roadmap-area: var(--hue-gold); }
.roadmap-entry--study     { --roadmap-area: var(--hue-green); }
.roadmap-entry--ai        { --roadmap-area: var(--hue-purple); }
.roadmap-entry--classroom { --roadmap-area: var(--hue-blue); }
.roadmap-entry--accounts  { --roadmap-area: var(--hue-teal); }
.roadmap-entry--tools     { --roadmap-area: var(--hue-orange); }
.roadmap-entry--platform  { --roadmap-area: var(--hue-gray); }
.roadmap-entry--design    { --roadmap-area: var(--hue-pink); }

/* «Próximos pasos»: the button is the <summary>, with the hard shadow of the
   site's main entrances, and the dashed stretch below it runs down to the
   dot of «Ahora». */
.roadmap-next {
  position: relative;
  padding-bottom: 2rem;
  text-align: center;
}

.roadmap-next::after {
  content: '';
  position: absolute;
  left: var(--roadmap-axis);
  bottom: calc(-1 * var(--roadmap-line-top));
  height: calc(2rem + var(--roadmap-line-top));
  border-left: 2px dashed color-mix(in srgb, var(--color-header-accent) 55%, transparent);
  translate: -50% 0;
  pointer-events: none;
}

.roadmap-next__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 1.25rem;
  border: 2px solid var(--color-notes-link);
  border-radius: 999px;
  background:
    linear-gradient(110deg, color-mix(in srgb, var(--color-header-accent) 16%, transparent), transparent 75%),
    var(--color-bg);
  box-shadow: 4px 4px 0 var(--color-notes-shadow);
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.roadmap-next__toggle::-webkit-details-marker {
  display: none;
}

.roadmap-next__toggle:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 5px 0 var(--color-notes-shadow);
}

.roadmap-next__toggle:focus-visible {
  outline: 2px solid var(--color-notes-link);
  outline-offset: 4px;
}

.roadmap-next__spark {
  display: inline-grid;
  place-items: center;
  color: var(--color-notes-link);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.roadmap-next__toggle:hover .roadmap-next__spark,
.roadmap-next[open]:not(.is-closing) .roadmap-next__spark {
  transform: rotate(72deg) scale(1.1);
}

.roadmap-next__label {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.roadmap-next__when-open,
.roadmap-next[open]:not(.is-closing) .roadmap-next__when-closed {
  display: none;
}

.roadmap-next[open]:not(.is-closing) .roadmap-next__when-open {
  display: inline;
}

/* The chevron points down while closed and up while open. */
.roadmap-next__chevron {
  width: 0.5rem;
  height: 0.5rem;
  margin-top: -0.2rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  rotate: 45deg;
  transition: rotate 0.3s ease, margin 0.3s ease;
}

.roadmap-next[open]:not(.is-closing) .roadmap-next__chevron {
  margin-top: 0.25rem;
  rotate: 225deg;
}

.roadmap-next__panel {
  text-align: left;
}

/* Only while it slides: otherwise the cards' hover shadow would be clipped. */
.roadmap-next__panel.is-sliding {
  overflow: hidden;
}

.roadmap-next__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 1rem;
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
}

.roadmap-step {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 1.2rem 1.25rem 1.15rem;
  border: 1px solid var(--color-line-hover);
  border-radius: var(--radius-card);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--color-header-accent) 7%, transparent), transparent 60%),
    var(--color-surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.roadmap-step:hover {
  --color-surface: var(--color-card-bg-hover);
  box-shadow: var(--shadow-lift);
}

/* The open invitation at the end: dashed, like everything «Próximamente»,
   and on a row of its own, centred under the others whatever the number of
   columns, with its contents centred too. */
.roadmap-step--more {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 26rem);
  align-items: center;
  border-style: dashed;
  background: transparent;
  text-align: center;
}

.roadmap-step--more .roadmap-step__icon,
.roadmap-step--more .roadmap-step__link {
  align-self: center;
}

.roadmap-step__icon {
  display: inline-grid;
  place-items: center;
  align-self: flex-start;
  width: 2.7rem;
  height: 2.7rem;
  margin-bottom: 0.85rem;
  border-radius: 0.8rem;
  color: var(--color-notes-link);
  background: color-mix(in srgb, var(--color-notes-link) 12%, transparent);
}

.roadmap-step__title {
  margin: 0 0 0.45rem;
  font-size: 1.08rem;
  line-height: 1.3;
}

.roadmap-step__text {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.94rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.roadmap-step__link {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 0.85rem;
  color: var(--color-notes-link);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.roadmap-step__link:hover,
.roadmap-step__link:focus-visible {
  text-decoration: underline;
}

/* --- The line itself --- */

.roadmap-line {
  position: relative;
  padding-bottom: 2.2rem;
}

/* The track, gold near «Ahora» and fading into a hairline towards the past,
   and the first day's dot at its very end. */
.roadmap-line::before,
.roadmap-line__progress {
  content: '';
  position: absolute;
  left: var(--roadmap-axis);
  top: var(--roadmap-line-top);
  translate: -50% 0;
  border-radius: 2px;
}

.roadmap-line::before {
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--color-header-accent) 60%, transparent),
    var(--color-line) 30%,
    var(--color-line)
  );
}

.roadmap-line::after {
  content: '';
  position: absolute;
  left: var(--roadmap-axis);
  bottom: 0;
  z-index: 1;
  width: 0.85rem;
  height: 0.85rem;
  translate: -50% 50%;
  border: 2px solid var(--color-notes-link);
  border-radius: 50%;
  background: var(--color-bg);
}

/* How far down you have read: `roadmap.js` writes the share. */
.roadmap-line__progress {
  width: 3px;
  height: calc((100% - var(--roadmap-line-top)) * var(--roadmap-progress, 0));
  background: linear-gradient(to bottom, var(--color-header-accent), var(--color-notes-link));
  box-shadow: 0 0 12px var(--color-glow);
}

.roadmap-line__progress::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0.55rem;
  height: 0.55rem;
  translate: -50% 50%;
  border-radius: 50%;
  background: var(--color-header-accent);
  box-shadow: 0 0 0 4px var(--color-glow), 0 0 14px var(--color-header-accent);
}

/* --- «Ahora» --- */

.roadmap-now {
  position: relative;
  margin: 0 0 2.2rem;
  padding-left: calc(var(--roadmap-axis) + var(--roadmap-gap));
}

.roadmap-now__dot {
  position: absolute;
  left: var(--roadmap-axis);
  top: var(--roadmap-line-top);
  z-index: 2;
  width: 1.15rem;
  height: 1.15rem;
  translate: -50% -50%;
  border-radius: 50%;
  background: var(--color-header-accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--color-header-accent) 22%, transparent);
}

.roadmap-now__dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--color-header-accent);
  opacity: 0;
}

.roadmap-now__card {
  position: relative;
  padding: 1.35rem 1.45rem 1.4rem;
  border: 1px solid var(--color-notes-link);
  border-radius: var(--radius-card);
  /* Opaque underneath: on a wide screen the line runs behind the card. */
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--color-header-accent) 14%, transparent), transparent 70%),
    var(--color-bg);
  box-shadow: 4px 4px 0 var(--color-notes-shadow);
}

.roadmap-now__eyebrow {
  margin: 0 0 0.4rem;
  color: var(--color-notes-link);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.roadmap-now__title {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
}

.roadmap-now__text {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.6;
}

.roadmap-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}

.roadmap-figure {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.roadmap-figure__value {
  color: var(--color-notes-link);
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.roadmap-figure__label {
  color: var(--color-muted);
  font-size: 0.82rem;
}

/* --- The months and their milestones --- */

.roadmap-month__title {
  position: relative;
  margin: 2.4rem 0 1.2rem;
  padding-left: calc(var(--roadmap-axis) + var(--roadmap-gap));
  font-size: 1rem;
  line-height: 1;
}

/* A small diamond on the line where a month starts. */
.roadmap-month__title::before {
  content: '';
  position: absolute;
  left: var(--roadmap-axis);
  top: 50%;
  z-index: 1;
  width: 0.6rem;
  height: 0.6rem;
  translate: -50% -50%;
  rotate: 45deg;
  border: 2px solid var(--color-notes-link);
  background: var(--color-bg);
}

.roadmap-month__pill {
  display: inline-block;
  padding: 0.4rem 0.95rem;
  border: 1px solid var(--color-line-hover);
  border-radius: 999px;
  background:
    linear-gradient(color-mix(in srgb, var(--color-notes-link) 10%, transparent), color-mix(in srgb, var(--color-notes-link) 10%, transparent)),
    var(--color-bg);
  color: var(--color-notes-link);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.roadmap-month__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.roadmap-entry {
  position: relative;
  margin: 0 0 1.1rem;
  padding-left: calc(var(--roadmap-axis) + var(--roadmap-gap));
}

/* The hairline from the line to the card, in the colour of the area. */
.roadmap-entry::after {
  content: '';
  position: absolute;
  top: 1.45rem;
  left: var(--roadmap-axis);
  width: var(--roadmap-gap);
  height: 1px;
  background: color-mix(in srgb, var(--roadmap-area) 55%, transparent);
  transform-origin: left center;
}

.roadmap-entry__dot {
  position: absolute;
  left: var(--roadmap-axis);
  top: 1.45rem;
  z-index: 1;
  width: 0.8rem;
  height: 0.8rem;
  translate: -50% -50%;
  border: 2px solid var(--roadmap-area);
  border-radius: 50%;
  background: var(--color-bg);
}

.roadmap-entry--major .roadmap-entry__dot {
  width: 1.05rem;
  height: 1.05rem;
  background: var(--roadmap-area);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--roadmap-area) 22%, transparent);
}

.roadmap-entry__dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--roadmap-area);
  opacity: 0;
}

.roadmap-entry__card {
  position: relative;
  isolation: isolate;
  padding: 1rem 1.15rem 1.05rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--roadmap-area) 8%, transparent), transparent 60%),
    var(--color-surface);
  box-shadow: inset 3px 0 0 var(--roadmap-area);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.roadmap-entry--major .roadmap-entry__card {
  border-color: color-mix(in srgb, var(--roadmap-area) 45%, var(--color-line));
}

.roadmap-entry__card:hover {
  --color-surface: var(--color-card-bg-hover);
  border-color: color-mix(in srgb, var(--roadmap-area) 65%, transparent);
  box-shadow: inset 3px 0 0 var(--roadmap-area), var(--shadow-lift);
}

.roadmap-entry__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin: 0 0 0.4rem;
}

.roadmap-entry__date {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.roadmap-entry__area {
  padding: 0.14rem 0.45rem;
  border: 1px solid color-mix(in srgb, var(--roadmap-area) 60%, transparent);
  border-radius: 0.2rem;
  color: var(--roadmap-area);
  background: color-mix(in srgb, var(--roadmap-area) 12%, transparent);
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.roadmap-entry__title {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
  line-height: 1.3;
}

.roadmap-entry__text {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.94rem;
  line-height: 1.55;
  text-wrap: pretty;
}

/* The caption of the first day, beside the line's last dot on a phone and
   under it on a wide screen. */
.roadmap-origin {
  margin: -0.75rem 0 0;
  padding-left: calc(var(--roadmap-axis) + var(--roadmap-gap));
  color: var(--color-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.roadmap-origin time {
  color: var(--color-text);
  font-weight: 600;
}

/* --- Wide screens: the line down the middle, the cards on both sides --- */

@media (min-width: 52rem) {
  .roadmap {
    --roadmap-axis: 50%;
    --roadmap-gap: 2.4rem;
    --roadmap-line-top: 0rem;
  }

  .roadmap-now {
    padding-left: 0;
    padding-top: 0;
  }

  .roadmap-now__dot {
    top: 0;
  }

  .roadmap-now__card {
    max-width: 40rem;
    margin: 0 auto;
    padding-top: 1.7rem;
    text-align: center;
  }

  .roadmap-figures {
    justify-content: center;
  }

  .roadmap-figure {
    align-items: center;
  }

  .roadmap-month__title {
    padding-left: 0;
    text-align: center;
  }

  /* The pill sits on the line itself, so no diamond. */
  .roadmap-month__title::before {
    content: none;
  }

  .roadmap-entry {
    width: 50%;
  }

  .roadmap-entry--left {
    margin-right: 50%;
    padding-left: 0;
    padding-right: var(--roadmap-gap);
  }

  /* The phone's padding is measured from the line at the left edge; here
     the line is the card's own left edge. */
  .roadmap-entry--right {
    margin-left: 50%;
    padding-left: var(--roadmap-gap);
  }

  /* Consecutive cards sit on opposite sides, so each can rise into the
     space beside the one before it. */
  .roadmap-entry + .roadmap-entry {
    margin-top: -3.2rem;
  }

  .roadmap-entry--left .roadmap-entry__dot {
    left: 100%;
  }

  .roadmap-entry--right .roadmap-entry__dot {
    left: 0;
  }

  .roadmap-entry--left::after {
    left: auto;
    right: 0;
    transform-origin: right center;
  }

  .roadmap-entry--right::after {
    left: 0;
  }

  /* The coloured edge faces the line on both sides. */
  .roadmap-entry--left .roadmap-entry__card {
    box-shadow: inset -3px 0 0 var(--roadmap-area);
  }

  .roadmap-entry--left .roadmap-entry__card:hover {
    box-shadow: inset -3px 0 0 var(--roadmap-area), var(--shadow-lift);
  }

  .roadmap-origin {
    margin-top: 1rem;
    padding-left: 0;
    text-align: center;
  }
}

/* --- Motion, only for those who have not asked for less --- */

@keyframes roadmap-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes roadmap-pulse {
  0% {
    opacity: 0.8;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(2.8);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .roadmap-now__dot::after {
    animation: roadmap-pulse 2.4s ease-out infinite;
  }

  .roadmap-next[open] .roadmap-step {
    animation: roadmap-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(var(--roadmap-index, 0) * 55ms + 80ms);
  }

  .roadmap-step:hover,
  .roadmap-entry__card:hover {
    transform: translateY(-3px);
  }

  .roadmap-now,
  .roadmap-month__pill,
  .roadmap-origin,
  .roadmap-entry__card {
    transition:
      opacity 0.6s ease,
      transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
      border-color 0.2s ease,
      box-shadow 0.2s ease;
  }

  .roadmap-entry__dot {
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.12s;
  }

  .roadmap-entry::after {
    transition: transform 0.4s ease 0.2s;
  }

  .roadmap.is-animated .roadmap-now:not(.is-visible),
  .roadmap.is-animated .roadmap-origin:not(.is-visible),
  .roadmap.is-animated .roadmap-month__title:not(.is-visible) .roadmap-month__pill {
    opacity: 0;
    transform: translateY(16px);
  }

  .roadmap.is-animated .roadmap-entry:not(.is-visible) .roadmap-entry__card {
    opacity: 0;
    transform: translateX(18px);
  }

  .roadmap.is-animated .roadmap-entry:not(.is-visible) .roadmap-entry__dot {
    transform: scale(0);
  }

  .roadmap.is-animated .roadmap-entry:not(.is-visible)::after {
    transform: scaleX(0);
  }

  /* A turning point rings twice as it comes in. */
  .roadmap.is-animated .roadmap-entry--major.is-visible .roadmap-entry__dot::after {
    animation: roadmap-pulse 1.3s ease-out 0.35s 2;
  }
}

@media (prefers-reduced-motion: no-preference) and (min-width: 52rem) {
  .roadmap.is-animated .roadmap-entry--left:not(.is-visible) .roadmap-entry__card {
    transform: translateX(-28px);
  }

  .roadmap.is-animated .roadmap-entry--right:not(.is-visible) .roadmap-entry__card {
    transform: translateX(28px);
  }
}
