/* ===== Atlas Farmacológico — sistema de diseño ===== */
:root {
  --bg: #07111a;
  --bg2: #0b1824;
  --panel: #0f202d;
  --panel2: #142a3a;
  --panel3: #1a3447;
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .14);
  --text: #e9f0f5;
  --muted: #a3b5c3;
  --dim: #6f8797;
  --teal: #2dd4bf;
  --teal2: #0fb5a1;
  --gold: #f5c86b;
  --gold2: #e3a93a;
  --rose: #fb7185;
  --green: #4ade80;
  --blue: #60a5fa;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --f-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --f-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-vad: 'Poppins', 'Inter', system-ui, sans-serif;
  --f-manual: 'Noto Serif', Georgia, serif;
  --f-label: 'Carlito', 'Calibri', 'Inter', sans-serif;
  --f-gamma: 'Merriweather', Georgia, serif;
  --topbar: 58px;
  --sidebar: 300px;
  --read: 720px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--f-body);
  font-size: 16px; line-height: 1.6; overflow-x: hidden;
  background-image: radial-gradient(1200px 600px at 80% -10%, rgba(45, 212, 191, .08), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(245, 200, 107, .06), transparent 60%);
  background-attachment: fixed;
}
img { max-width: 100%; height: auto; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--gold); color: #000; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
h1, h2, h3 { line-height: 1.2; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ===== barra superior ===== */
#scrollbar { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60; background: linear-gradient(90deg, var(--teal), var(--gold)); transition: width .1s linear; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: calc(var(--topbar) + var(--safe-t)); padding: var(--safe-t) 12px 0;
  display: flex; align-items: center; gap: 10px;
  background: rgba(7, 17, 26, .82); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--f-display); font-weight: 700; font-size: 1.12rem; white-space: nowrap; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand em { font-style: normal; color: var(--gold); }
