/* Entrada común: primero una decisión concreta, después el mapa completo. */
.ux-demand-start {
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 0;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid #d7e0e9;
  border-top: 3px solid #c04a50;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
  box-shadow: 0 16px 42px rgba(20, 34, 56, .08);
  color: #142238;
}

.ux-demand-start__top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

/* La portada sólo expone la pregunta y el índice elegido. */
body.portal-demand-first main > :not(.ux-demand-start):not(.ux-course-picker) {
  display: none;
}

.class-material {
  display: none !important;
}

.ux-demand-start__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #832e35;
  font: 800 10px/1.2 'Instrument Sans', system-ui, sans-serif;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.ux-demand-start__eyebrow::before {
  content: '';
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, #315f84 0 68%, transparent 68% 77%, #a65a5f 77%);
}

.ux-demand-start h2 {
  max-width: 720px;
  margin: 8px 0 5px;
  color: #142238;
  font: 600 clamp(30px, 4vw, 49px)/.98 'EB Garamond', Georgia, serif;
  letter-spacing: -.035em;
}

.ux-demand-start__summary {
  max-width: 680px;
  margin: 0;
  color: #44546a;
  font: 500 17px/1.5 'Newsreader', Georgia, serif;
}

.ux-course-picker {
  width: min(1180px, calc(100% - 32px));
  margin: 14px auto 48px;
  padding: clamp(22px, 3.2vw, 36px);
  border: 1px solid #d7e0e9;
  border-radius: 16px;
  background: #fff;
  color: #142238;
  box-shadow: 0 12px 34px rgba(20, 34, 56, .06);
}

.ux-course-picker header h2 {
  margin: 8px 0 5px;
  color: #142238;
  font: 600 clamp(28px, 3.6vw, 44px)/1 'EB Garamond', Georgia, serif;
  letter-spacing: -.03em;
}

.ux-course-picker header p {
  max-width: 720px;
  margin: 0;
  color: #44546a;
  font: 500 16px/1.5 'Newsreader', Georgia, serif;
}

.ux-course-picker__search {
  display: grid;
  gap: 7px;
  margin-top: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #d7e0e9;
}

.ux-course-picker__search label {
  color: #142238;
  font-size: 12px;
  font-weight: 800;
}

.ux-course-picker__search div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.ux-course-picker__search input,
.ux-course-picker__search button {
  min-height: 48px;
  border: 1px solid #bdcad7;
  border-radius: 9px;
  font: 700 14px/1.2 'Instrument Sans', system-ui, sans-serif;
}

