*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:             #f4f2fa;
  --surface:        #ffffff;
  --border:         #e2ddf0;
  --border-light:   #ede9f6;
  --text:           #1a1a1a;
  --text-secondary: #5a5470;
  --text-muted:     #9e98b8;
  --purple:         #3d1e78;
  --purple-mid:     #6b3fa0;
  --yellow:         #f0c300;
  --yellow-dark:    #c49e00;
  --magenta:        #c8006e;
  --success:        #16a34a;
  --success-light:  #dcfce7;
  --shadow-sm: 0 1px 4px rgba(61,30,120,.07);
  --shadow-md: 0 4px 18px rgba(61,30,120,.11);
  --shadow-lg: 0 12px 36px rgba(61,30,120,.18);
  --radius:    12px;
  --radius-sm: 6px;
}

html, body {
  height: 100%;
  font-family: 'Jost', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.repo-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.repo-header {
  background: var(--purple);
  border-bottom: 4px solid var(--magenta);
  padding: 24px 40px;
  display: flex;
  justify-content: center;
}
.repo-header-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}
.repo-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.repo-logo img {
  height: 44px;
  width: auto;
  flex-shrink: 0;
}
.repo-heading {
  flex: 1;
  min-width: 200px;
}
.repo-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .2px;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 1.2;
}
.repo-subtitle {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--purple);
  background: var(--yellow);
  border-radius: 4px;
  padding: 2px 10px;
  margin-top: 6px;
}
.repo-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.75);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 8px;
  padding: 7px 14px;
  transition: background .18s, color .18s;
  flex-shrink: 0;
}
.repo-back:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ── Main ── */
.repo-main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 40px 64px;
}

/* ── Resource Card Grid ── */
.nlm-grid,
#nlmGrid:not(:has(.section-block)) {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
#nlmGrid:has(.section-block) {
  display: block;
}

/* ── Resource Card ── */
.nlm-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--card-accent, var(--purple));
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
  overflow: hidden;
}
.nlm-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.nlm-card-body {
  padding: 16px 18px 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.nlm-card-index {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  color: var(--card-accent, var(--purple));
  text-transform: uppercase;
  margin-bottom: 10px;
  opacity: .7;
}
.nlm-card-name {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.38;
  color: var(--text);
  flex: 1;
  margin-bottom: 8px;
}
.nlm-card-desc {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 2px;
}
.nlm-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 9px 16px 11px;
  border-top: 1px solid var(--border-light);
}
.nlm-card-tag {
  display: inline-block;
  background: var(--card-accent, var(--purple));
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  border-radius: 20px;
  padding: 3px 11px;
  opacity: .9;
}
.nlm-card-yt-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: #ef4444;
  border-radius: 20px;
  padding: 3px 10px;
  margin-left: auto;
}
.nlm-card--yt { cursor: pointer; }
.nlm-card--yt:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

/* ── Sections ── */
.section-block { margin-bottom: 48px; }
.section-block:last-child { margin-bottom: 0; }
.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.section-header::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--yellow);
  border-radius: 2px;
}
.section-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .9px;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--purple);
  color: #fff;
  padding: 4px 14px;
  border-radius: 20px;
}

/* ── Locked resource card ── */
.nlm-card--locked {
  position: relative;
  cursor: not-allowed;
  pointer-events: none;
  user-select: none;
}
.nlm-card--locked .nlm-card-body,
.nlm-card--locked .nlm-card-footer {
  filter: blur(1.5px);
  opacity: .45;
}
.nlm-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255,255,255,.22);
  border-radius: var(--radius);
  backdrop-filter: blur(2px);
  z-index: 2;
}
.nlm-countdown {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--card-accent, var(--purple));
  background: rgba(255,255,255,.92);
  border-radius: 20px;
  padding: 4px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  font-variant-numeric: tabular-nums;
}
.nlm-lock-icon {
  width: 38px;
  height: 38px;
  color: var(--card-accent, var(--purple));
  opacity: .85;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.18));
}
.nlm-card-unlock-date {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .3px;
  margin-left: auto;
}