.brand .bi { font-weight: inherit; color: var(--gold); }
.brand span { overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 1.25rem; }
.icon-btn:hover { background: var(--panel2); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: .9rem; white-space: nowrap; }
.chip:hover { text-decoration: none; background: var(--panel2); }
.chip.streak b { color: var(--gold); }
.chip.level { padding-left: 4px; }
.ring { position: relative; width: 30px; height: 30px; display: inline-grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .ring-bg { stroke: rgba(255, 255, 255, .12); }
.ring .ring-fg { stroke: var(--teal); stroke-linecap: round; stroke-dasharray: 97.4; stroke-dashoffset: 97.4; transition: stroke-dashoffset .6s ease; }
.ring b { font-size: .8rem; }
.menu-btn { display: none; }
.back-btn { font-size: 1.9rem; line-height: 1; padding-bottom: 4px; color: var(--teal); }

/* ===== layout ===== */
.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - var(--topbar)); }
.sidebar {
  position: sticky; top: calc(var(--topbar) + var(--safe-t)); height: calc(100vh - var(--topbar) - var(--safe-t)); overflow-y: auto;
  border-right: 1px solid var(--line); padding: 16px 14px 40px; background: rgba(11, 24, 36, .55);
  scrollbar-width: thin; scrollbar-color: var(--panel3) transparent;
}
.scrim { display: none; }
main { min-width: 0; padding: 24px 28px 120px; outline: none; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 12px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a[hidden] { display: none; }
.nav a.active { background: linear-gradient(90deg, rgba(45, 212, 191, .16), rgba(45, 212, 191, .04)); color: var(--text); box-shadow: inset 3px 0 0 var(--teal); }
.nav .ico { width: 26px; text-align: center; font-size: 1.1rem; }
.nav .count { margin-left: auto; font-size: .75rem; color: var(--dim); }
.nav hr, .toc hr { border: 0; border-top: 1px solid var(--line); margin: 12px 4px; }
.toc h4 { margin: 18px 8px 8px; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.toc a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: .88rem; line-height: 1.35; border-left: 2px solid transparent; }
.toc a:hover { background: var(--panel); text-decoration: none; color: var(--text); }
.toc a.on { color: var(--teal); border-left-color: var(--teal); background: rgba(45, 212, 191, .07); }
.toc a.done::after { content: ' ✓'; color: var(--green); }

.tabbar { display: none; }

/* ===== bloques genéricos ===== */
.page-head { max-width: 1100px; margin: 0 auto 22px; }
.eyebrow { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); font-weight: 700; }
h1.title { font-family: var(--f-display); font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 6px 0 8px; letter-spacing: -.01em; }
.lede { color: var(--muted); max-width: 70ch; }
.wrap { max-width: 1100px; margin: 0 auto; }
.section-title { font-family: var(--f-display); font-size: 1.35rem; margin: 34px 0 14px; display: flex; align-items: center; gap: 10px; }
.section-title .more { margin-left: auto; font-family: var(--f-body); font-size: .88rem; font-weight: 500; }
.grid { display: grid; gap: 14px; }
.grid.g2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.g3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid.g4 { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.card {
  position: relative; display: block; background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; color: var(--text); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
a.card:hover, button.card:hover { transform: translateY(-2px); border-color: var(--line2); box-shadow: var(--shadow); text-decoration: none; }
button.card { text-align: left; width: 100%; }
.card h3 { margin: 6px 0 6px; font-size: 1.05rem; font-family: var(--f-body); font-weight: 650; }
.card p { margin: 0; color: var(--muted); font-size: .9rem; }
.card .accent { position: absolute; inset: 0 auto 0 0; width: 4px; border-radius: var(--radius) 0 0 var(--radius); }
.card .big-ico { font-size: 1.8rem; line-height: 1; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: rgba(255, 255, 255, .06); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.basico, .badge.esencial { color: #86efac; border-color: rgba(134, 239, 172, .3); background: rgba(74, 222, 128, .08); }
.badge.intermedio, .badge.clinico { color: #fde68a; border-color: rgba(253, 230, 138, .3); background: rgba(250, 204, 21, .08); }
.badge.avanzado, .badge.ampliado { color: #fca5a5; border-color: rgba(252, 165, 165, .3); background: rgba(248, 113, 113, .08); }
.badge.done { color: var(--green); border-color: rgba(74, 222, 128, .35); }
.badge.xp { color: var(--gold); border-color: rgba(245, 200, 107, .35); }
.progress { height: 8px; background: rgba(255, 255, 255, .08); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal2), var(--teal)); border-radius: 99px; transition: width .6s ease; }
.progress.gold > i { background: linear-gradient(90deg, var(--gold2), var(--gold)); }
.pmeta { display: flex; justify-content: space-between; font-size: .78rem; color: var(--dim); margin-top: 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); font-weight: 600; }
.btn:hover { text-decoration: none; background: var(--panel3); }
.btn.primary { background: linear-gradient(135deg, var(--teal), var(--teal2)); color: #04211d; border: 0; box-shadow: 0 8px 24px rgba(45, 212, 191, .25); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.gold { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #2a1a00; border: 0; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .88rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text); font: inherit;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(45, 212, 191, .18); }
.searchbox { position: relative; }
.searchbox .input { padding-left: 42px; }
.searchbox::before { content: ''; position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5' fill='none' stroke='%232dd4bf' stroke-width='2.4'/%3E%3Cpath d='M15.5 15.5 20 20' stroke='%232dd4bf' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.fchip { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--panel); color: var(--muted); font-size: .85rem; font-weight: 500; }
.fchip.on { background: rgba(45, 212, 191, .14); color: var(--teal); border-color: rgba(45, 212, 191, .5); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; margin: 16px 0; max-width: 100%; }

/* ===== inicio ===== */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 26px; margin: 0 auto; max-width: 1100px;
  background: linear-gradient(135deg, rgba(20, 42, 58, .95), rgba(10, 26, 38, .95)); border: 1px solid var(--line2);
}
.hero::after { content: ''; position: absolute; right: -80px; top: -80px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(45, 212, 191, .25), transparent 70%); pointer-events: none; }
.hero h1 { font-family: var(--f-display); font-size: clamp(1.6rem, 3.2vw, 2.3rem); margin: 4px 0 6px; }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: center; position: relative; z-index: 1; }
.lvlbox { background: rgba(0, 0, 0, .22); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.lvlbox .lv { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.lvlbox .lv .medal { font-size: 2rem; }
.lvlbox .lv b { display: block; font-size: 1.05rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stat b { display: block; font-size: 1.5rem; font-family: var(--f-display); }
.stat span { font-size: .8rem; color: var(--muted); }
.continue { display: flex; gap: 16px; align-items: center; }
.continue .play { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--teal), var(--teal2)); color: #04211d; font-size: 1.3rem; flex: none; }
.daily { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: .88rem; color: var(--muted); }
.theme-card .num { font-family: var(--f-display); font-size: .85rem; color: var(--dim); }
.theme-card .ti { display: flex; gap: 12px; align-items: flex-start; }
.theme-card .emoji { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; flex: none; }
.theme-card .progress { margin-top: 14px; }

/* ===== listas de lecciones ===== */
.lesson-list { display: flex; flex-direction: column; gap: 10px; }
.lrow { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text); min-height: 64px; }
.lrow:hover { text-decoration: none; border-color: var(--line2); background: var(--panel2); }
.lrow .n { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 700; font-family: var(--f-display); background: rgba(255, 255, 255, .06); color: var(--muted); }
.lrow.done .n { background: rgba(74, 222, 128, .15); color: var(--green); }
.lrow .t { flex: 1; min-width: 0; }
.lrow .t b { display: block; font-weight: 600; }
.lrow .t small { color: var(--dim); font-size: .8rem; }
.lrow .go { color: var(--dim); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: 10px 0 18px; scrollbar-width: none; }
.tabs button { flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-weight: 500; }
.tabs button.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ===== lector ===== */
.reader { max-width: var(--read); margin: 0 auto; }
.reader-head { margin-bottom: 18px; }
.crumbs { font-size: .82rem; color: var(--dim); display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); }
.reader-foot { margin: 34px 0 10px; padding: 22px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); text-align: center; }
.reader-foot p { color: var(--muted); margin: 0 0 14px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.pager a { padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text); min-width: 0; }
.pager a:hover { text-decoration: none; border-color: var(--line2); }
.pager small { display: block; color: var(--dim); font-size: .75rem; }
.pager b { display: block; font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager .next { text-align: right; grid-column: 2; }

/* ----- estilo MANUAL 2026 (libro serif, papel) ----- */
.manual {
  --m-ink: #1b2b3a; --m-title: #102a43; --m-accent: #2563eb; --m-muted: #486581; --m-soft: #eff6ff; --m-row: #cfdff6; --m-line: #dde4eb;
  background: #fff; color: var(--m-ink); font-family: var(--f-manual); font-size: 1.02rem; line-height: 1.72;
  border-radius: 18px; padding: 36px clamp(18px, 5vw, 52px); box-shadow: 0 20px 50px rgba(0, 0, 0, .35); text-align: left;
}
.manual .m-label { font-family: var(--f-label); letter-spacing: .28em; font-size: .8rem; color: var(--m-accent); text-transform: uppercase; }
.manual h1 { font-family: var(--f-manual); color: var(--m-title); font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 4px 0 16px; line-height: 1.15; }
.manual .lead { border-left: 3px solid var(--m-accent); padding: 4px 0 4px 16px; color: var(--m-muted); font-style: italic; margin: 0 0 24px; }
.manual h2 { color: var(--m-title); font-size: 1.32rem; margin: 34px 0 10px; }
.manual h3 { font-family: var(--f-label); color: var(--m-accent); font-size: 1.08rem; margin: 22px 0 6px; }
.manual p { margin: 0 0 14px; }
.manual b { color: var(--m-title); }
.manual ul { padding-left: 1.25em; margin: 0 0 14px; }
.manual li { margin: 0 0 8px; }
.manual li::marker { color: var(--m-ink); }
.m-box { margin: 22px 0; border-radius: 6px; padding: 16px 18px; font-size: .96rem; }
.m-box .blabel { font-family: var(--f-label); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 10px; color: var(--m-accent); }
.m-box.esquema, .m-box.tarjetas { background: var(--m-soft); border: 1px solid var(--m-line); }
.m-box.esquema .blabel { border-bottom: 1px solid var(--m-line); padding-bottom: 8px; }
.m-rows { display: flex; flex-direction: column; gap: 0; }
.m-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 12px 10px; border-top: 1px solid var(--m-row); background: rgba(207, 223, 246, .25); }
.m-row:nth-child(odd) { background: rgba(207, 223, 246, .5); }
.m-row .term { font-weight: 700; color: var(--m-title); }
.m-row .sub { font-family: var(--f-label); font-weight: 700; color: var(--m-accent); font-size: .9rem; }
.m-row .txt { color: var(--m-muted); font-size: .9rem; line-height: 1.5; }
.m-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.m-card { background: #fff; border: 1px solid var(--m-line); border-radius: 6px; padding: 12px 14px; font-size: .9rem; }
.m-card .clabel { font-family: var(--f-label); color: var(--m-accent); font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.m-card ul { margin: 0; }
.m-box.caso { background: #fdf2f2; border-left: 4px solid #db2626; }
.m-box.caso .blabel { color: #dc2626; }
.m-box.aviso { background: #fdf2f2; border-left: 4px solid #db2626; }
.m-box.aviso .blabel { color: #dc2626; }
.m-box.clave { background: #effdf4; border-left: 4px solid #16a349; }
.m-box.clave .blabel { color: #16a34a; }
.m-box.nota { background: #f0f4f9; border-left: 4px solid #2462eb; }
.m-box.etiqueta, .m-box.biblio { padding: 0; margin-top: 30px; }
.m-box.biblio { border-top: 1px solid var(--m-line); padding-top: 14px; }
.m-box.biblio .blabel, .m-box.etiqueta .blabel { color: #7b8794; }
.m-box.biblio ul { list-style: none; padding: 0; }
.m-box.biblio li { color: #3c5a80; font-size: .9rem; }
.m-box.biblio li::before { content: '– '; }
.m-box.autoeval { background: #fff; border: 1px solid var(--m-line); box-shadow: inset 0 3px 0 #0f2a42; }
.m-box.autoeval .blabel { color: #102a43; }
.qa { padding: 14px 0; border-top: 1px solid var(--m-line); }
.qa:first-of-type { border-top: 0; }
.qa .q { font-weight: 400; }
.qa .q b.qn { color: var(--m-title); }
.qa details summary { cursor: pointer; font-family: var(--f-label); font-weight: 700; color: #16a34a; letter-spacing: .06em; font-size: .85rem; list-style: none; margin-top: 8px; min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 1px solid rgba(22, 163, 74, .35); border-radius: 999px; }
.qa details summary::-webkit-details-marker { display: none; }
.qa details[open] summary { background: rgba(22, 163, 74, .08); }
.qa .a { color: #16a34a; margin-top: 10px; }
.qa .a b { color: #15803d; }
.m-table { width: 100%; border-collapse: collapse; font-size: .88rem; line-height: 1.45; min-width: 560px; background: #fff; }
.m-table caption { caption-side: top; text-align: left; font-weight: 700; color: var(--m-title); font-size: 1.05rem; padding: 0 0 10px; background: none; }
.m-table th { background: #0f2a42; color: #fff; font-family: var(--f-label); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; text-align: left; padding: 10px; border-right: 1px solid rgba(255, 255, 255, .15); }
.m-table td { padding: 10px; border-bottom: 1px solid var(--m-line); vertical-align: top; }
.m-table tr:nth-child(even) td { background: #f0f4f9; }
.m-table td:first-child { color: var(--m-title); }
.m-table td:last-child { color: var(--m-muted); }
.gloss { display: grid; gap: 0; }
.gloss .gi { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--m-line); font-size: .93rem; }
.gloss .gi dt { font-weight: 700; color: var(--m-title); }
.gloss .gi dd { margin: 0; color: var(--m-muted); }
.manual .m-part { font-family: var(--f-label); color: var(--m-accent); letter-spacing: .3em; font-size: .8rem; }
.manual :target { scroll-margin-top: 90px; }

/* ----- estilo REGALOS (presentación oscura, Merriweather) ----- */
.gamma { --g-bg: #09151a; --g-ink: #e2e6e9; --g-title: #f5f0f0; --g-card: #00307f; --g-border: #184a98; --g-accent: #5f9cff; --g-soft: #001d4d; font-family: var(--f-gamma); color: var(--g-ink); }
.g-page {
  position: relative; background: var(--g-bg); border-radius: 18px; padding: 28px clamp(18px, 4.5vw, 40px) 30px; margin: 0 0 22px; overflow: hidden;
  border: 1px solid rgba(95, 156, 255, .14); box-shadow: 0 18px 44px rgba(0, 0, 0, .4);
  background-image: radial-gradient(900px 400px at 100% 0%, rgba(24, 74, 152, .18), transparent 60%), linear-gradient(180deg, #0b1a20, #08131a);
}
.g-page .pnum { position: absolute; right: 16px; top: 12px; font-size: .72rem; color: rgba(226, 230, 233, .35); font-family: var(--f-body); }
.g-page h2.g-title { font-family: var(--f-gamma); font-weight: 400; color: var(--g-title); font-size: clamp(1.45rem, 3.4vw, 2rem); margin: 0 0 18px; line-height: 1.25; }
.gamma p { margin: 0 0 14px; font-size: .96rem; line-height: 1.75; }
.gamma h3 { font-family: var(--f-gamma); font-weight: 400; color: var(--g-title); font-size: 1.22rem; margin: 20px 0 10px; }
.gamma h4 { font-family: var(--f-gamma); font-weight: 400; color: var(--g-title); font-size: 1.06rem; margin: 16px 0 8px; }
.gamma b { color: #fff; }
.gamma ul, .gamma ol { padding-left: 1.3em; margin: 0 0 14px; }
.gamma li { margin: 0 0 7px; font-size: .95rem; line-height: 1.65; }
.gamma li::marker { color: var(--g-accent); }
.g-num { font-family: var(--f-gamma); color: var(--g-accent); font-size: .9rem; letter-spacing: .06em; border-bottom: 2px solid var(--g-border); padding-bottom: 6px; margin-bottom: 8px; }
.g-cards { display: grid; gap: 12px; margin: 0 0 14px; }
.g-card { border-radius: 10px; padding: 16px 18px; border: 1px solid var(--g-border); background: rgba(9, 21, 26, .6); position: relative; }
.g-card.solid { background: var(--g-card); border-color: var(--g-border); }
.g-card.soft { background: var(--g-soft); }
.g-card.num { padding-left: 64px; }
.g-card .badge-n { position: absolute; left: 0; top: 0; bottom: 0; width: 46px; display: grid; place-items: center; background: #00307f; color: #fff; font-size: 1.3rem; border-radius: 10px 0 0 10px; }
.g-card h4 { margin-top: 0; }
.g-card p:last-child, .g-card ul:last-child { margin-bottom: 0; }
.g-cols { display: grid; gap: 18px 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 8px; }
.g-fig { margin: 8px 0 18px; }
.g-fig img { display: block; margin: 0 auto; border-radius: 10px; cursor: zoom-in; }
.g-fig.side { float: right; width: 44%; margin: 0 0 12px 18px; }
.g-clear { clear: both; }
.g-table { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 520px; }
.g-table th { text-align: left; padding: 10px 12px; color: #fff; font-weight: 700; border-bottom: 1px solid rgba(255, 255, 255, .25); }
.g-table td { padding: 9px 12px; border-bottom: 1px solid rgba(255, 255, 255, .08); vertical-align: top; }
.g-table tr:nth-child(odd) td { background: rgba(255, 255, 255, .035); }

/* ----- estilo VADEMÉCUM (ficha clara, Poppins) ----- */
.vad-class-tile { position: relative; overflow: hidden; border-radius: 16px; padding: 16px; min-height: 120px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; border: 0; text-align: left; }
.vad-class-tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.vad-class-tile b { font-family: var(--f-vad); font-size: 1.02rem; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.vad-class-tile small { opacity: .92; font-family: var(--f-vad); }
.vad-class-tile .progress { background: rgba(255, 255, 255, .28); height: 6px; }
.vad-class-tile .progress > i { background: #fff; }
.drug-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text); min-height: 58px; }
.drug-row:hover { text-decoration: none; background: var(--panel2); }
.drug-row .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.drug-row .t { flex: 1; min-width: 0; }
.drug-row .t b { display: block; font-family: var(--f-vad); font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; }
.drug-row .t small { color: var(--dim); font-size: .78rem; }
.drug-row .ok { color: var(--green); }
.vlist { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ficha { --c: #1d87e4; background: #fffafa; color: #262323; font-family: var(--f-vad); border-radius: 18px; padding: clamp(14px, 3.5vw, 30px); box-shadow: 0 20px 50px rgba(0, 0, 0, .35); max-width: 860px; margin: 0 auto; }
.f-banner { background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 72%, #000)); border-radius: 14px; padding: 18px 22px 22px; color: #fff; }
.f-pill { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: color-mix(in srgb, var(--c) 70%, #000); border-radius: 8px; padding: 4px 10px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.f-pill .d { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.f-banner h1 { font-family: var(--f-vad); font-weight: 700; font-size: clamp(1.35rem, 4vw, 2rem); margin: 10px 0 0; line-height: 1.2; letter-spacing: .01em; }
.f-top { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 20px 4px 18px; }
.f-top h3 { font-size: .98rem; margin: 0 0 6px; color: #111; font-weight: 700; }
.f-top p { margin: 0; font-size: .9rem; color: #333; line-height: 1.55; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f-sec { border-radius: 10px; padding: 14px 16px 12px; }
.f-sec h3 { margin: 0 0 8px; font-size: 1rem; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.f-sec ul { margin: 0; padding-left: 1.15em; }
.f-sec li { font-size: .86rem; line-height: 1.5; margin: 0 0 6px; color: #262323; }
.f-sec li::marker { color: #262323; }
.f-sec.full { grid-column: 1 / -1; }
.f-sec.full ul { columns: 2; column-gap: 28px; }
.f-sec.full li { break-inside: avoid; }
.s-ind { background: #e4f5e7; } .s-ind h3 { color: #1e7a34; }
.s-pos { background: #f1e3f6; } .s-pos h3 { color: #7b2ca6; }
.s-mec { background: #e1effa; } .s-mec h3 { color: #1565c0; }
.s-adv { background: #fdeddb; } .s-adv h3 { color: #c56a0a; }
.s-con { background: #fae2e2; } .s-con h3 { color: #c0332e; }
.s-int { background: #ddf0ed; } .s-int h3 { color: #00786a; }
.s-fc { background: #efe9f9; } .s-fc h3 { color: #4b2e83; }
.f-perla { margin-top: 12px; background: #fff5de; border: 1px solid #f1dea0; border-radius: 10px; padding: 12px 16px; font-size: .86rem; color: #4a3b00; display: flex; gap: 10px; }
.f-perla b { color: #2e2500; }
.f-ref { margin-top: 14px; padding-top: 10px; border-top: 1px solid #e3dede; font-size: .75rem; color: #222; }
.f-actions { max-width: 860px; margin: 16px auto 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.f-links { max-width: 860px; margin: 14px auto 0; }
.f-links .badge { background: var(--panel); }

/* ===== práctica ===== */
.flash-stage { max-width: 640px; margin: 0 auto; perspective: 1600px; }
.flash { position: relative; min-height: 360px; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2, .8, .2, 1); cursor: pointer; }
.flash.flipped { transform: rotateY(180deg); }
.flash .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 20px; padding: 26px; overflow: auto; display: flex; flex-direction: column; font-family: var(--f-gamma); }
.flash .front { background: #5b8ff3; color: #0a0f1a; }
.flash .front .fq { font-size: 1.25rem; line-height: 1.5; margin: auto 0; }
.flash .back { background: #09151a; border: 1px solid #184a98; color: #e2e6e9; transform: rotateY(180deg); }
.flash .ftag { font-family: var(--f-body); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; opacity: .75; font-weight: 700; }
.flash .ftitle { font-size: 1.35rem; margin: 6px 0 14px; }
.flash .back .ex { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .2); font-size: .9rem; }
.flash .back .ex h5 { margin: 0 0 4px; font-size: .95rem; color: #fff; font-weight: 400; }
.flash p { margin: 0 0 10px; }
.flash-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.flash-actions .no { background: rgba(251, 113, 133, .12); border-color: rgba(251, 113, 133, .4); color: #fecdd3; }
.flash-actions .yes { background: rgba(74, 222, 128, .12); border-color: rgba(74, 222, 128, .45); color: #bbf7d0; }
.session-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.session-bar .progress { flex: 1; }
.opts { display: grid; gap: 10px; margin: 18px 0; }
.opt { text-align: left; padding: 14px 16px; min-height: 54px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel); display: flex; gap: 12px; align-items: flex-start; line-height: 1.45; }
.opt:hover:not([disabled]) { border-color: var(--teal); }
.opt .l { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); font-weight: 700; }
.opt.right { border-color: var(--green); background: rgba(74, 222, 128, .12); }
.opt.right .l { background: var(--green); color: #052e16; }
.opt.wrong { border-color: var(--rose); background: rgba(251, 113, 133, .12); }
.opt.wrong .l { background: var(--rose); color: #4c0519; }
.opt[disabled] { cursor: default; }
.verdict { padding: 14px 16px; border-radius: 12px; margin: 14px 0; font-weight: 600; }
.verdict.ok { background: rgba(74, 222, 128, .12); color: #bbf7d0; border: 1px solid rgba(74, 222, 128, .35); }
.verdict.ko { background: rgba(251, 113, 133, .12); color: #fecdd3; border: 1px solid rgba(251, 113, 133, .35); }
.case-card .gamma { margin-top: 14px; }
.ae-card { background: #fff; color: #1b2b3a; font-family: var(--f-manual); border-radius: 18px; padding: 26px; max-width: 700px; margin: 0 auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.ae-card .blabel { font-family: var(--f-label); color: #102a43; letter-spacing: .14em; font-size: .75rem; text-transform: uppercase; }
.ae-card .q { font-size: 1.12rem; margin: 12px 0; }
.ae-card .a { color: #16a34a; border-top: 1px solid #dde4eb; padding-top: 12px; }

/* ===== diarios ===== */
.tool { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: clamp(14px, 3vw, 24px); }
.tool h3 { margin: 0 0 12px; font-family: var(--f-display); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.form-grid label, .field label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.field { margin-bottom: 12px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg2); color: var(--muted); }
.seg button.on { background: rgba(45, 212, 191, .16); color: var(--teal); border-color: rgba(45, 212, 191, .5); }
.week { width: 100%; border-collapse: collapse; min-width: 560px; font-size: .88rem; }
.week th, .week td { border: 1px solid var(--line); padding: 6px; text-align: center; }
.week th { background: var(--panel2); font-weight: 600; font-size: .78rem; }
.week td.lbl { text-align: left; white-space: nowrap; color: var(--muted); }
.tick { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg2); font-size: 1.1rem; }
.tick.on { background: rgba(74, 222, 128, .2); border-color: var(--green); }
.glasses { display: flex; gap: 6px; flex-wrap: wrap; }
.glass { width: 42px; height: 48px; border-radius: 8px 8px 12px 12px; border: 1px solid var(--line2); background: var(--bg2); font-size: 1.2rem; }
.glass.on { background: rgba(96, 165, 250, .25); border-color: var(--blue); }
.entries { display: grid; gap: 10px; margin-top: 16px; }
.entry { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: .9rem; }
.entry .eh { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .8rem; margin-bottom: 6px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 10px; }
.bars div { flex: 1; background: linear-gradient(180deg, var(--gold), var(--gold2)); border-radius: 6px 6px 2px 2px; min-height: 2px; position: relative; }
.bars div span { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: .65rem; color: var(--dim); white-space: nowrap; }
.fq-item { margin-bottom: 16px; }
.fq-item p { margin: 0 0 8px; font-weight: 600; }

/* ===== logros ===== */
.ach { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.ach .ai { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; background: rgba(255, 255, 255, .05); flex: none; filter: grayscale(1); opacity: .45; }
.ach.on .ai { filter: none; opacity: 1; background: radial-gradient(circle at 30% 30%, rgba(245, 200, 107, .4), rgba(245, 200, 107, .08)); box-shadow: 0 0 0 1px rgba(245, 200, 107, .4); }
.ach b { display: block; }
.ach small { color: var(--muted); }
.ach .p { font-size: .72rem; color: var(--dim); margin-top: 4px; }
.levels { display: grid; gap: 8px; }
.lv-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.lv-row.cur { border-color: var(--teal); background: rgba(45, 212, 191, .08); }
.lv-row.past { opacity: .7; }

/* ===== asistente ===== */
.fab-help, .fab-top { position: fixed; right: 18px; z-index: 45; border: 0; border-radius: 50%; box-shadow: var(--shadow); }
.fab-help { bottom: calc(18px + var(--safe-b)); width: 58px; height: 58px; font-size: 1.5rem; background: linear-gradient(135deg, var(--gold), var(--gold2)); }
.fab-top { bottom: calc(88px + var(--safe-b)); width: 46px; height: 46px; background: var(--panel2); border: 1px solid var(--line2); color: var(--text); font-size: 1.2rem; }
.assistant {
  position: fixed; right: 18px; bottom: calc(90px + var(--safe-b)); width: min(420px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - 140px));
  z-index: 55; display: flex; flex-direction: column; background: var(--bg2); border: 1px solid var(--line2); border-radius: 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); overflow: hidden;
}
.assistant[hidden] { display: none; }
.as-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.as-head b { font-family: var(--f-display); }
.as-head small { display: block; color: var(--dim); font-size: .75rem; }
.as-head .icon-btn { margin-left: auto; width: 38px; height: 38px; font-size: 1rem; }
.as-body { padding: 14px 16px; overflow-y: auto; flex: 1; }
.as-foot { padding: 12px 16px; border-top: 1px solid var(--line); }
.faq-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.faq-chips button { text-align: left; padding: 8px 12px; min-height: 38px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel); font-size: .84rem; color: var(--muted); }
.faq-chips button:hover { color: var(--text); border-color: var(--teal); }
.answer { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; font-size: .9rem; }
.answer .src { font-size: .75rem; color: var(--dim); margin-bottom: 4px; }
.answer b.t { display: block; margin-bottom: 4px; }
.answer p { margin: 0 0 8px; color: var(--muted); }
.answer mark { background: rgba(245, 200, 107, .28); color: var(--text); border-radius: 3px; padding: 0 2px; }
.search-results .answer { margin-bottom: 12px; }

/* ===== toasts, modal, confeti, lightbox ===== */
.toasts { position: fixed; top: calc(var(--topbar) + 12px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { pointer-events: auto; background: var(--panel2); border: 1px solid var(--line2); border-radius: 14px; padding: 10px 16px; box-shadow: var(--shadow); font-size: .92rem; display: flex; gap: 10px; align-items: center; animation: tin .35s ease; }
.toast b { color: var(--gold); }
@keyframes tin { from { opacity: 0; transform: translateY(-10px) scale(.96); } to { opacity: 1; transform: none; } }
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(0, 0, 0, .6); padding: 20px; }
.modal[hidden] { display: none; }
.modal .box { background: linear-gradient(180deg, var(--panel2), var(--bg2)); border: 1px solid var(--line2); border-radius: 24px; padding: 30px 26px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); }
.modal .box .big { font-size: 4rem; line-height: 1; margin-bottom: 10px; }
.modal .box h2 { font-family: var(--f-display); margin: 6px 0; font-size: 1.6rem; }
.modal .box p { color: var(--muted); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; width: 100vw; height: 100vh; }
.lightbox { position: fixed; inset: 0; z-index: 92; background: rgba(0, 0, 0, .92); display: grid; place-items: center; padding: 16px; overflow: auto; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lightbox .icon-btn { position: fixed; top: calc(12px + var(--safe-t)); right: 12px; }

.loader { display: grid; place-items: center; padding: 60px 0; color: var(--dim); }
.loader::before { content: ''; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--teal); animation: spin .8s linear infinite; margin-bottom: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fin .35s ease; }
@keyframes fin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.kbd-hint { font-size: .78rem; color: var(--dim); text-align: center; margin-top: 10px; }
.notice { font-size: .8rem; color: var(--dim); border: 1px dashed var(--line2); border-radius: 12px; padding: 10px 14px; }

/* ===== responsive ===== */
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  :root { --topbar: 56px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-grid; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100%; width: min(86vw, 340px); z-index: 70; transform: translateX(-102%);
    transition: transform .28s ease; background: var(--bg2); padding-top: calc(16px + var(--safe-t)); padding-bottom: calc(40px + var(--safe-b));
  }
  .sidebar.open { transform: none; box-shadow: 30px 0 60px rgba(0, 0, 0, .5); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, .55); }
  .scrim[hidden] { display: none; }
  main { padding: 18px 16px calc(150px + var(--safe-b)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 44; height: calc(64px + var(--safe-b)); padding-bottom: var(--safe-b);
    background: rgba(7, 17, 26, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--dim); font-size: .68rem; font-weight: 600; min-height: 44px; }
  .tabbar a span { font-size: 1.25rem; line-height: 1; }
  .tabbar a.active { color: var(--teal); }
  .tabbar a:hover { text-decoration: none; }
  .fab-help { bottom: calc(76px + var(--safe-b)); width: 52px; height: 52px; }
  .fab-top { bottom: calc(138px + var(--safe-b)); }
  .assistant { right: 12px; left: 12px; width: auto; bottom: calc(76px + var(--safe-b)); max-height: calc(100vh - 150px - var(--safe-b)); }
  .lvl-name { display: none; }
  .chip.level { padding-right: 6px; }
}
@media (max-width: 640px) {
  .brand span em { display: none; }
  .back-btn:not([hidden]) + .brand span { display: none; }
  .brand { font-size: 1.02rem; }
  .f-top, .f-grid { grid-template-columns: 1fr; }
  .f-sec.full ul { columns: 1; }
  .m-row { grid-template-columns: 1fr; gap: 4px; }
  .gloss .gi { grid-template-columns: 1fr; gap: 4px; }
  .g-fig.side { float: none; width: auto; margin: 0 0 14px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .manual { padding: 24px 18px; font-size: .98rem; }
  .hero { padding: 20px; }
  .flash { min-height: 420px; }
  .vlist { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .chip.streak { padding: 0 8px; }
  .brand img { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .flash { transition: none; }
}
@media print {
  .topbar, .sidebar, .tabbar, .fab-help, .fab-top, .assistant { display: none !important; }
  .layout { display: block; }
  body { background: #fff; }
}

/* ===== infografías ===== */
.ig { max-width: 980px; margin: 0 auto; display: grid; gap: 18px; }
.ig h1.title { text-wrap: balance; }
.ig-fig { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ig-svg { display: block; width: 100%; min-width: 560px; height: auto; }
.ig-svg text { font: 500 12px var(--f-body); fill: var(--muted); }
.ig-svg .b { font-weight: 700; font-size: 13px; }
.ig-svg .tt { fill: var(--teal); }
.ig-svg .ta { fill: var(--gold); }
.ig-svg .tw { fill: var(--text); }
.ig-svg .tr { fill: var(--rose); }
.ig-svg .dk { fill: #07111a; }
.ig-svg .ln, .ig-svg .lt, .ig-svg .la, .ig-svg .lr { fill: none; }
.ig-svg .ln { stroke: var(--dim); }
.ig-svg .lt { stroke: var(--teal); }
.ig-svg .la { stroke: var(--gold); }
.ig-svg .lr { stroke: var(--rose); }
.ig-svg .bx { fill: var(--bg); }
.ig-svg .ft { fill: var(--teal); }
.ig-svg .fa { fill: var(--gold); }
.ig-svg .fr { fill: var(--rose); }
.ig-svg .fd { fill: var(--dim); }
.ig-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ig-col { border-radius: var(--radius); padding: 18px; display: grid; gap: 14px; align-content: start; border: 1px solid var(--line); min-width: 0; }
.ig-col.t { background: rgba(45, 212, 191, .07); border-color: rgba(45, 212, 191, .28); }
.ig-col.a { background: rgba(245, 200, 107, .07); border-color: rgba(245, 200, 107, .28); }
.ig-col h2 { font-family: var(--f-display); font-size: 1.45rem; margin: 0; }
.ig-col.t h2 { color: var(--teal); }
.ig-col.a h2 { color: var(--gold); }
.ig-row { display: grid; gap: 5px; }
.ig-row p { margin: 0; font-size: .95rem; }
.ig-row ul { margin: 0; padding-left: 18px; display: grid; gap: 2px; font-size: .95rem; }
.ig-lbl { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.ig .dose { color: var(--muted); font-size: .88em; font-variant-numeric: tabular-nums; }
.ig-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ig-chip { font-size: .84rem; line-height: 1.4; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line2); }
.ig-chip.warn { background: rgba(251, 113, 133, .1); border-color: rgba(251, 113, 133, .35); color: #fecdd3; }
.ig-bars, .ig-box, .ig-quiz { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 12px; }
.ig-bars h3, .ig-quiz h2 { margin: 0; font-size: 1.05rem; }
.ig-bar, .ig-axis { display: grid; grid-template-columns: 90px minmax(0, 1fr) 92px; gap: 10px; align-items: center; font-size: .9rem; }
.ig-track { position: relative; height: 24px; border-radius: 6px; background: rgba(255, 255, 255, .05); }
.ig-track i { position: absolute; top: 0; bottom: 0; border-radius: 6px; }
.ig-track i.t { background: linear-gradient(90deg, var(--teal2), var(--teal)); }
.ig-track i.a { background: linear-gradient(90deg, var(--gold2), var(--gold)); }
.ig-bar b { font-size: .85rem; font-variant-numeric: tabular-nums; }
.ig-bar b.t { color: var(--teal); }
.ig-bar b.a { color: var(--gold); }
.ig-axis div { position: relative; height: 16px; }
.ig-axis div span { position: absolute; top: 0; transform: translateX(-50%); font-size: .72rem; color: var(--dim); font-variant-numeric: tabular-nums; }
.ig-axis div span:first-child { transform: none; }
.ig-axis div span:last-child { transform: translateX(-100%); }
.ig-box p { margin: 0; }
.ig-alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: rgba(251, 113, 133, .09); border: 1px solid rgba(251, 113, 133, .35); }
.ig-alert p { margin: 0; }
.ig-rule { border-radius: var(--radius); padding: 20px; background: linear-gradient(135deg, rgba(45, 212, 191, .14), rgba(245, 200, 107, .14)); border: 1px solid var(--line2); display: grid; gap: 8px; }
.ig-rule p { margin: 0; color: var(--muted); }
.ig-rule .big { font-family: var(--f-display); font-size: clamp(1.25rem, 3vw, 1.6rem); line-height: 1.25; color: var(--text); text-wrap: balance; }
.ig-rule span.t { color: var(--teal); }
.ig-rule span.a { color: var(--gold); }
.ig-q { border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.ig-q summary { cursor: pointer; padding: 12px 14px; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.ig-q summary::-webkit-details-marker { display: none; }
.ig-see { margin-left: auto; font-size: .8rem; color: var(--teal); font-weight: 600; white-space: nowrap; }
.ig-q[open] .ig-see { display: none; }
.ig-q p { margin: 0; padding: 0 14px 14px; color: var(--green); }
.ig-q p::before { content: '→ '; }
.ig-foot { display: flex; flex-wrap: wrap; gap: 10px; }
.ig-src { font-size: .8rem; color: var(--dim); margin: 0; }
.ig-banner { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(45, 212, 191, .1); border: 1px solid rgba(45, 212, 191, .35); color: var(--text); }
.ig-banner:hover { text-decoration: none; background: rgba(45, 212, 191, .16); }
.ig-banner .go { margin-left: auto; color: var(--teal); font-size: 1.2rem; }
.ig-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; font-size: .88rem; color: var(--muted); }
.ig-card h3 { font-family: var(--f-display); font-size: 1.2rem; }
@media (max-width: 700px) {
  .ig-cols { grid-template-columns: 1fr; }
  .ig-bar, .ig-axis { grid-template-columns: 64px minmax(0, 1fr) 76px; }
}
.ig-svg .tb { fill: var(--blue); }
.ig-svg .lb { stroke: var(--blue); fill: none; }
.ig-svg .fb { fill: var(--blue); }
.ig-col.b { background: rgba(96, 165, 250, .07); border-color: rgba(96, 165, 250, .3); }
.ig-col.b h2 { color: var(--blue); }
.ig-tbl, .ig-steps { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 10px; min-width: 0; }
.ig-tbl h3, .ig-steps h3 { margin: 0; font-size: 1.05rem; }
.ig-tbl .table-wrap { margin: 0; }
.ig-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 520px; }
.ig-table th { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line2); }
.ig-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ig-table tr:last-child td { border-bottom: 0; }
.ig-table td:first-child { color: var(--text); white-space: nowrap; }
.ig-table tbody tr:nth-child(odd) td { background: rgba(255, 255, 255, .025); }
.ig-steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: igs; }
.ig-steps li { counter-increment: igs; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; align-items: start; }
.ig-steps li::before { content: counter(igs); grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #04211d; background: linear-gradient(135deg, var(--teal), var(--teal2)); }
.ig-steps li b { padding-top: 5px; }
.ig-steps li p { margin: 0; color: var(--muted); font-size: .93rem; }
.ig-bar, .ig-axis { grid-template-columns: 112px minmax(0, 1fr) 92px; }
@media (max-width: 700px) { .ig-bar, .ig-axis { grid-template-columns: 84px minmax(0, 1fr) 76px; } .ig-table td:first-child { white-space: normal; } }

/* ===== buscador ===== */
.i-search { width: 1em; height: 1em; display: block; }
.search-btn { color: var(--teal); font-size: 1.35rem; }
.nav .ico .i-search { margin: 0 auto; width: 1.15rem; height: 1.15rem; color: var(--teal); }
.home-search { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 14px 16px; min-height: 52px; border-radius: 14px; background: var(--bg2); border: 1.5px solid rgba(45, 212, 191, .45); color: var(--muted); font-size: 1rem; box-shadow: 0 0 0 4px rgba(45, 212, 191, .06); }
.home-search:hover { text-decoration: none; border-color: var(--teal); color: var(--text); }
.home-search .i-search { color: var(--teal); font-size: 1.3rem; flex: none; }
.sr-page { max-width: 760px; margin: 0 auto; }
.sr-title { display: flex; align-items: center; gap: 10px; }
.sr-title .i-search { color: var(--teal); font-size: .85em; }
.sr-bar { position: sticky; top: calc(var(--topbar) + var(--safe-t) + 8px); z-index: 5; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 16px; min-height: 58px; border-radius: 16px; background: var(--panel2); border: 1.5px solid rgba(45, 212, 191, .5); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.sr-bar:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(45, 212, 191, .18), 0 10px 30px rgba(0, 0, 0, .35); }
.sr-ico { color: var(--teal); font-size: 1.35rem; flex: none; }
.sr-bar input { flex: 1; min-width: 0; height: 44px; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 1.08rem; }
.sr-bar input::placeholder { color: var(--muted); opacity: .85; }
.sr-bar input::-webkit-search-cancel-button { display: none; }
.sr-clear { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .08); color: var(--muted); font-size: 1rem; }
.sr-clear:hover { color: var(--text); background: rgba(255, 255, 255, .14); }
.sr-filters { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 4px; scrollbar-width: none; }
.sr-filters::-webkit-scrollbar { display: none; }
.sr-filters .fchip { flex: none; }
.sr-count { font-size: .85rem; color: var(--dim); margin: 10px 2px; min-height: 1.2em; }
.sr-h { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: 22px 0 10px; }
.sr-sugg { display: flex; flex-wrap: wrap; gap: 8px; }
.sr-sugg button { padding: 9px 14px; min-height: 40px; border-radius: 999px; border: 1px solid var(--line2); background: var(--panel); color: var(--text); font-size: .9rem; }
.sr-sugg button:hover { border-color: var(--teal); }
.sr-item { position: relative; display: grid; gap: 4px; padding: 14px 40px 14px 16px; margin-bottom: 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.sr-item:hover { text-decoration: none; border-color: var(--line2); background: var(--panel2); }
.sr-item b { font-size: 1.02rem; line-height: 1.3; }
.sr-item p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-item small { color: var(--dim); font-size: .76rem; }
.sr-item mark { background: rgba(245, 200, 107, .28); color: var(--text); border-radius: 3px; padding: 0 2px; }
.sr-go { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--teal); font-size: 1.4rem; }
.sr-kind { justify-self: start; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .06); color: var(--muted); }
.sr-kind.k-v { background: rgba(45, 212, 191, .14); color: var(--teal); }
.sr-kind.k-i { background: rgba(96, 165, 250, .15); color: var(--blue); }
.sr-kind.k-p { background: rgba(245, 200, 107, .15); color: var(--gold); }
.sr-kind.k-c { background: rgba(167, 139, 250, .15); color: #c4b5fd; }

/* ===== inicio: Farmi ===== */
.farmi-hero { position: relative; display: flex; align-items: center; gap: 18px; padding-top: 22px; }
.farmi-mascot { width: auto; height: 168px; flex: none; filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .45)); animation: fm-bob 3.2s ease-in-out infinite; }
@keyframes fm-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .farmi-mascot { animation: none; } }
.farmi-mascot .fm-arm-l { transform-origin: 40px 86px; animation: fm-wave 2.4s ease-in-out infinite; }
@keyframes fm-wave { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-14deg); } 80% { transform: rotate(8deg); } 90% { transform: rotate(-10deg); } }
@media (prefers-reduced-motion: reduce) { .farmi-mascot .fm-arm-l { animation: none; } }
.farmi-bubble { position: absolute; left: 0; top: 0; padding: 4px 10px; border-radius: 12px 12px 12px 3px; background: var(--text); color: var(--bg); font-weight: 700; font-size: .85rem; }
.hero .farmi-name, .farmi-name { font-family: var(--f-display); font-size: clamp(3.2rem, 9vw, 4.6rem); line-height: .95; margin: 0; letter-spacing: -.02em; }
.farmi-name em { font-style: normal; color: var(--gold); }
.farmi-sub { margin: 8px 0 0; color: var(--muted); font-size: clamp(1.02rem, 2.4vw, 1.2rem); }
@media (max-width: 420px) { .farmi-mascot { height: 140px; } .farmi-bubble { left: 0; } .farmi-hero { gap: 12px; } }

/* ===== aviso de versión nueva ===== */
.upd-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + var(--safe-b)); z-index: 70; width: min(92vw, 480px); display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 16px; background: var(--panel2); border: 1.5px solid rgba(45, 212, 191, .55); box-shadow: 0 14px 40px rgba(0, 0, 0, .5); font-weight: 600; animation: upd-in .35s ease; }
.upd-bar span { flex: 1; font-size: .92rem; }
.upd-x { flex: none; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--dim); }
@keyframes upd-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 899px) { .upd-bar { bottom: calc(82px + var(--safe-b)); } }
@media (prefers-reduced-motion: reduce) { .upd-bar { animation: none; } }

.modal .box { max-height: calc(100vh - 40px - var(--safe-t) - var(--safe-b)); overflow-y: auto; }

/* ===== descargas (PDF para imprimir) ===== */
.dl-list { display: grid; gap: 10px; }
.dl-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.dl-ico { font-size: 26px; flex: 0 0 auto; }
.dl-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dl-txt b { font-weight: 600; line-height: 1.3; }
.dl-txt small { color: var(--muted); font-size: 13px; }
.dl-btn { flex: 0 0 auto; font-weight: 700; font-size: 13px; color: #fff; background: var(--teal); border-radius: 999px; padding: 7px 13px; white-space: nowrap; }

/* ===== calculadoras ===== */
.calc-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.calc-wrap > .calc-note { grid-column: 1 / -1; }
@media (max-width: 760px) { .calc-wrap { grid-template-columns: 1fr; } }
.calc-form .field:last-of-type { margin-bottom: 16px; }
.calc-in { display: flex; gap: 8px; align-items: center; }
.calc-in .input { flex: 1; min-width: 0; font-size: 1.05rem; }
.calc-in .calc-u { flex: 0 0 auto; width: auto; min-width: 118px; }
.calc-unit { flex: 0 0 auto; min-width: 54px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.calc-side { display: grid; gap: 14px; }
.calc-res { min-height: 150px; }
.calc-main { font-family: var(--f-display); font-size: 2.1rem; font-weight: 700; color: var(--teal2, var(--teal)); line-height: 1.15; margin: 4px 0 6px; word-break: break-word; }
.calc-sub { color: var(--muted); font-size: .95rem; margin-bottom: 10px; }
.calc-steps { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.calc-steps ol { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: .95rem; line-height: 1.45; }
.calc-warn { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(239, 95, 95, .10); color: #b42318; font-size: .9rem; line-height: 1.4; }
.calc-empty { color: var(--muted); font-size: .95rem; line-height: 1.5; }
.calc-formula p { margin: 6px 0 0; font-weight: 600; line-height: 1.45; }
.calc-note { margin-top: 18px; padding: 12px 14px; border-radius: 14px; background: rgba(240, 138, 93, .10); border: 1px solid rgba(240, 138, 93, .3); font-size: .88rem; line-height: 1.5; color: var(--text); }
.calc-card .big-ico { font-size: 1.8rem; }

/* upsells llamativos (11/11): cinta rotativa, precio tachado, boton que late */
.ribbon { position:absolute; top:10px; left:10px; background:linear-gradient(135deg,#f59e0b,#ef4444); color:#fff; font-weight:800; font-size:12px; letter-spacing:.04em; text-transform:uppercase; padding:6px 11px; border-radius:999px; box-shadow:0 6px 18px rgba(239,68,68,.45); transition:opacity .18s, transform .18s; z-index:2; }
.ribbon.flip { opacity:0; transform:translateY(-6px); }
.ribbon-card { top:12px; left:auto; right:12px; }
.card-new { position:relative; border-color:rgba(245,158,11,.55)!important; box-shadow:0 0 0 1px rgba(245,158,11,.25), 0 10px 30px rgba(245,158,11,.12); }
.oldp { opacity:.65; font-weight:600; margin-left:4px; }
.cta-pulse { white-space:nowrap; animation:ctapulse 2s ease-in-out infinite; font-weight:800; }
@keyframes ctapulse { 0%,100% { box-shadow:0 8px 24px rgba(45,212,191,.25); } 50% { box-shadow:0 8px 34px rgba(45,212,191,.7), 0 0 0 5px rgba(45,212,191,.15); } }
@media (prefers-reduced-motion: reduce) { .cta-pulse { animation:none; } .ribbon { transition:none; } }

/* menu: 'Unlock more' destacado mientras falte algun modulo */
#nav a.nav-unlock { background:linear-gradient(135deg,#f59e0b,#ef4444); color:#fff!important; font-weight:800; border-radius:12px; box-shadow:0 6px 18px rgba(239,68,68,.35); }
#nav a.nav-unlock:hover { filter:brightness(1.06); }
#nav a.nav-unlock .pill-new { background:#fff; color:#ef4444; font-size:10px; font-weight:900; padding:2px 7px; border-radius:999px; margin-left:6px; letter-spacing:.05em; vertical-align:middle; }

/* Medical System Pharmacology brand (2026-11-14, same as the Spain app): Montserrat 800; Medical in white, System in the logo green #01CDA9 */
.ms-word { font-family: 'Montserrat', var(--f-display); font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.ms-m { color: #fff; }
.ms-s { color: #01CDA9; }
.brand img { object-fit: contain; }
.brand .ms-name { display: flex; flex-direction: column; line-height: 1.05; overflow: visible; }
.brand .ms-name span { overflow: visible; }
.brand .ms-word { font-size: 1rem; }
.brand .ms-name .bi { font-family: 'Montserrat', var(--f-display); font-weight: 600; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: #cfe7e3; }
.farmi-mascot.farmi-logo-ms { height: 132px; filter: drop-shadow(0 10px 24px rgba(0, 200, 170, .25)); }
.farmi-name.farmi-name-ms { font-size: clamp(2rem, 5.2vw, 3.1rem); line-height: 1.02; }
.farmi-name.farmi-name-ms .ms-word { display: block; }
.farmi-name.farmi-name-ms em { display: block; font-family: 'Montserrat', var(--f-display); font-weight: 600; font-size: .42em; letter-spacing: .16em; text-transform: uppercase; color: #cfe7e3; margin-top: .35em; }
@media (max-width: 420px) { .farmi-mascot.farmi-logo-ms { height: min(84px, 21vw); } .farmi-name.farmi-name-ms { font-size: min(1.75rem, 6.6vw); } .brand .ms-word { font-size: .9rem; } .brand .ms-name .bi { font-size: .62rem; } }
