/* Atlas UX K: bubbles on the map, a back button, and the lesson layer */
:root{--k-paper:#FFF3E4;--k-ink:#17142B;--k-azul:#2F49FF;--k-celeste:#7DD3FF;--k-sol:#FFC736;--k-rosa:#FF7C95;--k-ease:cubic-bezier(.22,.8,.2,1)}
/* zoomed: no page scrollbars, no poster chrome */
html.k-zoom{scrollbar-width:none}
html.k-layer,html.k-layer body{overflow:hidden}
html.k-zoom::-webkit-scrollbar{display:none}
html.k-zoom .bar,html.k-zoom .zoom,html.k-zoom #panel{visibility:hidden}
#panel{display:none!important}
html.k-covered #wrap,html.k-covered .kbubbles,html.k-covered .kveil{visibility:hidden}

.kveil{position:fixed;inset:0;z-index:40;background:#FFF3E499;opacity:0;pointer-events:none;transition:opacity .35s var(--k-ease)}
.kveil.on{opacity:1;pointer-events:auto}
.kbubbles{position:fixed;inset:0;z-index:45;pointer-events:none}
.kb{position:absolute;pointer-events:none;opacity:0;scale:.6;transition:opacity .25s var(--k-ease),scale .35s cubic-bezier(.3,1.5,.5,1);
  display:inline-flex;align-items:center;gap:8px;min-height:64px;max-width:min(300px,46vw);padding:10px 24px;border:2.5px solid var(--k-ink);border-radius:999px;
  background:var(--k-paper);color:var(--k-ink);font:800 19px/1.15 Outfit,sans-serif;text-align:left;cursor:pointer;box-shadow:0 5px 0 var(--k-ink)}
.kbubbles.on .kb{opacity:1;scale:1;pointer-events:auto}
.kbubbles.on .kb:nth-child(3){transition-delay:.05s}.kbubbles.on .kb:nth-child(4){transition-delay:.1s}
.kstrip{position:absolute;border:2.5px solid var(--k-ink);border-radius:24px;background:var(--k-paper);opacity:0;transition:opacity .25s;padding:10px 16px;font:800 17px/1.2 Outfit,sans-serif;color:var(--k-ink)}
.kstrip[hidden]{display:none}.kbubbles.on .kstrip{opacity:1}
.kb:hover{translate:0 -2px}
.kb:active{translate:0 3px;box-shadow:0 2px 0 var(--k-ink)}
.kb:focus-visible{outline:3px solid var(--k-azul);outline-offset:4px}

.kback{position:fixed;left:16px;top:16px;z-index:50;height:48px;padding:0 18px 0 10px;border:0;border-radius:999px;display:inline-flex;align-items:center;gap:4px;
  background:var(--k-ink);color:#fff;font:700 16px/1 Outfit,sans-serif;cursor:pointer;box-shadow:0 8px 20px #17142B33}
.kback[hidden]{display:none}
.kback svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.kback:focus-visible,.ks-ok:focus-visible,.kr-done:focus-visible{outline:3px solid var(--k-azul);outline-offset:3px}
.kvh{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}

/* lesson layer: grows with clip-path, never with transform */
.klayer{position:fixed;inset:0;z-index:80;background:var(--k-paper)}
.klayer[hidden]{display:none}
.kl-lesson{position:absolute;inset:0}
.kl-lesson iframe{width:100%;height:100%;border:0;display:block}
.kl-reader{position:absolute;inset:0;z-index:2;background:var(--k-paper);overflow-y:auto;overscroll-behavior:contain}
.kl-reader[hidden]{display:none}
.kr-top{position:sticky;top:0;z-index:2;padding:12px 16px;background:var(--k-paper)}
.kr-top .kback{position:static;box-shadow:none}
.kr-body{max-width:720px;margin:0 auto;padding:12px 20px 24px;font-family:'DM Sans',sans-serif;font-size:18px;line-height:1.65;color:var(--k-ink);outline:none}
.kr-body h1{font-family:Outfit,sans-serif;font-weight:800;font-size:clamp(28px,4.4vw,40px);line-height:1.1;margin:18px 0 14px}
.kr-body h2,.kr-body h3,.kr-body h4{font-family:Outfit,sans-serif;font-weight:800;line-height:1.2;margin:32px 0 10px}
.kr-body h3{font-size:22px}.kr-body h4{font-size:18px}
.kr-body blockquote{margin:16px 0;padding:12px 18px;background:#fff;border-radius:14px}
.kr-body hr{border:0;border-top:2px dashed #17142B26;margin:24px 0}
.kr-body table{width:100%;border-collapse:collapse;font-size:15px;display:block;overflow-x:auto}
.kr-body th,.kr-body td{border-bottom:1px solid #17142B1F;padding:8px 10px;text-align:left;vertical-align:top}
.kr-body th{background:#fff}
.kr-body pre{white-space:pre-wrap;background:var(--k-ink);color:#FFF3E4;padding:14px 16px;border-radius:14px;font-size:14px;line-height:1.55}
.kr-body code{font-family:'DM Mono',monospace;font-size:.88em}
.kr-body img{max-width:100%}
.kr-foot{max-width:720px;margin:0 auto;padding:8px 20px 48px}
.kr-done{width:100%;min-height:54px;border:0;border-radius:999px;background:var(--k-azul);color:#fff;font:800 17px/1.2 Outfit,sans-serif;cursor:pointer}

/* "llega pronto" */
.ksoon{position:fixed;inset:0;z-index:70;display:grid;place-items:center;padding:16px;background:#17142B33}
.ksoon[hidden]{display:none}
.ks-card{width:min(360px,100%);padding:24px 24px 20px;border:2.5px solid var(--k-ink);border-radius:28px;background:var(--k-paper);box-shadow:0 6px 0 var(--k-ink);text-align:center;color:var(--k-ink)}
.ks-card img{display:block;margin:0 auto 6px}
.ks-card h2{margin:0 0 8px;font:800 24px/1.15 Outfit,sans-serif}
.ks-card p{margin:0 0 18px;font:500 17px/1.5 'DM Sans',sans-serif;color:#17142BCC}
.ks-ok{min-height:52px;padding:0 28px;border:0;border-radius:999px;background:var(--k-ink);color:#fff;font:800 17px/1 Outfit,sans-serif;cursor:pointer}

@media (max-width:699px){.kb{min-height:64px;padding:8px 18px;font-size:17px;max-width:min(200px,52vw)}.kback{left:12px;top:12px}.kr-body{font-size:17px;padding:8px 16px 20px}}
@media (prefers-reduced-motion:reduce){.kb,.kveil{transition:none}}
html{overflow-anchor:none}
html.k-measure .lift,html.k-measure .tag{transform:none!important;transition:none!important}

/* phone: lifted topic sheet */
.klift{position:fixed;inset:0;z-index:44;background:var(--k-paper);opacity:0;transition:opacity .22s var(--k-ease)}
.klift.on{opacity:1}
.klift[hidden]{display:none}
.kl-title{position:absolute;left:16px;right:16px;top:72px;margin:0;font:800 34px/1.1 Outfit,sans-serif;color:var(--k-ink)}
.kl-draw{position:fixed;overflow:hidden;border-radius:22px;contain:paint}
html.k-lifted #wrap{visibility:hidden}
.kbubbles.lift{inset:auto 16px calc(24px + env(safe-area-inset-bottom)) 16px;display:flex;flex-direction:column;gap:12px}
.kbubbles.lift.kscroll{inset:auto 8px calc(16px + env(safe-area-inset-bottom)) 8px;padding:8px;max-height:calc(var(--kl-list) + 16px);overflow-y:auto;overscroll-behavior:contain;pointer-events:auto}
.kbubbles.lift.kscroll .kb{flex:none}
.kbubbles.lift .kb{position:static;width:100%;max-width:none;min-height:60px;height:60px;justify-content:flex-start;text-align:left;transition-duration:.2s,.25s}
.kbubbles.lift .kb span{min-width:0;line-height:1.1}

/* Guardados: acceso a las preguntas que el alumno guarda en las lecciones */
.ksaved{position:fixed;top:16px;right:16px;z-index:11;height:52px;padding:0 18px 0 14px;border-radius:999px;display:inline-flex;align-items:center;gap:8px;background:var(--k-field,#FFF8EF);color:var(--k-ink,#17142B);font:700 16px/1 Outfit,sans-serif;text-decoration:none;box-shadow:0 8px 22px #17142B1A;transition:transform .15s}
.ksaved:hover{transform:translateY(-2px)}
.ksaved svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linejoin:round}
.ksaved span:not(:empty){min-width:24px;height:24px;padding:0 7px;border-radius:999px;background:var(--k-sol,#FFC736);display:grid;place-items:center;font-size:13px}
@media (max-width:520px){.ksaved{top:auto;bottom:calc(84px + env(safe-area-inset-bottom));right:16px;height:48px}}