.ux-course-picker__search input { padding: 10px 12px; color: #142238; }
.ux-course-picker__search button { padding: 10px 16px; background: #214e78; color: #fff; cursor: pointer; }

.ux-course-picker__filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.ux-course-picker__filters label {
  display: grid;
  gap: 6px;
  color: #142238;
  font: 800 12px/1.2 'Instrument Sans', system-ui, sans-serif;
}

.ux-course-picker__filters select {
  width: 100%;
  min-height: 48px;
  padding: 9px 38px 9px 11px;
  border: 1px solid #bdcad7;
  border-radius: 9px;
  background: #fff;
  color: #142238;
  font: 600 14px/1.3 'Instrument Sans', system-ui, sans-serif;
}

.ux-course-picker__filters select:focus-visible {
  outline: 3px solid rgba(47, 111, 166, .27);
  outline-offset: 2px;
}

.ux-course-picker__filters select:disabled {
  background: #edf3f8;
  color: #647084;
}

.ux-course-picker__status {
  margin: 16px 0 8px;
  color: #647084;
  font-size: 13px;
  font-weight: 700;
}

.ux-course-picker__index {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ux-course-picker__index a {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid #d7e0e9;
  border-radius: 9px;
  background: #fff;
  color: #214e78;
  text-decoration: none;
}

.ux-course-picker__index a:hover,
.ux-course-picker__index a:focus-visible {
  border-color: #2f6fa6;
  background: #edf3f8;
  outline: 0;
}

.ux-course-picker__index strong {
  font-size: 15px;
  line-height: 1.25;
}

.ux-course-picker__index span {
  color: #44546a;
  font-size: 12px;
  line-height: 1.4;
}

.ux-course-picker__noscript {
  margin-top: 16px;
  color: #44546a;
}

.ux-demand-start__hint {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid #bdcad7;
  border-radius: 999px;
  color: #214e78;
  font: 800 11px/1 'Instrument Sans', system-ui, sans-serif;
  letter-spacing: .04em;
  white-space: nowrap;
}

.ux-demand-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.ux-demand-subject-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ux-demand-subject {
  display: flex;
  min-height: 104px;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 15px;
  border: 1px solid #bdcad7;
  border-radius: 10px;
  background: #ffffff;
  color: #142238;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.ux-demand-subject:hover,
.ux-demand-subject:focus-visible {
  border-color: #2f6fa6;
  box-shadow: 0 9px 20px rgba(47, 111, 166, .14);
  outline: 0;
  transform: translateY(-2px);
}

.ux-demand-subject:focus-visible {
  outline: 3px solid rgba(47, 111, 166, .27);
  outline-offset: 3px;
}

.ux-demand-subject strong {
  color: #214e78;
  font: 600 23px/.98 'EB Garamond', Georgia, serif;
  letter-spacing: -.02em;
}

.ux-demand-subject span {
  color: #44546a;
  font-size: 12px;
  line-height: 1.35;
}

.ux-demand-followup {
  margin: 22px 0 9px;
  color: #44546a;
  font: 800 12px/1.3 'Instrument Sans', system-ui, sans-serif;
  letter-spacing: .04em;
}

.ux-demand-coverage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 14px 0 0;
  color: #44546a;
}

.ux-demand-coverage strong {
  margin-right: 2px;
  color: #214e78;
  font-size: 12px;
  font-weight: 800;
}

.ux-demand-coverage span {
  padding: 5px 8px;
  border: 1px solid #d7e0e9;
  border-radius: 999px;
  background: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.ux-demand-choice {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 112px;
  padding: 17px 16px 15px;
  border: 1px solid #bdcad7;
  border-radius: 11px;
  background: #fff;
  color: #214e78;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.ux-demand-choice:hover,
.ux-demand-choice:focus-visible {
  border-color: #2f6fa6;
  box-shadow: 0 9px 20px rgba(47, 111, 166, .14);
  outline: 0;
  transform: translateY(-2px);
}

.ux-demand-choice:focus-visible,
.ux-demand-question summary:focus-visible,
.ux-demand-more summary:focus-visible,
.ux-demand-link:focus-visible {
  outline: 3px solid rgba(47, 111, 166, .27);
  outline-offset: 3px;
}

.ux-demand-choice--primary {
  border-color: #214e78;
  background: #214e78;
  color: #fff;
}

.ux-demand-choice--primary:hover,
.ux-demand-choice--primary:focus-visible {
  border-color: #142238;
  background: #142238;
}

.ux-demand-choice strong {
  color: inherit;
  font: 800 16px/1.15 'Instrument Sans', system-ui, sans-serif;
}

.ux-demand-choice span {
  color: inherit;
  opacity: .86;
  font-size: 13px;
  line-height: 1.4;
}

.ux-demand-choice::after {
  content: '→';
  margin-top: auto;
  font-size: 18px;
  line-height: 1;
}

.ux-demand-questions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

.ux-demand-question,
.ux-demand-more {
  border-top: 1px solid #d7e0e9;
}

.ux-demand-question summary,
.ux-demand-more summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 2px;
  color: #142238;
  cursor: pointer;
  font: 800 13px/1.3 'Instrument Sans', system-ui, sans-serif;
  list-style: none;
}

.ux-demand-question summary::-webkit-details-marker,
.ux-demand-more summary::-webkit-details-marker {
  display: none;
}

.ux-demand-question summary::after,
.ux-demand-more summary::after {
  content: '+';
  flex: 0 0 auto;
  color: #c04a50;
  font-size: 20px;
  font-weight: 500;
}

.ux-demand-question[open] summary::after,
.ux-demand-more[open] summary::after {
  content: '−';
}

.ux-demand-question__body,
.ux-demand-more__body {
  display: grid;
  gap: 8px;
  padding: 0 0 14px;
}

.ux-demand-question__body p,
.ux-demand-more__body p {
  margin: 0;
  color: #44546a;
  font-size: 13px;
  line-height: 1.55;
}

.ux-demand-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.ux-demand-link {
  display: block;
  padding: 10px 11px;
  border: 1px solid #d7e0e9;
  border-radius: 8px;
  background: #fff;
  color: #214e78;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.ux-demand-link:hover {
  border-color: #2f6fa6;
  background: #edf3f8;
}

.ux-demand-more {
  margin-top: 17px;
}

.ux-demand-more summary {
  color: #44546a;
  font-size: 12px;
  font-weight: 700;
}

.ux-demand-more__body {
  padding-bottom: 0;
}

.ux-demand-more__body ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: #44546a;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 780px) {
  .ux-demand-start__top {
    display: block;
  }

  .ux-demand-start__hint {
    display: inline-block;
    margin-top: 13px;
  }

  .ux-demand-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ux-demand-subject-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ux-course-picker__filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .ux-demand-start {
    width: min(100% - 20px, 1180px);
    margin-top: 12px;
    padding: 22px 16px 18px;
    border-radius: 12px;
  }

  .ux-course-picker {
    width: min(100% - 20px, 1180px);
    margin-bottom: 28px;
    padding: 20px 16px;
    border-radius: 12px;
  }

  .ux-demand-actions,
  .ux-demand-subject-grid,
  .ux-demand-questions,
  .ux-demand-link-grid {
    grid-template-columns: 1fr;
  }

  .ux-demand-choice {
    min-height: 84px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ux-demand-choice {
    transition: none;
  }
}
