/* Creado por David Vásquez Velásquez. */

:root {
  --ink: #182a33;
  --muted: #50636d;
  --paper: #f5f8f9;
  --surface: #ffffff;
  --line: #c9d4d9;
  --navy: #173b57;
  --teal: #0b6b67;
  --teal-soft: #dff2ef;
  --amber: #8a4b00;
  --amber-soft: #fff4d6;
  --green: #176b3a;
  --green-soft: #e7f6ec;
  --red: #9b2c2c;
  --red-soft: #fdecec;
  --shadow: 0 22px 60px rgba(23, 59, 87, .12);
  --display: "Manrope", "Segoe UI", sans-serif;
  --body: "DM Sans", "Segoe UI", sans-serif;
  --data: "Roboto Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); color: var(--ink); }
body { min-width: 320px; min-height: 100%; margin: 0; font-family: var(--body); background: var(--paper); }
html.practice-immersive-fallback, html.practice-immersive-fallback body { width: 100%; min-height: 100dvh; overflow: hidden; }
button, a { font: inherit; }
button { border: 0; }
button:focus-visible, a:focus-visible, [role="radio"]:focus-visible { outline: 3px solid #f2b84b; outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 1000; top: 10px; left: 10px; transform: translateY(-160%); padding: .7rem 1rem; color: white; background: var(--navy); border-radius: .5rem; }
.skip-link:focus { transform: none; }

.practice-home { min-height: 100dvh; padding: clamp(1.1rem, 3vw, 2.4rem) clamp(1.1rem, 5vw, 5rem) 1.2rem; background: radial-gradient(circle at 88% 12%, rgba(11, 107, 103, .09), transparent 25rem), linear-gradient(180deg, #f8fafb 0%, var(--paper) 100%); }
.practice-home-header { max-width: 1340px; margin: 0 auto clamp(2.5rem, 6vw, 5.5rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.course-mark { display: inline-flex; gap: .8rem; align-items: center; color: var(--ink); text-decoration: none; }
.course-mark-icon { display: grid; place-items: center; width: 2.65rem; height: 2.65rem; color: white; background: var(--navy); border-radius: .7rem 1.25rem .7rem .7rem; font-size: 1.5rem; }
.course-mark span:last-child { display: grid; line-height: 1.05; }
.course-mark b { font-family: var(--display); font-size: 1.2rem; letter-spacing: .08em; }
.course-mark small { margin-top: .3rem; color: var(--muted); font-size: .74rem; }
.quiet-link { color: var(--navy); font-weight: 700; text-underline-offset: .25em; }

.practice-intro-grid { max-width: 1340px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); gap: clamp(2rem, 6vw, 7rem); align-items: center; }
.kicker { margin: 0 0 .8rem; color: var(--teal); font-family: var(--data); font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.practice-intro h1 { max-width: 760px; margin: 0; font-family: var(--display); font-size: clamp(2.65rem, 6vw, 5.8rem); line-height: .98; letter-spacing: -.055em; }
.practice-intro h1 span { color: var(--teal); }
.intro-copy { max-width: 690px; margin: 1.6rem 0 0; color: var(--muted); font-size: clamp(1.05rem, 1.5vw, 1.28rem); line-height: 1.65; }
.session-blueprint { display: grid; grid-template-columns: repeat(4, minmax(90px, 1fr)); max-width: 720px; margin: 2.2rem 0; border-block: 1px solid var(--line); }
.session-blueprint div { padding: 1.1rem .9rem 1.05rem 0; display: grid; gap: .25rem; }
.session-blueprint div + div { padding-left: 1rem; border-left: 1px solid var(--line); }
.session-blueprint b { font-family: var(--data); color: var(--navy); font-size: 1.3rem; }
.session-blueprint span { color: var(--muted); font-size: .78rem; }
.practice-rules { max-width: 700px; margin: 0; padding: 0; display: grid; gap: .7rem; list-style: none; }
.practice-rules li { position: relative; padding-left: 1.8rem; line-height: 1.5; }
.practice-rules li::before { content: ""; position: absolute; left: .1rem; top: .48rem; width: .65rem; height: .65rem; border: 2px solid var(--teal); border-radius: 50%; box-shadow: inset 0 0 0 2px var(--paper); background: var(--teal); }
.start-actions { margin-top: 2.2rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.start-actions p { color: var(--red); margin: 0; font-size: .9rem; }
.primary-action, .next-action { min-height: 3.25rem; padding: .8rem 1.3rem; border-radius: .8rem; color: white; background: var(--navy); font-weight: 700; cursor: pointer; box-shadow: 0 8px 24px rgba(23, 59, 87, .2); transition: transform .18s ease, background .18s ease; }
.primary-action:hover, .next-action:hover { background: #0f304a; transform: translateY(-1px); }
.primary-action:disabled, .next-action:disabled { cursor: wait; opacity: .58; transform: none; }

.progress-instrument { position: relative; padding: clamp(1.5rem, 3vw, 2.4rem); overflow: hidden; background: var(--surface); border: 1px solid #dce4e8; border-radius: 1.35rem; box-shadow: var(--shadow); }
.progress-instrument::before { content: ""; position: absolute; inset: 0 0 auto; height: .38rem; background: repeating-linear-gradient(90deg, var(--navy) 0 16%, #e4ecef 16% 17%); }
.instrument-heading { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-family: var(--data); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.instrument-heading i { color: var(--teal); font-style: normal; }
.learning-dial { --learning: 0; width: 9.5rem; aspect-ratio: 1; margin: 1.8rem 0 1.3rem; padding: .72rem; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--teal) calc(var(--learning) * 1%), #dfe8eb 0); }
.learning-dial::before { content: ""; grid-area: 1/1; width: 100%; height: 100%; border-radius: inherit; background: white; }
.learning-dial div { position: relative; grid-area: 1/1; }
.learning-dial strong { font: 700 2.4rem/1 var(--display); }
.learning-dial small { color: var(--muted); font: 500 .75rem var(--data); }
.progress-instrument h2 { margin: 0; font: 700 1.45rem/1.2 var(--display); }
.progress-instrument > p { color: var(--muted); line-height: 1.55; }
.statistics-grid { display: grid; grid-template-columns: repeat(2, 1fr); margin: 1.5rem 0; border: 1px solid var(--line); border-radius: .9rem; overflow: hidden; }
.statistics-grid div { padding: .9rem; display: grid; gap: .2rem; }
.statistics-grid div:nth-child(odd) { border-right: 1px solid var(--line); }
.statistics-grid div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.statistics-grid dt { color: var(--muted); font-size: .72rem; }
.statistics-grid dd { margin: 0; font: 700 1.15rem var(--data); }
.topic-bars { display: grid; gap: .65rem; }
.topic-bar { display: grid; grid-template-columns: 6.2rem 1fr 2.5rem; align-items: center; gap: .6rem; font-size: .75rem; }
.topic-bar span:first-child { color: var(--muted); text-transform: capitalize; }
.topic-bar i { height: .45rem; overflow: hidden; background: #e4ebee; border-radius: 99px; }
.topic-bar i::before { content: ""; display: block; width: var(--value); height: 100%; background: var(--teal); border-radius: inherit; }
.topic-bar b { text-align: right; font-family: var(--data); }
.instrument-note { margin-bottom: 0; font-size: .78rem; }

.history-panel { max-width: 1340px; margin: 4rem auto 2rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.history-panel > header { display: flex; justify-content: space-between; align-items: end; gap: 2rem; }
.history-panel h2 { margin: 0; font: 700 clamp(1.5rem, 3vw, 2.2rem) var(--display); }
.history-panel header > p { max-width: 420px; color: var(--muted); }
.history-chart { min-height: 190px; margin-top: 1.5rem; padding: 1.4rem; display: flex; gap: .65rem; align-items: end; border: 1px solid var(--line); border-radius: 1rem; background: white; }
.history-column { min-width: 2.6rem; flex: 1; display: grid; grid-template-rows: 1fr auto auto; gap: .45rem; align-items: end; text-align: center; }
.history-column i { width: min(100%, 3rem); height: calc(var(--score) * 1%); min-height: .25rem; justify-self: center; background: linear-gradient(180deg, #0b6b67, #173b57); border-radius: .35rem .35rem .1rem .1rem; }
.history-column b { font: 600 .76rem var(--data); }
.history-column span { color: var(--muted); font-size: .67rem; }
.practice-author { max-width: 1340px; margin: 3rem auto 0; color: var(--muted); font-size: .75rem; }

.practice-session { position: relative; width: 100vw; min-height: 100dvh; overflow: hidden; padding: 0 max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); background: var(--paper); user-select: none; }
.session-header { min-height: 4.4rem; max-width: 1220px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; border-bottom: 1px solid var(--line); }
.session-identity { display: flex; align-items: baseline; gap: .7rem; }
.session-identity b { color: var(--navy); font: 800 1.15rem var(--display); letter-spacing: .08em; }
.session-identity span, .session-status { color: var(--muted); font-size: .75rem; }
.session-status { display: flex; gap: .55rem; }
.session-status span { padding: .38rem .65rem; border: 1px solid var(--line); border-radius: 99px; background: white; }
.session-exit { justify-self: end; padding: .5rem .7rem; color: var(--muted); background: transparent; text-decoration: underline; text-underline-offset: .2rem; cursor: pointer; }

.sample-rail { max-width: 820px; margin: 1rem auto .6rem; display: grid; grid-template-columns: repeat(6, 1fr); align-items: start; }
.sample-node { position: relative; display: grid; justify-items: center; gap: .3rem; color: var(--muted); font: 500 .65rem var(--data); }
.sample-node:not(:last-child)::after { content: ""; position: absolute; z-index: 0; top: 1.05rem; left: 58%; width: 84%; height: 2px; background: var(--line); }
.sample-vial { position: relative; z-index: 1; width: 1.7rem; height: 2.15rem; overflow: hidden; border: 2px solid #8da1ab; border-top: 5px solid #8da1ab; border-radius: .15rem .15rem .55rem .55rem; background: white; }
.sample-vial::after { content: ""; position: absolute; inset: var(--fill, 100%) 2px 2px; background: var(--teal); border-radius: 0 0 .3rem .3rem; transition: inset .45s ease; }
.sample-node.done .sample-vial { border-color: var(--teal); --fill: 45%; }
.sample-node.current .sample-vial { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(23, 59, 87, .1); --fill: 68%; }
.sample-node.current { color: var(--navy); font-weight: 600; }

.question-stage { max-width: 1100px; min-height: calc(100dvh - 9rem); margin: 0 auto; padding: clamp(1rem, 2.5vh, 2rem) clamp(.2rem, 2vw, 1.4rem) 2rem; display: flex; flex-direction: column; }
.question-meta { display: flex; justify-content: space-between; gap: 1rem; align-items: end; }
.question-meta > div:first-child { display: grid; gap: .2rem; }
.question-meta span { color: var(--teal); font: 600 .69rem var(--data); letter-spacing: .1em; text-transform: uppercase; }
.question-meta b { font: 700 1rem var(--display); }
.timer { display: grid; justify-items: end; gap: .1rem; }
.timer small { color: var(--muted); font-size: .65rem; }
.timer strong { color: var(--navy); font: 600 1.5rem var(--data); }
.timer.warning strong { color: var(--amber); }
.timer.urgent strong { color: var(--red); }
.timer-track { height: .3rem; margin-top: .75rem; overflow: hidden; background: #dfe7ea; border-radius: 99px; }
.timer-track span { display: block; width: 100%; height: 100%; background: var(--teal); transform-origin: left; }
.question-content { width: 100%; margin: clamp(1.2rem, 3vh, 2.5rem) auto 0; }
.question-number { margin: 0 0 .65rem; color: var(--muted); font: 500 .75rem var(--data); }
.question-content h1 { max-width: 950px; margin: 0; font: 700 clamp(1.35rem, 3.1vh, 2.15rem)/1.27 var(--display); letter-spacing: -.02em; }
.answer-grid { margin-top: clamp(1.2rem, 3vh, 2.2rem); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.answer-option { min-height: 4rem; padding: .85rem 1rem; display: grid; grid-template-columns: 2rem 1fr; align-items: center; gap: .75rem; color: var(--ink); text-align: left; line-height: 1.35; border: 1px solid #bcc9cf; border-radius: .8rem; background: white; cursor: pointer; transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease; }
.answer-option:hover:not(:disabled) { border-color: var(--teal); box-shadow: 0 5px 16px rgba(11, 107, 103, .09); transform: translateY(-1px); }
.answer-option em { display: grid; place-items: center; width: 2rem; height: 2rem; color: var(--navy); font: 600 .77rem var(--data); font-style: normal; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); }
.answer-option.selected { border-width: 2px; border-color: var(--navy); background: #f1f6f8; }
.answer-option.correct { border-color: var(--green); background: var(--green-soft); }
.answer-option.incorrect { border-color: var(--red); background: var(--red-soft); }
.answer-option:disabled { cursor: default; color: #3d5059; }

.feedback-panel { margin-top: 1rem; padding: 1rem 1.1rem; display: grid; grid-template-columns: 2.5rem 1fr; gap: .9rem; border: 1px solid var(--line); border-radius: .9rem; background: white; }
.feedback-panel.correct { border-color: #8fc5a4; background: var(--green-soft); }
.feedback-panel.incorrect { border-color: #e0abab; background: var(--red-soft); }
.feedback-mark { display: grid; place-items: center; width: 2.35rem; height: 2.35rem; color: white; border-radius: 50%; background: var(--green); font-weight: 800; }
.feedback-panel.incorrect .feedback-mark { background: var(--red); }
.feedback-result { margin: 0; color: var(--muted); font: 600 .7rem var(--data); text-transform: uppercase; letter-spacing: .08em; }
.feedback-panel h2 { margin: .25rem 0; font: 700 1rem/1.3 var(--display); }
.feedback-panel p { margin: .4rem 0 0; line-height: 1.45; }
.selected-feedback { color: var(--muted); font-size: .88rem; }
.question-actions { margin-top: auto; padding-top: 1rem; display: flex; justify-content: flex-end; }
.next-action { min-width: 13rem; background: var(--teal); }
.session-watermark { position: fixed; z-index: 0; right: 1rem; bottom: .2rem; margin: 0; color: rgba(24, 42, 51, .12); font: 500 .62rem var(--data); pointer-events: none; }

.protection-cover { position: fixed; z-index: 500; inset: 0; padding: 1.5rem; display: grid; place-items: center; color: white; text-align: center; background: #132b3c; }
.protection-cover > div { max-width: 560px; }
.protection-cover .kicker { color: #8ad3ce; }
.protection-cover h2 { margin: 0; font: 700 clamp(2rem, 5vw, 3.2rem) var(--display); }
.protection-cover p:not(.kicker) { margin: 1rem auto 1.6rem; color: #d5e1e7; line-height: 1.6; }
.cover-symbol { display: inline-grid; place-items: center; width: 4rem; height: 4rem; margin-bottom: 1.3rem; border: 1px solid #5b7888; border-radius: 50%; color: #8ad3ce; font-size: 1.5rem; }

.completion-view { min-height: 100dvh; padding: 1.2rem; display: grid; place-items: center; background: radial-gradient(circle at top, rgba(11, 107, 103, .12), transparent 30rem), var(--paper); }
.completion-card { width: min(680px, 100%); padding: clamp(1.5rem, 5vw, 3rem); border: 1px solid var(--line); border-radius: 1.4rem; background: white; box-shadow: var(--shadow); }
.completion-score { display: flex; align-items: baseline; gap: .3rem; color: var(--navy); }
.completion-score strong { font: 800 clamp(4rem, 12vw, 7rem)/1 var(--display); letter-spacing: -.08em; }
.completion-score span { color: var(--muted); font: 600 1.3rem var(--data); }
.completion-card h1 { margin: .7rem 0; font: 700 clamp(1.7rem, 5vw, 2.6rem) var(--display); }
.completion-card > p { color: var(--muted); line-height: 1.55; }
.completion-safety { margin: 1.5rem 0; padding: 1rem; display: flex; justify-content: space-between; border-radius: .8rem; background: var(--teal-soft); }
.completion-safety b { color: var(--teal); font-family: var(--data); }
.completion-topics { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.completion-topic { padding: .75rem .5rem; display: grid; gap: .2rem; text-align: center; border: 1px solid var(--line); border-radius: .7rem; }
.completion-topic b { color: var(--green); }
.completion-topic.missed b { color: var(--red); }
.completion-topic span { color: var(--muted); font-size: .7rem; text-transform: capitalize; }
.completion-actions { margin-top: 1.8rem; display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.completion-card .practice-author { margin: 2rem 0 0; font-size: .7rem; }

.exit-dialog { width: min(520px, calc(100% - 2rem)); padding: 0; border: 0; border-radius: 1rem; box-shadow: 0 30px 100px rgba(0, 0, 0, .3); }
.exit-dialog::backdrop { background: rgba(9, 24, 33, .72); backdrop-filter: blur(4px); }
.exit-dialog form { padding: 1.5rem; }
.exit-dialog h2 { margin: 0; font: 700 1.5rem var(--display); }
.exit-dialog p:not(.kicker) { color: var(--muted); line-height: 1.5; }
.exit-dialog form > div { margin-top: 1.3rem; display: flex; justify-content: flex-end; gap: .6rem; }
.quiet-button, .danger-button { min-height: 2.8rem; padding: .65rem 1rem; border-radius: .65rem; cursor: pointer; font-weight: 700; }
.quiet-button { color: var(--navy); background: #edf2f4; }
.danger-button { color: white; background: var(--red); }

@media (max-width: 900px) {
  .practice-intro-grid { grid-template-columns: 1fr; }
  .progress-instrument { max-width: 660px; }
  .session-header { grid-template-columns: 1fr auto; }
  .session-status { display: none; }
  .session-exit { grid-column: 2; grid-row: 1; }
}

@media (max-width: 660px) {
  .practice-home { padding-inline: 1rem; }
  .practice-home-header { margin-bottom: 2.5rem; }
  .practice-intro h1 { font-size: clamp(2.5rem, 14vw, 4rem); }
  .session-blueprint { grid-template-columns: repeat(2, 1fr); }
  .session-blueprint div:nth-child(3) { border-left: 0; }
  .session-blueprint div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .answer-grid { grid-template-columns: 1fr; }
  .question-stage { min-height: calc(100dvh - 8.2rem); }
  .question-content h1 { font-size: 1.3rem; }
  .sample-node span { display: none; }
  .completion-topics { grid-template-columns: repeat(2, 1fr); }
  .history-panel > header { display: block; }
}

@media (max-height: 760px) and (min-width: 661px) {
  .session-header { min-height: 3.7rem; }
  .sample-rail { margin-block: .55rem .2rem; }
  .sample-vial { width: 1.35rem; height: 1.7rem; }
  .sample-node:not(:last-child)::after { top: .82rem; }
  .question-stage { min-height: calc(100dvh - 6.8rem); padding-top: .55rem; }
  .question-content { margin-top: .8rem; }
  .answer-grid { margin-top: 1rem; }
  .answer-option { min-height: 3.3rem; padding-block: .55rem; font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  body * { display: none !important; }
  body::before { content: "La práctica TP1 no está disponible para impresión."; display: block; padding: 2rem; color: black; font: 16pt sans-serif; }
}

/* Contenido químico enriquecido · Creado por David Vásquez Velásquez. */
.practice-rich-content{display:grid;gap:.55rem;min-width:0}.practice-rich-content p{margin:0}.practice-rich-content ul,.practice-rich-content ol{margin:.25rem 0;padding-left:1.4rem}.practice-rich-content sub,.practice-rich-content sup{font-size:.7em;line-height:0}.practice-rich-content .chemical-formula{font-family:"Roboto Mono",monospace;font-weight:650;white-space:nowrap}
.practice-molecule{width:min(360px,100%);margin:.4rem auto 0;padding:.65rem;border:1px solid var(--line);border-radius:10px;background:#fff}.practice-molecule img{display:block;width:100%;height:min(190px,24vh);object-fit:contain}.practice-molecule figcaption{overflow:hidden;margin-top:.3rem;color:var(--muted);font:600 10px "Roboto Mono",monospace;text-align:center;text-overflow:ellipsis;white-space:nowrap}.answer-option .practice-molecule{width:min(230px,100%)}.answer-option .practice-molecule img{height:110px}.answer-option>span{min-width:0}.feedback-answer .practice-rich-content,.selected-feedback .practice-rich-content{display:inline-grid;margin-left:.25rem}
