:root {
  color-scheme: light;
  --paper: #fffaf4;
  --white: #fffdf9;
  --ink: #281a20;
  --muted: #67565d;
  --brand: #681329;
  --brand-dark: #490c1c;
  --rose: #96314c;
  --pale-rose: #f7eaec;
  --line: #e9ddd4;
  --sand: #f3e6d3;
  --gold: #c59342;
  --green: #22654d;
  --green-soft: #e6f3ec;
  --frame: 1160px;
  --radius: 24px;
  font-family: 'Avenir Next', Avenir, 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
body:has(dialog[open]) { overflow: hidden; }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
a { color: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:where(button, a):focus-visible { outline: 3px solid #9d6528; outline-offset: 5px; }
img { max-width: 100%; }
.frame { width: min(var(--frame), calc(100% - 88px)); margin-inline: auto; }
.screen-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; z-index: 5; top: 14px; left: 14px; padding: 10px 16px;
  background: var(--white); color: var(--brand); font-weight: 700;
}
.site-header { border-bottom: 1px solid #eadfd5; background: var(--paper); }
.header-inner { display: flex; justify-content: space-between; align-items: center; min-height: 76px; gap: 16px; }
.brand { line-height: 0; display: block; flex: 0 1 auto; }
.brand img { width: 177px; height: 56px; object-fit: contain; object-position: left center; }
.site-header nav { display: flex; gap: 8px; align-items: center; }
.site-header nav a {
  padding: 12px 17px; border-radius: 12px; min-height: 44px;
  display: inline-flex; align-items: center; text-decoration: none;
  white-space: nowrap; font-size: 14px; font-weight: 700;
}
.site-header nav a:hover { color: var(--brand); background: var(--pale-rose); }
.eyebrow {
  text-transform: uppercase; color: var(--brand); letter-spacing: .13em;
  font-weight: 700; font-size: .69rem; line-height: 1.5;
}
.button {
  min-height: 47px; border: 1px solid transparent; border-radius: 13px;
  padding: 10px 19px; font-size: .95rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
}
.button-primary { color: white; background: var(--brand); box-shadow: 0 4px 0 var(--brand-dark); }
.button-primary:hover:not(:disabled) { background: #801b35; }
.button:active:not(:disabled) { transform: translateY(2px); }
.button:disabled { color: #5f5157; background: #e9e0e2; box-shadow: none; }
.button-quiet { color: var(--brand); border-color: #dbc6cc; background: var(--white); }
.button-quiet:hover { background: var(--pale-rose); }
.dashboard {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(255px, 320px);
  gap: 32px; align-items: start; margin-top: 40px; margin-bottom: 64px;
}
#ruta, #aprender, #progreso { scroll-margin-top: 24px; }
.section-head { margin-bottom: 16px; }
.section-head h2 { margin-top: 3px; font-size: clamp(1.56rem, 2.8vw, 2.22rem); line-height: 1.16; font-weight: 700; letter-spacing: -.045em; }
.progress .section-head h2 { font-size: clamp(1.56rem, 2.6vw, 1.96rem); }
.levels {
  display: grid; width: fit-content; max-width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 3px;
  background: #f5ece4; margin-bottom: 16px;
}
.levels button {
  border: 1px solid transparent; border-radius: 10px; background: transparent; min-height: 43px;
  padding: 6px 14px; font-size: .88rem; font-weight: 700; color: var(--muted);
}
.levels button:hover { color: var(--brand); }
.levels button[aria-pressed="true"] { background: var(--white); border-color: #e4d5cb; color: var(--brand); box-shadow: 0 2px 2px #3b192009; }
.active-route { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.route-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px 22px; border-bottom: 1px solid #eddcda;
  border-radius: 23px 23px 0 0; background: #f8edef;
}
[data-current-level="media"] .route-summary { border-color: #eee1ca; background: #f8edda; }
.route-summary h3 { font-size: 1.125rem; color: var(--brand); font-weight: 700; }
.route-summary p { font-size: .85rem; line-height: 1.4; margin-top: 3px; color: var(--muted); }
.route-count {
  color: var(--brand); border: 1px solid #e7cdd3; background: #fffbf8;
  border-radius: 100px; font-size: .75rem; font-weight: 700; white-space: nowrap;
  padding: 6px 10px;
}
[data-current-level="media"] .route-count { border-color: #e9d7b8; }
.lesson-track { position: relative; list-style: none; margin: 0; padding: 15px 18px; }
.lesson-track::before {
  content: ''; position: absolute; top: 43px; bottom: 43px; left: 51px;
  width: 2px; background: #e5ccd2;
}
.lesson-track li { position: relative; }
.lesson-link {
  width: 100%; min-height: 87px; display: grid; align-items: center;
  grid-template-columns: 49px minmax(0,1fr) auto; gap: 14px;
  background: none; border: 1px solid transparent; border-radius: 16px; padding: 9px;
  text-align: left;
}
.lesson-link:hover { background: #fbf2ef; border-color: #f2e3df; }
.lesson-node {
  width: 47px; height: 45px; border-radius: 15px; display: grid; place-items: center;
  color: var(--brand); background: #f3dfe5; border: 1px solid #efd4dd;
  box-shadow: 0 3px 0 #e2bcc9; font-size: 1rem; font-weight: 700;
}
.lesson-node::before { content: ''; display: block; margin-left: 3px; width: 0; height: 0; border-block: 6px solid transparent; border-left: 9px solid currentColor; }
.lesson-link[data-next="true"] .lesson-node { background: var(--rose); color: white; border-color: #87243c; box-shadow: 0 3px 0 var(--brand); }
.lesson-link[data-done="true"] .lesson-node { background: #e8f2eb; color: var(--green); border-color: #d7e9db; box-shadow: 0 3px 0 #c5ddca; }
.lesson-link[data-done="true"] .lesson-node::before {
  border: solid currentColor; border-width: 0 0 2px 2px;
  width: 11px; height: 6px; transform: rotate(-45deg); margin: -3px 0 0;
}
.lesson-details { display: grid; gap: 2px; }
.lesson-topic { color: var(--brand); font-size: .67rem; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
.lesson-name { font-size: 1rem; line-height: 1.26; font-weight: 700; }
.lesson-duration { font-size: .77rem; line-height: 1.35; color: var(--muted); }
.lesson-action { font-weight: 700; font-size: .82rem; color: var(--brand); padding-right: 5px; }
.progress-panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 19px; background: var(--white); }
.progress-overview { display: flex; gap: 14px; align-items: center; margin: 1px 0 17px; }
.progress-overview div > strong { font-size: 1.13rem; }
.progress-overview p { color: var(--muted); font-size: .81rem; line-height: 1.32; }
.progress-ring {
  --completed: 0%; flex: 0 0 63px; height: 63px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--rose) var(--completed), #ecdde2 0);
}
.progress-ring span {
  width: 51px; height: 51px; background: var(--white); border-radius: 50%; display: grid;
  place-items: center; font-size: .81rem; color: var(--brand); font-weight: 700;
}
.progress-level { border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; font-size: .81rem; }
.progress-level strong { color: var(--brand); font-variant-numeric: tabular-nums; }
.progress-note { margin-top: 4px; color: var(--muted); font-size: .77rem; line-height: 1.4; }
.tip {
  border-left: 3px solid var(--gold); border-radius: 0 13px 13px 0; padding: 12px 14px;
  margin: 15px 0 0; background: #f8eddb; color: #5f4943; font-size: .83rem; line-height: 1.43;
}
.tip-title { font-weight: 700; color: var(--ink); margin-bottom: 3px; }

.lesson-dialog {
  padding: 0; inset: 0; border: 0; margin: auto; width: min(890px, calc(100vw - 40px));
  max-width: none; max-height: calc(100dvh - 44px); color: var(--ink); background: var(--white);
  border-radius: 26px; box-shadow: 0 30px 90px #2f16295c;
}
.lesson-dialog::backdrop { background: #2b182bbb; }
.exercise { display: flex; flex-direction: column; }
.exercise-header {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 16px; padding: 18px 26px; border-bottom: 1px solid var(--line);
  background: #fff8f1; position: sticky; top: 0; z-index: 2;
}
.close-button {
  width: 44px; min-height: 44px; padding: 0; background: var(--white);
  border-color: var(--line); color: var(--brand); font-size: 1.68rem; font-weight: 600;
}
.close-button:hover { background: var(--pale-rose); }
.exercise-indicator p { color: var(--brand); margin-bottom: 6px; font-size: .8rem; font-weight: 700; }
.exercise-indicator progress {
  appearance: none; display: block; width: 100%; height: 8px; border-radius: 20px;
  border: 0; overflow: hidden; background: #efdee4; color: var(--rose);
}
.exercise-indicator progress::-webkit-progress-bar { background: #efdee4; }
.exercise-indicator progress::-webkit-progress-value { background: var(--rose); }
.exercise-indicator progress::-moz-progress-bar { background: var(--rose); }
.question-count { color: var(--muted); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.exercise-stage { width: min(100%, 700px); margin: auto; padding: 26px 27px 18px; }
.exercise-intro { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; }
.exercise-intro img { width: 84px; height: 98px; object-fit: contain; }
.exercise-stage h2 {
  color: var(--brand); font-size: clamp(1.45rem, 3.2vw, 2.15rem);
  font-weight: 700; letter-spacing: -.038em; line-height: 1.14; margin-top: 5px;
}
.exercise-stage h2:focus { outline: 0; }
.exercise-goal { color: var(--muted); font-size: .94rem; line-height: 1.45; margin-top: 5px; }
.option-group { padding: 0; border: 0; margin: 16px 0 0; min-width: 0; }
.option-group legend {
  font-size: clamp(1rem, 2vw, 1.16rem); line-height: 1.37;
  font-weight: 700; margin: 0 0 11px; padding: 0;
}
.option {
  display: grid; grid-template-columns: 29px minmax(0,1fr); align-items: center; gap: 11px;
  width: 100%; position: relative; cursor: pointer; padding: 10px 12px; min-height: 49px;
  border-radius: 13px; border: 1px solid #e8d9d4; background: var(--white);
  font-size: .96rem; line-height: 1.33;
}
.option + .option { margin-top: 8px; }
.option:not(:has(input:disabled)):hover { background: #faf0ef; }
.option:has(input:focus-visible) { outline: 3px solid #9d6528; outline-offset: 3px; }
.option:has(input:checked) { background: var(--pale-rose); border-color: var(--rose); }
.option:has(input:disabled) { cursor: default; }
.option[data-correct] { background: var(--green-soft); border-color: #7eb69e; }
.option[data-mistake] { border-color: #b85a6b; }
.option input { position: absolute; margin: 0; inset-inline-start: 17px; width: 16px; height: 16px; opacity: 0; }
.option-marker {
  background: #f3e8e2; color: #655057; border-radius: 8px; display: grid;
  place-items: center; width: 26px; height: 26px; font-size: .76rem; font-weight: 700;
}
.option:has(input:checked) .option-marker { color: white; background: var(--rose); }
.option[data-correct] .option-marker { color: white; background: var(--green); }
.feedback {
  background: var(--green-soft); border-radius: 14px; color: #174633;
  margin-top: 13px; padding: 10px 13px; line-height: 1.38; font-size: .9rem;
}
.feedback[data-state="review"] { background: #f8edda; color: #664520; }
.feedback strong { display: block; margin-bottom: 2px; }
.exercise-footer {
  padding: 13px 26px 17px; background: var(--white); border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.exercise-footer .button-primary { min-width: 132px; }
.exercise-footer .footer-main { margin-left: auto; }
.outcome { text-align: center; display: grid; justify-items: center; padding-block: 4px 14px; }
.outcome img { width: 125px; height: 135px; object-fit: contain; }
.takeaway {
  margin-top: 17px; border-radius: 15px; background: #f8edda; border: 1px solid #eee0c3;
  padding: 15px 17px; width: min(100%, 475px); text-align: left;
}
.takeaway h3 { color: var(--brand); font-size: 1rem; margin-bottom: 5px; }
.takeaway p { color: #594948; line-height: 1.5; }

@media (max-width: 900px) {
  .frame { width: calc(100% - 56px); }
  .dashboard { gap: 22px; grid-template-columns: minmax(0, 1fr) minmax(225px, .56fr); }
}
@media (max-width: 740px) {
  .frame { width: calc(100% - 36px); }
  .header-inner { min-height: 66px; }
  .dashboard { grid-template-columns: 1fr; margin-top: 29px; gap: 31px; }
  .progress-panel { max-width: none; }
}
@media (max-width: 520px) {
  .frame { width: calc(100% - 28px); }
  .header-inner { gap: 5px; }
  .brand img { width: min(137px, 38vw); height: 44px; }
  .site-header nav { gap: 0; }
  .site-header nav a { font-size: .77rem; padding: 9px 9px; }
  .section-head { margin-bottom: 12px; }
  .levels { width: 100%; }
  .levels button { padding-inline: 5px; }
  .route-summary { padding: 14px 13px; }
  .route-summary p { font-size: .78rem; }
  .route-count { font-size: .68rem; padding: 4px 7px; }
  .lesson-track { padding: 9px 7px; }
  .lesson-track::before { left: 35px; }
  .lesson-link { padding: 7px; min-height: 81px; gap: 10px; grid-template-columns: 40px minmax(0,1fr) auto; }
  .lesson-node { width: 40px; height: 40px; border-radius: 12px; }
  .lesson-name { font-size: .91rem; }
  .lesson-topic { font-size: .6rem; }
  .lesson-action { font-size: .72rem; padding-right: 0; }
  .lesson-dialog { width: 100%; height: 100%; max-height: 100dvh; margin: 0; border-radius: 0; }
  .exercise { min-height: 100%; }
  .exercise-header { padding: 12px 14px; gap: 10px; }
  .exercise-stage { padding: 16px 15px; margin: 0 auto; flex: 1; }
  .exercise-intro { gap: 8px; }
  .exercise-intro img { width: 57px; height: 67px; }
  .exercise-footer { padding: 11px 14px max(14px, env(safe-area-inset-bottom)); }
  .exercise-footer .button { padding-inline: 11px; font-size: .84rem; }
  .exercise-footer .button-primary { min-width: 102px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .button:active:not(:disabled) { transform: none; }
}
