:root {
  --ink: #183536;
  --muted: #55706e;
  --cream: #f7f3e9;
  --paper: #fffdf8;
  --coral: #ef765e;
  --coral-dark: #c94f43;
  --mint: #b8d7c6;
  --yellow: #f7cf70;
  --teal: #285d5c;
  --line: #d8e0d8;
  --shadow: 0 18px 50px rgba(24, 53, 54, .12);
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background: var(--cream);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background-color: var(--cream); background-image: radial-gradient(rgba(24, 53, 54, .065) .7px, transparent .7px); background-size: 7px 7px; font-size: 20px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.section-shell { width: min(1160px, calc(100% - 48px)); margin: 0 auto; }
#inicio { scroll-margin-top: 96px; }
.site-header { align-items: center; backdrop-filter: blur(12px); background: rgba(247, 243, 233, .93); border-bottom: 1px solid rgba(24, 53, 54, .12); display: flex; gap: 28px; justify-content: space-between; margin: 0 auto; max-width: 1280px; padding: 10px 40px; position: sticky; top: 0; z-index: 10; }
.brand { align-items: center; color: var(--ink); display: inline-flex; gap: 10px; white-space: nowrap; }
.brand strong { font-weight: 700; }
.brand-logo { display: block; height: 62px; object-fit: contain; width: 82px; }
.brand-name { font: 700 1.15rem/1.1 Georgia, serif; letter-spacing: -.02em; }
.brand-name span { color: #E8872D; }
.brand-name strong { color: #D89020; font-weight: 700; }
.main-nav { align-items: center; background: rgba(255, 253, 248, .72); border: 1px solid rgba(24, 53, 54, .14); border-radius: 999px; display: flex; gap: 3px; margin-left: auto; padding: 3px; }
.main-nav a, .footer-links a { color: var(--muted); font: 700 .95rem/1.3 Arial, sans-serif; }
.main-nav a { border: 1px solid transparent; border-radius: 999px; padding: 8px 14px; position: relative; }
.main-nav a:hover, .main-nav a:focus-visible, .footer-links a:hover, .text-link:hover { color: var(--coral-dark); }
.main-nav a:hover, .main-nav a:focus-visible, .main-nav a.is-active { background: var(--yellow); border-color: rgba(24, 53, 54, .12); color: var(--coral-dark); }
.main-nav a:focus-visible, .button:focus-visible, .text-link:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
.hero { align-items: center; display: grid; gap: 70px; grid-template-columns: 1fr 1fr; min-height: 0; padding: 58px 0 66px; position: relative; }
.hero::before { border-left: 1px solid rgba(24, 53, 54, .16); border-top: 1px solid rgba(24, 53, 54, .16); content: ''; height: 120px; left: -28px; position: absolute; top: 44px; width: 120px; }
.hero-copy { max-width: 560px; }
.hero-visual { align-items: center; display: flex; flex-direction: column; gap: 24px; }
.eyebrow, .card-kicker, .panel-topline, .about-label { color: var(--coral-dark); font: 700 14px/1.3 Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow { margin: 0 0 18px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(3rem, 6vw, 5.4rem); letter-spacing: -.055em; line-height: .96; margin-bottom: 28px; max-width: 670px; }
h2 { font-size: clamp(2.2rem, 4vw, 3.5rem); letter-spacing: -.04em; line-height: 1.02; margin-bottom: 20px; }
h3 { font-size: 1.7rem; letter-spacing: -.025em; line-height: 1.06; margin-bottom: 12px; }
.hero-lead { color: var(--muted); font-size: 1.22rem; max-width: 520px; }
.hero-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 24px; margin: 34px 0 24px; }
.button { border: 0; border-radius: 3px; cursor: pointer; display: inline-flex; font: 700 .98rem/1.2 Arial, sans-serif; gap: 16px; justify-content: center; letter-spacing: .02em; padding: 18px 22px; transition: background .2s, transform .2s; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--coral); color: var(--paper); }
.button-primary:hover { background: var(--coral-dark); }
.button-dark { background: var(--ink); color: var(--paper); width: 100%; }
.button-dark:hover { background: var(--teal); }
.text-link { border-bottom: 1px solid var(--coral); color: var(--ink); font: 700 .98rem/1.4 Arial, sans-serif; padding-bottom: 3px; }
.hero-note { color: var(--muted); font: .9rem Arial, sans-serif; }
.status-dot { background: var(--teal); border-radius: 50%; display: inline-block; height: 8px; margin-right: 8px; width: 8px; }
.activity-teaser { background: var(--paper); border-left: 5px solid var(--coral); box-shadow: 8px 8px 0 rgba(24, 53, 54, .1); max-width: 500px; padding: 18px 20px 14px; width: 100%; }
.teaser-topline, .teaser-controls { align-items: center; display: flex; justify-content: space-between; }
.teaser-topline { color: var(--coral-dark); font: 700 13px/1.2 Arial, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.teaser-body { align-items: end; display: flex; gap: 20px; justify-content: space-between; padding: 15px 0 17px; }
.teaser-category { color: var(--muted); font: 700 14px/1.2 Arial, sans-serif; letter-spacing: .08em; margin: 0 0 6px; text-transform: uppercase; }
.teaser-body h2 { font-size: 1.65rem; margin-bottom: 6px; }
.teaser-body p:last-child { color: var(--muted); font-size: 17px; line-height: 1.35; margin: 0; }
.teaser-start { background: transparent; border: 0; border-bottom: 2px solid var(--coral); color: var(--ink); cursor: pointer; flex: 0 0 auto; font: 700 15px/1.2 Arial, sans-serif; padding: 7px 0; }
.teaser-start:hover { color: var(--coral-dark); }
.teaser-controls { border-top: 1px solid var(--line); padding-top: 11px; }
.teaser-controls > button { background: transparent; border: 1px solid var(--ink); border-radius: 50%; color: var(--ink); cursor: pointer; font-size: 1.1rem; height: 34px; width: 34px; }
.teaser-controls > button:hover, .teaser-controls > button:focus-visible { background: var(--yellow); }
.teaser-dots { display: flex; gap: 8px; }
.teaser-dots button { background: var(--line); border: 0; border-radius: 50%; cursor: pointer; height: 10px; padding: 0; width: 10px; }
.teaser-dots button.is-active { background: var(--coral); transform: scale(1.25); }
.hero-art { background-color: var(--teal);  background-position: center; background-size: cover; border: 12px solid var(--paper); box-shadow: 18px 18px 0 var(--yellow), 0 24px 55px rgba(24, 53, 54, .22); height: 360px; max-width: 500px; overflow: hidden; position: relative; transform: rotate(3deg); width: 100%; }
.hero-art::before { background: rgba(24, 53, 54, .18); content: ''; inset: 0; position: absolute; }
.art-sun { background: var(--yellow); border-radius: 50%; height: 190px; position: absolute; right: -22px; top: -22px; width: 190px; }
.art-ring { border: 1px solid rgba(24, 53, 54, .28); border-radius: 50%; height: 340px; left: -70px; position: absolute; top: 20px; width: 340px; }
.art-ring-two { height: 220px; left: auto; right: 40px; top: 200px; width: 220px; }
.art-card { background: var(--paper); box-shadow: var(--shadow); position: absolute; transform: rotate(-7deg); z-index: 1; }
.art-card-main { left: 14%; padding: 27px 28px 22px; top: 24%; width: 230px; }
.art-card-label { color: var(--coral-dark); display: block; font: 700 .7rem Arial, sans-serif; letter-spacing: .13em; margin-bottom: 21px; text-transform: uppercase; }
.art-card-main strong { font-size: 1.8rem; line-height: 1.05; }
.art-line { background: var(--mint); display: block; height: 9px; margin-top: 25px; width: 100%; }
.art-line.short { margin-top: 9px; width: 62%; }
.art-card-small { bottom: 10%; padding: 18px 22px; right: 7%; transform: rotate(8deg); width: 155px; }
.art-card-small strong { font-size: 1.05rem; line-height: 1.1; }
.art-star { color: var(--coral); float: right; font: 2rem Arial, sans-serif; }
.art-caption { bottom: 12%; color: var(--teal); font: italic 1.2rem Georgia, serif; left: 12%; position: absolute; transform: rotate(-7deg); }
.activity-section { border-top: 1px solid rgba(24, 53, 54, .14); padding: 72px 0 105px; position: relative; scroll-margin-top: 96px; }
.activity-section::before { background: var(--coral); content: ''; height: 5px; left: 0; position: absolute; top: -3px; width: 82px; }
.section-heading { align-items: flex-start; display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }
.section-heading h2 { margin-bottom: 0; }
.section-intro { color: var(--muted); margin-bottom: 0; max-width: 650px; }
.activity-grid { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
.activity-card { border: 1px solid rgba(24, 53, 54, .14); box-shadow: 0 14px 0 rgba(24, 53, 54, .09); display: flex; flex-direction: column; min-height: 390px; padding: 28px; position: relative; transition: box-shadow .2s, transform .2s; }
.activity-card::after { border: 1px solid rgba(24, 53, 54, .2); content: ''; height: 16px; position: absolute; right: 18px; top: 18px; transform: rotate(45deg); width: 16px; }
.activity-card:hover { box-shadow: 0 20px 0 rgba(24, 53, 54, .11); transform: translateY(-5px); }
.activity-memory { background: var(--yellow); }
.activity-attention { background: var(--coral); }
.activity-language { background: var(--mint); }
.activity-icon { align-items: center; border: 1px solid currentColor; border-radius: 50%; display: flex; font: 700 .72rem Arial, sans-serif; height: 42px; justify-content: center; margin-bottom: 30px; width: 42px; }
.card-kicker { color: inherit; margin-bottom: 14px; }
.activity-card h3 { max-width: 230px; }
.activity-card p:not(.card-kicker) { color: rgba(24, 53, 54, .77); font-size: 20px; line-height: 1.5; max-width: 275px; }
.activity-meta { border-top: 1px solid rgba(24, 53, 54, .28); display: flex; flex-direction: column; gap: 7px; margin: 18px 0 22px; padding-top: 12px; }
.activity-meta span { color: rgba(24, 53, 54, .72); font: 700 14px/1.35 Arial, sans-serif; }
.activity-meta span:first-child { color: var(--ink); text-transform: uppercase; }
.activity-card .button { margin-top: auto; }
.activity-panel { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); margin-top: 28px; padding: 30px; }
.panel-topline { align-items: center; display: flex; justify-content: space-between; }
.close-panel { background: transparent; border: 0; color: var(--muted); cursor: pointer; font: 700 .78rem Arial, sans-serif; }
.close-panel span { color: var(--ink); font-size: 1.4rem; margin-left: 8px; vertical-align: middle; }
.exercise { margin: 30px auto 4px; max-width: 650px; text-align: center; }
.exercise h3 { font-size: 2.2rem; }
.exercise-instruction { color: var(--muted); }
.exercise-feedback { color: var(--teal); font-weight: 700; min-height: 30px; }
.sequence { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 25px 0; }
.sequence span { background: var(--mint); border-radius: 2px; font-size: 1.15rem; padding: 12px 17px; }

.exercise-controls { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.exercise input { border: 1px solid var(--line); font: 1rem Arial, sans-serif; max-width: 100%; padding: 13px; text-align: center; width: 320px; }
.symbol-grid { display: grid; gap: 8px; grid-template-columns: repeat(4, minmax(44px, 56px)); justify-content: center; margin: 25px auto; }
.symbol-grid button { background: var(--mint); border: 2px solid transparent; cursor: pointer; font-size: 1.4rem; height: 48px; }
.symbol-grid button:hover, .symbol-grid button:focus { border-color: var(--coral-dark); }
.word-options { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 24px 0; }
.word-options button { background: var(--yellow); border: 0; cursor: pointer; padding: 13px 18px; }
.cognition-section { background-color: var(--teal);  background-position: center; background-size: cover; color: var(--paper); padding: 32px 0; }
.cognition-layout { display: grid; gap: 80px; grid-template-columns: 1fr 1fr; }
.cognition-visual { height: 245px; margin-top: 42px; max-width: 470px; position: relative; }
.cognition-orbit { border: 1px solid rgba(255, 253, 248, .28); border-radius: 50%; left: 50%; position: absolute; top: 50%; transform: translate(-50%, -50%); }
.orbit-one { height: 185px; width: 185px; }
.orbit-two { border-color: rgba(247, 207, 112, .58); height: 118px; width: 330px; }
.cognition-center { align-items: center; background: var(--yellow); border-radius: 50%; color: var(--ink); display: flex; flex-direction: column; height: 108px; justify-content: center; left: 50%; position: absolute; top: 50%; transform: translate(-50%, -50%); width: 108px; }
.cognition-center strong { font: 700 16px/1.1 Arial, sans-serif; }
.cognition-center span { font: 14px/1.3 Georgia, serif; margin-top: 5px; }
.cognition-skill { background: rgba(255, 253, 248, .12); border: 1px solid rgba(255, 253, 248, .42); border-radius: 30px; color: var(--paper); font: 700 14px/1 Arial, sans-serif; letter-spacing: .04em; padding: 11px 15px; position: absolute; }
.skill-memory { left: 0; top: 17px; }
.skill-attention { right: 0; top: 47px; }
.skill-language { bottom: 14px; left: 42px; }
.skill-planning { bottom: 0; right: 26px; }
.cognition-visual::after { animation: cognition-pulse 4s ease-in-out infinite; border: 1px solid var(--yellow); border-radius: 50%; content: ''; height: 13px; left: 50%; opacity: .7; position: absolute; top: 50%; transform: translate(-50%, -50%); width: 13px; }
@keyframes cognition-pulse { 0%, 100% { opacity: .35; transform: translate(-50%, -50%) scale(1); } 50% { opacity: .9; transform: translate(-50%, -50%) scale(1.7); } }
.eyebrow-light { color: var(--yellow); }
.cognition-copy { color: rgba(255, 253, 248, .95); max-width: 500px; text-shadow: 0 2px 14px rgba(24, 53, 54, .48); }
.medical-note { background: rgba(24, 53, 54, .34); border-left: 3px solid var(--yellow); color: var(--paper); font-size: 1rem; margin-top: 32px; padding: 10px 14px 10px 18px; text-shadow: none; }
.about-section { align-items: center; display: grid; gap: 64px; grid-template-columns: .7fr 1.3fr; padding: 58px 0; scroll-margin-top: 96px; }
.about-visual {  background-position: center; background-size: cover; border: 0; border-radius: 8px; box-shadow: 12px 12px 0 var(--yellow), 0 18px 35px rgba(24, 53, 54, .12); min-height: 0; overflow: hidden; padding: 20px 22px; }
.about-label { border-top: 2px solid var(--coral); color: var(--coral-dark); display: block; font: 700 14px/1.3 Arial, sans-serif; letter-spacing: .14em; padding-top: 13px; text-transform: uppercase; }
.about-steps { margin-top: 18px; max-width: 410px; }
.about-steps div { align-items: center; background: rgba(255, 253, 248, .78); border-radius: 5px; box-shadow: 0 5px 0 rgba(24, 53, 54, .08); display: flex; gap: 18px; margin-bottom: 8px; padding: 9px 14px; }
.about-steps div:last-child { margin-bottom: 0; }
.about-steps strong { align-items: center; background: var(--coral); border-radius: 50%; color: var(--paper); display: inline-flex; flex: 0 0 34px; font: 700 13px/1 Arial, sans-serif; height: 34px; justify-content: center; }
.about-steps span { color: var(--ink); font-size: 1.08rem; }
.about-section p { color: var(--muted); max-width: 560px; }
.site-footer { background: var(--ink); color: var(--paper); padding: 36px 0 18px; }
.footer-main { display: grid; gap: 32px; grid-template-columns: 1.4fr .8fr .9fr; padding-bottom: 25px; }
.footer-brand { color: var(--paper); }
.footer-brand .brand-logo { height: 78px; width: 104px; }
.footer-brand .brand-name { font-size: 1.3rem; }
.footer-brand .brand-name span { color: #F6A15C; }
.footer-brand .brand-name strong { color: #F6C453; }
.footer-brand-block p, .footer-contact span:last-child { color: rgba(255, 253, 248, .68); font: 16px/1.45 Arial, sans-serif; margin: 10px 0 0; max-width: 300px; }
.footer-column { display: flex; flex-direction: column; gap: 15px; }
.footer-heading { color: var(--yellow); font: 700 13px/1.2 Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-links a, .footer-contact a { color: var(--paper); font: 700 16px/1.35 Arial, sans-serif; }
.footer-links a:hover, .footer-contact a:hover { color: var(--yellow); }
.footer-bottom { align-items: center; border-top: 1px solid rgba(255, 253, 248, .2); color: rgba(255, 253, 248, .58); display: flex; font: 14px/1.4 Arial, sans-serif; justify-content: space-between; padding-top: 12px; }
.footer-bottom a { color: rgba(255, 253, 248, .72); }
@media (min-width: 821px) {
  .site-header { padding-bottom: 12px; padding-top: 12px; }
  .hero { gap: 48px; padding-bottom: 38px; padding-top: 4px; }
  h1 { font-size: clamp(3rem, 5vw, 4.6rem); max-width: 620px; }
  .hero-lead { font-size: 1.08rem; }
  .hero-actions { margin-bottom: 16px; margin-top: 24px; }
  .hero-art { height: 300px; }
  .hero-visual { gap: 16px; }
  .activity-teaser { padding-bottom: 11px; padding-top: 14px; }
  .teaser-body { padding-bottom: 11px; padding-top: 11px; }
  .teaser-body h2 { font-size: 1.45rem; }
  .teaser-body p:last-child { font-size: 18px; }
  .activity-section { padding-bottom: 55px; padding-top: 4px; }
  .activity-section .section-heading { margin-bottom: 16px; }
  .activity-card { min-height: 300px; padding: 14px 16px; }
  .activity-card h3 { font-size: 1.5rem; margin-bottom: 8px; }
  .activity-card p:not(.card-kicker) { font-size: 19px; line-height: 1.5; }
  .activity-icon { margin-bottom: 14px; }
  .activity-meta { margin-bottom: 10px; margin-top: 8px; padding-top: 9px; }
  .activity-card .button { padding-bottom: 14px; padding-top: 14px; }
}
@media (max-width: 820px) {
  .site-header { gap: 18px; padding: 14px 24px; }
  .main-nav { gap: 14px; }
  .main-nav a { font-size: .86rem; padding: 9px 2px 7px; }
  .section-shell { width: min(100% - 36px, 600px); }
  .hero { gap: 36px; grid-template-columns: 1fr; padding: 46px 0 58px; }
  .hero-art { height: 390px; justify-self: center; max-width: 520px; }
  .activity-teaser { max-width: none; }
  .activity-grid, .cognition-layout, .about-section { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; gap: 10px; }
  .activity-card { min-height: 340px; }
  .cognition-layout { gap: 25px; }
  .about-section { gap: 25px; }
  .footer-main { gap: 34px; grid-template-columns: 1fr; }
  .footer-bottom { align-items: flex-start; flex-direction: column; gap: 10px; }
}
@media (max-width: 520px) {
  body { font-size: 19px; }
  .site-header { flex-wrap: wrap; }
  .main-nav { order: 3; overflow-x: auto; padding-bottom: 3px; width: 100%; }
  .main-nav a { white-space: nowrap; }
  h1 { font-size: 3.2rem; }
  .hero-art { height: 350px; }
  .teaser-body { align-items: start; flex-direction: column; gap: 12px; }
  .teaser-start { align-self: flex-start; }
  .art-card-main { left: 8%; top: 20%; }
  .art-caption { display: none; }
  .activity-section, .about-section { padding: 70px 0; }
}

/* Legibilidad, controles y navegación accesible. */
[hidden] { display: none !important; }
:root { --header-offset: 110px; }
section[id], .activity-panel, #contenido { scroll-margin-top: var(--header-offset); }
:where(a, button, input, [tabindex]):focus-visible { outline: 3px solid #183536; outline-offset: 4px; }
.site-footer a:focus-visible { outline-color: var(--yellow); }
.skip-link { background: var(--ink); color: var(--paper); left: 16px; padding: 12px 18px; position: fixed; top: 8px; transform: translateY(-150%); z-index: 100; }
.skip-link:focus { transform: none; }
.button-primary { background: #a63d31; color: var(--paper); }
.button-primary:hover { background: #873026; }
.button-secondary { background: var(--paper); border: 2px solid var(--ink); color: var(--ink); }
.button, .teaser-start, .close-panel, .word-options button, .main-nav a { min-height: 48px; font-size: 18px; }
.main-nav a { align-items: center; display: flex; }
.main-nav a:hover, .main-nav a:focus-visible, .main-nav a.is-active { color: var(--ink); }
.teaser-controls > button { height: 48px; width: 48px; }
.teaser-dots { gap: 4px; }
.teaser-dots button { background: transparent; display: grid; height: 44px; place-items: center; width: 44px; }
.teaser-dots button::before { background: var(--muted); border-radius: 50%; content: ''; height: 12px; width: 12px; }
.teaser-dots button.is-active { background: transparent; transform: none; }
.teaser-dots button.is-active::before { background: var(--ink); box-shadow: 0 0 0 3px var(--yellow); }
.hero::before, .art-ring, .cognition-visual::after { display: none; }
.hero-art { background: var(--mint); transform: none; box-shadow: 10px 10px 0 var(--yellow); }
.hero-art::before { display: none; }
.art-caption { color: var(--ink); }
.about-visual { background: var(--mint); }
.eyebrow, .card-kicker, .teaser-topline, .teaser-category, .activity-meta span, .about-label { font-size: 16px; letter-spacing: .05em; }
.hero-lead { font-size: 20px; }
.hero-note, .medical-note { font-size: 18px; }
.activity-card { padding: 24px; }
@media (min-width: 821px) {
  .activity-card { padding-top: 16px; padding-bottom: 16px; }
}
.activity-card p:not(.card-kicker), .activity-meta span { color: var(--ink); }
.activity-card:hover { transform: none; }
.activity-panel { padding: 28px; }
.exercise input { font-size: 20px; min-height: 48px; }
#memory-answer-area label { display: block; font-weight: bold; }
#memory-help { font-size: 18px; }
.review-words { background: transparent; border: 0; cursor: pointer; margin-top: 18px; min-height: 48px; text-decoration: underline; }
.exercise-actions { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 24px; }
.exercise-actions .button { width: auto; }
.symbol-grid { width: 100%; }
.symbol-grid button { font-family: Arial, sans-serif; height: 56px; }
.is-correct { outline: 3px solid var(--teal); outline-offset: 2px; }
@media (max-width: 1050px) {
  .site-header { flex-wrap: wrap; gap: 10px; padding: 12px 18px; }
  .main-nav { border-radius: 12px; flex-wrap: wrap; gap: 4px; justify-content: center; margin: 0; width: 100%; }
  .main-nav a { padding: 8px 10px; }
}
@media (max-width: 520px) {
  h1 { font-size: clamp(2.4rem, 10vw, 3.2rem); line-height: 1.08; }
  .main-nav { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .main-nav a { justify-content: center; white-space: normal; }
  .activity-panel { padding: 16px; }
  .exercise-actions .button { width: 100%; }
  .hero-art { height: 320px; }
  .art-card-main { width: 200px; }
  .orbit-two { max-width: 100%; }
  .footer-contact a { overflow-wrap: anywhere; }
}
/* Keep activity actions in view while the exercise can scroll on short screens. */
.activity-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100dvh - var(--header-offset) - 16px);
  padding: 12px 16px;
}
#activity-content {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}
.exercise {
  margin: 0 auto;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px;
  width: 100%;
}
.exercise h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 10px; }
.exercise-instruction { line-height: 1.4; margin-bottom: 12px; }
.exercise-feedback { line-height: 1.4; margin: 10px 0 0; min-height: 0; }
.exercise-feedback:empty { margin: 0; }
.symbol-grid { gap: 6px; grid-template-columns: repeat(5, minmax(44px, 56px)); margin: 12px auto; }
.symbol-grid button { height: 48px; }
.exercise-actions { background: var(--paper); gap: 8px; margin-top: 8px; padding-top: 10px; }
.exercise-actions .button { padding: 12px 16px; }
@media (min-width: 700px) {
  .exercise-attention { align-content: center; align-items: center; column-gap: 24px; display: grid; grid-template-columns: 1fr 1fr; max-width: 900px; text-align: left; }
  .exercise-attention h3, .exercise-attention .exercise-instruction, .exercise-attention .exercise-feedback { grid-column: 1; }
  .exercise-attention .symbol-grid { grid-column: 2; grid-row: 1 / 4; }
}
.menu-toggle { display: none; }
.activity-page { padding-top: 16px; padding-bottom: 36px; }
.activity-page > .section-heading h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.1; max-width: none; }
.activity-page > .section-heading { gap: 8px; margin-bottom: 20px; }
.activity-page > .section-heading h1 { margin-bottom: 8px; }
.activity-page .activity-card { min-height: 0; }
.activity-page .activity-icon { margin-bottom: 12px; }
.activity-page .activity-card .activity-launch { margin: 4px 0 16px; }
.activity-page .activity-card h3 { max-width: none; }
.activity-page .activity-meta { margin-bottom: 0; }
.activity-breadcrumb { color: var(--muted); font: 18px/1.4 Arial, sans-serif; margin-bottom: 8px; }
.activity-breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; }
.activity-page .activity-panel { margin-top: 0; max-height: calc(100dvh - var(--header-offset) - 84px); }
/* Give each exercise the remaining viewport; the footer follows below it. */
body[data-activity] .activity-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100dvh - var(--header-offset) + 16px);
  padding-top: 16px;
  padding-bottom: 16px;
}
body[data-activity] .activity-page .activity-panel {
  height: 100%;
  max-height: none;
  min-height: 0;
}
body[data-activity] .exercise { min-height: 0; }
.exercise h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.025em; line-height: 1.06; margin-bottom: 10px; max-width: none; }
.exercise-attention h1 { grid-column: 1; }
.panel-topline a.close-panel { align-items: center; display: inline-flex; letter-spacing: normal; text-transform: none; }
@media (max-width: 820px) {
  .site-header { gap: 8px; padding: 8px 12px; }
  .site-header .brand { gap: 6px; }
  .site-header .brand-logo { height: 44px; width: 54px; }
  .site-header .brand-name { font-size: 1rem; }
  .has-menu-toggle .menu-toggle { align-items: center; background: var(--paper); border: 1px solid var(--ink); border-radius: 6px; color: var(--ink); cursor: pointer; display: inline-flex; flex-shrink: 0; font: 700 18px/1.2 Arial, sans-serif; gap: 8px; justify-content: center; margin-left: auto; min-height: 48px; padding: 8px 12px; }
  .menu-toggle[aria-expanded="true"] { background: var(--yellow); }
  .has-menu-toggle .main-nav { background: var(--paper); border: 1px solid var(--line); border-radius: 0 0 12px 12px; box-shadow: var(--shadow); display: none; grid-template-columns: 1fr; left: 0; margin: 0; max-height: calc(100dvh - var(--header-offset)); overflow-y: auto; padding: 8px 12px; position: absolute; right: 0; top: 100%; width: 100%; }
  .menu-toggle[aria-expanded="true"] + .main-nav { display: grid; }
  .has-menu-toggle .main-nav a { justify-content: flex-start; padding: 12px 16px; }
  .activity-section { padding-top: 28px; padding-bottom: 36px; }
  .activity-panel { padding: 8px; }
  .exercise { padding: 6px; }
  .exercise-actions .button { flex: 1 1 0; min-width: 0; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  /* Mantener el comportamiento de movimiento reducido. */
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* Memoria: contenido completo sin una segunda barra de desplazamiento. */
body[data-activity="memory"] .activity-page {
  height: auto;
  grid-template-rows: auto auto;
  padding-top: 8px;
  padding-bottom: 16px;
}
body[data-activity="memory"] .activity-page .activity-panel {
  height: auto;
  max-height: none;
}
body[data-activity="memory"] #activity-content { grid-template-rows: auto auto; }
body[data-activity="memory"] .exercise { overflow: visible; padding: 4px 8px; }
body[data-activity="memory"] .panel-topline { margin-bottom: 8px; }
body[data-activity="memory"] .exercise h1 { margin-bottom: 8px; }
body[data-activity="memory"] .exercise-instruction { margin-bottom: 10px; }
body[data-activity="memory"] #memory-help { margin-bottom: 10px; }
body[data-activity="memory"] .review-words { margin-top: 8px; }
body[data-activity="memory"] .exercise-feedback { margin-top: 8px; padding: 8px 12px; font-size: 20px; scroll-margin-block: 120px 24px; }
body[data-activity="memory"] .exercise-feedback:empty { padding: 0; margin: 0; }
body[data-activity="memory"] .exercise-actions { margin-top: 8px; padding-top: 10px; }