/* ── Empty state ── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  opacity: .4;
}
.empty-state-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.empty-state-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Landing: city grid ── */
.landing-section-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.city-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.city-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.city-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--purple);
}
.city-card-thumb {
  height: 100px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-mid) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.city-card-thumb svg {
  width: 40px;
  height: 40px;
  color: rgba(255,255,255,.55);
}
.city-card-body {
  padding: 18px 20px 20px;
}
/* Los nombres de liceo son largos: el texto se mantiene contenido y parte
   en varias lineas en vez de desbordar la tarjeta. */
.city-card-name {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--purple);
  line-height: 1.3;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}
.city-card-inst {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.city-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--purple);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  border-radius: 8px;
  padding: 7px 16px;
}
.city-card--locked {
  opacity: .5;
  cursor: default;
  pointer-events: none;
}
.city-card--locked .city-card-thumb {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
}
.city-card--locked .city-card-name { color: var(--text-muted); }
.city-soon-badge {
  display: inline-block;
  background: var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-radius: 6px;
  padding: 5px 12px;
}

/* ── Pantalla de acceso (index.html) ── */
.acceso-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 48px 16px 64px;
}
.acceso-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 34px 30px 30px;
  text-align: center;
}
.acceso-titulo {
  font-size: 19px;
  font-weight: 800;
  color: var(--purple);
  line-height: 1.3;
  margin-bottom: 6px;
}
.acceso-sub {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 22px;
}
.acceso-input {
  width: 100%;
  font-family: inherit;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 3px;
  text-align: center;
  text-transform: uppercase;
  color: var(--purple);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 12px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.acceso-input:focus { border-color: var(--purple); background: var(--surface); }
.acceso-input::placeholder { color: var(--text-muted); font-weight: 600; letter-spacing: 2px; }
.acceso-msg {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  min-height: 1.4em;
  margin: 10px 0 4px;
}
.acceso-msg--err { color: var(--magenta); }
.acceso-msg--ok  { color: #0f766e; }
.acceso-btn {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: #fff;
  background: var(--purple);
  border: none;
  border-radius: 12px;
  padding: 13px 24px;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.acceso-btn:hover:not(:disabled) { background: var(--purple-mid); }
.acceso-btn:disabled { opacity: .6; cursor: default; }

/* Salir del liceo, para equipos compartidos. */
.btn-salir {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
}
.btn-salir:hover { color: var(--magenta); text-decoration: underline; }

/* ── Calama: module grid ── */
.modules-intro {
  margin-bottom: 32px;
}
.modules-intro-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--purple);
  margin-bottom: 4px;
}
.modules-intro-sub {
  font-size: 14px;
  color: var(--text-secondary);
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.module-tile {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.module-tile:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--purple);
}
.module-thumb {
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.city-card .module-thumb {
  height: 100px;
  aspect-ratio: unset;
}
.city-card .module-thumb--fab { background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important; }
.city-card .module-thumb--rv  { background: linear-gradient(135deg, #c8006e 0%, #9f1239 100%) !important; }
.city-card .module-thumb--rob { background: linear-gradient(135deg, #b45309 0%, #92400e 100%) !important; }
.city-card .module-thumb--ia  { background: linear-gradient(135deg, #0f766e 0%, #065f46 100%) !important; }
.module-thumb svg {
  width: 52px;
  height: 52px;
  color: rgba(255,255,255,.65);
  stroke-width: 1.5;
}
.module-thumb--fab  { background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%); }
.module-thumb--rv   { background: linear-gradient(135deg, #c8006e 0%, #9f1239 100%); }
.module-thumb--rob  { background: linear-gradient(135deg, #b45309 0%, #92400e 100%); }
.module-thumb--ia   { background: linear-gradient(135deg, #0f766e 0%, #065f46 100%); }
.module-label {
  padding: 14px 16px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.module-tile--locked {
  cursor: default;
  pointer-events: none;
}
.module-tile--locked .module-thumb {
  filter: grayscale(.6);
  opacity: .7;
}
.module-tile--locked .module-label {
  color: var(--text-muted);
}
.module-soon {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 3px 9px;
  backdrop-filter: blur(4px);
}

/* ── Botón volver ── */
.btn-volver {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 22px;
  font-family: 'Jost', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--purple);
  text-decoration: none;
  margin-bottom: 32px;
  transition: border-color .18s, box-shadow .18s, transform .12s;
  box-shadow: var(--shadow-sm);
}
.btn-volver:hover {
  border-color: var(--purple);
  box-shadow: var(--shadow-md);
  transform: translateX(-3px);
}
.btn-volver svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Breadcrumb (oculto) ── */
.breadcrumb { display: none; }

/* ── Modals PDF / Image ── */
.pdf-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.78);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pdf-backdrop.open { display: flex; }
.modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--purple);
  padding: 10px 16px;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}
.modal-topbar-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  opacity: .75;
  transition: opacity .15s;
}
.modal-topbar-close:hover { opacity: 1; }
.modal-topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--yellow);
  color: var(--purple);
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 20px;
  padding: 5px 14px;
  transition: opacity .15s;
  border: none;
  cursor: pointer;
}
.modal-topbar-btn:hover { opacity: .85; }
.pdf-modal {
  width: 100%;
  max-width: 920px;
  height: 90vh;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
}
.pdf-modal iframe {
  width: 100%;
  flex: 1;
  border: none;
  display: block;
}
.img-modal {
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
}
.img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: auto;
}
.img-wrap img {
  max-width: 100%;
  max-height: calc(90vh - 60px);
  border-radius: 6px;
  object-fit: contain;
}

/* ── Modal Código ── */
.code-modal {
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  background: #fafafa;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
}
.code-lang-label {
  font-size: 11px;
  font-family: monospace;
  color: #ccc;
  margin: 0 auto 0 0;
  padding-left: 4px;
}
.code-wrap {
  flex: 1;
  overflow: auto;
  display: flex;
  background: #282c34;
}
.code-gutter {
  flex-shrink: 0;
  padding: 20px 12px 20px 16px;
  background: #eaeaea;
  border-right: 1px solid #d0d0d0;
  text-align: right;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #999;
  user-select: none;
}
.code-pre {
  margin: 0;
  padding: 20px 24px;
  flex: 1;
  overflow: visible;
  background: transparent !important;
}
.code-pre code,
.code-pre code.hljs,
.code-wrap .hljs {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.7;
  padding: 0;
  white-space: pre;
  display: block;
}
.code-wrap, .code-pre { background: #fafafa; }
.code-modal--dark .code-wrap,
.code-modal--dark .code-pre { background: #282c34; }
.code-modal--dark .code-gutter { background: #21252b; border-right-color: #181a1f; color: #636d83; }
.code-modal--dark { background: #282c34; }

/* ── Modal YouTube ── */
.yt-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.yt-backdrop.open { display: flex; }
.yt-modal {
  position: relative;
  width: 100%;
  max-width: 860px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.yt-close {
  position: absolute;
  top: -38px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  opacity: .8;
  transition: opacity .15s;
  z-index: 10;
}
.yt-close:hover { opacity: 1; }
.yt-wrap {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
}
.yt-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
  display: block;
}

/* ── Soporte Btn ── */
.soporte-btn {
  flex-shrink: 0;
  background: var(--yellow);
  color: var(--purple);
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-family: 'Jost', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s, transform .12s;
}
.soporte-btn:hover { background: #ffe033; transform: translateY(-1px); }

/* ── Soporte Modal ── */
.soporte-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.soporte-backdrop.active { display: flex; }
.soporte-modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px 32px 32px;
  position: relative;
  box-shadow: 0 20px 60px rgba(61,30,120,.25);
  border-top: 5px solid var(--purple);
}
.soporte-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  transition: color .15s;
}
.soporte-close:hover { color: var(--text); }
.soporte-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.soporte-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.soporte-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}
.soporte-field label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.soporte-field label span { color: var(--magenta); }
.soporte-field input,
.soporte-field textarea {
  font-family: 'Jost', system-ui, sans-serif;
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
  resize: vertical;
}
.soporte-field input:focus,
.soporte-field textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(61,30,120,.1);
}
.soporte-error {
  font-size: 12px;
  color: var(--magenta);
  margin-top: 4px;
  display: none;
}
.soporte-error.visible { display: block; }
.soporte-status {
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  padding: 0;
  margin-bottom: 0;
  transition: all .2s;
}
.soporte-status--ok { background: #dcfce7; color: #15803d; padding: 12px 16px; margin-bottom: 14px; }
.soporte-status--err { background: #fee2e2; color: #b91c1c; padding: 12px 16px; margin-bottom: 14px; }
.soporte-submit {
  width: 100%;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 13px;
  font-family: 'Jost', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background .18s, transform .12s;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.soporte-submit:hover:not(:disabled) { background: var(--purple-mid); transform: translateY(-1px); }
.soporte-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ══ Responsive ═════════════════════════════════════════════════════════ */

/* ── Tablet ── */
@media (max-width: 960px) {
  .nlm-grid,
  #nlmGrid:not(:has(.section-block)) { grid-template-columns: repeat(2, 1fr); }
  .city-grid   { grid-template-columns: repeat(2, 1fr); }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .repo-main   { padding: 28px 24px 48px; }
  .repo-header { padding: 18px 24px; }
  .repo-logo img { height: 38px; }
  .repo-title  { font-size: 18px; }
  .section-block { margin-bottom: 36px; }
}

/* ── Móvil grande ── */
@media (max-width: 700px) {
  /* La cabecera se apila: logo y botón «volver» arriba, título debajo.
     Antes el título se aplastaba entre los dos. */
  .repo-header { padding: 14px 16px; }
  .repo-header-inner { flex-wrap: wrap; gap: 12px; }
  .repo-logo { order: 1; }
  .repo-back { order: 2; margin-left: auto; padding: 6px 12px; font-size: 12px; }
  .repo-heading { order: 3; flex: 1 1 100%; min-width: 0; }
  .repo-logo img { height: 34px; }
  .repo-title { font-size: 16px; }
  .repo-subtitle { font-size: 10.5px; margin-top: 4px; }

  .repo-main { padding: 22px 16px 40px; }
  .section-header { gap: 10px; margin-bottom: 14px; }
  .section-title { font-size: 11px; padding: 4px 11px; white-space: normal; }
}

/* ── Móvil ── */
@media (max-width: 500px) {
  .nlm-grid,
  #nlmGrid:not(:has(.section-block)) { grid-template-columns: 1fr; }
  .city-grid   { grid-template-columns: 1fr; }
  .acceso-box  { padding: 16px; }
  .acceso-row  { flex-direction: column; }
  .acceso-btn  { padding: 12px 24px; }
  /* Los módulos se quedan en dos columnas: son tarjetas cuadradas y
     pequeñas, y en una sola columna obligan a un desplazamiento larguísimo. */
  .module-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  .repo-main { padding: 18px 13px 36px; }
  .nlm-card-body { padding: 14px 15px 10px; }
  .nlm-card-name { font-size: 14px; }
  .nlm-card-desc { font-size: 12px; }
  .landing-section-title, .modules-intro-title { font-size: 15px; }
  .acceso-main   { padding: 28px 16px 48px; }
  .acceso-card   { padding: 26px 20px 22px; }
  .acceso-titulo { font-size: 17px; }
  .acceso-input  { font-size: 18px; letter-spacing: 2px; }
}

/* ── Pantallas muy estrechas ── */
@media (max-width: 360px) {
  .module-grid { grid-template-columns: 1fr; }
  .repo-title { font-size: 14.5px; }
}

/* ── Modales del sitio público ───────────────────────────────────────────
   El visor de código, el de PDF, el de imagen y el de vídeo daban por hecho
   una pantalla ancha. */
@media (max-width: 700px) {
  .soporte-modal { padding: 28px 20px 24px; }
  .soporte-btn   { font-size: 13px; padding: 8px 13px; }

  .code-modal, .yt-modal {
    width: 100%; max-width: 100%;
    max-height: 92vh; border-radius: 12px;
  }
  .modal-topbar { padding: 9px 12px; }
  .modal-topbar-btn { font-size: 11.5px; padding: 5px 11px; }

  /* Los visores ocupan la pantalla completa: en un teléfono no sobra sitio. */
  .pdf-modal, .img-modal {
    max-width: 100%; width: 100%;
    height: 100vh; height: 100dvh;
    border-radius: 0;
  }
  .pdf-backdrop { padding: 0; }
  .modal-topbar { border-radius: 0; }

  /* La numeración de líneas se come el ancho útil en un teléfono. */
  .code-gutter { display: none; }
  .code-pre { font-size: 12px; padding: 12px; }
}

/* Quien prefiera menos movimiento, que no lo tenga. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
