:root {
  --bg: #050a12;
  --bg-2: #071525;
  --panel: rgba(12, 27, 46, .78);
  --panel-solid: #0c1b2e;
  --panel-2: rgba(20, 42, 67, .74);
  --line: rgba(167, 211, 255, .16);
  --line-strong: rgba(167, 211, 255, .31);
  --text: #f5f8ff;
  --muted: #aebcd0;
  --cyan: #45e6ff;
  --cyan-2: #007c9e;
  --gold: #ffcf5a;
  --gold-2: #a46500;
  --magenta: #ff5ae5;
  --green: #5bf5ab;
  --red: #ff6f7d;
  --shadow: 0 24px 80px rgba(0,0,0,.38);
  --radius: 24px;
  --font-scale: 1;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: calc(16px * var(--font-scale)); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% -5%, rgba(69,230,255,.14), transparent 30%),
    radial-gradient(circle at 87% 15%, rgba(255,90,229,.11), transparent 28%),
    linear-gradient(160deg, var(--bg), #06101c 48%, #081422);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
body.text-large { --font-scale: 1.12; }
body.text-xlarge { --font-scale: 1.24; }
body.no-motion *, body.no-motion *::before, body.no-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
body.focus-mode .topbar, body.focus-mode .mobile-nav, body.focus-mode .ambient { opacity: .18; }
body.focus-mode .topbar:hover, body.focus-mode .mobile-nav:hover, body.focus-mode .topbar:focus-within, body.focus-mode .mobile-nav:focus-within { opacity: 1; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
a { color: var(--cyan); }
img { max-width: 100%; display: block; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 500; transform: translateY(-160%); padding: 12px 18px; border-radius: 12px; background: #fff; color: #000; font-weight: 800; }
.skip-link:focus { transform: translateY(0); }
.ambient { position: fixed; z-index: -1; border-radius: 50%; filter: blur(90px); opacity: .35; pointer-events: none; }
.ambient-a { width: 420px; height: 420px; background: #00688c; top: 12%; left: -250px; }
.ambient-b { width: 500px; height: 500px; background: #6f145f; right: -320px; bottom: 5%; }

.topbar {
  position: sticky; top: 0; z-index: 100;
  min-height: 76px; padding: 10px clamp(14px,3vw,42px);
  display: grid; grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr); align-items: center; gap: 20px;
  background: rgba(5,10,18,.79); backdrop-filter: blur(22px) saturate(150%);
  border-bottom: 1px solid var(--line);
  transition: opacity .25s ease;
}
.brand { appearance: none; border: 0; background: none; padding: 0; display: inline-flex; align-items: center; gap: 13px; cursor: pointer; justify-self: start; min-height: 52px; text-align: left; }
.brand-mark { width: 43px; height: 43px; display: grid; grid-template-columns: repeat(3,1fr); gap: 3px; padding: 7px; border: 1px solid rgba(255,255,255,.24); border-radius: 14px; background: linear-gradient(145deg, rgba(255,255,255,.2), rgba(255,255,255,.03)); box-shadow: inset 0 1px 0 rgba(255,255,255,.32), 0 8px 30px rgba(69,230,255,.15); transform: perspective(200px) rotateX(7deg) rotateY(-8deg); }
.brand-mark i { display: block; border-radius: 3px; background: linear-gradient(180deg,var(--cyan),#008bae); box-shadow: 0 0 12px rgba(69,230,255,.45); }
.brand-mark i:nth-child(2) { background: linear-gradient(180deg,var(--gold),#b96c00); }
.brand-mark i:nth-child(3) { background: linear-gradient(180deg,var(--magenta),#9b1888); }
.brand-copy { display: grid; line-height: 1.1; }
.brand-copy strong { letter-spacing: .035em; font-size: 1rem; }
.brand-copy small { margin-top: 5px; color: var(--muted); font-weight: 650; }
.desktop-nav { display: flex; align-items: center; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.035); }
.nav-link { min-height: 44px; padding: 0 15px; border: 0; border-radius: 13px; background: transparent; color: var(--muted); font-size: .9rem; font-weight: 800; cursor: pointer; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-link.active { color: #06121c; background: linear-gradient(180deg,#86f3ff,#31bad0); box-shadow: inset 0 1px 0 #fff, 0 8px 22px rgba(69,230,255,.23); }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.xp-chip { min-height: 46px; padding: 7px 13px; border-radius: 14px; display: flex; gap: 8px; align-items: center; background: linear-gradient(145deg,rgba(255,207,90,.2),rgba(255,207,90,.05)); border: 1px solid rgba(255,207,90,.32); box-shadow: inset 0 1px 0 rgba(255,255,255,.2); }
.xp-chip span { color: var(--gold); font-size: .72rem; font-weight: 900; letter-spacing: .12em; }
.icon-button { width: 46px; height: 46px; min-width: 46px; display: inline-grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 14px; background: linear-gradient(145deg,rgba(255,255,255,.13),rgba(255,255,255,.025)); box-shadow: inset 0 1px 0 rgba(255,255,255,.18),0 7px 20px rgba(0,0,0,.2); cursor: pointer; font-size: 1.35rem; }
.icon-button:hover { border-color: var(--cyan); transform: translateY(-1px); }
.icon-button svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); }

main { width: min(1540px, 100%); margin: 0 auto; padding: clamp(22px,4vw,58px) clamp(16px,4vw,58px) 110px; }
.page { animation: page-in .35s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(9px); } }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-header h1 { margin: 3px 0 0; font-size: clamp(2rem,5vw,4.2rem); line-height: .98; letter-spacing: -.045em; }
.page-header p { max-width: 760px; color: var(--muted); line-height: 1.65; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--cyan); font-size: .72rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; box-shadow: 0 0 8px currentColor; }

.hero { min-height: 560px; position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(360px,.85fr); align-items: center; gap: clamp(32px,6vw,100px); padding: clamp(30px,6vw,86px); border-radius: 38px; border: 1px solid var(--line-strong); background: linear-gradient(135deg,rgba(20,46,75,.92),rgba(5,18,32,.83) 56%,rgba(46,16,57,.76)); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.2); }
.hero::before { content:""; position:absolute; inset:-2px; background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.08) 43%, transparent 60%); transform: translateX(-120%); animation: sheen 7s ease-in-out infinite; pointer-events:none; }
@keyframes sheen { 0%,65% { transform:translateX(-120%)} 85%,100% {transform:translateX(120%)} }
.hero-copy { position: relative; z-index: 2; }
.hero h1 { margin: 14px 0 22px; font-size: clamp(3rem,7vw,7.2rem); letter-spacing: -.07em; line-height: .86; max-width: 850px; }
.hero h1 .metal { display:block; background: linear-gradient(180deg,#fff 5%,#bcecff 35%,#6a8aa6 53%,#fff 72%,#8cc8df); -webkit-background-clip:text; color:transparent; filter: drop-shadow(0 8px 26px rgba(0,0,0,.35)); }
.hero h1 .accent { display:block; color:var(--gold); font-size:.46em; letter-spacing:.01em; margin-top:18px; }
.hero p { color:#c5d1e0; font-size: clamp(1rem,1.6vw,1.25rem); max-width:700px; line-height:1.65; }
.hero-actions { display:flex; flex-wrap:wrap; gap:14px; margin-top:30px; }
.button { min-height: 50px; padding: 0 22px; display:inline-flex; align-items:center; justify-content:center; gap:10px; border:1px solid var(--line-strong); border-radius:15px; background:linear-gradient(145deg,rgba(255,255,255,.13),rgba(255,255,255,.03)); color:#fff; text-decoration:none; font-weight:850; cursor:pointer; box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 10px 24px rgba(0,0,0,.25); transition:transform .16s ease,border-color .16s ease,filter .16s ease; }
.button:hover { transform:translateY(-2px); border-color:rgba(255,255,255,.5); filter:brightness(1.07); }
.button.primary { color:#06121c; border-color:#b7f7ff; background:linear-gradient(180deg,#9cf7ff,#33c6df 53%,#1591ac); box-shadow:inset 0 2px 0 rgba(255,255,255,.78),inset 0 -3px 0 rgba(0,66,86,.42),0 13px 35px rgba(69,230,255,.25); }
.button.gold { color:#241500; border-color:#fff0ad; background:linear-gradient(180deg,#fff2a6,#ffcc4d 52%,#be7100); box-shadow:inset 0 2px 0 rgba(255,255,255,.78),inset 0 -3px 0 rgba(105,54,0,.5),0 13px 35px rgba(255,207,90,.22); }
.button.ghost { background:rgba(255,255,255,.04); box-shadow:none; }
.button.danger { border-color:rgba(255,111,125,.55); color:#ffdbe0; }
.button.small { min-height:44px; padding:0 15px; font-size:.87rem; }
.hero-orbit { position:relative; min-height:430px; display:grid; place-items:center; perspective:900px; }
.globe { width:min(360px,75vw); aspect-ratio:1; position:relative; border-radius:50%; background:radial-gradient(circle at 32% 28%,#8cf4ff 0,#1ea1bd 8%,#08627d 27%,#062c46 53%,#03111f 75%); border:1px solid rgba(168,245,255,.7); box-shadow:inset -40px -30px 70px rgba(0,0,0,.7),inset 18px 15px 35px rgba(255,255,255,.25),0 0 0 14px rgba(69,230,255,.035),0 0 0 15px rgba(69,230,255,.12),0 35px 100px rgba(0,0,0,.55),0 0 65px rgba(69,230,255,.2); animation:globe-float 6s ease-in-out infinite; }
.globe::before { content:""; position:absolute; inset:13%; border-radius:47% 53% 60% 40%; background:linear-gradient(135deg,#6fe0a1,#157d5e); transform:rotate(-13deg); filter:drop-shadow(9px 8px 10px rgba(0,0,0,.3)); clip-path:polygon(18% 1%,49% 8%,61% 25%,94% 34%,80% 51%,87% 72%,54% 93%,38% 73%,14% 79%,3% 54%,23% 39%,3% 21%); opacity:.9; }
.globe::after { content:""; position:absolute; inset:0; border-radius:50%; background:repeating-linear-gradient(0deg,transparent 0 22px,rgba(136,246,255,.18) 23px,transparent 24px); mask-image:radial-gradient(circle,#000,transparent 74%); }
@keyframes globe-float { 50% { transform:translateY(-12px) rotateY(5deg); } }
.orbit-ring { position:absolute; width:115%; height:42%; border:1px solid rgba(255,207,90,.55); border-radius:50%; transform:rotate(-15deg); box-shadow:0 0 18px rgba(255,207,90,.15); }
.orbit-dot { position:absolute; width:18px; height:18px; border-radius:50%; background:var(--gold); box-shadow:0 0 20px var(--gold); animation:orbit-dot 7s linear infinite; }
@keyframes orbit-dot { from{transform:rotate(0deg) translateX(205px) rotate(0deg)} to{transform:rotate(360deg) translateX(205px) rotate(-360deg)} }
.floating-stat { position:absolute; padding:14px 17px; min-width:130px; border:1px solid var(--line-strong); border-radius:17px; background:rgba(7,21,37,.74); backdrop-filter:blur(14px); box-shadow:0 18px 40px rgba(0,0,0,.35),inset 0 1px 0 rgba(255,255,255,.15); }
.floating-stat strong { display:block; font-size:1.55rem; color:var(--gold); }
.floating-stat small { color:var(--muted); }
.fs-a { left:-2%; top:9%; transform:rotate(-3deg); }
.fs-b { right:-3%; bottom:12%; transform:rotate(3deg); }

.metrics-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin:22px 0 42px; }
.metric-card, .card { border:1px solid var(--line); border-radius:var(--radius); background:linear-gradient(145deg,rgba(20,43,70,.78),rgba(7,19,34,.72)); box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 18px 48px rgba(0,0,0,.23); }
.metric-card { padding:23px; position:relative; overflow:hidden; }
.metric-card::after { content:""; position:absolute; inset:auto -30% -75% 20%; height:140%; border-radius:50%; background:radial-gradient(circle,rgba(69,230,255,.13),transparent 65%); }
.metric-card strong { display:block; font-size:clamp(1.7rem,3vw,2.7rem); line-height:1; }
.metric-card span { display:block; margin-top:9px; color:var(--muted); font-weight:700; }

.section-title { display:flex; align-items:end; justify-content:space-between; gap:20px; margin:42px 0 18px; }
.section-title h2 { margin:0; font-size:clamp(1.6rem,3vw,2.6rem); letter-spacing:-.035em; }
.section-title p { margin:6px 0 0; color:var(--muted); }
.card-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.feature-card { min-height:270px; position:relative; overflow:hidden; padding:28px; display:flex; flex-direction:column; align-items:flex-start; }
.feature-card .card-index { width:52px; height:52px; display:grid; place-items:center; border-radius:17px; font-weight:950; background:linear-gradient(145deg,rgba(255,255,255,.16),rgba(255,255,255,.03)); border:1px solid var(--line-strong); color:var(--gold); box-shadow:inset 0 1px 0 rgba(255,255,255,.22); }
.feature-card h3 { margin:24px 0 8px; font-size:1.4rem; }
.feature-card p { margin:0 0 24px; color:var(--muted); line-height:1.55; }
.feature-card .button { margin-top:auto; }
.feature-card::after { content:""; position:absolute; width:180px; height:180px; right:-75px; top:-75px; border-radius:50%; background:radial-gradient(circle,rgba(69,230,255,.18),transparent 70%); }

.progress-shell { height:10px; border-radius:99px; background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.08); overflow:hidden; }
.progress-fill { height:100%; width:0; border-radius:inherit; background:linear-gradient(90deg,var(--cyan),var(--green)); box-shadow:0 0 18px rgba(69,230,255,.45); transition:width .35s ease; }
.progress-fill.gold { background:linear-gradient(90deg,var(--gold),#ff8a45); }
.progress-label { display:flex; justify-content:space-between; gap:12px; margin:8px 0; color:var(--muted); font-size:.83rem; }

.route-layout { display:grid; grid-template-columns:minmax(250px,330px) minmax(0,1fr); gap:22px; align-items:start; }
.route-sidebar { position:sticky; top:98px; padding:18px; max-height:calc(100vh - 125px); overflow:auto; }
.task-nav { display:grid; gap:8px; margin-top:18px; }
.task-nav button { min-height:54px; padding:9px 12px; display:grid; grid-template-columns:35px 1fr auto; align-items:center; gap:10px; text-align:left; border:1px solid transparent; border-radius:14px; color:var(--muted); background:transparent; cursor:pointer; }
.task-nav button:hover { background:rgba(255,255,255,.05); color:#fff; }
.task-nav button.active { color:#fff; border-color:rgba(69,230,255,.35); background:linear-gradient(90deg,rgba(69,230,255,.14),rgba(69,230,255,.03)); }
.task-nav .num { width:34px; height:34px; display:grid; place-items:center; border-radius:11px; background:rgba(255,255,255,.08); font-weight:900; }
.task-nav button.done .num { color:#052018; background:var(--green); }
.task-nav small { color:var(--gold); font-weight:850; }
.exam-panel { min-height:650px; padding:clamp(22px,4vw,42px); }
.exam-topline { display:flex; justify-content:space-between; align-items:center; gap:18px; margin-bottom:24px; }
.exam-topline h2 { margin:4px 0 0; font-size:clamp(1.5rem,3vw,2.5rem); }
.score-badge, .timer-badge { min-height:48px; padding:10px 15px; display:flex; align-items:center; gap:9px; border:1px solid var(--line-strong); border-radius:14px; background:rgba(255,255,255,.05); font-weight:850; }
.timer-badge.warning { color:var(--red); border-color:rgba(255,111,125,.5); }
.instruction { padding:14px 17px; margin:0 0 22px; border-left:4px solid var(--cyan); border-radius:0 14px 14px 0; background:rgba(69,230,255,.07); color:#c7e8ee; line-height:1.55; }
.reading-context { max-height:410px; overflow:auto; padding:22px; margin:18px 0; border:1px solid var(--line); border-radius:18px; background:rgba(0,0,0,.18); line-height:1.72; color:#dce6f3; }
.blank-token { display:inline-flex; min-width:54px; min-height:34px; align-items:center; justify-content:center; margin:2px 4px; border-bottom:2px dashed var(--gold); color:var(--gold); font-weight:900; }
.question-stack { display:grid; gap:15px; }
.question-block { padding:20px; border:1px solid var(--line); border-radius:18px; background:rgba(255,255,255,.025); }
.question-block h3, .question-block p { margin-top:0; }
.option-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; margin-top:14px; }
.option-button { min-height:58px; padding:12px 15px; display:flex; align-items:center; gap:12px; text-align:left; border:1px solid var(--line-strong); border-radius:15px; background:linear-gradient(145deg,rgba(255,255,255,.09),rgba(255,255,255,.025)); cursor:pointer; box-shadow:inset 0 1px 0 rgba(255,255,255,.1); }
.option-button .letter { width:33px; height:33px; min-width:33px; display:grid; place-items:center; border-radius:10px; background:rgba(255,255,255,.1); color:var(--cyan); font-weight:950; }
.option-button:hover { border-color:var(--cyan); transform:translateY(-1px); }
.option-button.selected { border-color:var(--gold); background:rgba(255,207,90,.12); }
.option-button.correct { border-color:var(--green); background:rgba(91,245,171,.14); }
.option-button.incorrect { border-color:var(--red); background:rgba(255,111,125,.12); }
.option-button:disabled { cursor:default; transform:none; }
.tf-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.tf-button { min-height:55px; border:1px solid var(--line-strong); border-radius:15px; background:rgba(255,255,255,.045); font-weight:900; cursor:pointer; }
.tf-button.selected { border-color:var(--gold); color:var(--gold); }
.text-answer { width:100%; min-height:54px; padding:12px 15px; border:1px solid var(--line-strong); border-radius:14px; color:#fff; background:rgba(0,0,0,.25); }
.chip-bank { display:flex; flex-wrap:wrap; gap:10px; margin:16px 0; }
.drag-chip { min-height:48px; padding:8px 14px; border:1px solid rgba(255,207,90,.35); border-radius:14px; background:linear-gradient(145deg,rgba(255,207,90,.18),rgba(255,207,90,.04)); color:#fff1bd; font-weight:800; cursor:grab; }
.drag-chip.selected { outline:3px solid var(--cyan); }
.drag-chip.used { opacity:.35; text-decoration:line-through; }
.drop-slot { min-height:50px; min-width:70px; padding:7px 12px; display:inline-flex; align-items:center; justify-content:center; border:2px dashed rgba(69,230,255,.45); border-radius:13px; color:var(--cyan); background:rgba(69,230,255,.06); vertical-align:middle; cursor:pointer; }
.drop-slot.filled { border-style:solid; color:#fff; background:rgba(69,230,255,.12); }
.match-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.match-column { display:grid; gap:10px; }
.match-item { min-height:54px; padding:12px 14px; border:1px solid var(--line-strong); border-radius:14px; background:rgba(255,255,255,.04); cursor:pointer; text-align:left; }
.match-item.selected { border-color:var(--gold); background:rgba(255,207,90,.1); }
.match-item.matched { border-color:var(--green); opacity:.72; }
.feedback { margin:18px 0 0; padding:17px 19px; border-radius:16px; border:1px solid var(--line); line-height:1.55; }
.feedback.success { border-color:rgba(91,245,171,.4); background:rgba(91,245,171,.09); }
.feedback.error { border-color:rgba(255,111,125,.4); background:rgba(255,111,125,.08); }
.exam-actions { display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-top:25px; padding-top:20px; border-top:1px solid var(--line); }

.filter-bar { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-bottom:22px; }
.search-input { min-height:50px; min-width:min(100%,330px); padding:0 16px; border:1px solid var(--line-strong); border-radius:15px; background:rgba(0,0,0,.18); color:#fff; }
.segmented { display:inline-flex; padding:4px; border:1px solid var(--line); border-radius:15px; background:rgba(255,255,255,.03); }
.segmented button { min-height:42px; padding:0 14px; border:0; border-radius:11px; background:transparent; color:var(--muted); font-weight:800; cursor:pointer; }
.segmented button.active { background:rgba(69,230,255,.16); color:#fff; }
.country-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.country-card { position:relative; min-height:250px; padding:24px; display:flex; flex-direction:column; overflow:hidden; cursor:pointer; text-align:left; }
.country-card:hover { transform:translateY(-4px); border-color:rgba(69,230,255,.4); }
.country-flag { font-size:3.1rem; filter:drop-shadow(0 8px 13px rgba(0,0,0,.34)); }
.country-card h3 { margin:18px 0 4px; font-size:1.35rem; }
.country-card p { margin:0; color:var(--muted); }
.country-meta { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top:auto; padding-top:18px; }
.country-meta strong { color:var(--gold); }
.country-card .mini-progress { position:absolute; left:0; right:0; bottom:0; height:5px; background:rgba(255,255,255,.05); }
.country-card .mini-progress i { display:block; height:100%; background:linear-gradient(90deg,var(--cyan),var(--green)); }
.country-detail { display:grid; grid-template-columns:minmax(280px,400px) minmax(0,1fr); gap:22px; }
.country-profile { padding:28px; position:sticky; top:100px; }
.profile-flag { font-size:5rem; }
.fact-list { display:grid; gap:10px; margin:24px 0; }
.fact-row { display:grid; grid-template-columns:130px 1fr; gap:12px; padding:10px 0; border-bottom:1px solid var(--line); }
.fact-row span { color:var(--muted); }
.practice-card { padding:clamp(24px,4vw,42px); min-height:570px; }
.practice-head { display:flex; justify-content:space-between; align-items:center; gap:15px; margin-bottom:24px; }
.question-counter { color:var(--muted); font-weight:800; }
.question-visual { min-height:150px; margin:12px 0 22px; display:grid; place-items:center; border-radius:20px; border:1px solid var(--line); background:radial-gradient(circle at center,rgba(69,230,255,.09),transparent 65%),rgba(0,0,0,.13); text-align:center; padding:24px; }
.question-visual .visual-symbol { font-size:4rem; }
.question-visual h2 { max-width:850px; margin:12px auto 0; font-size:clamp(1.35rem,3vw,2.2rem); line-height:1.25; }

.world-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.world-card { min-height:230px; padding:26px; position:relative; overflow:hidden; }
.world-card .world-icon { width:58px; height:58px; display:grid; place-items:center; border-radius:18px; background:linear-gradient(145deg,rgba(255,255,255,.18),rgba(255,255,255,.03)); font-size:1.8rem; border:1px solid var(--line-strong); }
.world-card h3 { margin:20px 0 8px; }
.world-card p { color:var(--muted); }
.module-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; }
.module-card { padding:20px; min-height:190px; display:flex; flex-direction:column; }
.module-card .module-code { color:var(--cyan); font-weight:900; font-size:.8rem; }
.module-card h3 { margin:9px 0 5px; }
.module-card p { color:var(--muted); font-size:.9rem; }
.module-card .button { margin-top:auto; align-self:flex-start; }
.gallery-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.gallery-grid figure { margin:0; aspect-ratio:4/3; overflow:hidden; border-radius:17px; border:1px solid var(--line); background:#091421; }
.gallery-grid img { width:100%; height:100%; object-fit:cover; transition:transform .35s ease; }
.gallery-grid figure:hover img { transform:scale(1.04); }

.library-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.pdf-card { overflow:hidden; }
.pdf-cover { height:300px; overflow:hidden; background:#edf1f6; }
.pdf-cover img { width:100%; height:100%; object-fit:cover; object-position:top; }
.pdf-body { padding:22px; }
.pdf-body h3 { margin:0 0 8px; }
.pdf-body p { color:var(--muted); line-height:1.5; }
.pdf-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }
.pdf-viewer { width:100%; height:min(78vh,950px); border:1px solid var(--line); border-radius:22px; background:#fff; }
.page-viewer { display:grid; grid-template-columns:300px minmax(0,1fr); gap:18px; }
.page-thumbs { max-height:75vh; overflow:auto; display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:10px; }
.page-thumbs button { padding:0; border:2px solid transparent; border-radius:10px; overflow:hidden; background:#fff; cursor:pointer; }
.page-thumbs button.active { border-color:var(--gold); }
.page-thumbs img { width:100%; }
.page-main { min-height:75vh; padding:15px; display:grid; place-items:center; }
.page-main img { max-height:73vh; border-radius:10px; box-shadow:0 18px 55px rgba(0,0,0,.45); }

.results-panel { max-width:900px; margin:0 auto; padding:clamp(28px,6vw,65px); text-align:center; }
.result-ring { --score:0; width:190px; height:190px; margin:25px auto; border-radius:50%; display:grid; place-items:center; background:conic-gradient(var(--cyan) calc(var(--score)*1%),rgba(255,255,255,.08) 0); box-shadow:0 0 50px rgba(69,230,255,.14); }
.result-ring::before { content:""; width:150px; height:150px; border-radius:50%; background:var(--panel-solid); position:absolute; }
.result-ring strong { position:relative; font-size:2.6rem; }
.result-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:25px 0; }
.result-stat { padding:17px; border:1px solid var(--line); border-radius:15px; background:rgba(255,255,255,.035); }
.result-stat strong { display:block; font-size:1.6rem; color:var(--gold); }

.empty-state { padding:70px 25px; text-align:center; border:1px dashed var(--line-strong); border-radius:24px; color:var(--muted); }
.notice { padding:17px 20px; border:1px solid rgba(255,207,90,.3); border-radius:16px; background:rgba(255,207,90,.07); color:#ffeab4; line-height:1.55; }
.tag { display:inline-flex; min-height:30px; align-items:center; padding:3px 10px; border:1px solid var(--line); border-radius:999px; color:var(--muted); font-size:.76rem; font-weight:850; }
.tag.cyan { color:var(--cyan); border-color:rgba(69,230,255,.32); }
.tag.gold { color:var(--gold); border-color:rgba(255,207,90,.34); }

.modal { width:min(720px,calc(100% - 30px)); padding:0; border:0; border-radius:26px; color:var(--text); background:transparent; box-shadow:0 35px 110px rgba(0,0,0,.65); }
.modal::backdrop { background:rgba(0,5,12,.75); backdrop-filter:blur(9px); }
.modal-card { padding:28px; border:1px solid var(--line-strong); border-radius:26px; background:linear-gradient(145deg,#12263e,#071321); }
.modal-head { display:flex; align-items:start; justify-content:space-between; gap:20px; }
.modal h2 { margin:5px 0 0; }
.settings-grid { display:grid; gap:12px; margin:25px 0; }
.setting-row { min-height:68px; padding:12px 15px; display:flex; justify-content:space-between; align-items:center; gap:20px; border:1px solid var(--line); border-radius:16px; background:rgba(255,255,255,.03); }
.setting-row span { display:grid; gap:4px; }
.setting-row small { color:var(--muted); }
.setting-row select { min-height:44px; padding:0 10px; color:#fff; border:1px solid var(--line-strong); border-radius:12px; background:#0b1b2e; }
.setting-row input[type=checkbox] { width:48px; height:26px; accent-color:var(--cyan); }
.modal-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:10px; }
.small-modal { max-width:520px; }
.toast-region { position:fixed; z-index:400; right:20px; bottom:90px; display:grid; gap:10px; pointer-events:none; }
.toast { width:min(390px,calc(100vw - 40px)); padding:15px 17px; border:1px solid var(--line-strong); border-radius:15px; background:#10243b; box-shadow:0 18px 55px rgba(0,0,0,.45); animation:toast-in .25s ease; }
.toast.success { border-color:rgba(91,245,171,.5); }
.toast.error { border-color:rgba(255,111,125,.5); }
@keyframes toast-in { from{opacity:0;transform:translateX(20px)} }
.mobile-nav { display:none; }

@media (max-width:1180px) {
  .topbar { grid-template-columns:1fr auto; }
  .desktop-nav { display:none; }
  .hero { grid-template-columns:1fr; }
  .hero-orbit { min-height:360px; }
  .metrics-grid { grid-template-columns:repeat(2,1fr); }
  .country-grid { grid-template-columns:repeat(3,1fr); }
  .card-grid, .world-grid, .module-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:820px) {
  .topbar { min-height:66px; padding:8px 14px; }
  .brand-copy small { display:none; }
  .xp-chip { display:none; }
  main { padding:22px 14px 100px; }
  .hero { min-height:auto; padding:30px 22px; border-radius:27px; }
  .hero h1 { font-size:clamp(3rem,17vw,5.2rem); }
  .hero-orbit { min-height:310px; }
  .globe { width:250px; }
  .orbit-dot { display:none; }
  .floating-stat { min-width:112px; padding:11px; }
  .metrics-grid { grid-template-columns:1fr 1fr; }
  .route-layout, .country-detail, .page-viewer { grid-template-columns:1fr; }
  .route-sidebar, .country-profile { position:static; max-height:none; }
  .task-nav { grid-template-columns:repeat(3,1fr); }
  .task-nav button { grid-template-columns:1fr; text-align:center; min-height:76px; }
  .task-nav button span:not(.num), .task-nav button small { display:none; }
  .option-grid, .match-grid { grid-template-columns:1fr; }
  .country-grid { grid-template-columns:repeat(2,1fr); }
  .gallery-grid { grid-template-columns:repeat(2,1fr); }
  .library-grid, .card-grid, .world-grid, .module-grid { grid-template-columns:1fr; }
  .page-thumbs { grid-template-columns:repeat(4,1fr); max-height:210px; }
  .result-stats { grid-template-columns:1fr; }
  .mobile-nav { position:fixed; z-index:110; left:10px; right:10px; bottom:calc(8px + env(safe-area-inset-bottom)); min-height:68px; padding:7px; display:grid; grid-template-columns:repeat(5,1fr); border:1px solid var(--line-strong); border-radius:21px; background:rgba(5,13,23,.9); backdrop-filter:blur(22px) saturate(150%); box-shadow:0 16px 55px rgba(0,0,0,.5); transition:opacity .25s ease; }
  .mobile-nav button { min-height:54px; display:grid; place-items:center; gap:2px; border:0; border-radius:14px; background:transparent; color:var(--muted); font-size:.67rem; font-weight:800; }
  .mobile-nav button span { color:var(--cyan); font-size:.82rem; font-weight:950; }
  .mobile-nav button.active { color:#06121c; background:linear-gradient(180deg,#90f5ff,#32bfd7); }
  .mobile-nav button.active span { color:#06121c; }
  .toast-region { bottom:90px; right:12px; }
}
@media (max-width:520px) {
  .brand-mark { width:39px; height:39px; }
  .top-actions .icon-button:first-of-type { display:none; }
  .metrics-grid { grid-template-columns:1fr; }
  .country-grid { grid-template-columns:1fr; }
  .country-card { min-height:210px; }
  .page-header { align-items:flex-start; flex-direction:column; }
  .exam-topline { align-items:flex-start; flex-direction:column; }
  .task-nav { grid-template-columns:repeat(4,1fr); }
  .gallery-grid { grid-template-columns:1fr 1fr; }
  .fact-row { grid-template-columns:1fr; gap:4px; }
  .page-thumbs { grid-template-columns:repeat(3,1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important; }
}
@media print {
  .topbar,.mobile-nav,.ambient,.hero-actions,.button,.icon-button { display:none !important; }
  body { background:#fff; color:#000; }
  main { max-width:none; padding:0; }
  .card,.exam-panel,.question-block { background:#fff; color:#000; box-shadow:none; border:1px solid #aaa; }
  .reading-context { color:#000; max-height:none; }
}

/* ======================================================================
   MATRIX OLIMPIADAS Y CULTURA — RC2
   Integración de tres etapas, respuestas cercanas, imágenes contextuales,
   interfaz metálica 3D y entrenamiento oral con transcripción.
   ====================================================================== */

:root {
  --chrome-hi: rgba(255,255,255,.92);
  --chrome-mid: rgba(152,190,224,.72);
  --chrome-low: rgba(35,69,105,.86);
  --metal-cyan-1: #c8fbff;
  --metal-cyan-2: #45e7ff;
  --metal-cyan-3: #067f9f;
  --metal-gold-1: #fff2a6;
  --metal-gold-2: #ffc83f;
  --metal-gold-3: #a85f00;
  --metal-magenta-1: #ffd0fa;
  --metal-magenta-2: #ff62df;
  --metal-magenta-3: #8b197d;
}

/* Botones 3D metálicos consistentes */
.button,
.option-button,
.tf-button,
.match-item,
.drag-chip,
.drop-slot,
.segmented button,
.task-nav button,
.mobile-nav button {
  position: relative;
  isolation: isolate;
  transform-style: preserve-3d;
  transition: transform .16s ease, filter .16s ease, border-color .16s ease,
              box-shadow .16s ease, background .16s ease;
}
.button::before,
.option-button::before,
.tf-button::before,
.match-item::before,
.drag-chip::before,
.drop-slot::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 1px 2px auto 2px;
  height: 44%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.25), transparent);
  pointer-events: none;
}
.button:active,
.option-button:active,
.tf-button:active,
.match-item:active,
.drag-chip:active,
.drop-slot:active {
  transform: translateY(2px) scale(.995);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.34), 0 3px 8px rgba(0,0,0,.26);
}
.button.primary,
.nav-link.active,
.mobile-nav button.active {
  color: #03151f;
  border-color: var(--metal-cyan-1);
  background:
    linear-gradient(180deg, var(--metal-cyan-1) 0%, var(--metal-cyan-2) 42%,
      #1db5ce 58%, var(--metal-cyan-3) 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.82),
    inset 0 -4px 0 rgba(0,52,73,.42),
    0 8px 0 #054d61,
    0 15px 34px rgba(19,210,239,.26);
  text-shadow: 0 1px rgba(255,255,255,.45);
}
.button.gold {
  color: #241400;
  border-color: var(--metal-gold-1);
  background:
    linear-gradient(180deg, var(--metal-gold-1) 0%, var(--metal-gold-2) 42%,
      #e99b0a 60%, var(--metal-gold-3) 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.8),
    inset 0 -4px 0 rgba(83,40,0,.46),
    0 8px 0 #714000,
    0 15px 34px rgba(255,185,28,.23);
  text-shadow: 0 1px rgba(255,255,255,.45);
}
.button.magenta {
  color: #21051d;
  border-color: var(--metal-magenta-1);
  background:
    linear-gradient(180deg, var(--metal-magenta-1) 0%, var(--metal-magenta-2) 42%,
      #c02aa9 59%, var(--metal-magenta-3) 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.82),
    inset 0 -4px 0 rgba(74,0,64,.48),
    0 8px 0 #65105b,
    0 15px 34px rgba(255,74,221,.24);
  text-shadow: 0 1px rgba(255,255,255,.38);
}
.button.danger {
  color: #fff;
  border-color: #ffb5bd;
  background: linear-gradient(180deg,#ff9aa5,#e84e61 48%,#8e1728);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.62), inset 0 -4px 0 rgba(75,0,9,.42),
    0 7px 0 #6a101e, 0 13px 28px rgba(255,75,98,.2);
}
.button.ghost {
  background: linear-gradient(145deg, rgba(126,174,216,.20), rgba(14,35,58,.68));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.18), inset 0 -3px 0 rgba(0,0,0,.26),
    0 6px 0 rgba(2,11,21,.8), 0 11px 24px rgba(0,0,0,.23);
}
.button.small { min-height: 44px; padding-inline: 17px; }
.button[disabled], .button:disabled { opacity:.45; filter:saturate(.35); cursor:not-allowed; transform:none; box-shadow:none; }

/* Evita el doble scroll: texto + respuestas permanecen en la misma zona visual. */
.gap-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(285px, 360px);
  gap: 16px;
  align-items: start;
}
.gap-workspace .reading-context {
  max-height: none;
  overflow: visible;
  margin: 0;
  min-height: 430px;
}
.gap-answer-dock {
  position: sticky;
  top: 94px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(69,230,255,.30);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(29,64,98,.94), rgba(6,21,37,.97)),
    radial-gradient(circle at 10% 0%, rgba(69,230,255,.18), transparent 50%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 18px 44px rgba(0,0,0,.32);
}
.dock-title { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.dock-title strong { font-size:1.06rem; }
.dock-title span { color:var(--gold); font-weight:900; }
.dock-help { margin:12px 0 0; color:var(--muted); font-size:.82rem; line-height:1.5; }
.chip-bank { display:grid; gap:9px; margin:0; }
.drag-chip {
  width:100%;
  min-height:56px;
  display:grid;
  grid-template-columns:34px minmax(0,1fr);
  align-items:center;
  gap:10px;
  text-align:left;
  color:#fff;
  border-color:rgba(255,207,90,.42);
  background:linear-gradient(160deg,rgba(255,231,150,.22),rgba(124,75,0,.24));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 4px 0 rgba(76,45,0,.62),0 9px 20px rgba(0,0,0,.2);
}
.drag-chip:hover { transform:translateY(-2px); border-color:var(--gold); }
.chip-code { width:31px; height:31px; display:grid; place-items:center; border-radius:10px; color:#2b1800; background:linear-gradient(180deg,#fff2a6,#e7a51a); font-weight:950; }
.drop-slot {
  min-width:170px;
  max-width:min(100%,720px);
  min-height:44px;
  padding:7px 12px;
  margin:4px 5px;
  white-space:normal;
  line-height:1.35;
  text-align:left;
  color:#bcf8ff;
  border-color:rgba(69,230,255,.72);
  background:linear-gradient(145deg,rgba(28,112,137,.30),rgba(6,38,55,.72));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 4px 0 rgba(0,54,70,.65);
}
.drop-slot.filled {
  color:#071620;
  border-style:solid;
  border-color:#b5f8ff;
  background:linear-gradient(180deg,#bdf9ff,#4ddbef 52%,#168aa3);
  box-shadow:inset 0 2px 0 rgba(255,255,255,.85),0 5px 0 #075a70,0 10px 20px rgba(44,221,244,.18);
  font-weight:800;
}

/* Imágenes dentro de tareas oficiales */
.official-task-image {
  margin: 0 0 20px;
  min-height: 220px;
  max-height: 390px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: #07121f;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 18px 44px rgba(0,0,0,.28);
}
.official-task-image img { width:100%; height:100%; min-height:220px; max-height:390px; object-fit:cover; }

/* Tres etapas */
.stage-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.stage-card { overflow:hidden; display:flex; flex-direction:column; min-height:560px; }
.stage-image { height:210px; position:relative; overflow:hidden; background:#07131f; }
.stage-image img { width:100%; height:100%; object-fit:cover; filter:saturate(1.12) contrast(1.03); }
.stage-image::after { content:""; position:absolute; inset:0; background:linear-gradient(180deg,transparent 40%,rgba(6,16,28,.9)); }
.stage-number { position:absolute; z-index:2; left:18px; bottom:15px; width:52px; height:52px; display:grid; place-items:center; border-radius:16px; color:#07151d; font-size:1.2rem; font-weight:950; background:linear-gradient(180deg,#fff5aa,#ffc13b 52%,#a96600); border:1px solid #fff1a4; box-shadow:inset 0 2px 0 #fff,0 7px 0 #704000,0 13px 25px rgba(0,0,0,.35); }
.stage-body { padding:24px; display:flex; flex-direction:column; flex:1; }
.stage-body h2 { margin:8px 0 5px; font-size:1.6rem; }
.stage-body h3 { margin:0 0 12px; color:var(--cyan); font-size:1rem; }
.stage-body p { margin:0; color:var(--muted); line-height:1.55; }
.stage-metrics { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:20px 0; }
.stage-metrics div { padding:12px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.035); }
.stage-metrics strong { display:block; color:var(--gold); font-size:1.2rem; }
.stage-metrics span { color:var(--muted); font-size:.78rem; }
.stage-actions { margin-top:auto; display:grid; gap:12px; }
.stage-guide { margin-top:22px; padding:24px 30px; display:grid; grid-template-columns:minmax(230px,.45fr) 1fr; gap:28px; align-items:center; }
.stage-guide h2 { margin:5px 0 0; }
.stage-guide ol { margin:0; display:grid; grid-template-columns:repeat(2,1fr); gap:12px 24px; color:#d9e6f4; line-height:1.5; }

/* Preguntas visuales y traducción opcional */
.question-visual { overflow:hidden; position:relative; isolation:isolate; }
.question-visual.has-image { min-height:clamp(270px,38vw,480px); padding:0; align-items:end; }
.question-bg { position:absolute; z-index:-2; inset:0; width:100%; height:100%; object-fit:cover; filter:saturate(1.06) contrast(1.04); }
.question-visual.has-image::after { content:""; position:absolute; z-index:-1; inset:0; background:linear-gradient(180deg,rgba(1,7,14,.05) 15%,rgba(2,13,24,.48) 53%,rgba(2,10,19,.94) 100%); }
.question-visual-overlay { width:100%; padding:clamp(20px,4vw,38px); text-shadow:0 2px 15px rgba(0,0,0,.72); }
.question-visual-overlay h2 { color:#fff; }
.translation-button { margin-top:16px; text-shadow:none; }
.question-translation { margin:-10px 0 22px; padding:15px 18px; border:1px solid rgba(255,207,90,.38); border-radius:15px; color:#fff0be; background:linear-gradient(145deg,rgba(255,207,90,.13),rgba(80,47,0,.18)); line-height:1.55; box-shadow:inset 0 1px 0 rgba(255,255,255,.15); }

/* Respuestas cercanas y más táctiles */
.option-button,
.tf-button,
.match-item {
  min-height:64px;
  border-color:rgba(151,199,238,.37);
  background:linear-gradient(155deg,rgba(91,135,177,.24),rgba(10,29,49,.75));
  box-shadow:inset 0 2px 0 rgba(255,255,255,.14),inset 0 -3px 0 rgba(0,0,0,.24),0 5px 0 rgba(2,12,23,.82),0 11px 24px rgba(0,0,0,.19);
}
.option-button:hover,.tf-button:hover,.match-item:hover { transform:translateY(-2px); border-color:var(--cyan); }
.option-button.selected,.tf-button.selected,.match-item.selected { border-color:var(--gold); background:linear-gradient(150deg,rgba(255,222,118,.27),rgba(92,54,0,.42)); box-shadow:inset 0 2px 0 rgba(255,255,255,.18),0 5px 0 #684000,0 12px 24px rgba(255,185,33,.15); }
.option-button.correct { border-color:var(--green); background:linear-gradient(150deg,rgba(91,245,171,.28),rgba(5,78,53,.55)); }
.option-button.incorrect { border-color:var(--red); background:linear-gradient(150deg,rgba(255,111,125,.25),rgba(91,11,23,.58)); }

/* Entrenamiento oral: imagen siempre visible, grabación y transcripción */
.oral-layout { display:grid; grid-template-columns:minmax(360px,.88fr) minmax(480px,1.12fr); gap:20px; align-items:start; }
.oral-image-panel,.oral-recorder-panel { padding:clamp(20px,3vw,30px); }
.oral-image-panel { position:sticky; top:94px; }
.oral-image-wrap { aspect-ratio:4/3; overflow:hidden; border-radius:22px; border:1px solid var(--line-strong); background:#06111e; box-shadow:inset 0 2px 0 rgba(255,255,255,.17),0 18px 45px rgba(0,0,0,.34); }
.oral-image-wrap img { width:100%; height:100%; object-fit:contain; background:#07121f; }
.oral-prompt { padding:20px 2px 6px; }
.oral-prompt h2 { margin:8px 0 16px; font-size:clamp(1.25rem,2.4vw,1.9rem); line-height:1.3; }
.recorder-top { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.recorder-top h2 { margin:6px 0 0; }
.rec-status { min-height:36px; display:inline-flex; align-items:center; padding:5px 11px; border:1px solid var(--line-strong); border-radius:999px; color:var(--muted); background:rgba(255,255,255,.04); font-weight:850; }
.rec-status.recording { color:#ffdce1; border-color:rgba(255,111,125,.6); background:rgba(255,76,96,.15); box-shadow:0 0 22px rgba(255,76,96,.2); }
.rec-status.paused { color:#fff0bd; border-color:rgba(255,207,90,.55); background:rgba(255,207,90,.11); }
.rec-status.success { color:#c9ffe5; border-color:rgba(91,245,171,.55); background:rgba(91,245,171,.1); }
.oral-controls { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:24px 0 18px; }
.oral-controls .button { padding-inline:12px; }
.meter-row { display:grid; grid-template-columns:1fr auto; align-items:center; gap:16px; margin-bottom:18px; }
.audio-meter { height:16px; overflow:hidden; border:1px solid var(--line-strong); border-radius:99px; background:rgba(0,0,0,.34); box-shadow:inset 0 2px 5px rgba(0,0,0,.42); }
.audio-meter span { display:block; width:0; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--green),var(--cyan),var(--gold),var(--red)); box-shadow:0 0 16px rgba(69,230,255,.38); transition:width .08s linear; }
#oralTimer { min-width:62px; font-variant-numeric:tabular-nums; text-align:right; color:var(--gold); }
.oral-transcript-label { display:grid; gap:9px; margin-top:20px; }
.oral-transcript { min-height:230px; resize:vertical; line-height:1.65; background:rgba(0,0,0,.31); }
.oral-live { min-height:55px; margin-top:10px; padding:12px 15px; border:1px dashed rgba(69,230,255,.35); border-radius:14px; color:#b8eaf1; background:rgba(69,230,255,.05); line-height:1.5; }
.oral-review-actions { display:flex; flex-wrap:wrap; gap:12px; margin:18px 0; }
.oral-analysis-card { padding:20px; margin-top:18px; border:1px solid rgba(255,207,90,.32); border-radius:18px; background:linear-gradient(145deg,rgba(255,207,90,.1),rgba(9,26,44,.73)); }
.analysis-head { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.analysis-head h3 { margin:0; }
.analysis-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:15px 0; }
.analysis-grid div { padding:12px; border:1px solid var(--line); border-radius:13px; background:rgba(255,255,255,.035); }
.analysis-grid strong { display:block; color:var(--cyan); font-size:1.25rem; }
.analysis-grid span { color:var(--muted); font-size:.76rem; }
.oral-navigation { align-items:center; }

/* Barra móvil con seis rutas sin bloquear ni superponer texto. */
@media (max-width:1180px) {
  .stage-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .oral-layout { grid-template-columns:1fr; }
  .oral-image-panel { position:static; }
}

@media (max-width:920px) {
  .gap-workspace { grid-template-columns:1fr; }
  .gap-answer-dock { position:static; max-height:none; order:-1; }
  .gap-answer-dock .chip-bank { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .stage-guide { grid-template-columns:1fr; }
  .stage-guide ol { grid-template-columns:1fr; }
}

@media (max-width:820px) {
  .stage-grid { grid-template-columns:1fr; }
  .stage-card { min-height:0; }
  .stage-image { height:190px; }
  .official-task-image,.official-task-image img { min-height:180px; max-height:280px; }
  .reading-context { padding:17px; }
  .drop-slot { min-width:calc(100% - 12px); margin:7px 6px; }
  .gap-answer-dock .chip-bank { grid-template-columns:1fr; }
  .oral-controls { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .analysis-grid { grid-template-columns:1fr 1fr; }
  .mobile-nav { grid-template-columns:repeat(6,1fr); }
  .mobile-nav button { min-width:0; padding:4px 2px; font-size:.58rem; line-height:1.1; }
  .mobile-nav button span { font-size:.76rem; }
}

@media (max-width:520px) {
  .question-visual.has-image { min-height:300px; }
  .question-visual-overlay { padding:18px; }
  .oral-controls { grid-template-columns:1fr; }
  .analysis-grid { grid-template-columns:1fr; }
  .recorder-top { flex-direction:column; }
  .stage-body { padding:20px; }
  .stage-metrics { grid-template-columns:1fr; }
  .mobile-nav { left:5px; right:5px; padding:5px; gap:2px; }
  .mobile-nav button { min-height:51px; font-size:.54rem; }
}

/* Pregunta e interacción visibles a la vez en pantallas amplias. */
.practice-workspace {
  display:grid;
  grid-template-columns:minmax(0,1.06fr) minmax(390px,.94fr);
  gap:18px;
  align-items:start;
  margin-top:18px;
}
.practice-visual-column { min-width:0; }
.practice-answer-column {
  min-width:0;
  position:sticky;
  top:94px;
  padding:20px;
  border:1px solid rgba(151,199,238,.27);
  border-radius:20px;
  background:linear-gradient(145deg,rgba(19,44,72,.86),rgba(5,18,32,.92));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.16),0 16px 38px rgba(0,0,0,.25);
}
.practice-workspace .question-visual { margin:0; min-height:clamp(360px,43vw,590px); }
.practice-answer-column .option-grid { grid-template-columns:1fr; }
.practice-answer-column .question-translation { margin:0 0 15px; }
.practice-actions { margin-top:18px; }

@media (max-width:1050px) {
  .practice-workspace { grid-template-columns:1fr; }
  .practice-answer-column { position:static; }
  .practice-workspace .question-visual { min-height:clamp(300px,58vw,480px); }
  .practice-answer-column .option-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:650px) {
  .practice-answer-column { padding:14px; }
  .practice-answer-column .option-grid { grid-template-columns:1fr; }
  .practice-workspace .question-visual { min-height:310px; }
}

/* ======================= MATRIX RC3 =============================== */
.page-action-cluster { display:flex; flex-wrap:wrap; gap:12px; justify-content:flex-end; }
.button { position:relative; overflow:hidden; border-width:1px; background:linear-gradient(115deg,rgba(255,255,255,.18),rgba(255,255,255,.025) 34%,rgba(255,255,255,.15) 52%,rgba(255,255,255,.025) 72%),linear-gradient(180deg,#26394f,#101d2c 58%,#07111d); box-shadow:inset 0 2px 0 rgba(255,255,255,.32),inset 0 -4px 0 rgba(0,0,0,.42),0 12px 28px rgba(0,0,0,.33),0 0 0 1px rgba(255,255,255,.035); }
.button::after { content:""; position:absolute; inset:2px 12% auto; height:42%; border-radius:999px; background:linear-gradient(180deg,rgba(255,255,255,.32),transparent); opacity:.48; pointer-events:none; }
.button:active { transform:translateY(3px); box-shadow:inset 0 2px 6px rgba(0,0,0,.45); }
.button.magenta { color:#190719; border-color:#ffc5ff; background:linear-gradient(180deg,#ffc0ff,#e45be7 48%,#8f238f); box-shadow:inset 0 2px 0 rgba(255,255,255,.78),inset 0 -4px 0 rgba(72,0,78,.5),0 14px 35px rgba(224,87,229,.25); }
.reading-audio-bar { position:sticky; top:92px; z-index:8; display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 14px; padding:10px 12px; border:1px solid rgba(69,230,255,.38); border-radius:16px; background:linear-gradient(135deg,rgba(4,23,40,.97),rgba(17,37,64,.96)); box-shadow:0 14px 30px rgba(0,0,0,.28),inset 0 1px 0 rgba(255,255,255,.15); backdrop-filter:blur(14px); }
.reading-audio-label { margin-right:auto; color:#dffaff; font-weight:900; }
.speak-mini { width:42px; min-width:42px; height:42px; display:grid; place-items:center; border:1px solid rgba(150,243,255,.55); border-radius:13px; background:linear-gradient(180deg,#8cf5ff,#28bdd5 55%,#0b8099); color:#04151d; font-size:1rem; cursor:pointer; box-shadow:inset 0 2px 0 rgba(255,255,255,.75),inset 0 -3px 0 rgba(0,62,76,.43),0 8px 20px rgba(40,205,228,.18); }
.speak-mini:hover { filter:brightness(1.09); transform:translateY(-1px); }
.speak-mini:active { transform:translateY(2px); }
.option-audio-row, .chip-audio-row, .prompt-with-audio, .question-title-audio, .prompt-audio-input { display:flex; align-items:center; gap:8px; }
.option-audio-row > .option-button, .option-audio-row > .tf-button, .option-audio-row > .match-item { flex:1; }
.chip-audio-row { padding:3px; border-radius:15px; background:rgba(255,255,255,.025); }
.prompt-with-audio { justify-content:space-between; align-items:flex-start; }
.prompt-with-audio p { flex:1; }
.question-title-audio { justify-content:center; align-items:center; }
.question-title-audio h2 { margin-inline:auto 0; }
.question-title-audio .speak-mini { margin-right:auto; }
.prompt-audio-input .text-answer { flex:1; }
.colombia-map-layout { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr); gap:20px; align-items:start; }
.interactive-map-card, .map-item-bank { padding:20px; }
.map-scorebar { display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.map-scorebar strong { font-size:1.2rem; color:var(--gold); }
.map-scorebar .button { margin-left:auto; }
.interactive-map { position:relative; aspect-ratio:3/4; max-height:73vh; min-height:620px; width:min(100%,690px); margin:auto; background-size:contain; background-repeat:no-repeat; background-position:center; border-radius:24px; border:1px solid rgba(115,233,255,.28); overflow:hidden; box-shadow:inset 0 0 70px rgba(0,0,0,.45),0 20px 45px rgba(0,0,0,.35); }
.map-region-zone { position:absolute; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:7px; border:2px dashed rgba(255,255,255,.55); border-radius:18px; background:rgba(5,16,31,.55); color:#fff; cursor:pointer; backdrop-filter:blur(4px); transition:.18s ease; text-shadow:0 2px 5px rgba(0,0,0,.8); }
.map-region-zone strong { font-size:clamp(.72rem,1.3vw,1rem); }
.map-region-zone small { font-size:.66rem; color:#d2edf6; }
.map-region-zone span { position:absolute; right:6px; top:5px; min-width:24px; height:24px; display:grid; place-items:center; border-radius:8px; background:var(--gold); color:#221400; font-weight:950; }
.map-region-zone:hover, .map-region-zone.drag-over { border-style:solid; border-color:var(--cyan); background:rgba(20,105,128,.62); transform:scale(1.025); box-shadow:0 0 25px rgba(69,230,255,.32); }
.map-item-bank { position:sticky; top:96px; max-height:calc(100vh - 120px); overflow:auto; }
.map-items { display:grid; gap:11px; margin-top:17px; }
.map-item-card { display:grid; grid-template-columns:92px minmax(0,1fr) 42px; align-items:center; gap:12px; padding:8px; border:1px solid var(--line-strong); border-radius:17px; background:linear-gradient(145deg,rgba(255,255,255,.095),rgba(255,255,255,.025)); cursor:grab; transition:.18s ease; }
.map-item-card img { width:92px; height:72px; object-fit:cover; border-radius:12px; }
.map-item-card strong, .map-item-card small { display:block; }
.map-item-card small { margin-top:3px; color:var(--muted); }
.map-item-card.selected { outline:3px solid var(--cyan); transform:translateX(-4px); }
.map-item-card.correct { border-color:var(--green); background:rgba(91,245,171,.11); }
.map-item-card.placed { opacity:.48; cursor:default; }
.map-item-card.incorrect { animation:matrix-shake .35s ease; border-color:var(--red); }
@keyframes matrix-shake { 25%{transform:translateX(-7px)} 50%{transform:translateX(7px)} 75%{transform:translateX(-4px)} }
.map-mode-tabs { margin:0 0 18px; }
.official-task-image img, .oral-image-wrap img, .page-main img, .pdf-cover img { image-rendering:auto; filter:contrast(1.025) saturate(1.02); }
.official-task-image { overflow:hidden; border-radius:18px; border:1px solid var(--line); }
.official-task-image img { display:block; width:100%; max-height:450px; object-fit:cover; }
.reading-context { max-height:none; overflow:visible; }
.gap-answer-dock { position:sticky; top:154px; max-height:calc(100vh - 180px); overflow:auto; }
.no-motion .map-item-card.incorrect { animation:none; }
@media (max-width:980px) { .colombia-map-layout{grid-template-columns:1fr}.map-item-bank{position:static;max-height:none}.map-items{grid-template-columns:repeat(2,minmax(0,1fr))}.interactive-map{min-height:560px}.gap-answer-dock{position:static;max-height:none} }
@media (max-width:620px) { .reading-audio-bar{top:70px}.reading-audio-label{width:100%}.map-items{grid-template-columns:1fr}.interactive-map{min-height:500px}.map-region-zone small{display:none}.map-item-card{grid-template-columns:76px minmax(0,1fr) 42px}.map-item-card img{width:76px;height:64px}.option-grid{grid-template-columns:1fr}.page-action-cluster{justify-content:flex-start} }


/* ======================== MATRIX RC4 =============================== */
.recorded-audio-bar {
  display:grid;
  grid-template-columns:minmax(220px,1fr) minmax(280px,520px);
  align-items:center;
  gap:16px;
  margin:0 0 15px;
  padding:12px 14px;
  border:1px solid rgba(96,232,255,.42);
  border-radius:18px;
  background:
    linear-gradient(120deg,rgba(255,255,255,.11),rgba(255,255,255,.018) 45%),
    linear-gradient(180deg,#122f4a,#071829);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.2),
    inset 0 -3px 0 rgba(0,0,0,.38),
    0 14px 30px rgba(0,0,0,.27);
}
.recorded-audio-copy {
  display:flex;
  align-items:center;
  gap:12px;
}
.recorded-audio-copy > span {
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border-radius:14px;
  background:linear-gradient(180deg,#9af8ff,#25bfd8 60%,#08778d);
  box-shadow:inset 0 2px 0 rgba(255,255,255,.8),0 7px 18px rgba(36,205,227,.2);
}
.recorded-audio-copy strong,
.recorded-audio-copy small {
  display:block;
}
.recorded-audio-copy small {
  margin-top:3px;
  color:var(--muted);
}
.recorded-audio-bar audio {
  width:100%;
  accent-color:#40dff4;
}

.input-correction-card {
  transition:border-color .18s ease, background .18s ease, transform .18s ease;
}
.input-correction-card.answer-correct {
  border-color:rgba(91,245,171,.75);
  background:linear-gradient(135deg,rgba(91,245,171,.11),rgba(5,25,37,.7));
}
.input-correction-card.answer-incorrect {
  border-color:rgba(255,107,125,.74);
  background:linear-gradient(135deg,rgba(255,107,125,.10),rgba(5,25,37,.7));
}
.correct-sentence-audio {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  margin-top:10px;
  color:#91ffd0;
  font-weight:900;
}
.correct-sentence-audio .speak-mini {
  animation:rc4-audio-arrival .34s ease;
}
@keyframes rc4-audio-arrival {
  from { opacity:0; transform:scale(.65); }
  to { opacity:1; transform:scale(1); }
}

@media (max-width:760px) {
  .recorded-audio-bar {
    grid-template-columns:1fr;
  }
}


/* ======================== MATRIX RC5 =============================== */
.speak-mini.is-speaking {
  color:#07131a;
  outline:3px solid rgba(255,214,74,.85);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.85),
    0 0 0 5px rgba(255,211,70,.16),
    0 0 28px rgba(255,211,70,.48);
  animation:matrix-speaker-pulse 1s ease-in-out infinite;
}
@keyframes matrix-speaker-pulse {
  50% { transform:scale(1.08); }
}

.match-help {
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
  padding:12px 14px;
  border:1px solid rgba(67,232,255,.35);
  border-radius:17px;
  background:linear-gradient(135deg,rgba(15,55,79,.88),rgba(7,24,42,.9));
}
.match-help-icon {
  display:grid;
  place-items:center;
  width:46px;
  min-width:46px;
  height:46px;
  border-radius:15px;
  background:linear-gradient(180deg,#8cf8ff,#24bad3 58%,#0a7188);
  box-shadow:inset 0 2px 0 rgba(255,255,255,.76),0 8px 20px rgba(36,205,228,.2);
}
.match-help strong,
.match-help small { display:block; }
.match-help small { margin-top:3px; color:var(--muted); }

.match-board {
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:clamp(52px,9vw,135px);
  padding:10px 3px;
}
.match-lines {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  z-index:1;
  pointer-events:none;
  overflow:visible;
}
.match-connection-line {
  fill:none;
  stroke-width:5;
  stroke-linecap:round;
  filter:drop-shadow(0 0 5px currentColor);
  animation:matrix-line-arrival .25s ease;
}
@keyframes matrix-line-arrival {
  from { stroke-dasharray:12 12; opacity:.2; }
  to { stroke-dasharray:none; opacity:1; }
}
.match-column {
  position:relative;
  z-index:2;
  display:grid;
  align-content:start;
  gap:12px;
}
.match-node-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) 44px;
  gap:8px;
  align-items:center;
}
.match-node-row-right {
  grid-template-columns:44px minmax(0,1fr);
}
.match-item {
  position:relative;
  min-height:70px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:13px 20px;
  border:1px solid var(--line-strong);
  border-radius:18px;
  background:
    linear-gradient(120deg,rgba(255,255,255,.12),rgba(255,255,255,.025) 42%),
    linear-gradient(180deg,#263d56,#0c1d30);
  color:var(--text);
  text-align:left;
  cursor:grab;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.23),
    inset 0 -4px 0 rgba(0,0,0,.42),
    0 10px 22px rgba(0,0,0,.22);
  transition:.18s ease;
}
.match-left-item { padding-right:34px; }
.match-right-item { padding-left:34px; }
.match-item:hover,
.match-item.selected,
.match-item.drag-target {
  border-color:var(--cyan);
  transform:translateY(-2px);
  box-shadow:0 0 0 3px rgba(67,232,255,.14),0 13px 28px rgba(0,0,0,.3);
}
.match-item.matched {
  border-color:var(--match-color);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.28),
    0 0 0 3px color-mix(in srgb,var(--match-color) 22%,transparent),
    0 10px 24px rgba(0,0,0,.25);
}
.match-item.matched::after {
  content:attr(data-pair-number);
  position:absolute;
  top:7px;
  min-width:24px;
  height:24px;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:var(--match-color);
  color:#06131c;
  font-weight:950;
  font-size:.78rem;
}
.match-left-item.matched::after { left:7px; }
.match-right-item.matched::after { right:7px; }
.match-hook {
  position:absolute;
  top:50%;
  width:22px;
  height:22px;
  display:grid;
  place-items:center;
  border:3px solid #9bf4ff;
  border-radius:50%;
  background:#092033;
  color:#59e9ff;
  font-size:0;
  transform:translateY(-50%);
  box-shadow:0 0 0 4px rgba(67,232,255,.12),0 0 15px rgba(67,232,255,.35);
}
.match-hook::after {
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:currentColor;
}
.match-hook-right { right:-12px; }
.match-hook-left { left:-12px; }
.match-item.matched .match-hook {
  border-color:var(--match-color);
  color:var(--match-color);
  box-shadow:0 0 0 4px color-mix(in srgb,var(--match-color) 18%,transparent),0 0 17px var(--match-color);
}
.match-answer-correct { outline:3px solid rgba(91,245,171,.7); }
.match-answer-wrong { outline:3px solid rgba(255,107,125,.72); }
.match-summary { margin-top:15px; }

@media (max-width:760px) {
  .match-board {
    grid-template-columns:1fr;
    gap:26px;
  }
  .match-lines { display:none; }
  .match-left-item,
  .match-right-item { padding-inline:38px 20px; }
  .match-hook-right,
  .match-hook-left {
    left:8px;
    right:auto;
  }
  .match-node-row,
  .match-node-row-right {
    grid-template-columns:44px minmax(0,1fr);
  }
  .match-node-row:not(.match-node-row-right) .speak-mini {
    grid-column:1;
    grid-row:1;
  }
  .match-node-row:not(.match-node-row-right) .match-item {
    grid-column:2;
    grid-row:1;
  }
}

/* ======================== MATRIX RC7 =============================== */
.audio-diagnostic-panel {
  display:grid; gap:12px; padding:15px; margin:4px 0 14px;
  border:1px solid rgba(69,232,255,.38); border-radius:18px;
  background:linear-gradient(135deg,rgba(16,54,78,.92),rgba(7,22,38,.94));
  box-shadow:inset 0 2px 0 rgba(255,255,255,.16),0 12px 25px rgba(0,0,0,.22);
}
.audio-diagnostic-panel strong,.audio-diagnostic-panel small{display:block}
.audio-diagnostic-panel small{margin-top:3px;color:var(--muted)}
.audio-diagnostic-buttons{display:flex;flex-wrap:wrap;gap:8px}
.audio-diagnostic-status{margin:0;padding:9px 11px;border-radius:12px;background:rgba(0,0,0,.22);color:var(--muted)}
.audio-diagnostic-status.running{color:#aef7ff;background:rgba(69,232,255,.1)}
.audio-diagnostic-status.success{color:#8fffc9;background:rgba(91,245,171,.11)}
.audio-diagnostic-status.error{color:#ffadb8;background:rgba(255,107,125,.11)}
.question-bg{transition:opacity .2s ease,transform .35s ease}
.question-visual:hover .question-bg{transform:scale(1.012)}


/* ======================== MATRIX RC8 =============================== */
.drag-chip.value-only { display:flex; align-items:center; justify-content:flex-start; width:100%; min-width:0; }
.drag-chip .chip-value { min-width:0; overflow-wrap:anywhere; white-space:normal; line-height:1.25; }
.gap-answer-dock .chip-audio-row { display:grid; grid-template-columns:minmax(0,1fr) 44px; width:100%; }
.gap-answer-dock .drag-chip { min-width:0; max-width:100%; }
.success-reading-panel {
  display:flex; align-items:center; justify-content:space-between; gap:14px; margin:0 0 15px; padding:13px 16px;
  border:1px solid rgba(91,245,171,.65); border-radius:18px;
  background:linear-gradient(135deg,rgba(91,245,171,.15),rgba(8,30,42,.94)); color:#baffdc; font-weight:900;
  box-shadow:0 12px 28px rgba(0,0,0,.25),inset 0 1px 0 rgba(255,255,255,.16);
}

.official-match-combinations { display:grid; gap:9px; margin-top:17px; }
.official-match-combo { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:12px; padding:12px 15px; border:1px solid var(--line); border-radius:15px; background:rgba(255,255,255,.035); }
.official-match-combo b { color:var(--cyan); font-size:1.2rem; }
.official-match-combo.correct { border-color:rgba(91,245,171,.75); background:rgba(91,245,171,.10); }
.official-match-combo.wrong { border-color:rgba(255,107,125,.75); background:rgba(255,107,125,.10); }
.official-match-board .match-answer-correct { outline:3px solid rgba(91,245,171,.78); }
.official-match-board .match-answer-wrong { outline:3px solid rgba(255,107,125,.78); }

.country-photo-card { min-height:300px; padding:0; background-image:var(--country-cover); background-position:center; background-size:cover; isolation:isolate; }
.country-photo-shade { position:absolute; inset:0; z-index:-1; background:linear-gradient(180deg,rgba(1,10,20,.06),rgba(2,14,28,.9) 70%,rgba(2,14,28,.98)); }
.country-flag-image { width:112px; height:68px; object-fit:cover; border-radius:10px; margin:18px; border:2px solid rgba(255,255,255,.75); box-shadow:0 10px 24px rgba(0,0,0,.38); }
.country-code { position:absolute; right:18px; top:18px; padding:7px 10px; border-radius:10px; background:rgba(2,15,29,.75); color:#fff; font-weight:950; letter-spacing:.08em; }
.country-card-copy { margin-top:auto; padding:18px 20px 50px; }
.country-photo-card h3 { margin:0 0 5px; color:#fff; text-shadow:0 2px 8px rgba(0,0,0,.8); }
.country-photo-card p { color:#dceaf4; text-shadow:0 2px 7px rgba(0,0,0,.8); }
.country-photo-card .country-meta { left:20px; right:20px; bottom:18px; }
.country-profile-visual { position:relative; margin:-20px -20px 18px; height:230px; overflow:hidden; border-radius:20px 20px 12px 12px; }
.country-profile-cover { width:100%; height:100%; object-fit:cover; }
.profile-flag-image { position:absolute; left:18px; bottom:16px; width:145px; height:86px; object-fit:cover; border-radius:12px; border:3px solid rgba(255,255,255,.85); box-shadow:0 12px 28px rgba(0,0,0,.45); }

@media (max-width:760px){
  .official-match-combo { grid-template-columns:1fr; gap:5px; }
  .official-match-combo b { transform:rotate(90deg); justify-self:center; }
  .country-photo-card { min-height:250px; }
}


/* ======================== MATRIX RC9 =============================== */
.practice-context-card {
  margin:20px 0 8px;
  padding:18px;
  border:1px solid rgba(70,226,247,.34);
  border-radius:22px;
  background:linear-gradient(145deg,rgba(7,30,50,.97),rgba(15,39,65,.94));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 16px 38px rgba(0,0,0,.24);
}
.practice-context-head { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; margin-bottom:14px; }
.practice-context-head h2 { margin:4px 0 6px; font-size:clamp(1.15rem,2.3vw,1.65rem); }
.practice-context-head p { margin:0; color:var(--muted); max-width:900px; }
.practice-source-pages { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.practice-source-pages.single-page { grid-template-columns:minmax(0,760px); justify-content:center; }
.practice-source-page {
  display:flex; flex-direction:column; gap:8px; padding:9px;
  border:1px solid rgba(151,199,238,.28); border-radius:17px;
  background:#eef2f6; color:#082033; text-decoration:none; overflow:hidden;
  box-shadow:0 12px 28px rgba(0,0,0,.28); transition:.18s ease;
}
.practice-source-page:hover { transform:translateY(-2px); border-color:var(--cyan); }
.practice-source-page img { width:100%; max-height:690px; object-fit:contain; object-position:top; background:#fff; border-radius:10px; }
.practice-source-page span { padding:4px 8px; font-weight:900; text-align:center; }
.adapted-listening-panel {
  display:grid; grid-template-columns:minmax(0,1fr) auto; gap:14px; align-items:center;
  margin:0 0 15px; padding:15px; border:1px solid rgba(255,113,223,.36); border-radius:18px;
  background:linear-gradient(135deg,rgba(103,21,105,.24),rgba(9,24,42,.86));
}
.adapted-listening-panel strong,.adapted-listening-panel small { display:block; }
.adapted-listening-panel small { margin-top:5px; color:var(--muted); }
.adapted-listening-panel details { grid-column:1/-1; border-top:1px solid var(--line); padding-top:10px; }
.adapted-listening-panel summary { cursor:pointer; font-weight:900; color:#f5c7ff; }
.adapted-listening-panel p { line-height:1.65; color:#edf8ff; }
.practice-workspace.has-source-context { margin-top:14px; }
.practice-workspace.has-source-context .question-visual { min-height:240px; }
.image-option-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px; }
.image-option-button {
  position:relative; display:flex; flex-direction:column; align-items:stretch; gap:8px;
  padding:10px; border:1px solid var(--line-strong); border-radius:18px;
  background:linear-gradient(180deg,#243b55,#0b1d30); color:var(--text); cursor:pointer;
  box-shadow:inset 0 2px 0 rgba(255,255,255,.22),inset 0 -4px 0 rgba(0,0,0,.4),0 10px 24px rgba(0,0,0,.25);
  text-align:left; transition:.18s ease;
}
.image-option-button:hover,.image-option-button.selected { border-color:var(--cyan); transform:translateY(-2px); box-shadow:0 0 0 3px rgba(67,232,255,.14),0 14px 28px rgba(0,0,0,.3); }
.image-option-button img { width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:12px; background:#fff; }
.image-option-button > span:last-child { font-weight:800; color:#dcecff; }
.image-option-code {
  position:absolute; z-index:2; left:17px; top:17px; width:38px; height:38px; display:grid; place-items:center;
  border-radius:12px; background:linear-gradient(180deg,#80f3ff,#1ea7c1); color:#06151d; font-weight:950;
  box-shadow:0 6px 15px rgba(0,0,0,.38),inset 0 2px 0 rgba(255,255,255,.72);
}
@media (max-width:850px) {
  .practice-source-pages { grid-template-columns:1fr; }
  .practice-source-page img { max-height:none; }
  .adapted-listening-panel { grid-template-columns:1fr; }
  .adapted-listening-panel .button { justify-self:start; }
}
@media (max-width:560px) {
  .practice-context-card { padding:12px; }
  .practice-context-head { flex-direction:column; }
  .image-option-grid { grid-template-columns:1fr; }
}

.build-version-note{margin:12px 0 0;padding:10px 12px;border:1px solid rgba(102,232,255,.28);border-radius:12px;background:rgba(5,24,39,.55);color:var(--muted);font-size:.82rem}.build-version-note strong{color:var(--cyan)}


/* ======================== MATRIX · estilos heredados consolidados en RC21 ============================== */
.build-chip {
  display:inline-flex; align-items:center; justify-content:center; margin-left:8px;
  min-width:46px; height:23px; padding:0 8px; border-radius:999px;
  border:1px solid rgba(102,232,255,.55); background:rgba(8,35,54,.82);
  color:#7ff1ff; font-size:.68rem; font-weight:950; letter-spacing:.08em;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 0 18px rgba(69,230,255,.16);
}
.country-flag-fallback {
  width:112px; height:68px; margin:18px; border-radius:10px; place-items:center;
  border:2px solid rgba(255,255,255,.75); background:rgba(5,25,42,.9);
  color:#fff; font-size:2rem; box-shadow:0 10px 24px rgba(0,0,0,.38);
}
.country-flag-fallback:not([hidden]) { display:grid; }
.country-photo-card { background-color:#10263a; }


/* ======================== MATRIX · refinamientos consolidados en RC21 ============================== */
.input-set-hint {
  margin:0 0 14px; padding:12px 15px; border:1px solid rgba(69,230,255,.28);
  border-radius:14px; background:rgba(69,230,255,.07); color:#dffbff;
  font-weight:750; line-height:1.45;
}
.site-footer {
  width:min(1540px,calc(100% - 32px)); margin:0 auto 28px; padding:15px clamp(16px,4vw,36px);
  display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
  border:1px solid var(--line); border-radius:18px;
  background:linear-gradient(145deg,rgba(13,32,52,.78),rgba(5,17,30,.72));
  color:var(--muted); font-size:.84rem; letter-spacing:.02em;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08);
}
.site-footer strong { color:var(--gold); letter-spacing:.09em; }
@media (max-width:820px) {
  .site-footer { margin-bottom:96px; justify-content:center; text-align:center; }
}
@media print { .site-footer { display:none !important; } }

/* ==================================================================
   RC21 · Laboratorium gramatyki
   Scoped additions: no changes to Colombia, exam or oral modules.
   ================================================================== */
.grammar-world-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}
.grammar-world-metrics article {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 19px;
  background: linear-gradient(145deg, rgba(69,230,255,.09), rgba(255,255,255,.025));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.11);
}
.grammar-world-metrics strong {
  color: var(--gold);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1;
}
.grammar-world-metrics span {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.35;
}
.grammar-world-note { margin-bottom: 26px; }
.module-card-head,
.module-card-tags,
.grammar-badges,
.practice-visual-tags,
.grammar-hint-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.module-card-head { justify-content: space-between; }
.module-card-tags { margin: 15px 0; }
.grammar-module-card {
  position: relative;
  overflow: hidden;
}
.grammar-module-card::after {
  content: "";
  position: absolute;
  inset: auto -50px -60px auto;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(69,230,255,.14), transparent 70%);
  pointer-events: none;
}
.grammar-briefing-page { max-width: 1420px; margin-inline: auto; }
.grammar-hero {
  display: grid;
  grid-template-columns: minmax(280px, .82fr) minmax(0, 1.18fr);
  gap: clamp(22px, 4vw, 52px);
  padding: clamp(20px, 4vw, 42px);
  overflow: hidden;
}
.grammar-hero-media {
  min-height: 310px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--panel-solid);
}
.grammar-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.grammar-hero-copy {
  display: grid;
  align-content: center;
}
.grammar-hero-copy h2 {
  margin: 16px 0 10px;
  font-size: clamp(1.7rem, 3.4vw, 3rem);
  line-height: 1.08;
}
.grammar-hero-copy > p {
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.7;
}
.grammar-cycle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 19px;
}
.grammar-cycle span {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255,255,255,.045);
  font-weight: 850;
}
.grammar-cycle i { color: var(--gold); font-style: normal; }
.grammar-rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.grammar-rule-card {
  position: relative;
  padding-top: 29px;
}
.grammar-rule-card h3 { margin: 9px 0; }
.grammar-rule-card p { color: var(--muted); line-height: 1.62; }
.grammar-example {
  margin-top: 16px;
  padding: 14px;
  border-left: 3px solid var(--cyan);
  border-radius: 0 13px 13px 0;
  background: rgba(69,230,255,.07);
  color: var(--text);
  font-weight: 800;
  line-height: 1.5;
}
.grammar-rule-card .speak-mini { margin-top: 12px; }
.grammar-error-card {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
  gap: 24px;
  border-color: rgba(255,207,90,.35);
}
.grammar-error-card ul {
  margin: 0;
  display: grid;
  gap: 10px;
  padding-left: 22px;
  color: #f3e4b9;
  line-height: 1.55;
}
.grammar-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.grammar-mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 250px;
  padding: 28px 24px 24px;
  overflow: hidden;
}
.grammar-mode-card .card-index {
  display: inline-grid;
  place-items: center;
  width: 54px;
  min-width: 54px;
  height: 54px;
  border-radius: 16px;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--cyan);
  background: rgba(54, 214, 255, .10);
  border: 1px solid rgba(54, 214, 255, .26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.grammar-mode-card h3 { margin: 4px 0 0; }
.grammar-mode-card p { color: var(--muted); line-height: 1.6; }
.grammar-mode-card .button { margin-top: auto; }
.grammar-mode-card.featured {
  border-color: rgba(255,207,90,.48);
  background: linear-gradient(145deg, rgba(255,207,90,.11), rgba(255,255,255,.025));
}
.grammar-instruction {
  margin: 0 0 14px;
  padding: 13px 15px;
  border-left: 3px solid var(--gold);
  border-radius: 0 12px 12px 0;
  background: rgba(255,207,90,.07);
  color: #fff1c5;
  line-height: 1.5;
}
.practice-visual-tags {
  justify-content: center;
  margin: 8px 0 12px;
}
.grammar-hint-actions { margin-top: 12px; }
.grammar-hint-panel {
  margin-top: 11px;
  padding: 14px 16px;
  border: 1px solid rgba(255,207,90,.36);
  border-radius: 14px;
  background: rgba(255,207,90,.075);
  color: #fff2c7;
  line-height: 1.55;
}
.grammar-hint-panel[hidden] { display: none; }
.retry-feedback { border-style: dashed; }
.feedback-xp {
  display: inline-flex;
  margin-left: 6px;
  color: var(--gold);
  font-weight: 900;
}
@media (max-width: 980px) {
  .grammar-world-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grammar-hero { grid-template-columns: 1fr; }
  .grammar-hero-media { min-height: 250px; }
  .grammar-rule-grid { grid-template-columns: 1fr; }
  .grammar-error-card { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grammar-world-metrics,
  .grammar-mode-grid { grid-template-columns: 1fr; }
  .grammar-world-metrics article { min-height: 90px; }
  .grammar-hero { padding: 15px; }
  .grammar-hero-media { min-height: 210px; }
  .grammar-cycle i { display: none; }
  .grammar-cycle span { width: 100%; justify-content: center; }
  .grammar-mode-card .button { width: 100%; }
  .practice-visual-tags { gap: 5px; }
}



/* ======================= MATRIX RC21 · IMÁGENES HABILIDADES ========== */
:where(.page-header h1,.module-card h3,.grammar-hero-copy h2,.section-title h2,.question-title-audio h2,.grammar-rule-card summary,.lexical-group-card h3){
  overflow-wrap:anywhere;word-break:normal;hyphens:auto;
}
.page-header{align-items:flex-start}
.page-header>div{min-width:0;max-width:min(100%,1120px)}
.page-header h1{font-size:clamp(2rem,4.6vw,4rem);line-height:1.02}
.page-header .button{flex:0 0 auto}
.module-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,310px),1fr));align-items:stretch}
.module-card{min-width:0;min-height:250px;gap:8px}
.module-card h3{font-size:clamp(1.1rem,1.7vw,1.42rem);line-height:1.22;margin:8px 0 2px}
.module-card p{font-size:.93rem;line-height:1.5;margin:0}
.module-card .button{width:100%;margin-top:auto}
.module-subtopic-list{display:flex;flex-wrap:wrap;gap:6px;margin:5px 0 2px}
.module-subtopic-list span{max-width:100%;padding:5px 8px;border-radius:999px;background:rgba(69,230,255,.075);border:1px solid rgba(69,230,255,.16);color:#c9edf4;font-size:.72rem;font-weight:750;line-height:1.25}
.lexical-module-card{border-color:rgba(249,115,22,.26);background:linear-gradient(145deg,rgba(249,115,22,.075),rgba(255,255,255,.025))}
.lexical-world-metrics article:nth-child(3){border-color:rgba(249,115,22,.4)}

.practice-card{padding:clamp(18px,3vw,34px)}
.practice-answer-column{overflow:hidden}
.practice-answer-column :where(.grammar-instruction,.instruction,.notice,.feedback,.text-answer,.option-button,.tf-button,.drag-chip,.match-item){font-size:clamp(1rem,1.45vw,1.16rem)}
.grammar-instruction{font-size:clamp(1.02rem,1.5vw,1.18rem);font-weight:700}
.question-title-audio h2{font-size:clamp(1.7rem,3.3vw,2.7rem)!important;line-height:1.16!important;max-width:920px!important}
.option-button,.tf-button,.match-item{min-height:64px;line-height:1.35}
.text-answer{min-height:66px;font-size:1.2rem;font-weight:750}
.choice-chip-bank{display:flex;flex-wrap:wrap;gap:12px;margin:15px 0}
.compact-chip{width:auto!important;min-width:125px;display:inline-flex!important;grid-template-columns:none!important;justify-content:center;text-align:center;font-size:1.08rem}

/* Sentence ordering: horizontal, sequential, touch-friendly. */
.order-workspace{display:grid;gap:14px}
.order-section-label{display:grid;grid-template-columns:38px auto 1fr;align-items:center;gap:10px;color:#e8f8ff}
.order-section-label>span{width:36px;height:36px;display:grid;place-items:center;border-radius:12px;background:linear-gradient(180deg,#86f3ff,#21a9c2);color:#05151d;font-weight:950;box-shadow:0 5px 0 #075b6f}
.order-section-label strong{font-size:1.08rem}
.order-section-label small{justify-self:end;color:var(--muted)}
.order-token-bank,.order-sentence-line{display:flex;flex-flow:row wrap;align-items:center;align-content:flex-start;gap:10px;min-width:0}
.order-token-bank{padding:14px;border:1px solid rgba(255,207,90,.25);border-radius:17px;background:rgba(255,207,90,.045)}
.order-sentence-line{min-height:90px;padding:15px;border:2px dashed rgba(69,230,255,.5);border-radius:18px;background:rgba(2,16,30,.52);transition:.18s ease}
.order-sentence-line.drag-target{border-style:solid;border-color:var(--gold);background:rgba(255,207,90,.08)}
.order-token,.order-answer-token{width:auto;max-width:100%;min-height:54px;padding:10px 16px;border:1px solid rgba(255,207,90,.45);border-radius:15px;background:linear-gradient(180deg,rgba(255,244,196,.25),rgba(90,56,0,.35));color:#fff8da;font-size:clamp(1.02rem,1.55vw,1.2rem);font-weight:900;line-height:1.2;cursor:pointer;box-shadow:inset 0 1px 0 rgba(255,255,255,.28),0 4px 0 rgba(83,49,0,.7)}
.order-token:hover,.order-answer-token:hover{transform:translateY(-2px);border-color:var(--gold)}
.order-token.used{opacity:.28;transform:none;text-decoration:none;cursor:default}
.order-answer-token{display:inline-flex;align-items:center;gap:9px;border-color:rgba(69,230,255,.52);background:linear-gradient(180deg,rgba(118,239,255,.24),rgba(6,83,105,.45));box-shadow:inset 0 1px 0 rgba(255,255,255,.3),0 4px 0 #064f63}
.order-answer-token small{font-size:1.2em;color:#b9f8ff}
.order-placeholder{align-self:center;color:#87a5b9;font-size:1rem;font-style:italic}
.order-live-preview{min-height:42px;padding:10px 13px;border-left:3px solid var(--cyan);border-radius:0 12px 12px 0;background:rgba(69,230,255,.065);font-size:clamp(1.12rem,1.7vw,1.35rem);font-weight:850;line-height:1.45;color:#e8fbff}

/* Completar la palabra */
.hangman-game,.wordsearch-game{display:grid;gap:16px}
.game-clue{display:flex;align-items:center;gap:13px;padding:14px;border:1px solid rgba(69,230,255,.25);border-radius:16px;background:rgba(69,230,255,.055)}
.game-clue>span{font-size:2rem}.game-clue p{margin:4px 0 0;color:var(--muted);line-height:1.45}
.hangman-word{min-height:78px;display:flex;align-items:center;justify-content:center;padding:12px;border-radius:18px;background:rgba(0,0,0,.22);color:#fff2a7;font-size:clamp(1.8rem,5vw,3.2rem);font-weight:950;letter-spacing:.16em;text-align:center}
.hangman-meter{display:flex;align-items:center;justify-content:space-between;color:#d8eff7;font-weight:850}.hangman-meter div{font-size:2.1rem}
.hangman-alphabet{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:7px}
.hangman-alphabet button,.wordsearch-grid button{aspect-ratio:1;min-width:0;border:1px solid rgba(116,216,240,.3);border-radius:11px;background:linear-gradient(145deg,rgba(255,255,255,.12),rgba(255,255,255,.035));color:#fff;font-weight:900;cursor:pointer}
.hangman-alphabet button:hover,.wordsearch-grid button:hover{border-color:var(--cyan);transform:translateY(-1px)}
.hangman-alphabet button.right{background:rgba(91,245,171,.2);border-color:var(--green)}.hangman-alphabet button.wrong{background:rgba(255,111,125,.16);border-color:var(--red)}
.hangman-alphabet button:disabled{opacity:.44;cursor:default;transform:none}

/* Sopa de letras */
.wordsearch-grid{width:min(100%,530px);margin-inline:auto;display:grid;grid-template-columns:repeat(var(--wordsearch-size),minmax(0,1fr));gap:5px;padding:12px;border:1px solid rgba(69,230,255,.28);border-radius:20px;background:rgba(0,0,0,.2)}
.wordsearch-grid button{font-size:clamp(.78rem,2.3vw,1.16rem);border-radius:9px}
.wordsearch-grid button.selected{color:#221400;border-color:#fff0a4;background:linear-gradient(180deg,#fff5b8,#ffc83d);box-shadow:0 0 0 3px rgba(255,207,90,.16)}
.wordsearch-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:11px 13px;border-radius:14px;background:rgba(255,255,255,.035)}

/* Progressive-disclosure cards for ADHD-friendly briefings. */
.grammar-rule-grid{grid-template-columns:repeat(3,minmax(0,1fr));align-items:start}
.grammar-rule-card{padding:0!important;overflow:hidden}
.grammar-rule-card summary,.grammar-error-card summary{list-style:none;display:flex;align-items:center;gap:11px;min-height:72px;padding:17px 19px;cursor:pointer;font-weight:900;font-size:1.1rem}
.grammar-rule-card summary::-webkit-details-marker,.grammar-error-card summary::-webkit-details-marker{display:none}
.grammar-rule-card summary i,.grammar-error-card summary i{margin-left:auto;color:var(--cyan);font-style:normal;font-size:1.4rem;transition:transform .18s ease}
.grammar-rule-card[open] summary i,.grammar-error-card[open] summary i{transform:rotate(45deg)}
.grammar-rule-card summary .card-index{position:static;flex:0 0 auto}
.grammar-rule-content{padding:0 19px 19px}.grammar-rule-content p{color:var(--muted);line-height:1.58}
.grammar-error-card{display:block!important;padding:0!important}.grammar-error-card summary h2{margin:4px 0 0;font-size:clamp(1.25rem,2vw,1.75rem)}.grammar-error-card ul{padding:0 28px 20px 45px!important}
.lexical-group-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px}
.lexical-group-card{min-width:0;padding:20px}.lexical-group-icon{font-size:2.2rem}.lexical-group-card h3{margin:10px 0 12px;line-height:1.2}.lexical-word-cloud{display:flex;flex-wrap:wrap;gap:7px}.lexical-word-cloud span{padding:7px 9px;border-radius:10px;background:rgba(69,230,255,.08);border:1px solid rgba(69,230,255,.16);font-weight:800;font-size:.9rem}
.lexical-mode-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}

/* Positive visual feedback. */
.star-celebration{position:fixed;z-index:9999;inset:0;pointer-events:none;overflow:hidden}
.star-celebration span{position:absolute;left:var(--x);top:52%;color:#ffdc63;font-size:clamp(1.3rem,3vw,2.4rem);text-shadow:0 0 16px rgba(255,211,67,.8);animation:star-burst 1.18s cubic-bezier(.12,.7,.2,1) var(--delay) both}
@keyframes star-burst{0%{opacity:0;transform:translate(-50%,10px) scale(.2) rotate(0)}18%{opacity:1}100%{opacity:0;transform:translate(calc(-50% + var(--drift)),-42vh) scale(1.15) rotate(var(--spin))}}

@media(max-width:1050px){.lexical-group-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.lexical-mode-grid{grid-template-columns:1fr}.grammar-rule-grid{grid-template-columns:1fr}}
@media(max-width:650px){
  .page-header h1{font-size:clamp(1.85rem,9vw,2.7rem)}
  .practice-card{padding:14px}.practice-head{align-items:flex-start}.score-badge{white-space:nowrap}
  .question-title-audio{align-items:flex-end}.question-title-audio h2{font-size:clamp(1.5rem,7.3vw,2.05rem)!important}
  .practice-answer-column{padding:13px}.grammar-instruction{font-size:1rem}
  .order-section-label{grid-template-columns:36px minmax(0,1fr)}.order-section-label small{display:none}
  .order-token-bank,.order-sentence-line{gap:8px;padding:11px}.order-token,.order-answer-token{min-height:50px;padding:9px 12px;font-size:1rem}
  .hangman-alphabet{grid-template-columns:repeat(7,minmax(0,1fr))}.hangman-word{letter-spacing:.08em}
  .wordsearch-grid{gap:3px;padding:7px}.wordsearch-grid button{border-radius:6px}
  .lexical-group-grid{grid-template-columns:1fr}
  .module-card{min-height:auto}.module-subtopic-list span{font-size:.7rem}
}
@media(prefers-reduced-motion:reduce){.star-celebration{display:none}.grammar-rule-card summary i,.grammar-error-card summary i{transition:none}}


/* RC21 · accesibilidad táctil y foco visible */
button, .button, select, input { min-height: 44px; }
button:focus-visible, .button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
@media (max-width: 620px) {
  .grammar-mode-card { min-height: 0; padding: 22px 18px 18px; }
  .question-title, .question-prompt { font-size: clamp(1.2rem, 5.3vw, 1.55rem); line-height: 1.45; }
}

/* ======================== MATRIX RC21 ===============================
   Correcciones de mapa táctil, legibilidad infantil, navegación y revisión. */

/* Enunciados y oraciones más visibles. */
.practice-answer-column .grammar-instruction {
  font-size: clamp(1.18rem, 1.8vw, 1.42rem);
  line-height: 1.48;
  font-weight: 850;
  color: #fff2bd;
  padding: 14px 16px;
  border-left: 4px solid var(--gold);
  border-radius: 0 15px 15px 0;
  background: rgba(255, 207, 90, .075);
}
.prompt-with-audio .instruction {
  margin: 0;
  padding: 16px 18px;
  border-left: 4px solid var(--cyan);
  border-radius: 0 16px 16px 0;
  background: rgba(69, 230, 255, .09);
  color: #eafcff;
  font-size: clamp(1.32rem, 2.15vw, 1.72rem) !important;
  line-height: 1.5;
  font-weight: 850;
  letter-spacing: .005em;
}
.choice-chip-bank .drag-chip,
.drop-slot {
  font-size: clamp(1.12rem, 1.65vw, 1.32rem);
  line-height: 1.35;
}
.option-button > span:last-child,
.tf-button,
.text-answer {
  font-size: clamp(1.12rem, 1.7vw, 1.34rem);
}

/* Navegación segura hacia preguntas anteriores: solo revisión, sin duplicar puntos. */
.review-mode-banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(69, 230, 255, .38);
  border-radius: 14px;
  background: rgba(69, 230, 255, .08);
  color: #dffbff;
  font-weight: 850;
  line-height: 1.45;
}
.review-feedback {
  display: grid;
  gap: 8px;
}
.review-feedback > span {
  display: block;
}
.review-answer-audio,
.feedback-answer-audio {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  vertical-align: middle;
}
.practice-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.practice-actions #previousPractice {
  margin-right: auto;
}
.practice-actions #reviewNextPractice {
  margin-left: auto;
}

/* Mapa: la tarjeta se arrastra de verdad y queda alojada en su región. */
.map-drag-help {
  display: grid;
  gap: 3px;
  margin: 0 0 12px;
  padding: 11px 13px;
  border: 1px solid rgba(69, 230, 255, .28);
  border-radius: 14px;
  background: rgba(69, 230, 255, .065);
  color: #e9fbff;
}
.map-drag-help span {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.4;
}
.map-region-zone {
  justify-content: flex-start;
  gap: 5px;
  padding: 7px 6px 6px;
  overflow: hidden;
  touch-action: manipulation;
}
.map-region-heading {
  position: relative;
  z-index: 2;
  width: 100%;
  flex: 0 0 auto;
  padding: 2px 24px 3px 2px;
  text-align: center;
  pointer-events: none;
}
.map-region-heading strong,
.map-region-heading small {
  display: block;
}
.map-region-zone .map-region-score {
  position: absolute;
  z-index: 5;
  right: 5px;
  top: 5px;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 8px;
  background: var(--gold);
  color: #221400;
  font-size: .78rem;
  font-weight: 950;
  text-shadow: none;
}
.map-region-placements {
  position: relative;
  z-index: 3;
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  overflow: auto;
  scrollbar-width: thin;
}
.map-region-zone.has-correct-card {
  border-style: solid;
  border-color: rgba(91, 245, 171, .82);
  background: rgba(7, 61, 55, .64);
}
.map-region-zone.correct-flash {
  box-shadow: 0 0 0 4px rgba(91, 245, 171, .22), 0 0 30px rgba(91, 245, 171, .38);
}
.map-region-zone.incorrect-region {
  border-color: var(--red);
  background: rgba(91, 20, 36, .63);
}
.map-item-card {
  position: relative;
  grid-template-columns: 24px 82px minmax(0,1fr) 42px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.map-item-card .map-drag-grip {
  display: grid;
  place-items: center;
  color: #9beeff;
  font-size: 1.35rem;
  cursor: grab;
}
.map-item-copy {
  min-width: 0;
}
.map-item-copy strong,
.map-item-copy small {
  overflow-wrap: anywhere;
}
.map-card-check {
  display: none;
}
.map-item-card.is-pointer-dragging {
  opacity: .28;
}
.map-drag-ghost {
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: min(310px, 72vw);
  display: grid;
  grid-template-columns: 54px minmax(0,1fr);
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 2px solid var(--cyan);
  border-radius: 15px;
  background: #0b263c;
  color: #fff;
  box-shadow: 0 18px 45px rgba(0,0,0,.55), 0 0 24px rgba(69,230,255,.28);
  pointer-events: none;
  opacity: .94;
  transform: translate3d(-200vw,-200vh,0);
}
.map-drag-ghost img {
  width: 54px;
  height: 48px;
  border-radius: 9px;
  object-fit: cover;
}
.map-drag-ghost .map-drag-grip,
.map-drag-ghost .speak-mini,
.map-drag-ghost .map-card-check,
.map-drag-ghost small {
  display: none;
}
.map-region-zone .map-item-card.placed-on-map {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) 20px;
  gap: 5px;
  padding: 4px 5px;
  border: 1px solid rgba(177,255,222,.76);
  border-radius: 10px;
  background: linear-gradient(145deg,rgba(43,132,105,.94),rgba(5,45,48,.94));
  color: #fff;
  cursor: default;
  opacity: 1;
  transform: none;
  box-shadow: 0 4px 10px rgba(0,0,0,.34);
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
  pointer-events: none;
}
.map-region-zone .map-item-card.placed-on-map img {
  width: 34px;
  height: 30px;
  border-radius: 7px;
}
.map-region-zone .map-item-card.placed-on-map .map-item-copy strong {
  font-size: clamp(.58rem, .92vw, .76rem);
  line-height: 1.1;
}
.map-region-zone .map-item-card.placed-on-map .map-item-copy small,
.map-region-zone .map-item-card.placed-on-map .map-drag-grip,
.map-region-zone .map-item-card.placed-on-map .speak-mini {
  display: none;
}
.map-region-zone .map-item-card.placed-on-map .map-card-check {
  position: static;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #91ffd0;
  color: #053226;
  font-size: .78rem;
  font-weight: 950;
  text-shadow: none;
}

/* El nombre visible ya no evoca el ahorcamiento. */
.hangman-game .game-clue > span::before {
  content: "✎";
}
.hangman-game .game-clue > span {
  font-size: 0;
}
.hangman-game .game-clue > span::before {
  font-size: 2rem;
}

@media (max-width: 980px) {
  .map-item-card {
    grid-template-columns: 22px 70px minmax(0,1fr) 42px;
  }
  .map-item-card img {
    width: 70px;
    height: 60px;
  }
}
@media (max-width: 650px) {
  .practice-answer-column .grammar-instruction {
    font-size: 1.12rem;
  }
  .prompt-with-audio {
    align-items: center;
  }
  .prompt-with-audio .instruction {
    font-size: 1.24rem !important;
  }
  .practice-actions > .button {
    flex: 1 1 145px;
  }
  .interactive-map {
    min-height: 540px;
  }
  .map-region-heading strong {
    font-size: .69rem;
  }
  .map-region-zone .map-item-card.placed-on-map .map-item-copy strong {
    font-size: .58rem;
  }
}

/* RC21 · el mapa no fuerza una anchura mayor que la pantalla móvil. */
@media (max-width: 650px) {
  .interactive-map-card,
  .map-item-bank {
    min-width: 0;
    padding: 14px;
  }
  .interactive-map {
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: auto;
    aspect-ratio: 3 / 4;
  }
  .map-scorebar,
  .map-drag-help,
  .map-items {
    min-width: 0;
  }
}


/* RC21: PDF-derived exercises are native interface components. */
.practice-context-card.native-context{padding:20px;border:1px solid rgba(67,232,255,.28);background:linear-gradient(180deg,rgba(13,43,67,.97),rgba(8,28,48,.97));}
.native-context-image{margin:0;display:flex;justify-content:center;border-radius:20px;overflow:hidden;background:rgba(4,19,34,.72);border:1px solid rgba(154,190,218,.25);}
.native-context-image img{display:block;width:min(100%,760px);max-height:620px;object-fit:contain;background:#0b2034;}
.native-source-text{max-height:440px;overflow:auto;padding:18px 20px;border-radius:18px;background:rgba(4,19,34,.78);border:1px solid rgba(154,190,218,.22);font-size:clamp(1.05rem,1.4vw,1.24rem);line-height:1.72;scrollbar-gutter:stable;}
.native-source-text p{margin:0 0 1em;}
.native-source-text p:last-child{margin-bottom:0;}
.native-gap{display:inline-flex;min-width:2.15em;justify-content:center;padding:.05em .45em;margin:0 .16em;border-radius:.5em;background:#ffe36e;color:#172238;font-weight:950;box-shadow:0 0 0 2px rgba(255,227,110,.24);}
.original-source-reference{margin-top:14px;padding:12px 14px;border-radius:14px;background:rgba(255,255,255,.035);border:1px dashed rgba(154,190,218,.25);}
.original-source-reference summary{cursor:pointer;font-weight:850;color:#b9d1e3;}
.original-source-links{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0;}
.original-source-reference p{margin:6px 0 0;color:#9fb7c8;font-size:.92rem;}
.question-visual:not(.has-image){background:radial-gradient(circle at 50% 32%,rgba(67,232,255,.12),transparent 34%),linear-gradient(150deg,#102a43,#07192c);min-height:330px;}
.question-visual:not(.has-image) .question-visual-overlay{background:none;}
.image-option-audio-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;}
.image-option-button img{width:100%;aspect-ratio:4/3;object-fit:cover;background:#07192c;}
.image-option-button{height:100%;}
.image-option-button>span:last-child{font-size:clamp(.95rem,1.2vw,1.08rem);line-height:1.25;}
@media(max-width:720px){.native-source-text{max-height:360px;padding:15px;font-size:1.08rem}.image-option-grid{grid-template-columns:1fr}.practice-context-card.native-context{padding:14px}}


/* RC22 — visual context and reliable audio affordance */
.question-visual.has-image .question-bg{opacity:1;object-position:center center;}
.question-visual.has-image::after{background:linear-gradient(180deg,rgba(1,7,14,.02) 0%,rgba(2,13,24,.28) 48%,rgba(2,10,19,.92) 100%);}
.question-visual.has-image .question-visual-overlay{min-height:100%;display:flex;flex-direction:column;justify-content:flex-end;}
.speak-mini[data-matrix-speak-ready="1"]{position:relative;}
.speak-mini[data-matrix-speak-ready="1"]::after{content:"";position:absolute;inset:-4px;border:1px solid transparent;border-radius:16px;}
.speak-mini.is-speaking{animation:matrix-audio-pulse .9s ease-in-out infinite alternate;}
@keyframes matrix-audio-pulse{from{filter:brightness(1)}to{filter:brightness(1.28) drop-shadow(0 0 8px rgba(102,240,255,.7))}}
@media(max-width:720px){.question-visual.has-image{min-height:330px}.question-visual.has-image .question-bg{object-position:center}.speak-mini{width:48px;min-width:48px;height:48px}}

/* RC25 · Auditoría pedagógica intensiva */
.wordsearch-clues{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:4px 0 12px}
.wordsearch-clues>div{display:grid;grid-template-columns:32px 1fr auto;align-items:center;gap:8px;padding:9px 10px;border:1px solid rgba(116,216,240,.25);border-radius:12px;background:rgba(255,255,255,.035)}
.wordsearch-clues>div>span{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:rgba(69,230,255,.16);color:var(--cyan);font-weight:950}
.wordsearch-clues p{margin:0;color:#d8eff7;font-size:.96rem;line-height:1.3}
.wordsearch-clues strong{color:#a9bdcc;font-size:.76rem;white-space:nowrap}
.wordsearch-clues>div.found{border-color:var(--green);background:rgba(91,245,171,.1)}
.wordsearch-clues>div.found strong{color:var(--green)}
.wordsearch-grid button.found{color:#052116;border-color:var(--green);background:linear-gradient(180deg,#a9ffd2,#52e59d);box-shadow:0 0 0 2px rgba(91,245,171,.14)}
.wordsearch-footer>div{display:grid;gap:3px}.wordsearch-footer span{color:#c8dbe7;font-size:.9rem}
.retry-feedback{display:grid;gap:8px}.retry-hint{display:block;padding-top:4px;line-height:1.45}
.practice-answer-column .grammar-instruction{font-size:clamp(1.18rem,1.6vw,1.55rem);line-height:1.35}
.prompt-with-audio .instruction{font-size:clamp(1.25rem,1.8vw,1.65rem);line-height:1.4}
.question-title-audio h2{font-size:clamp(1.75rem,3vw,3rem)}
@media (max-width:720px){
  .wordsearch-clues{grid-template-columns:1fr}
  .wordsearch-clues>div{grid-template-columns:30px 1fr}
  .wordsearch-clues strong{grid-column:2}
  .wordsearch-grid{gap:2px;padding:5px}
  .wordsearch-grid button{font-size:clamp(.68rem,3.2vw,.92rem);border-radius:5px}
}

/* RC25: po odpowiedzi fałszywe zdanie nie pozostaje utrwalone jako model. */
.question-title-audio h2.corrected-statement {
  color: #dfffee;
  text-shadow: 0 2px 16px rgba(62, 238, 176, .28);
}

/* ======================================================================
   MATRIX RC26 · PHONE EQUIVALENCE LAYER
   Mobile-first interaction without removing desktop functionality.
   ====================================================================== */
:root{
  --mobile-dock-height:72px;
  --mobile-safe-bottom:max(10px,env(safe-area-inset-bottom));
}
.mobile-question-summary,.mobile-question-tools{display:none}
.mobile-menu-dialog{width:min(94vw,520px);padding:0;border:0;background:transparent}
.mobile-menu-dialog::backdrop{background:rgba(0,5,12,.76);backdrop-filter:blur(8px)}
.mobile-menu-card{padding:18px;border:1px solid var(--line-strong);border-radius:24px;background:linear-gradient(150deg,#132d49,#071525 62%,#24122d);box-shadow:0 28px 90px rgba(0,0,0,.68)}
.mobile-menu-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.mobile-menu-route{min-width:0;min-height:112px;padding:14px;display:grid;grid-template-columns:42px minmax(0,1fr);grid-template-rows:auto auto;align-items:center;gap:3px 10px;text-align:left;border:1px solid var(--line-strong);border-radius:17px;background:linear-gradient(145deg,rgba(255,255,255,.13),rgba(255,255,255,.025));box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 9px 22px rgba(0,0,0,.25);cursor:pointer}
.mobile-menu-route>span{grid-row:1/3;width:42px;height:42px;display:grid;place-items:center;border-radius:13px;background:linear-gradient(180deg,#92f5ff,#1ab3cc);color:#05151d;font-weight:950}
.mobile-menu-route strong{font-size:1rem}.mobile-menu-route small{color:var(--muted);line-height:1.25}

@media (max-width:820px){
  html{scroll-padding-bottom:calc(var(--mobile-dock-height) + 34px + env(safe-area-inset-bottom))}
  body{-webkit-tap-highlight-color:transparent;overscroll-behavior-y:none}
  main{padding:14px 10px calc(var(--mobile-dock-height) + 112px + env(safe-area-inset-bottom))}
  .topbar{min-height:58px;padding:6px 10px;grid-template-columns:minmax(0,1fr) auto;gap:8px}
  .brand{min-width:0;min-height:46px;gap:8px}.brand-mark{width:38px;height:38px;padding:6px;border-radius:12px}.brand-copy strong{font-size:.84rem;letter-spacing:.035em}.build-chip{font-size:.58rem}.top-actions{gap:6px}.top-actions .icon-button{width:44px;min-width:44px;height:44px}
  .mobile-nav{left:8px;right:8px;bottom:var(--mobile-safe-bottom);min-height:var(--mobile-dock-height);padding:6px;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;border-radius:20px}
  .mobile-nav button{min-width:0;min-height:58px;padding:4px 1px;font-size:.64rem;line-height:1.05;touch-action:manipulation}
  .mobile-nav button span{font-size:.84rem}.mobile-nav button.active{box-shadow:inset 0 1px 0 #fff,0 7px 18px rgba(69,230,255,.24)}
  .site-footer{margin-bottom:10px;padding:16px 12px;flex-direction:column;align-items:flex-start;gap:5px}
  .eyebrow{font-size:.76rem;line-height:1.25;letter-spacing:.11em}
  .hero{padding:24px 16px;border-radius:25px;gap:18px}.hero h1{font-size:clamp(2.65rem,15vw,4.6rem);line-height:.9}.hero p{font-size:1rem;line-height:1.55}.hero-actions{display:grid;grid-template-columns:1fr;gap:10px}.hero-actions .button{width:100%}.hero-orbit{min-height:270px}.globe{width:min(230px,70vw)}
  .page-header:not(.practice-page-header){margin-bottom:18px}.page-header:not(.practice-page-header) h1{font-size:clamp(1.9rem,9vw,3rem);line-height:1.02}.page-header p{line-height:1.5}
  .card{border-radius:20px}.button{min-height:48px;padding-inline:16px}

  /* Practice header becomes a compact toolbar instead of consuming a screen. */
  .practice-page{min-width:0}
  .practice-page-header{position:sticky;top:58px;z-index:32;margin:0 0 9px;padding:8px 9px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;border:1px solid var(--line-strong);border-radius:16px;background:rgba(5,16,29,.94);backdrop-filter:blur(18px);box-shadow:0 10px 25px rgba(0,0,0,.32)}
  .practice-page-header>div{min-width:0}.practice-page-header .eyebrow{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.69rem}.practice-page-header .eyebrow::before{display:none}
  .practice-page-header h1{margin:3px 0 0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:1rem;line-height:1.18;letter-spacing:-.015em}
  .practice-page-header #exitPractice{min-height:44px;padding:0 12px;font-size:.82rem}
  .practice-card{padding:10px;border-radius:19px}.practice-head{align-items:center;gap:8px}.question-counter{font-size:.86rem}.score-badge{min-height:44px;padding:8px 11px;font-size:.82rem}.progress-block{margin:9px 0 11px}.progress-label{font-size:.78rem}
  .practice-workspace{margin-top:8px;gap:10px}.practice-workspace .question-visual{min-height:230px;max-height:52vh;border-radius:18px}.question-visual-overlay{padding:12px}.practice-visual-tags{gap:5px}.practice-visual-tags .tag{font-size:.64rem;padding:4px 7px}.visual-symbol{font-size:2rem}
  .desktop-question-prompt{display:none!important}.question-visual .translation-button{display:none}
  .practice-answer-column{padding:11px;overflow:visible;border-radius:18px}
  .mobile-question-summary{display:grid;gap:9px;margin-bottom:11px;padding:11px;border:1px solid rgba(69,230,255,.3);border-radius:15px;background:linear-gradient(145deg,rgba(69,230,255,.1),rgba(255,255,255,.025))}
  .mobile-question-title{display:grid;grid-template-columns:minmax(0,1fr) 48px;align-items:center;gap:8px}.mobile-question-title h2{margin:0;font-size:clamp(1.18rem,5.7vw,1.55rem);line-height:1.3;overflow-wrap:anywhere}.mobile-question-title .speak-mini{width:48px;min-width:48px;height:48px}
  .mobile-question-tools{display:flex;flex-wrap:wrap;gap:7px}.mobile-question-tools .button{display:inline-flex;flex:1 1 125px;min-height:44px;padding:0 10px;font-size:.78rem}
  .practice-workspace.mobile-visual-collapsed .practice-visual-column{display:none}.practice-workspace.mobile-visual-collapsed{grid-template-columns:1fr}
  .practice-answer-column .grammar-instruction{margin:0 0 10px;padding:11px 12px;font-size:1.05rem;line-height:1.4}
  .prompt-with-audio .instruction{font-size:1.12rem!important;line-height:1.4}
  .option-button,.tf-button,.match-item{min-height:58px}.option-audio-row{align-items:stretch}.option-audio-row>.speak-mini{align-self:center;width:48px;min-width:48px;height:48px}.option-button>span:last-child,.tf-button,.text-answer{font-size:1.05rem}
  .practice-actions{position:sticky;z-index:28;bottom:calc(var(--mobile-dock-height) + var(--mobile-safe-bottom) + 5px);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:14px -4px -4px;padding:8px 4px 4px;background:linear-gradient(180deg,rgba(7,21,37,0),rgba(7,21,37,.96) 24%);backdrop-filter:blur(10px)}
  .practice-actions>.button{width:100%;min-width:0;min-height:50px;padding:0 8px;font-size:.83rem;white-space:normal;line-height:1.16}.practice-actions>.button:last-child:nth-child(odd){grid-column:1/-1}
  .feedback{font-size:.98rem;line-height:1.48}.feedback-answer-audio,.review-answer-audio{display:inline-flex;vertical-align:middle}
  .question-translation{font-size:1rem;line-height:1.45}

  /* Matching: two clearly labelled, independently scrollable rows. */
  .match-board{display:block;overflow:visible}.match-lines{display:none}.match-column{display:flex;gap:9px;overflow-x:auto;scroll-snap-type:x mandatory;padding:42px 2px 8px;position:relative;scrollbar-width:thin;overscroll-behavior-inline:contain}.match-column+ .match-column{margin-top:8px}
  .match-column::before{position:absolute;left:2px;top:7px;color:#fff2bd;font-weight:900;font-size:.86rem}.match-column:first-of-type::before{content:'1. Wybierz kartę'}.match-column:last-of-type::before{content:'2. Wybierz pasującą odpowiedź'}
  .match-node-row,.match-node-row-right{flex:0 0 min(82vw,310px);grid-template-columns:48px minmax(0,1fr);scroll-snap-align:start}.match-item{min-height:64px}.match-hook-right,.match-hook-left{left:8px;right:auto}.match-left-item,.match-right-item{padding-inline:38px 14px}

  /* Ordering remains horizontal and every token has a valid finger target. */
  .order-token,.order-answer-token{min-width:44px;min-height:50px;padding:9px 13px}.order-token-bank,.order-sentence-line{gap:8px;padding:10px}.order-live-preview{font-size:1.05rem}

  /* Letter games: usable targets instead of compressed grids. */
  .hangman-alphabet{grid-template-columns:repeat(5,minmax(44px,1fr));gap:7px}.hangman-alphabet button{min-width:44px;min-height:44px}.hangman-word{font-size:clamp(1.65rem,8vw,2.5rem);letter-spacing:.08em}
  .wordsearch-game{overflow-x:auto;overscroll-behavior-inline:contain;padding-bottom:8px}.wordsearch-grid{width:430px;min-width:430px;margin-inline:0;gap:4px;padding:7px}.wordsearch-grid button{min-width:42px;min-height:42px;font-size:.9rem}.wordsearch-footer,.wordsearch-clues{min-width:min(430px,100%)}

  /* Colombia: bank first; click/tap is the primary phone interaction. */
  .colombia-map-layout{display:flex;flex-direction:column;gap:12px}.map-item-bank{order:-1;padding:13px}.map-item-bank h2{margin:.35em 0}.map-items{display:flex!important;gap:9px;overflow-x:auto;scroll-snap-type:x mandatory;padding:2px 2px 9px;overscroll-behavior-inline:contain}.map-item-card{flex:0 0 min(84vw,330px);scroll-snap-align:center;grid-template-columns:22px 66px minmax(0,1fr) 48px;min-height:82px}.map-item-card img{width:66px;height:60px}.interactive-map-card{padding:12px}.interactive-map{min-height:0!important;height:auto!important;aspect-ratio:3/4;border-radius:18px}.map-drag-help{font-size:.88rem}.map-region-zone{border-radius:12px;padding:4px}.map-region-heading strong{font-size:.65rem}.map-region-heading small{display:none}.map-region-zone .map-region-score{right:2px;top:2px}

  /* Dialogs and PDF material fit the visual viewport. */
  .modal{max-height:calc(100dvh - 18px);max-width:calc(100vw - 14px)}.modal-card{max-height:calc(100dvh - 18px);overflow:auto;padding:16px}.settings-grid{grid-template-columns:1fr}.setting-row{grid-template-columns:minmax(0,1fr) auto;gap:10px}.pdf-viewer{height:calc(100dvh - 190px);min-height:520px}.page-main{padding:8px}.page-thumbs{display:flex;overflow-x:auto;max-height:none}.page-thumbs button{flex:0 0 76px}
  .native-source-text{max-height:46vh}.image-option-grid{grid-template-columns:1fr}.image-option-audio-row{grid-template-columns:minmax(0,1fr) 48px}
  .oral-layout{gap:12px}.oral-recorder-panel,.oral-image-panel{padding:13px}.oral-controls{grid-template-columns:repeat(2,minmax(0,1fr))}.oral-controls .button{min-width:0;padding-inline:7px;font-size:.8rem}.oral-transcript{min-height:150px;font-size:1rem}
}

@media (max-width:360px){
  main{padding-inline:7px}.topbar{padding-inline:7px}.brand-copy strong{font-size:.76rem;letter-spacing:.02em}.build-chip{display:none}.mobile-nav{left:4px;right:4px;padding:4px}.mobile-nav button{font-size:.58rem}.practice-card{padding:7px}.practice-answer-column{padding:9px}.practice-page-header h1{font-size:.93rem}.practice-actions>.button{font-size:.76rem}.mobile-menu-grid{grid-template-columns:1fr}.mobile-menu-route{min-height:86px}
}

/* Phone landscape: retain simultaneous question/answer visibility. */
@media (orientation:landscape) and (max-width:950px) and (max-height:600px){
  :root{--mobile-dock-height:54px}.topbar{position:sticky;min-height:50px}.brand-mark{width:34px;height:34px}.top-actions .icon-button{width:40px;min-width:40px;height:40px}.mobile-nav{min-height:52px;padding:3px}.mobile-nav button{min-height:44px;grid-template-columns:auto auto;display:flex;justify-content:center;gap:5px;font-size:.6rem}.mobile-nav button span{font-size:.72rem}
  main{padding-top:7px;padding-bottom:calc(78px + env(safe-area-inset-bottom))}.practice-page-header{top:50px;padding:5px 8px}.practice-page-header h1{-webkit-line-clamp:1}.practice-card{padding:7px}.practice-head,.progress-block{margin-block:4px}.practice-workspace{grid-template-columns:minmax(0,.9fr) minmax(330px,1.1fr);gap:8px}.practice-workspace .question-visual{min-height:calc(100dvh - 178px);max-height:none}.practice-answer-column{max-height:calc(100dvh - 178px);overflow:auto;padding:9px}.mobile-question-summary{display:none}.desktop-question-prompt{display:flex!important}.desktop-question-prompt h2{font-size:clamp(1.05rem,3vw,1.45rem)!important}.question-visual .translation-button{display:inline-flex}.practice-actions{bottom:0;position:sticky}.match-node-row,.match-node-row-right{flex-basis:240px}.wordsearch-grid{width:410px;min-width:410px}.oral-layout{grid-template-columns:minmax(260px,.9fr) minmax(330px,1.1fr)}.oral-image-panel{position:sticky;top:52px}.oral-controls{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media (prefers-reduced-motion:reduce){.mobile-nav,.practice-page-header{transition:none}}

/* RC26 post-audit refinements */
@media (max-width:820px){
  .practice-page-header .eyebrow{font-size:.75rem}
  .practice-visual-tags .tag{font-size:.75rem}
  .practice-answer-column{padding-bottom:calc(var(--mobile-dock-height) + 118px + env(safe-area-inset-bottom))}
  .wordsearch-game{overflow:visible}
  .wordsearch-grid{width:100%;min-width:0;grid-template-columns:repeat(var(--wordsearch-size),44px);justify-content:start;overflow-x:auto;overscroll-behavior-inline:contain}
  .wordsearch-grid button{min-width:44px;min-height:44px}
  .wordsearch-footer,.wordsearch-clues{min-width:0;width:100%}
}
@media (orientation:landscape) and (max-width:950px) and (max-height:600px){.top-actions .icon-button{width:44px;min-width:44px;height:44px}}
@media (max-width:820px) and (orientation:portrait){
  .practice-actions{position:static;display:grid;margin:14px 0 0;padding:8px 0 0;background:none;backdrop-filter:none}
}

@media (max-width: 820px) {
  .interactive-map { scroll-margin-top: calc(var(--app-header-height, 72px) + 12px); }
}

/* RC26 map containment after multi-viewport audit. */
@media (max-width:820px){
  .colombia-map-layout,.map-item-bank,.interactive-map-card{width:100%;max-width:100%;min-width:0}
  .map-item-bank{overflow:hidden}
  .map-items{width:100%;max-width:100%;min-width:0}
  .map-mode-tabs button{min-height:44px}
}

/* RC26 focused phone practice: the global dock yields to the exercise controls. */
@media (max-width:820px){
  body.practice-active .mobile-nav{display:none}
  body.practice-active main{padding-bottom:calc(28px + env(safe-area-inset-bottom))}
  body.practice-active .practice-answer-column{padding-bottom:18px}
}

/* RC26 long-answer containment: demonyms and compounds must wrap beside audio. */
@media (max-width:820px){
  .option-audio-row{width:100%;max-width:100%;min-width:0}
  .option-audio-row>.option-button,.option-audio-row>.tf-button,.option-audio-row>.match-item{min-width:0;max-width:100%}
  .option-button>span:last-child,.tf-button>span:last-child,.text-answer{min-width:0;overflow-wrap:anywhere;word-break:normal}
  .option-audio-row>.speak-mini{flex:0 0 48px}
}

/* RC26 settings touch targets. */
@media (max-width:820px){
  .setting-row input[type=checkbox]{width:48px;min-width:48px;height:44px;flex:0 0 48px}
}


/* RC32 — Ratón Tutor animado, bidireccional y global */
.culture-image-option .image-option-caption{font-weight:800}
.mouse-tutor{position:fixed;right:18px;bottom:18px;z-index:390;width:122px;display:grid;justify-items:end;filter:drop-shadow(0 12px 28px rgba(0,0,0,.55));touch-action:none;contain:layout style}
.mouse-tutor-button{width:108px;height:132px;padding:0;border:0;background:transparent;cursor:grab;display:grid;place-items:end center;transition:transform .18s ease,filter .18s ease;overflow:visible}
.mouse-tutor-button:active{cursor:grabbing}.mouse-tutor-button:hover,.mouse-tutor.translator-active .mouse-tutor-button{transform:translateY(-4px) scale(1.04);filter:drop-shadow(0 0 15px rgba(255,202,61,.55))}
.mouse-tutor-animation,.mouse-tutor-poster{grid-area:1/1;width:100%;height:100%;object-fit:contain;pointer-events:none;user-select:none;-webkit-user-drag:none}
.mouse-tutor-bubble{position:absolute;bottom:108px;width:min(330px,calc(100vw - 138px));padding:15px 40px 15px 16px;border:1px solid rgba(89,224,255,.55);border-radius:18px;background:linear-gradient(145deg,rgba(8,31,53,.98),rgba(15,54,76,.98));box-shadow:0 16px 40px rgba(0,0,0,.45);color:#eefaff;opacity:0;transform:translateY(8px) scale(.96);pointer-events:none;transition:.18s ease}
.mouse-tutor.bubble-to-left .mouse-tutor-bubble{right:92px;left:auto}.mouse-tutor.bubble-to-right .mouse-tutor-bubble{left:92px;right:auto}
.mouse-tutor-bubble.visible,.mouse-tutor.translator-active .mouse-tutor-bubble{opacity:1;transform:none;pointer-events:auto}
.mouse-tutor-bubble>strong{display:block;color:#fff0a9;font-size:1.02rem;margin-bottom:4px}.mouse-tutor-bubble>span{font-size:.9rem;color:#b9d0df;line-height:1.35}
#mouseTutorClose{position:absolute;right:8px;top:7px;width:32px;height:32px;border:0;border-radius:50%;background:rgba(255,255,255,.08);color:white;font-size:20px;cursor:pointer}
.mouse-tutor-result{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1.2fr) auto;gap:7px;align-items:center;margin-top:11px;padding-top:10px;border-top:1px solid rgba(89,224,255,.25)}
.mouse-tutor-result b{color:#6cecff;overflow-wrap:anywhere}.mouse-tutor-result strong{color:#fff;overflow-wrap:anywhere}.mouse-tutor-speak{width:40px;height:40px;border:1px solid #55e5ff;border-radius:12px;background:#0ca5c4;color:white}
@media(max-width:700px){.mouse-tutor{right:4px;bottom:calc(74px + env(safe-area-inset-bottom));width:92px}.practice-active .mouse-tutor{bottom:8px}.mouse-tutor-button{width:82px;height:102px}.mouse-tutor-bubble{bottom:84px;width:min(286px,calc(100vw - 98px));font-size:.92rem}.mouse-tutor.bubble-to-left .mouse-tutor-bubble{right:68px}.mouse-tutor.bubble-to-right .mouse-tutor-bubble{left:68px}.mouse-tutor-result{grid-template-columns:minmax(0,1fr) auto minmax(0,1.15fr) auto}.mouse-tutor.translator-active .mouse-tutor-button{animation:mouseTutorPulse 1.1s ease-in-out infinite}}
@keyframes mouseTutorPulse{50%{transform:translateY(-5px) scale(1.08)}}
.no-motion .mouse-tutor-animation{content:url('assets/assistant/video/raton_tutor_animado_poster_rc33.png')}
.no-motion .mouse-tutor *{animation:none!important;transition:none!important}
@media(prefers-reduced-motion:reduce){.mouse-tutor-animation{content:url('assets/assistant/video/raton_tutor_animado_poster_rc33.png')}}

/* RC32: prevent the static poster from being displayed together with the animation. */
.mouse-tutor-poster[hidden]{display:none!important}.mouse-tutor-animation[hidden]{display:none!important}

/* RC32 Ratón/Mysz Tutor: clear direction and robust mobile layout */
.mouse-direction-controls{display:flex;gap:.35rem;flex-wrap:wrap;margin:.55rem 0 .35rem}.mouse-direction-controls button{min-height:36px;padding:.35rem .6rem;border:1px solid rgba(78,226,255,.35);border-radius:10px;background:#102a40;color:#dcecff;font-weight:800}.mouse-direction-controls button.active{background:linear-gradient(180deg,#42e8ff,#0799bc);color:#031421;border-color:#9ef5ff}.mouse-tutor-direction{font-size:.82rem;color:#8fe9ff;border-top:1px solid rgba(143,233,255,.25);padding-top:.42rem}.mouse-tutor-result b,.mouse-tutor-result strong{overflow-wrap:anywhere;word-break:normal;hyphens:auto}.mouse-tutor-audio-status{min-height:1.1rem;font-size:.78rem;color:#ffe88a;margin-top:.25rem}.mouse-tutor-bubble{max-width:min(370px,calc(100vw - 24px))}@media(max-width:480px){.mouse-tutor-bubble{font-size:.92rem}.mouse-direction-controls button{font-size:.72rem;min-height:34px}.mouse-tutor-result{grid-template-columns:minmax(0,1fr) auto minmax(0,1.25fr) auto}}
/* RC32: Ratón Tutor — palabra, expresión y oración */
.mouse-tutor-toolbar{display:flex;justify-content:flex-end;margin:.45rem 0 .25rem}
.mouse-greeting-replay{min-height:36px;padding:.35rem .7rem;border:1px solid rgba(255,224,105,.55);border-radius:10px;background:linear-gradient(180deg,#594816,#2f260d);color:#fff2a6;font-weight:900;cursor:pointer}
.mouse-scope-controls{display:flex;gap:.32rem;flex-wrap:wrap;margin:.35rem 0 .45rem}
.mouse-scope-controls button{min-height:36px;padding:.34rem .55rem;border:1px solid rgba(158,245,255,.32);border-radius:10px;background:#102a40;color:#dcecff;font-weight:850;font-size:.76rem}
.mouse-scope-controls button.active{background:linear-gradient(180deg,#8df3ff,#20b8d5);color:#031421;border-color:#d7fbff}
.mouse-tutor-result b,.mouse-tutor-result strong{max-height:7rem;overflow:auto;line-height:1.25}
@media(max-width:480px){.mouse-scope-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.mouse-scope-controls button{font-size:.69rem;padding:.32rem .4rem}.mouse-greeting-replay{font-size:.76rem}}
/* RC32 mobile practice docking: keep the assistant visible without covering answers. */
@media(max-width:700px){
  .practice-active .mouse-tutor:not(.translator-active){left:auto!important;top:auto!important;right:4px!important;bottom:118px!important;width:68px!important}
  .practice-active .mouse-tutor:not(.translator-active) .mouse-tutor-button{width:62px!important;height:78px!important;opacity:.92}
  .practice-active .mouse-tutor.translator-active{left:auto!important;top:auto!important;right:4px!important;bottom:92px!important;width:86px!important}
  .practice-active .mouse-tutor.translator-active .mouse-tutor-button{width:78px!important;height:98px!important}
}

.mouse-tutor-speak[hidden]{display:none!important}
.mouse-tutor-button{will-change:transform;contain:paint}
.mouse-tutor-bubble{transition-duration:.12s}


/* RC34 — full-body Ratón Tutor and persistent translation session. */
.mouse-tutor{
  overflow:visible!important;
  contain:layout style!important;
  width:132px;
}
.mouse-tutor-button{
  width:120px;
  height:171px;
  aspect-ratio:132/177;
  overflow:visible!important;
  contain:layout style!important;
  place-items:center!important;
  isolation:isolate;
}
.mouse-tutor-animation,.mouse-tutor-poster{
  width:100%!important;
  height:100%!important;
  object-fit:contain!important;
  object-position:center bottom!important;
  overflow:visible!important;
  clip-path:none!important;
  transform:none;
}
.mouse-tutor-bubble{bottom:154px}
@media(max-width:700px){
  .mouse-tutor{width:106px}
  .mouse-tutor-button{width:98px;height:140px}
  .mouse-tutor-bubble{bottom:126px}
  .mouse-tutor.bubble-to-left .mouse-tutor-bubble{right:82px}
  .mouse-tutor.bubble-to-right .mouse-tutor-bubble{left:82px}
}
@media(max-width:480px){
  .mouse-tutor{width:98px}
  .mouse-tutor-button{width:90px;height:129px}
  .mouse-tutor-bubble{bottom:116px}
  .mouse-tutor.bubble-to-left .mouse-tutor-bubble{right:88px}
  .mouse-tutor.bubble-to-right .mouse-tutor-bubble{left:88px}
}
@media(max-width:700px){
  .practice-active .mouse-tutor:not(.translator-active){
    left:auto!important;top:auto!important;right:6px!important;bottom:112px!important;width:82px!important;
  }
  .practice-active .mouse-tutor:not(.translator-active) .mouse-tutor-button{
    width:76px!important;height:109px!important;opacity:.96!important;overflow:visible!important;contain:layout style!important;
  }
  .practice-active .mouse-tutor.translator-active{
    left:auto!important;top:auto!important;right:6px!important;bottom:92px!important;width:100px!important;
  }
  .practice-active .mouse-tutor.translator-active .mouse-tutor-button{
    width:92px!important;height:132px!important;overflow:visible!important;contain:layout style!important;
  }
}

/* ======================================================================
   MATRIX RC34.2 · MOBILE MANEUVERABILITY AUDIT
   Compact Ratón Tutor dock, unobstructed dialogs and phone-safe controls.
   ====================================================================== */
.mouse-tutor[hidden]{display:none!important}

@media (max-width:820px), (orientation:landscape) and (max-width:950px) and (max-height:600px){
  /* The assistant remains present on every screen but occupies a top-bar
     control instead of covering exercises, cards or the bottom navigator. */
  .mouse-tutor,
  .practice-active .mouse-tutor,
  .practice-active .mouse-tutor:not(.translator-active),
  .practice-active .mouse-tutor.translator-active{
    position:fixed!important;
    left:auto!important;
    right:62px!important;
    top:7px!important;
    bottom:auto!important;
    width:48px!important;
    height:48px!important;
    z-index:390!important;
    display:grid!important;
    place-items:center!important;
    filter:none!important;
    overflow:visible!important;
    touch-action:manipulation!important;
  }
  .mouse-tutor-button,
  .practice-active .mouse-tutor:not(.translator-active) .mouse-tutor-button,
  .practice-active .mouse-tutor.translator-active .mouse-tutor-button{
    width:48px!important;
    height:48px!important;
    min-width:48px!important;
    min-height:48px!important;
    padding:2px!important;
    place-items:center!important;
    overflow:hidden!important;
    contain:paint!important;
    cursor:pointer!important;
    border:1px solid rgba(150,243,255,.55)!important;
    border-radius:14px!important;
    background:linear-gradient(145deg,rgba(34,89,115,.98),rgba(6,25,40,.98))!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.32),0 7px 18px rgba(0,0,0,.35)!important;
    opacity:1!important;
    transform:none!important;
  }
  .mouse-tutor-button:hover,
  .mouse-tutor.translator-active .mouse-tutor-button{
    transform:none!important;
    filter:drop-shadow(0 0 8px rgba(255,212,75,.65))!important;
  }
  .mouse-tutor-animation,.mouse-tutor-poster{
    width:44px!important;
    height:44px!important;
    object-fit:contain!important;
    object-position:center!important;
  }

  /* When activated, the dictionary becomes a readable drawer under the
     header. It may overlay content only while the learner explicitly uses it. */
  .mouse-tutor-bubble,
  .mouse-tutor.bubble-to-left .mouse-tutor-bubble,
  .mouse-tutor.bubble-to-right .mouse-tutor-bubble{
    position:fixed!important;
    left:8px!important;
    right:8px!important;
    top:64px!important;
    bottom:auto!important;
    width:auto!important;
    max-width:none!important;
    max-height:calc(100dvh - 76px)!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
    padding:16px 16px 18px!important;
    border-radius:18px!important;
    transform:translateY(-8px) scale(.985)!important;
    transform-origin:top center!important;
  }
  .mouse-tutor-bubble.visible,
  .mouse-tutor.translator-active .mouse-tutor-bubble{
    transform:none!important;
  }
  #mouseTutorClose{
    width:44px!important;
    height:44px!important;
    min-width:44px!important;
    min-height:44px!important;
    right:7px!important;
    top:7px!important;
  }
  .mouse-tutor-bubble>strong{padding-right:48px;font-size:1.05rem}
  .mouse-tutor-bubble>span{display:block;padding-right:4px;font-size:.94rem;line-height:1.45}
  .mouse-tutor-toolbar{justify-content:stretch;margin:.65rem 0 .45rem}
  .mouse-greeting-replay{width:100%;min-height:44px!important;font-size:.84rem!important}
  .mouse-direction-controls{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px!important}
  .mouse-scope-controls{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px!important}
  .mouse-direction-controls button,.mouse-scope-controls button{
    width:100%;min-width:0;min-height:44px!important;padding:7px 5px!important;font-size:.75rem!important;line-height:1.15
  }
  .mouse-tutor-direction{font-size:.82rem;line-height:1.35}
  .mouse-tutor-result{
    grid-template-columns:minmax(0,1fr) 44px!important;
    gap:7px 9px!important;
    align-items:center!important;
    max-height:42dvh!important;
    overflow:auto!important;
  }
  .mouse-tutor-result b{grid-column:1/-1;max-height:none!important;padding-bottom:4px}
  .mouse-tutor-result>span{display:none}
  .mouse-tutor-result strong{grid-column:1;max-height:none!important;line-height:1.4}
  .mouse-tutor-speak{grid-column:2;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important}

  /* No floating assistant inside modal settings/navigation panels. */
  body:has(dialog[open]) .mouse-tutor{display:none!important}
}

@media (max-width:480px){
  /* Settings controls stack instead of being clipped outside the dialog. */
  .setting-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    align-items:stretch!important;
    gap:10px!important;
    padding:13px!important;
  }
  .setting-row span{min-width:0}
  .setting-row select{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    justify-self:stretch!important;
  }
  .setting-row input[type=checkbox]{justify-self:end!important}
  .audio-diagnostic-buttons{display:grid!important;grid-template-columns:1fr!important}
  .audio-diagnostic-buttons .button{width:100%!important}
  .modal-actions{display:grid!important;grid-template-columns:1fr!important}
  .modal-actions .button{width:100%!important}
}
@media (max-width:820px), (orientation:landscape) and (max-width:950px) and (max-height:600px){
  .mouse-tutor,
  .practice-active .mouse-tutor,
  .practice-active .mouse-tutor:not(.translator-active),
  .practice-active .mouse-tutor.translator-active{contain:none!important}
}
@media (orientation:landscape) and (max-width:950px) and (max-height:600px){
  .mouse-tutor,
  .practice-active .mouse-tutor,
  .practice-active .mouse-tutor:not(.translator-active),
  .practice-active .mouse-tutor.translator-active{right:58px!important;top:3px!important;width:44px!important;height:44px!important}
  .mouse-tutor-button,
  .practice-active .mouse-tutor:not(.translator-active) .mouse-tutor-button,
  .practice-active .mouse-tutor.translator-active .mouse-tutor-button{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important}
  .mouse-tutor-animation,.mouse-tutor-poster{width:40px!important;height:40px!important}
  .mouse-tutor-bubble,
  .mouse-tutor.bubble-to-left .mouse-tutor-bubble,
  .mouse-tutor.bubble-to-right .mouse-tutor-bubble{top:52px!important;max-height:calc(100dvh - 58px)!important}
}

/* RC34.2 post-audit: reserve the complete action cluster on tablet and
   landscape layouts, and preserve exact 44 px touch targets in the drawer. */
@media (min-width:521px) and (max-width:820px) and (orientation:portrait){
  .mouse-tutor,
  .practice-active .mouse-tutor,
  .practice-active .mouse-tutor:not(.translator-active),
  .practice-active .mouse-tutor.translator-active{right:114px!important}
}
@media (orientation:landscape) and (max-width:950px) and (max-height:600px){
  .mouse-tutor,
  .practice-active .mouse-tutor,
  .practice-active .mouse-tutor:not(.translator-active),
  .practice-active .mouse-tutor.translator-active{right:112px!important}
}
@media (max-width:820px), (orientation:landscape) and (max-width:950px) and (max-height:600px){
  .mouse-tutor.translator-active.bubble-to-left .mouse-tutor-bubble,
  .mouse-tutor.translator-active.bubble-to-right .mouse-tutor-bubble,
  .mouse-tutor-bubble.visible{transform:none!important}
}
@media (orientation:landscape) and (max-width:950px) and (max-height:600px){
  .mouse-tutor,
  .practice-active .mouse-tutor,
  .practice-active .mouse-tutor:not(.translator-active),
  .practice-active .mouse-tutor.translator-active{right:134px!important}
}


/* ======================================================================
   MATRIX RC34.3 · TOUCH DESKTOP EQUIVALENCE
   On compact touch devices the application keeps the computer composition,
   while the browser remains freely pinch-zoomable. No content or mode is
   removed. Touch exercises receive direct-tap alternatives to dragging.
   ====================================================================== */
html.phone-desktop-equivalent{
  touch-action:pan-x pan-y pinch-zoom;
  -webkit-text-size-adjust:100%;
}
html.phone-desktop-equivalent body{
  min-width:960px;
  overflow-x:auto;
  touch-action:pan-x pan-y pinch-zoom;
}
html.phone-desktop-equivalent .topbar{
  grid-template-columns:minmax(185px,220px) minmax(0,1fr) auto!important;
  gap:10px!important;
  padding:8px 14px!important;
}
html.phone-desktop-equivalent .desktop-nav{
  display:flex!important;
  min-width:0;
  max-width:100%;
  overflow-x:auto;
  overscroll-behavior-inline:contain;
  scrollbar-width:thin;
  scroll-snap-type:x proximity;
}
html.phone-desktop-equivalent .desktop-nav .nav-link{
  flex:0 0 auto;
  scroll-snap-align:start;
}
html.phone-desktop-equivalent .mobile-nav{display:none!important}
html.phone-desktop-equivalent main{
  width:min(1540px,100%);
  padding:24px 28px 86px!important;
}
html.phone-desktop-equivalent .brand-copy small,
html.phone-desktop-equivalent .xp-chip{display:flex!important}
html.phone-desktop-equivalent .practice-workspace{
  grid-template-columns:minmax(0,1.06fr) minmax(390px,.94fr)!important;
  gap:18px!important;
  align-items:start!important;
}
html.phone-desktop-equivalent .practice-answer-column{
  position:sticky!important;
  top:94px!important;
  overflow:visible!important;
}
html.phone-desktop-equivalent .practice-workspace .question-visual{
  min-height:clamp(360px,43vw,590px)!important;
  max-height:none!important;
}
html.phone-desktop-equivalent .mobile-question-summary{display:none!important}
html.phone-desktop-equivalent .desktop-question-prompt{display:flex!important}
html.phone-desktop-equivalent .question-visual .translation-button{display:inline-flex!important}
html.phone-desktop-equivalent .practice-actions{
  position:static!important;
  display:flex!important;
  margin-top:18px!important;
  padding:0!important;
  background:none!important;
  backdrop-filter:none!important;
}
html.phone-desktop-equivalent .gap-workspace{
  grid-template-columns:minmax(0,1fr) minmax(260px,300px)!important;
}
html.phone-desktop-equivalent .gap-answer-dock{
  position:sticky!important;
  top:94px!important;
  max-height:calc(100vh - 120px)!important;
  overflow:auto!important;
  order:initial!important;
}
html.phone-desktop-equivalent .route-layout{
  grid-template-columns:190px minmax(0,1fr)!important;
}
html.phone-desktop-equivalent .route-sidebar{
  position:sticky!important;
  top:98px!important;
  max-height:calc(100vh - 125px)!important;
}
html.phone-desktop-equivalent button,
html.phone-desktop-equivalent .button,
html.phone-desktop-equivalent [role="button"]{
  -webkit-user-select:none;
  user-select:none;
  -webkit-touch-callout:none;
}
html.phone-desktop-equivalent button:not(:disabled),
html.phone-desktop-equivalent .button:not([disabled]),
html.phone-desktop-equivalent [role="button"]{
  cursor:pointer;
  touch-action:manipulation;
}
html.phone-desktop-equivalent .drag-chip[data-chip],
html.phone-desktop-equivalent [data-practice-chip],
html.phone-desktop-equivalent [data-order-token]{
  touch-action:none;
}
html.phone-desktop-equivalent button:not(:disabled):active,
html.phone-desktop-equivalent .button:not([disabled]):active,
html.phone-desktop-equivalent [role="button"]:active{
  transform:translateY(2px) scale(.992)!important;
  filter:brightness(1.12)!important;
}
.drop-slot.selected-target{
  border-style:solid!important;
  border-color:var(--gold)!important;
  color:#fff3b5!important;
  background:linear-gradient(145deg,rgba(255,207,90,.24),rgba(86,49,0,.52))!important;
  box-shadow:0 0 0 4px rgba(255,207,90,.15),inset 0 1px 0 rgba(255,255,255,.35)!important;
  animation:matrixGapTargetPulse .9s ease-in-out infinite alternate;
}
@keyframes matrixGapTargetPulse{
  from{filter:brightness(1)}
  to{filter:brightness(1.22)}
}
.touch-drag-ghost{
  position:fixed!important;
  z-index:1000!important;
  width:min(320px,72vw)!important;
  min-height:54px!important;
  padding:10px 14px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:2px solid var(--gold)!important;
  border-radius:15px!important;
  background:linear-gradient(145deg,#5b4512,#162a3c)!important;
  color:#fff8cf!important;
  box-shadow:0 18px 46px rgba(0,0,0,.58)!important;
  pointer-events:none!important;
  opacity:.96!important;
  transform:translate(-50%,-65%) rotate(-1deg)!important;
}
.touch-drop-target{
  outline:4px solid var(--cyan)!important;
  outline-offset:4px!important;
  filter:brightness(1.18)!important;
}
.touch-dragging,
.touch-dragging *{cursor:grabbing!important}
.drag-chip.touch-ready::after{
  content:'dotknij lub przytrzymaj';
  display:block;
  grid-column:1/-1;
  margin-top:2px;
  color:#cde9f3;
  font-size:.68rem;
  font-weight:700;
  opacity:.78;
}
html.phone-desktop-equivalent .dock-help{
  color:#d9eff8;
  font-size:.9rem;
}
html.phone-desktop-equivalent .drop-slot,
html.phone-desktop-equivalent .drag-chip,
html.phone-desktop-equivalent .option-button,
html.phone-desktop-equivalent .tf-button,
html.phone-desktop-equivalent .match-item{
  min-height:56px;
}
@media (hover:none) and (pointer:coarse){
  .button:hover,.option-button:hover,.tf-button:hover,.match-item:hover,.drag-chip:hover{
    transform:none;
  }
}
@media (prefers-reduced-motion:reduce){
  .drop-slot.selected-target{animation:none}
}

/* RC34.3 touch clarity: preserve PC semantics while making touch targets explicit. */
html.phone-desktop-equivalent .practice-answer-column .option-grid{
  grid-template-columns:1fr!important;
}
html.phone-desktop-equivalent :is(button,a[href],[role="button"]){
  pointer-events:auto;
  position:relative;
}
html.phone-desktop-equivalent :is(button,a[href],[role="button"]):focus-visible{
  outline:4px solid var(--cyan)!important;
  outline-offset:4px!important;
}
html.phone-desktop-equivalent .mouse-tutor :is(button,[role="button"]){
  min-height:44px;
}
html.phone-desktop-equivalent .mouse-tutor-close{
  min-width:44px;
  min-height:44px;
}
html.phone-desktop-equivalent :is(.eyebrow,.score-badge,.build-chip,.xp-chip,.dock-title > span):not(button):not(a){
  cursor:default!important;
  transform:none!important;
}
html.phone-desktop-equivalent .drag-chip.touch-ready{
  border-style:solid;
}
html.phone-desktop-equivalent .drag-chip.touch-ready::before{
  content:'👆';
  flex:0 0 auto;
  margin-right:5px;
  font-size:.85rem;
}
html.phone-desktop-equivalent #mouseTutorClose{
  min-width:44px!important;
  width:44px!important;
  min-height:44px!important;
  height:44px!important;
}
