/* Student home, progress and exam configuration */
.app-shell .hero {
  max-width: 1200px;
  min-height: auto;
  align-items: center;
  gap: clamp(24px,4vw,56px);
}
.hero .eyebrow { display: inline-flex; align-items: center; color: #41615e; letter-spacing: .095em; }
.hero .eyebrow i { margin-right: 8px; background: #dfebe6; color: #245b50; }
.app-shell .hero h1 {
  font: 730 clamp(2.55rem,4.9vw,4.6rem)/1.02 var(--campus-sans);
  letter-spacing: -.062em;
  margin: 18px 0 22px;
  text-wrap: balance;
}
.app-shell .hero h1 em { font: italic 500 1.03em/1.07 var(--campus-serif); color: #235f53; letter-spacing: -.045em; }
.hero .hero-question-count {
  width: 100%; text-align: start; margin: 0 0 20px;
  border-inline-start: 3px solid #649083;
  padding: 4px 0 4px clamp(12px,2vw,20px);
}
.hero .hero-question-count > div { flex-flow: row wrap; align-items: baseline; justify-content: flex-start; gap: 2px 10px; color: #205e51; }
.hero .hero-question-count strong { font-size: clamp(2.1rem,4.2vw,3.4rem); line-height: 1.05; letter-spacing: -.055em; }
.hero .hero-question-count span { font-size: 1rem; }
.hero .hero-question-count p { margin: 7px 0 0; font: 520 .8rem/1.5 var(--campus-sans); color: #4d625e; }
.hero .hero-description { margin-bottom: 18px; }
.app-shell :is(.hero-buttons,.resume-strip,.practical-resume,.simulation-setup) .primary {
  color: #fff; background: linear-gradient(120deg,#234d60,#143548);
  border: 1px solid #234859; border-radius: 12px;
  box-shadow: inset 0 1px #ffffff26,0 4px 10px #183d461a;
}
.hero .hero-buttons .secondary { border-color: #9facac; border-radius: 12px; background: #fffefa; }
.app-shell .hero-panel {
  display: grid; gap: 16px;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  padding: clamp(18px,2.7vw,32px);
  width: 100%; max-width: none; min-width: 0; margin: 0;
  color: #fcfdf8; border: 1px solid #294e59; border-radius: 22px;
  background: radial-gradient(ellipse at 100% 0%,#244b50,transparent 64%),#112b3d;
  box-shadow: 0 15px 36px #1e37401c;
}
.hero-panel::before { display: none; }
.hero-panel .panel-header {
  grid-column: 1 / -1; gap: 12px; align-items: baseline; padding-bottom: 14px;
  border-bottom: 1px solid #ffffff33; color: #ecf3ee;
  font: 650 .8rem/1.45 var(--campus-sans); text-transform: none; letter-spacing: 0;
}
.hero-panel .panel-header b { color: #b1dacb; font-size: .72rem; }
.hero-panel .progress-ring {
  width: min(100%,155px); height: auto; aspect-ratio: 1; margin: 0; align-self: center; justify-self: center;
  background: conic-gradient(from -90deg,#a4ded0 0 var(--progress,0deg),#34505e var(--progress,0deg));
}
.hero-panel .progress-ring::after { width: 84%; height: 84%; background: #153141; }
.hero-panel .progress-ring strong { color: white; font: 680 clamp(1.55rem,3vw,2.65rem)/1 var(--campus-sans); font-variant-numeric: tabular-nums; letter-spacing: -.06em; }
.hero-panel .progress-ring span { color: #c1d5da; font-size: .76rem; }
.hero-panel .metric-grid { grid-template-columns: 1fr; gap: 7px; min-width: 0; }
.hero-panel .metric-grid article {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 7px; align-items: center;
  padding: 10px 12px; background: #ffffff08; border: 1px solid #ffffff29; border-radius: 10px;
}
.hero-panel .metric-grid strong { grid-column: 2; grid-row: 1 / 3; color: #fff; font-size: clamp(1.06rem,2vw,1.5rem); font-variant-numeric:tabular-nums; }
.hero-panel .metric-grid span { color: #edf5f4; font-size: .79rem; }
.hero-panel .metric-grid small { grid-column: 1; color: #bed2d7; font-size: .72rem; overflow-wrap: anywhere; }
.hero-panel .streak { grid-column: 1 / -1; margin: 0; padding: 12px; background: #102632; border: 1px solid #ffffff24; }
.hero-panel .streak > span { color: #e6c892; }
.hero-panel .streak strong { color: #f4f5ee; }
.hero-panel .streak small { color: #c5d4d6; }
.app-shell .resume-strip, .simulation-setup .practical-resume {
  background: #edf4f0; border: 1px solid #bfd1c7; border-inline-start: 4px solid #487c69; border-radius: 14px;
}
.app-shell .resume-strip p small, .simulation-setup .practical-resume strong { color: #326453; }
#test-builder .modality-tabs > [aria-selected="true"] {
  border-color: #f3d59e; box-shadow: inset 0 -3px #f3d59e,0 2px 6px #0003;
}
.app-shell .simulation-builder .section-heading { border-bottom: 0; padding-bottom: 0; margin-bottom: 16px; }
.simulation-builder .section-heading h2 { font: 720 clamp(1.85rem,3.4vw,2.9rem)/1.08 var(--campus-sans); letter-spacing: -.048em; }
.simulation-builder .simulation-setup {
  gap: clamp(15px,2.1vw,25px); padding: clamp(15px,2.5vw,30px);
  background: #fffefa; border: 1px solid #d3d9d6; border-radius: 20px; box-shadow: var(--campus-shadow);
}
.simulation-setup .simulation-intro h3 { font: 680 clamp(1.25rem,2.2vw,1.8rem)/1.18 var(--campus-sans); letter-spacing: -.035em; }
.simulation-setup .simulation-intro .step { color: #685261; }
.simulation-setup .simulation-third-picker { width: 100%; max-width: 40rem; min-width: 0; }
.simulation-setup .simulation-third-picker select { width: 100%; min-width: 0; min-height: 48px; border: 1px solid #9eaaa9; border-radius: 10px; color: #17394b; padding-inline: 12px 24px; }
.simulation-setup .simulation-body-cards {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,169px),1fr)); gap: 10px;
}
.simulation-setup .simulation-body-cards > button {
  display: flex; flex-direction: column; justify-content: flex-start;
  min-width: 0; padding: clamp(12px,1.8vw,20px);
  border: 1px solid #bfc9ca; border-radius: 14px; color: #163246; background: #fff;
  font-family: var(--campus-sans); cursor: pointer;
}
.simulation-setup .simulation-body-cards > button > strong {
  width: 100%; padding-bottom: 11px; margin: 0 0 11px;
  border-bottom: 1px solid #d8e1df; color: inherit;
  font-size: clamp(.97rem,1.5vw,1.16rem); letter-spacing: -.025em; line-height: 1.25;
}
.simulation-setup .simulation-body-cards > button > div { width: 100%; }
.simulation-setup .simulation-body-cards span { display: grid; grid-template-columns: 3.1rem 1fr; gap: 6px; color: #526674; font-size: .79rem; line-height: 1.4; }
.simulation-setup .simulation-body-cards span b { color: #275f53; font-variant-numeric:tabular-nums; white-space: nowrap; }
.simulation-setup .simulation-body-cards > .active { background: #183e43; color: #fff; border-color: #183e43; box-shadow: inset 0 3px #abc9ae; }
.simulation-setup .simulation-body-cards > .active > strong { border-color: #ffffff35; }
.simulation-setup .simulation-body-cards > .active span { color: #e2eeeb; }
.simulation-setup .simulation-body-cards > .active b { color: #b7e8ca; }
.simulation-setup .simulation-notes { font-size: .82rem; gap: 6px 16px; line-height: 1.5; }
.app-shell .builder:has(+ .features) { padding-bottom: clamp(24px,4vw,52px); }
.app-shell .features {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,210px),1fr));
  gap: 12px; margin-bottom: clamp(28px,4vw,55px);
}
.features article {
  --feature-edge: #427b6d;
  padding: 18px 20px 20px; border: 1px solid #d8ded9; border-top: 3px solid var(--feature-edge);
  border-radius: 5px 5px 15px 15px; background: #fffefa;
}
.features article:nth-child(2) { --feature-edge: #957448; }
.features article:nth-child(3) { --feature-edge: #79647d; }
.features article > span { display: none; }
.features article h3 { color: var(--campus-ink); margin: 0 0 7px; font: 675 1.12rem/1.22 var(--campus-sans); letter-spacing: -.03em; }
.features article p { font-size: .84rem; line-height: 1.5; }
.app-shell footer {
  background: linear-gradient(100deg,#102a3d,#1c3945); border-top: 2px solid #c2ab85;
  min-height: 92px; gap: 14px; padding-block: 18px;
}
.app-shell footer strong { font-size: .94rem; }
.app-shell footer :is(span,small) { color: #cbdbde; font-size: .76rem; }
@media (min-width: 860px) { .app-shell .hero { grid-template-columns: minmax(0,1.17fr) minmax(0,.83fr); } }
@media (max-width: 620px) {
  .app-shell .hero { gap: 20px; padding: 24px 16px; }
  .hero .hero-buttons { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,150px),1fr)); gap: 8px; }
  .hero .hero-buttons button { padding-inline: 10px; }
  .app-shell .resume-strip > div:last-child { display: flex; flex-wrap: wrap; }
  .app-shell .resume-strip .primary { flex: 1; }
  .app-shell .features { padding-inline: 16px; gap: 8px; }
}
@media (max-width: 410px) {
  .hero-panel .metric-grid article { grid-template-columns: 1fr; padding: 8px; }
  .hero-panel .metric-grid strong { grid-column: 1; grid-row: 2; }
  .hero-panel .metric-grid small { grid-row: 3; }
}
@media (forced-colors: active) {
  .simulation-setup .simulation-body-cards > .active { border: 3px double Highlight; }
}

.hero .hero-copy {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(18px,3vw,36px);
  border: 1px solid #c9d6d4; border-radius: 22px;
  background: linear-gradient(155deg,#eef4ef,#fffefa 60%);
}
.hero .hero-copy::before {
  content: ""; position: absolute; z-index: -1; inset: 0 0 auto auto;
  width: 60%; height: clamp(120px,16vw,190px);
  background: var(--campus-portico) right 22% / cover;
  filter: grayscale(1); opacity: .21; pointer-events: none;
  mask-image: linear-gradient(90deg,transparent,#000 90%),linear-gradient(180deg,#000 15%,transparent);
  mask-composite: intersect;
}
@media (max-width: 620px) {
  .topbar:has(.nav-actions[aria-label="Cuenta de alumno"]) { flex-wrap: wrap; gap: 5px 12px; }
  .topbar .nav-actions[aria-label="Cuenta de alumno"] { flex-wrap: wrap; gap: 4px; }
  .topbar .nav-actions[aria-label="Cuenta de alumno"] .text-button {
    display: inline-flex; align-items: center; min-height: 44px; padding: 6px 10px;
    color: #264b55; overflow-wrap: anywhere;
  }
  .hero .hero-copy { padding: 16px; }
  .app-shell .hero h1 { font-size: clamp(2.05rem,8.8vw,2.8rem); text-wrap: initial; }
}

/* Reading room: the timer and controls frame the question; answers stay on a quiet surface. */
.test-layout .test-main { min-width: 0; }
.test-main .test-topline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px;
  padding: clamp(16px,2.4vw,26px); border-radius: 18px 18px 0 0;
  background: linear-gradient(105deg,#102a3ce8,#153e45ed),var(--campus-portico) right 40% / cover;
  color: #fffefa;
}
.test-main .test-topline > div:first-child { min-width: 0; flex: 1 1 13rem; }
.test-main .test-topline > div:first-child > span { color: #c2dfdc; letter-spacing: .055em; font-size: .78rem; overflow-wrap: anywhere; }
.test-main .test-topline strong { font: 650 clamp(1.25rem,2.5vw,1.8rem)/1.14 var(--campus-sans); letter-spacing: -.035em; }
.test-main .test-topline > div:first-child small { color: #eedbb6; margin-top: 2px; font-size: .76rem; }
.test-main .test-top-actions { align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.test-topline .timer { display: grid; grid-template-columns: auto auto; gap: 1px 6px; align-items: center; }
.test-topline .timer b { color: #fff; font: 660 1.17rem/1.25 var(--campus-sans); font-variant-numeric: tabular-nums; }
.test-topline .timer span, .test-topline .timer small { color: #cee4df; }
.test-topline .timer small { grid-column: 1/-1; font-size: .72rem; }
.test-topline .finish-now-button { min-height: 44px; border-color: #769795; background: #173645; color: #f7fcf8; white-space: normal; }
.test-main .linear-progress { height: 5px; margin: 0 0 16px; background: #d6dfd8; border-radius: 0 0 8px 8px; }
.test-main .linear-progress i { background: linear-gradient(90deg,#427c6e,#89bda8); }
.test-main .question-card { padding: clamp(17px,3.2vw,38px); background: #fffefa; }
.question-card .question-meta { flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.question-card .question-meta > span { font: 750 .75rem/1.5 var(--campus-sans); color: #435b68; letter-spacing: .06em; }
.question-card .question-meta b { color: #35685c; }
.test-main .question-card h2 { margin: .75em 0 1.05em; max-width: 57ch; font: 500 clamp(1.3rem,2.4vw,1.85rem)/1.35 var(--campus-serif); letter-spacing: -.023em; overflow-wrap: anywhere; }
.question-card .options { gap: 9px; }
.test-main .option {
  --answer-edge: #ced8d5; --answer-wash: #fff; --answer-chip: #eef2ef; --answer-letter: #314e53;
  background: var(--answer-wash); border: 1px solid var(--answer-edge); border-radius: 12px;
  align-items: baseline; gap: 12px; padding: 12px 15px; min-height: 52px;
}
.test-main .option p { margin: 0; min-width: 0; color: #1e3444; font: 475 clamp(.96rem,1.15vw,1.05rem)/1.55 var(--campus-sans); overflow-wrap: anywhere; }
.test-main .option > span {
  background: var(--answer-chip); color: var(--answer-letter); border: 1px solid var(--answer-edge);
  align-self: flex-start; border-radius: 8px; width: 30px; height: 30px; font: 720 .8rem/1 var(--campus-sans);
}
.test-main .option.chosen { --answer-edge: #44718b; --answer-wash: #edf4f9; --answer-chip: #315b73; --answer-letter: white; }
.test-main .option.correct { --answer-edge: #4a826e; --answer-wash: #edf6ef; --answer-chip: #30644f; --answer-letter: white; }
.test-main .option.wrong { --answer-edge: #b17077; --answer-wash: #fcf0ef; --answer-chip: #8d4151; --answer-letter: white; }
.test-main .option[aria-pressed=true] { box-shadow: inset 3px 0 var(--answer-edge); }
.test-main .option.correct > b { color: #30644f; }
.test-main .option.wrong::after { content: "×"; align-self: center; color: #893e4c; font: bold 1.3rem/1 var(--campus-sans); }
.test-main .blank-answer { min-height: 42px; padding-inline: 14px; color: #485b67; }
.test-main .blank-answer.selected { color: #654f19; }
.question-card .feedback {
  padding: 16px 18px; border: 1px solid #becfc2; border-inline-start: 4px solid #47785e;
  border-radius: 12px; background: #f1f6ef;
}
.question-card .feedback.error { border-color: #dcc7c5; border-inline-start-color: #965764; background: #faf3f1; }
.question-card .feedback > div { flex-wrap: wrap; align-items: baseline; }
.question-card .feedback b { width: auto; max-width: 100%; color: #334f61; font-size: .84rem; overflow-wrap: anywhere; }
.question-card .feedback :is(p,small,a) { margin-inline-start: 0; }
.question-card .feedback p { color: #334854; line-height: 1.6; }
.test-controls :is(.flag-button,.incident-button,.primary,.secondary) { min-height: 44px; border-radius: 10px; }
.test-controls .primary, .results-actions .primary { background: #173e4a; border-color: #173e4a; }
.test-layout .question-map { padding: clamp(14px,2vw,22px); border-top: 3px solid #477a70; background: #fcfdf9; }
.question-map .summary-label { color: #355e58; }
.question-map .map-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,36px),1fr)); gap: 5px; }
.question-map .map-grid button { min-height: 40px; aspect-ratio: auto; border-radius: 8px; font: 650 .84rem/1 var(--campus-sans); font-variant-numeric: tabular-nums; }
.question-map .map-grid button.current { outline: 2px solid #29495b; outline-offset: 1px; background: #173e4a; color: white; border-color: white; }
.question-map .map-grid button.flagged::after { width: 7px; height: 7px; background: #eabd56; box-shadow: 0 0 0 1px #593e15; }
.test-layout .map-grid button:focus-visible { outline: 3px dashed #145e95; outline-offset: 2px; }
.test-layout .question-map .map-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.test-layout .map-legend span { font-size: .73rem; color: #455969; }
.app-shell .results-hero { text-align: start; border: 0; padding: 8px 0 0; }
.results-layout .results-hero h1 { color: #162f40; font: 720 clamp(2rem,4.3vw,3.45rem)/1.05 var(--campus-sans); letter-spacing: -.052em; margin: 12px 0; }
.results-layout .results-hero p { color: #465a69; font-size: .9rem; }
.app-shell .results-layout .score-card {
  max-width: none; margin: 20px 0 28px; padding: clamp(18px,3vw,32px);
  grid-template-columns: minmax(110px,.65fr) minmax(0,1.35fr); gap: clamp(14px,4vw,42px);
  background: linear-gradient(120deg,#112d40,#214846); border: 1px solid #234453; color: #fff;
}
.score-card .score-circle {
  width: min(100%,150px); height: auto; aspect-ratio: 1; justify-self: center;
  background: conic-gradient(from -90deg,#b4dec6 0 var(--score),#3a5864 var(--score));
}
.score-card .score-circle::after { width: 85%; height: 85%; background: #193746; }
.score-card .score-circle span, .score-card .score-circle strong small { color: #d5e7dd; }
.score-card .score-details { width: 100%; min-width: 0; gap: 12px 16px; }
.score-card .score-details div { padding-block: 5px; border-bottom: 1px solid #ffffff38; }
.score-card .score-details span { color: #daebe6; font-size: .78rem; }
.score-card .score-details strong { color: #fff; font-size: clamp(1.1rem,2.65vw,1.85rem); font-variant-numeric:tabular-nums; }
.score-card .score-details .green { color: #b0e5c0; }
.score-card .score-details .red { color: #ffbdba; }
.results-layout .result-filters button { border-radius: 11px; }
.results-layout .result-filters button.active { color: white; background: #193f47; border-color: #193f47; box-shadow: inset 0 -3px #a0c4af; }
.results-layout .result-filters button.active b { background: #d4e7dc; color: #1c4240; }
.review-list details[open] { border-color: #a7beb6; }
.review-list details[open] summary { background: #f0f5f0; }
.review-list summary strong { color: #203b49; font-size: .98rem; line-height: 1.4; overflow-wrap: anywhere; }
.review-list summary::after { content: ""; flex: none; width: 7px; height: 7px; border: solid #46605f; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.review-list details[open] summary::after { transform: rotate(225deg); }
.results-layout .review-body { padding: 12px clamp(14px,2vw,24px) 20px; }
@media (max-width: 620px) {
  .test-main .test-topline { flex-direction: column; align-items: stretch; gap: 12px; }
  .test-main .test-topline > div:first-child { flex: auto; }
  .test-main .test-top-actions { justify-content: space-between; }
  .test-controls .question-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .question-card .feedback b { flex-basis: 100%; margin: 0; }
  .app-shell .results-layout .score-card { grid-template-columns: 1fr; }
  .score-card .score-circle { width: 118px; }
  .results-layout .result-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (forced-colors: active) {
  .test-main .option[aria-pressed=true], .question-map .map-grid button.current, .results-layout .result-filters button.active { border: 3px double Highlight; }
}
@media (prefers-reduced-motion: reduce) { .test-main .linear-progress i { transition: none; } }

/* The case catalogue pairs a compact selector with an editorial case sheet. */
.practical-library .practical-featured > article {
  border: 1px solid #284f4c;
  border-radius: 20px;
  background: linear-gradient(118deg, #123e3c, #12313c 82%);
  color: #fff;
  padding: clamp(20px, 4vw, 40px);
  box-shadow: 0 12px 30px #0c303018;
}
.practical-featured > article h3 {
  color: #fff;
  font: 500 clamp(1.45rem, 3vw, 2.15rem)/1.16 Georgia, serif;
  margin: .65em 0 .35em;
  overflow-wrap: anywhere;
}
.practical-featured > article > p { color: #d6e7e4; line-height: 1.65; }
.practical-featured > article .practical-card-tags :is(span,b) {
  background: #234e4e;
  border: 1px solid #648882;
  color: #edf7f3;
}
.practical-featured > article dl {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  padding-block: .85rem;
  border-block: 1px solid #51736e;
  margin-block: 1.1rem;
}
.practical-featured > article dl div { background: transparent; padding: 0; }
.practical-featured > article dt { color: #cbdfdb; font-size: .75rem; }
.practical-featured > article dd { color: #fff; font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.practical-featured > article .primary:enabled { background: #e1f3e6; color: #123d32; border-color: #e1f3e6; }
.practical-library :is(.practical-featured,.practical-filters) > label { min-width: 0; }
.practical-library select { min-width: 0; max-width: 100%; min-height: 44px; text-overflow: ellipsis; }
:is(.practical-library,.practical-question-card) :is(button,select):focus-visible {
  outline: 3px solid #c38b37;
  outline-offset: 3px;
}
/* Legal facts and correction remain readable alongside the existing question controls. */
:is(.simulation-runner,.practical-results) > .practical-statement {
  border: 1px solid #dcd6c5;
  border-inline-start: 4px solid #927546;
  background: #fbf9f2;
  padding: clamp(16px, 3vw, 28px);
  max-height: min(48vh, 30rem);
}
.practical-statement > strong { color: #695027; font-size: .72rem; }
.practical-statement > p { color: #293d43; font: 400 1.04rem/1.7 Georgia, serif; max-width: 78ch; overflow-wrap: anywhere; }
.practical-question-card .practical-options button { min-height: 46px; align-items: center; }
.practical-question-card .practical-options button span { font-size: .96rem; line-height: 1.5; padding-top: 0; overflow-wrap: anywhere; }
.practical-question-card .practical-options button.selected { box-shadow: inset 3px 0 #1b6259; }
.practical-question-card .practical-options button.selected b { background: #1b6259; color: white; }
.practical-question-card .practical-feedback { border-inline-start-width: 4px; }
.practical-feedback.ok > strong { color: #125540; }
.practical-feedback.fail > strong { color: #842f28; }
.practical-question-card .practical-feedback :is(p,blockquote) { font-size: .96rem; line-height: 1.65; overflow-wrap: anywhere; }
.practical-feedback blockquote { margin-inline: 0; padding-inline-start: 1em; border-inline-start: 2px solid currentColor; }
@media (max-width: 44rem) {
  .practical-library .practical-featured { grid-template-columns: minmax(0,1fr); }
  .practical-question-card .practical-question-head { flex-wrap: wrap; gap: 8px; }
  .practical-question-card .practical-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .practical-question-card .practical-controls button { min-height: 44px; }
  .practical-question-card .practical-controls .primary { grid-column: 1 / -1; }
}
