:root{
  --bg: #0b1020;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.09);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.72);
  --line: rgba(255,255,255,.14);
  --accent: #6ee7ff;
  --accent2: #a78bfa;
  --shadow: 0 20px 60px rgba(0,0,0,.45);
  --radius: 18px;
  --maxw: 1100px;
}

*{ box-sizing: border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 20% 20%, rgba(110,231,255,.16), transparent 60%),
    radial-gradient(900px 500px at 80% 30%, rgba(167,139,250,.18), transparent 60%),
    radial-gradient(1200px 800px at 60% 90%, rgba(255,255,255,.06), transparent 60%),
    var(--bg);
}

/* Topbar */
.topbar{
  position: sticky;
  top:0;
  z-index: 50;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(10,14,30,.72);
  backdrop-filter: blur(12px);
}

.brand{ display:flex; align-items:center; gap:12px; min-width: 240px; }
.brand__dot{
  width: 12px; height:12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 0 6px rgba(110,231,255,.10);
}
.brand__title{ font-weight: 700; letter-spacing: .2px; }
.brand__subtitle{ color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.controls{ display:flex; gap:10px; align-items:center; }

.btn{
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .08s ease, background .2s ease, border-color .2s ease;
  font-weight: 600;
  font-size: 13.5px;
}
.btn:hover{ background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.22); }
.btn:active{ transform: translateY(1px); }
.btn--primary{
  background: linear-gradient(135deg, rgba(110,231,255,.22), rgba(167,139,250,.18));
  border-color: rgba(255,255,255,.22);
}

/* Stage */
.stage{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 16px 90px;
}

/* Progress */
.progress{
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  overflow:hidden;
  margin: 12px 4px 16px;
}
.progress__bar{
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

/* Deck / Slides */
.deck{
  position: relative;
  min-height: 62vh;
}
.slide{
  display:none;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.slide.is-active{ display:block; }

.slide__content{
  padding: 30px 30px 26px;
}

.kicker{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
  border: 1px solid var(--line);
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
}

h1{
  margin: 16px 0 10px;
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.08;
  letter-spacing: -.02em;
}
h2{
  margin: 6px 0 12px;
  font-size: clamp(20px, 2.3vw, 30px);
  letter-spacing: -.01em;
}
h3{
  margin: 0 0 10px;
  font-size: 17px;
}

.lead{
  color: var(--text);
  font-size: 16.5px;
  line-height: 1.55;
  margin: 0 0 14px;
}
.meta{
  margin-top: 14px;
  display:grid;
  gap: 6px;
  color: var(--muted);
}
.meta__label{
  color: rgba(255,255,255,.85);
  font-weight: 700;
}
.hint{
  margin-top: 18px;
  color: var(--muted);
  font-size: 13.5px;
}

kbd{
  padding: 2px 7px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}

/* Layout helpers */
.grid2{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.cards3{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.card{
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 16px 14px;
}
.bullets{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}
.bullets li{ margin: 6px 0; }

.callout{
  margin-top: 16px;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(110,231,255,.22);
  background: rgba(110,231,255,.08);
  color: rgba(255,255,255,.88);
}
.tip{
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(167,139,250,.22);
  background: rgba(167,139,250,.08);
  color: rgba(255,255,255,.88);
}
.pillrow{ display:flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.pill{
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 12.5px;
}

/* Table */
.tablewrap{
  overflow:auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  margin-top: 10px;
  -webkit-overflow-scrolling: touch; /* mejor scroll en iOS */
}
.table{
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
.table th, .table td{
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  text-align: left;
}
.table th{
  color: rgba(255,255,255,.88);
  font-size: 13px;
  letter-spacing: .02em;
  background: rgba(255,255,255,.05);
}
.table td{ color: var(--muted); }

/* Bottom nav */
.nav{
  position: fixed;
  left: 0; right:0;
  bottom: 0;
  z-index: 60;
  border-top: 1px solid var(--line);
  background: rgba(10,14,30,.78);
  backdrop-filter: blur(12px);
  padding: 12px 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 14px;

  /* FIX: para que en pantallas pequeñas no se encime */
  flex-wrap: wrap;
}
.nav__btn{
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  font-size: 13.5px;
  min-width: 124px;
}
.nav__btn--primary{
  background: linear-gradient(135deg, rgba(110,231,255,.22), rgba(167,139,250,.18));
  border-color: rgba(255,255,255,.22);
}
.nav__center{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 2px;
  min-width: 220px;
}
.nav__counter{
  color: var(--muted);
  font-weight: 800;
  font-size: 12.5px;
}
.nav__title{
  color: rgba(255,255,255,.88);
  font-weight: 800;
  font-size: 13.5px;
  text-align:center;
  max-width: 420px;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

/* Modal */
.modal{
  width: min(980px, calc(100% - 24px));
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(10,14,30,.92);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 0;
}
.modal::backdrop{ background: rgba(0,0,0,.55); }
.modal__header{
  padding: 14px 14px 12px;
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.modal__title{ font-weight: 900; font-size: 16px; }
.modal__subtitle{ color: var(--muted); font-size: 13px; margin-top: 2px; }
.modal__grid{
  padding: 14px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.thumb{
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  border-radius: 16px;
  padding: 12px;
  cursor:pointer;
  transition: transform .08s ease, background .2s ease;
}
.thumb:hover{ background: rgba(255,255,255,.08); }
.thumb:active{ transform: translateY(1px); }
.thumb__n{
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
}
.thumb__t{
  margin-top: 6px;
  font-weight: 900;
  font-size: 13.5px;
}
.thumb__p{
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

/* Footer note */
.footerNote{
  margin-top: 18px;
  color: var(--muted);
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 14px;
}

/* Responsive */
@media (max-width: 860px){
  .grid2{ grid-template-columns: 1fr; }
  .cards3{ grid-template-columns: 1fr; }
  .slide__content{ padding: 22px 18px 18px; }
  .nav__center{ min-width: 170px; }
  .modal__grid{ grid-template-columns: 1fr; }
}

/* Extra small nav improvements */
@media (max-width: 520px){
  .nav__btn{ min-width: 46%; }
  .nav__center{ width: 100%; order: 3; margin-top: 6px; }
  .stage{ padding-bottom: 120px; }
}

/* Tabla responsive tipo tarjetas */
@media (max-width: 640px) {
  .table { min-width: 0 !important; }
  .table thead { display: none; }

  .tablewrap {
    overflow: visible;
    border-radius: 16px;
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  .table tr {
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.05);
    border-radius: 16px;
    padding: 10px 12px;
    margin: 10px 0;
  }

  .table td {
    border: none;
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: rgba(255,255,255,.82);
  }

  .table td::before {
    content: attr(data-label);
    font-weight: 900;
    color: rgba(255,255,255,.92);
    flex: 0 0 38%;
  }
}

@media print{
  .topbar, .nav, .progress{ display:none !important; }
  body{ background: #ffffff; color:#111; }
  .slide{
    display:block !important;
    page-break-after: always;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: none;
  }
  .slide__content{ padding: 22px; }
  .card, .callout, .tip, .tablewrap{
    background: #fff;
    border-color: #ddd;
  }
  .bullets, .lead, .meta, .pill{ color:#333 !important; }
}