:root {
  color-scheme: light;
  --canvas: #f3f6fa;
  --paper: #fff;
  --ink: #142238;
  --subtle: #506078;
  --faint: #5b6d85;
  --line: #dce4ee;
  --dark: #111d30;
  --dark-soft: #1b2a42;
  --blue: #2359ac;
  --blue-pale: #e9f1fe;
  --gold: #ffd78b;
  --r: 14px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid #648ff0; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
svg.icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 5; background: white; padding: 9px 12px; border-radius: 6px; transform: translateY(-150%); }
.skip:focus { transform: none; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.side { background: var(--dark); color: white; min-width: 0; }
.side-inner { position: sticky; top: 0; min-height: 100dvh; display: flex; flex-direction: column; padding: 25px 17px 18px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 2px; text-decoration: none; width: fit-content; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--gold); display: grid; place-items: center; color: #16243a; }
.brand-mark .icon { width: 23px; height: 23px; }
.brand-title { font-size: 13px; font-weight: 760; display: block; white-space: nowrap; }
.brand-region { font-size: 12px; color: #a9bbd2; display: block; margin-top: 3px; }
.side-title { padding: 0 11px; margin: 39px 0 10px; color: #a9bbd2; font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .15em; }
.side-choices { display: grid; gap: 5px; }
.side-choice { border: 1px solid transparent; background: transparent; border-radius: 8px; min-height: 43px; padding: 9px 9px 9px 10px; color: #c3d1e3; width: 100%; display: flex; gap: 9px; align-items: center; text-align: left; white-space: nowrap; font-size: 12.5px; font-weight: 550; }
.side-choice .icon { width: 17px; height: 17px; }
.side-choice .nav-count { color: #a9bbd2; margin-left: auto; font-size: 11px; }
.side-choice:hover { background: #23334c; color: #fff; }
.side-choice[aria-pressed="true"] { background: #263956; color: #fff; border-color: #3b4e6b; }
.side-choice[aria-pressed="true"] .icon { color: var(--gold); }
.side-note { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid #2f3e54; color: #a9bbd2; font-size: 11px; line-height: 1.5; display: flex; gap: 8px; align-items: center; }
.side-note .icon { width: 15px; height: 15px; }
.workspace { min-width: 0; }
.top { background: #fff; border-bottom: 1px solid var(--line); padding: 0 32px; }
.top-inner { margin: 0 auto; max-width: 1360px; min-height: 61px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.top-title { font-size: 13px; color: #324760; font-weight: 660; display: flex; align-items: center; gap: 8px; }
.top-title .icon { width: 16px; }
main { max-width: 1424px; padding: 26px 32px 32px; margin: 0 auto; }
.hero { position: relative; isolation: isolate; min-height: 274px; overflow: hidden; background: #12213a; color: white; border-radius: 17px; display: flex; align-items: center; border: 1px solid #253e5c; }
.hero::before { content: ""; position: absolute; z-index: -2; inset: 0 0 0 17%; background: url("./salamanca.webp") center 53% / cover no-repeat; }
.hero::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg,#12213a 1%,#12213a 24%,rgba(18,33,58,.86) 42%,rgba(18,33,58,.21) 79%,rgba(18,33,58,.07)), linear-gradient(0deg,rgba(14,26,46,.36),transparent 63%); }
.hero-body { padding: 30px 36px; width: 100%; }
.hero-region { display: inline-flex; align-items: center; gap: 7px; color: var(--gold); font-size: 10px; font-weight: 780; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 11px; }
.hero-region .icon { width: 14px; height: 14px; }
.hero h1 { font-size: clamp(35px, 4.4vw, 62px); letter-spacing: -.055em; line-height: .99; font-weight: 790; max-width: 600px; }
.hero p { margin-top: 13px; max-width: 430px; color: #e0e9f5; font-size: 14px; line-height: 1.48; }
.catalogue { margin-top: 31px; }
.catalogue-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.catalogue h2 { font-size: clamp(23px, 2.5vw, 31px); font-weight: 780; letter-spacing: -.04em; }
.tally { margin-top: 4px; color: var(--subtle); font-size: 13px; line-height: 1.4; }
.filter { background: #e8edf5; border: 1px solid #dfe7f0; border-radius: 9px; padding: 3px; display: inline-flex; gap: 1px; }
.filter button { border: 1px solid transparent; background: transparent; padding: 6px 10px; font-size: 12px; font-weight: 660; color: #42546d; min-height: 33px; border-radius: 6px; white-space: nowrap; }
.filter button:hover { color: var(--blue); }
.filter [aria-pressed="true"] { background: white; color: #164d9b; border-color: #dce5f0; box-shadow: 0 1px 2px #192e4a12; }
.card-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.card { display: flex; flex-direction: column; text-decoration: none; gap: 9px; min-width: 0; min-height: 168px; border: 1px solid var(--line); background: white; padding: 15px; border-radius: var(--r); transition: border-color .18s, box-shadow .18s, transform .18s; }
.card:hover { border-color: #8eafd9; box-shadow: 0 6px 20px #18365e13; transform: translateY(-2px); }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.subject { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: 11px; font-weight: 750; color: #284364; }
.subject-icon { display: grid; place-items: center; width: 31px; height: 31px; background: var(--icon-bg, #e9f1fe); color: var(--icon-fg, #2455a0); border-radius: 8px; flex: 0 0 auto; }
.subject-icon .icon { width: 17px; height: 17px; }
[data-topic="seguridad"] { --icon-bg:#e9eefc; --icon-fg:#4154a2; }
[data-topic="espectaculos"] { --icon-bg:#fbefd9; --icon-fg:#8a5a1c; }
[data-topic="administrativa"] { --icon-bg:#e2f2f1; --icon-fg:#18665e; }
[data-topic="animales"] { --icon-bg:#eaf2e3; --icon-fg:#476631; }
.level { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; padding: 4px 7px; border-radius: 5px; font-weight: 760; line-height: 1.2; white-space: nowrap; color:#245a46; background:#e7f5ed; }
.level::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.level[data-level="medio"] { color:#795014; background:#fcf0d6; }
.level[data-level="avanzado"] { color:#8b3e55; background:#fbeaf0; }
.card h3 { font-size: 16px; font-weight: 770; letter-spacing: -.022em; line-height: 1.2; }
.card p { color: var(--subtle); font-size: 12px; line-height: 1.36; flex: 1; }
.card-footer { border-top: 1px solid #edf0f4; padding-top: 9px; display: flex; justify-content: space-between; align-items: center; gap: 5px; color: var(--faint); font-size: 11px; }
.card-footer > span { display: inline-flex; align-items: center; gap: 5px; }
.card-footer .icon { width: 13px; height: 13px; }
.card-link { color: #2156a5; font-weight: 750; }
.page-foot { margin-top: 23px; color: var(--subtle); font-size: 12px; line-height: 1.45; }
.backrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 17px; }
.backlink, .quiet { display: inline-flex; gap: 7px; align-items: center; color: #254c82; font-size: 13px; font-weight: 700; text-decoration: none; }
.backlink:hover, .quiet:hover { text-decoration: underline; }
.backlink .icon, .quiet .icon { width: 16px; height: 16px; }
.quiet { border: 0; background: transparent; padding: 6px 3px; }
.case-head { background: var(--dark); border-radius: 14px; color: white; padding: 22px 27px; border: 1px solid #2d4260; }
.case-head .subject { color: #dce9fb; }
.case-head .tagline { display: flex; align-items: center; gap: 12px; }
.case-head h1 { margin: 10px 0 0; font-size: clamp(24px, 4vw, 42px); line-height: 1.04; letter-spacing: -.045em; }
.case-head p { margin-top: 9px; max-width: 65ch; color: #c5d5eb; font-size: 13px; line-height: 1.45; }
.case-layout { display: grid; grid-template-columns: minmax(222px, .65fr) minmax(0, 1.65fr); gap: 15px; margin-top: 15px; align-items: start; }
.panel { background: white; border: 1px solid var(--line); border-radius: var(--r); padding: 23px; }
.panel h2 { font-weight: 770; letter-spacing: -.025em; font-size: 20px; line-height: 1.18; }
.context { padding: 18px; }
.context h2 { font-size: 16px; display: flex; gap: 8px; align-items: center; }
.context h2 .icon { width: 17px; height: 17px; color: var(--blue); }
.context p, .update { color: #40536a; font-size: 14px; line-height: 1.57; margin-top: 10px; }
.step-list { padding: 0; margin: 17px 0 0; list-style: none; display: grid; gap: 6px; }
.step-list li { padding: 7px; border-radius: 6px; display:flex; gap:7px; align-items:center; font-size: 12px; color: var(--subtle); }
.step-list li[aria-current="step"] { background: var(--blue-pale); color: #174887; font-weight: 720; }
.step-list .icon { width: 14px; height: 14px; }
.step-n { display:inline-grid; place-items:center; width:19px; height:19px; flex:0 0 auto; border:1px solid #c9d7e8; border-radius:50%; }
.progress { margin: 9px 0 17px; }
.step-label { color: #255a9c; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.update { margin-bottom: 17px; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.answers { display: grid; gap: 8px; }
.answer { position: relative; min-width: 0; display: flex; align-items: center; gap: 11px; padding: 11px; color: #283b55; border: 1px solid #d7e2ef; border-radius: 8px; font-size: 14px; line-height: 1.37; cursor: pointer; }
.answer:hover { background: #f5f8fd; }
.answer:has(input:focus-visible) { outline: 3px solid #648ff0; outline-offset: 2px; }
.answer:has(input:checked) { background: #edf4ff; border-color: #4d79bd; color: #143a70; }
.answer input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.answer-letter { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; background: #eef3fa; color: #365275; border: 1px solid #dce6f3; border-radius: 6px; font-weight: 750; font-size: 12px; }
.answer:has(input:checked) .answer-letter { background: #2459a7; color: white; border-color: #2459a7; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.actions.end { justify-content: flex-end; }
.primary, .secondary { display:inline-flex; align-items:center; justify-content:center; gap: 7px; min-height: 42px; padding: 10px 14px; border: 1px solid #2156a5; border-radius: 8px; background: #2156a5; color: white; text-decoration: none; font-size: 13px; font-weight: 725; }
.primary:hover:not(:disabled) { background: #184680; }
.primary:disabled { background: #dce6f4; border-color: #dce6f4; color: #4d6281; }
.secondary { background: white; color: #234b82; border-color: #c9d8ea; }
.secondary:hover { background: #f0f5fd; }
.primary .icon, .secondary .icon { width: 15px; height: 15px; }
.score { text-align: center; }
.score h2 { font-size: 16px; }
.score .points { display: block; margin-top: 8px; font-size: clamp(37px, 5vw, 57px); font-weight: 800; letter-spacing: -.065em; color: #204f93; }
.score .points small { color: var(--subtle); font-size: 17px; letter-spacing: 0; font-weight: 600; }
.score p { margin-top: 4px; color: var(--subtle); font-size: 13px; }
.review { display: grid; gap: 11px; }
.solution { color: #334b66; line-height: 1.54; font-size: 14px; margin-top: 8px; }
.review-item { margin: 0; padding: 15px 16px; }
.review-item h3 { font-size: 15px; margin: 8px 0 5px; }
.review-item p { color: #40536a; font-size: 13px; line-height: 1.47; margin: 5px 0 0; }
.verdict { display: inline-flex; gap: 5px; align-items: center; color: #245a46; background: #e7f5ed; padding: 4px 7px; border-radius: 5px; font-size: 11px; font-weight: 760; }
.verdict.missed { color: #893c52; background: #fbeaf0; }
.verdict .icon { width: 12px; height: 12px; }
.refs { list-style: none; padding: 0; margin: 9px 0 0; display: grid; gap: 7px; }
.refs a { color: #2156a5; font-size: 13px; text-decoration-thickness: 1px; text-underline-offset: 3px; font-weight: 650; }
.refs .icon { width: 13px; height: 13px; margin-left: 4px; }
.refs a:hover { color: #163965; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
dialog { max-width: min(430px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 13px; padding: 22px; color: var(--ink); box-shadow: 0 18px 80px #0b17334d; }
dialog::backdrop { background: #101d36a0; }
dialog h2 { font-size: 20px; }
dialog p { font-size: 14px; color: var(--subtle); margin-top: 8px; line-height: 1.45; }
@media (min-width: 1500px) {
  .shell { grid-template-columns: 249px minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  .shell { grid-template-columns: 197px minmax(0, 1fr); }
  .side-inner { padding-inline: 13px; }
  main, .top { padding-inline: 21px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .shell { display: block; }
  .side-inner { min-height: 0; position: static; padding: 13px 15px 9px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-mark .icon { width: 19px; height: 19px; }
  .brand-title { font-size: 12px; }
  .brand-region { font-size: 11px; }
  .side-title, .side-note, .nav-count { display: none; }
  .side-choices { display: flex; overflow-x: auto; padding: 9px 0 4px 4px; margin-inline: -4px; scrollbar-width: thin; scrollbar-color: #657994 transparent; gap: 4px; }
  .side-choice { width: auto; flex: 0 0 auto; min-height: 35px; padding: 5px 8px; font-size: 12px; }
  .side-choice .icon { width: 14px; height: 14px; }
  .top-inner { min-height: 42px; }
  main { padding-top: 17px; }
  .hero { min-height: 223px; }
  .hero-body { padding: 25px; }
  .hero::after { background: linear-gradient(90deg,#12213a 4%,rgba(18,33,58,.84) 45%,rgba(18,33,58,.24)); }
}
@media (max-width: 540px) {
  main, .top { padding-inline: 13px; }
  .catalogue { margin-top: 22px; }
  .catalogue-head { align-items: flex-start; flex-direction: column; gap: 10px; margin-bottom: 11px; }
  .filter { max-width: 100%; }
  .filter button { flex: 1; padding-inline: 8px; }
  .card-grid, .case-layout { grid-template-columns: 1fr; }
  .card-grid { gap: 8px; }
  .card { min-height: 145px; padding: 13px; }
  .hero-body { padding: 21px; }
  .hero h1 { font-size: clamp(29px, 8.6vw, 46px); }
  .hero p { max-width: 275px; }
  .hero::after { background: linear-gradient(90deg,#12213a 0%,rgba(18,33,58,.87) 45%,rgba(18,33,58,.43)); }
  .case-head { padding: 17px; }
  .panel { padding: 15px; }
  .step-list { display: none; }
  .backrow { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

progress.progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 6px;
  border: 0;
  background: #e5ebf3;
  color: #2f66ba;
  border-radius: 6px;
  overflow: hidden;
}
.progress::-webkit-progress-bar { background: #e5ebf3; }
.progress::-webkit-progress-value { background: #2f66ba; }
.progress::-moz-progress-bar { background: #2f66ba; }
.update, .answer span:last-child, .statement { white-space: pre-line; }
.score .step-list { text-align: left; }
.score .step-list li { padding: 0; }
.step-list button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  text-align: left;
  color: var(--subtle);
  background: #f5f8fc;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px;
  font-size: 12px;
}
.step-list button:hover, .step-list button[aria-pressed="true"] {
  color: #174887;
  background: var(--blue-pale);
  border-color: #c8d8ee;
}
.review-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.review-toolbar p { color: var(--subtle); font-size: 13px; margin-top: 5px; }
.review-toolbar label { display: flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--subtle); font-size: 13px; cursor: pointer; }
.review-toolbar input { accent-color: #2156a5; }
@media (max-width: 540px) {
  .score .step-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
