/* =====================================================================
   Base compartida — Aula Virtual de Computación
   Paleta: blanco + un solo color de marca (#87220E) + sombras.
   ===================================================================== */
@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }

:root {
  /* Marca (único color) y sus tintes */
  --c:      #87220E;
  --c-700:  #6E1B0B;
  --c-800:  #521408;
  --c-500:  #A03A25;
  --c-300:  #D9A69B;
  --c-200:  #EBCBC4;
  --c-100:  #F6E6E2;
  --c-50:   #FBF4F2;
  --c-a08:  rgba(135, 34, 14, .08);
  --c-a14:  rgba(135, 34, 14, .14);

  /* Neutros (texto y bordes) */
  --white:  #FFFFFF;
  --bg:     #F8F7F7;
  --ink:    #1F1A19;
  --ink-2:  #4A4341;
  --muted:  #857C79;
  --line:   #ECE7E5;
  --line-2: #F3F0EF;

  /* Sombras en capas */
  --sh-1: 0 1px 2px rgba(31, 26, 25, .05), 0 1px 1px rgba(31, 26, 25, .03);
  --sh-2: 0 1px 2px rgba(31, 26, 25, .04), 0 8px 24px -10px rgba(31, 26, 25, .12);
  --sh-3: 0 2px 6px rgba(31, 26, 25, .05), 0 20px 40px -14px rgba(135, 34, 14, .22);
  --sh-pop: 0 12px 48px -12px rgba(31, 26, 25, .28), 0 2px 6px rgba(31, 26, 25, .06);
  --ring: 0 0 0 3px var(--c-a14);

  --r-lg: 18px;
  --r:    14px;
  --r-sm: 10px;
  --r-xs: 7px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: .22s var(--ease);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--c); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }
::selection { background: var(--c-100); color: var(--c-800); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* Scrollbar discreta */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-200); }

/* ---------------------------------------------------------------- Superficies */
.panel {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  border: 1px solid rgba(31, 26, 25, .04);
}
.panel-pad { padding: 1.5rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.panel-title { font-size: 1.02rem; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: .55rem; }
.panel-title .ico { color: var(--c); }
.eyebrow { font-size: .72rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------------------------------------------------------------- Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 40px; padding: 0 1.05rem; border-radius: 999px;
  font-weight: 600; font-size: .9rem; white-space: nowrap;
  transition: background var(--t), box-shadow var(--t), color var(--t), transform var(--t);
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--c); color: #fff; box-shadow: 0 1px 2px rgba(82, 20, 8, .3), 0 6px 16px -6px rgba(135, 34, 14, .55); }
.btn-primary:hover { background: var(--c-700); }
.btn-soft { background: var(--c-50); color: var(--c); }
.btn-soft:hover { background: var(--c-100); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-line { background: var(--white); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line), var(--sh-1); }
.btn-line:hover { color: var(--c); box-shadow: inset 0 0 0 1px var(--c-200), var(--sh-1); }
.btn-danger { color: var(--c); background: var(--white); box-shadow: inset 0 0 0 1px var(--c-200); }
.btn-danger:hover { background: var(--c); color: #fff; }
.btn-sm { height: 32px; padding: 0 .8rem; font-size: .82rem; }
.btn-xs { height: 28px; padding: 0 .65rem; font-size: .78rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; }
.btn-icon.btn-sm { width: 30px; height: 30px; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- Formularios */
.field { display: flex; flex-direction: column; gap: .35rem; }
.field > label, .label { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.hint { font-size: .76rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 .9rem;
  background: var(--white); border-radius: var(--r-sm);
  border: 1px solid var(--line); box-shadow: var(--sh-1);
  transition: border-color var(--t), box-shadow var(--t);
}
.textarea { height: auto; min-height: 96px; padding: .7rem .9rem; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 2.2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23857C79' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; }
.input:hover, .select:hover, .textarea:hover { border-color: #DED7D5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--c-300); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: #B5ADAA; }
.check { display: inline-flex; align-items: center; gap: .55rem; font-size: .88rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--c); }

/* ---------------------------------------------------------------- Chips y badges */
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  height: 26px; padding: 0 .65rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap;
}
.chip-c { background: var(--c-50); color: var(--c); }
.chip-solid { background: var(--c); color: #fff; }
.chip-line { background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
.chip-err { background: #fdecea; color: #b42318; }
.chip-err .ico { vertical-align: -2px; }

/* Nivel diagnóstico: intensidad del mismo color */
.lvl { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; }
.lvl::before { content: ''; width: 9px; height: 9px; border-radius: 50%; }
.lvl-aceptable { color: var(--ink-2); }
.lvl-aceptable::before { background: var(--c); }
.lvl-medio { color: var(--ink-2); }
.lvl-medio::before { background: var(--c-300); }
.lvl-bajo { color: var(--c); }
.lvl-bajo::before { background: var(--white); box-shadow: inset 0 0 0 2px var(--c); }

/* ---------------------------------------------------------------- Barra de progreso */
.bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--c-500), var(--c)); transition: width .9s var(--ease); }

/* ---------------------------------------------------------------- Esqueletos */
.sk { position: relative; overflow: hidden; background: var(--line-2); border-radius: var(--r-xs); }
.sk::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); animation: sk 1.3s infinite; }
@keyframes sk { to { transform: translateX(100%); } }
.sk-line { height: 12px; margin: .45rem 0; }

/* ---------------------------------------------------------------- Vacíos */
.empty { text-align: center; padding: 2.2rem 1rem; color: var(--muted); font-size: .9rem; }
.empty .ico { margin: 0 auto .7rem; color: var(--c-300); }

/* ---------------------------------------------------------------- Modales */
.modal-wrap {
  position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 1rem;
  background: rgba(31, 26, 25, .32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade .2s var(--ease);
}
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 2rem); overflow: auto;
  background: var(--white); border-radius: 22px; box-shadow: var(--sh-pop);
  animation: pop .26s var(--ease);
}
.modal-lg { width: min(860px, 100%); }
.modal-xl { width: min(1080px, 100%); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.4rem; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-2); }
.modal-head h2 { font-size: 1.08rem; font-weight: 650; letter-spacing: -.01em; }
.modal-body { padding: 1.4rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: 1rem 1.4rem 1.3rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------------------------------------------------------------- Toasts */
.toasts { position: fixed; z-index: 1000; bottom: 1.2rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; width: min(440px, calc(100% - 2rem)); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: .65rem; width: 100%;
  padding: .8rem 1rem; border-radius: 14px; background: var(--ink); color: #fff;
  font-size: .88rem; font-weight: 500; box-shadow: var(--sh-pop); animation: toastIn .3s var(--ease);
}
.toast.err { background: var(--c); }
.toast .ico { flex: none; opacity: .9; }
.toast.out { animation: toastOut .25s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- Calendario compartido */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .9rem; }
.cal-head strong { font-size: 1rem; font-weight: 650; text-transform: capitalize; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow div { text-align: center; font-size: .7rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding-bottom: .35rem; }
.cal-day {
  position: relative; aspect-ratio: 1 / .9; display: grid; place-items: center;
  border-radius: 12px; font-size: .88rem; font-weight: 500; color: var(--ink-2);
  transition: background var(--t), color var(--t), box-shadow var(--t);
}
.cal-day:hover { background: var(--c-50); color: var(--c); }
.cal-day.out { color: #CFC8C6; }
.cal-day.today { color: var(--c); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--c-200); }
.cal-day.sel { background: var(--c); color: #fff; box-shadow: 0 6px 14px -6px rgba(135,34,14,.6); }
.cal-day .dots { position: absolute; bottom: 14%; left: 50%; transform: translateX(-50%); display: flex; gap: 3px; }
.cal-day .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.cal-day.sel .dots i { background: #fff; }

.ev-tipo-entrega { --ev: var(--c); }
.ev-tipo-aviso   { --ev: var(--c-500); }
.ev-tipo-clase   { --ev: var(--c-300); }
.ev-tipo-sin_clases { --ev: #8C8582; }

/* ---------------------------------------------------------------- Eventos y horario (aula y consulta) */
.ev-list { display: flex; flex-direction: column; gap: .5rem; }
.ev { display: flex; gap: .85rem; align-items: center; padding: .55rem .4rem; border-radius: 12px; }
.ev:hover { background: var(--line-2); }
.ev-date { width: 46px; flex: none; text-align: center; border-radius: 11px; padding: .3rem 0; background: var(--white); box-shadow: var(--sh-1), inset 0 0 0 1px var(--line); }
.ev-date b { display: block; font-size: 1.05rem; font-weight: 750; line-height: 1.1; color: var(--c); }
.ev-date small { display: block; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ev-info { min-width: 0; }
.ev-info b { display: block; font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-info small { font-size: .76rem; color: var(--muted); }
.ev-tag { display: inline-flex; align-items: center; gap: .3rem; }
.ev-tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ev, var(--c)); }

.day-ev { padding: .75rem .9rem; border-radius: 12px; background: var(--white); box-shadow: inset 0 0 0 1px var(--line-2); margin-bottom: .5rem; border-left: 3px solid var(--ev, var(--c)); }
.day-ev b { display: block; font-size: .9rem; }
.day-ev p { font-size: .82rem; color: var(--ink-2); margin-top: .2rem; white-space: pre-line; }
.day-ev .ev-tag { font-size: .72rem; color: var(--muted); font-weight: 600; margin-top: .35rem; }

.tt-wrap { overflow-x: auto; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); }
.tt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .86rem; min-width: 620px; }
.tt th { position: sticky; top: 0; background: var(--white); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: .8rem .6rem; border-bottom: 1px solid var(--line); }
.tt th.today { color: var(--c); }
.tt th.today::after { content: ''; display: block; width: 18px; height: 3px; border-radius: 3px; background: var(--c); margin: .35rem auto 0; }
.tt td { padding: .45rem; text-align: center; border-bottom: 1px solid var(--line-2); }
.tt td.hr { font-weight: 650; font-size: .78rem; color: var(--ink-2); white-space: nowrap; text-align: left; padding-left: 1rem; font-variant-numeric: tabular-nums; }
.tt td.today { background: rgba(135, 34, 14, .025); }
.tt .cls { display: block; padding: .5rem .4rem; border-radius: 10px; background: var(--c-50); color: var(--c-700); font-weight: 600; font-size: .82rem; }
.tt .cls.mine { background: var(--c); color: #fff; box-shadow: 0 6px 14px -8px rgba(135,34,14,.8); }
.tt .cls.none { background: none; color: #D6CFCD; }
.tt tr.now td.hr { color: var(--c); }
.tt tr.now td.hr::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c); margin-right: .45rem; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.tt tr.recess td { background: repeating-linear-gradient(-45deg, var(--white), var(--white) 8px, var(--line-2) 8px, var(--line-2) 16px); font-size: .72rem; font-weight: 700; letter-spacing: .3em; color: var(--muted); }
.tt tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------- Popups del aula (tips, datos, noticias) */
.pp-wrap { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 1rem; background: rgba(31, 26, 25, .45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade .25s var(--ease); }
.pp-wrap.pp-out { opacity: 0; transition: opacity .2s; }
.pp-card { position: relative; display: flex; flex-direction: column; width: min(560px, 100%); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); padding: 1.5rem 1.6rem 1.2rem; border-radius: 24px; background: var(--white); box-shadow: var(--sh-pop); outline: none; overflow: hidden; animation: pp-in .45s var(--ease); }
.pp-card.pp-con-img { width: min(860px, 100%); }
.pp-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 6px; background: linear-gradient(90deg, var(--c-700), var(--c), var(--c-300)); }
@keyframes pp-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.pp-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.pp-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--c-50); color: var(--c-700); }
.pp-noticia .pp-badge { background: var(--c); color: #fff; box-shadow: 0 6px 14px -8px rgba(135,34,14,.8); }
.pp-curioso .pp-badge { background: linear-gradient(120deg, var(--c-50), #fff); box-shadow: inset 0 0 0 1px var(--c-100); }
.pp-dots { display: flex; gap: 5px; }
.pp-dots i { width: 18px; height: 5px; border-radius: 4px; background: var(--line); }
.pp-dots i.ok { background: var(--c-300); }
.pp-dots i.cur { background: var(--c); }
/* el contenido completo siempre cabe: la imagen se adapta a la altura disponible y el texto se desplaza si hiciera falta */
.pp-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 1rem; }
.pp-img { flex: 0 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; border-radius: 16px; overflow: hidden; background: var(--line-2); }
.pp-img img { display: block; max-width: 100%; max-height: min(40vh, 360px); width: auto; height: auto; object-fit: contain; }
.pp-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.pp-title { font-size: 1.35rem; font-weight: 750; letter-spacing: -.025em; line-height: 1.25; overflow-wrap: anywhere; }
.pp-text { margin-top: .55rem; font-size: 1rem; line-height: 1.6; color: var(--ink-2); white-space: pre-line; overflow-wrap: anywhere; }
.pp-foot { flex: none; display: flex; align-items: center; gap: .75rem; margin-top: 1.2rem; }
.pp-bar { flex: 1; height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.pp-bar i { display: block; height: 100%; background: var(--c); transform-origin: left center; border-radius: 6px; }
.pp-time { min-width: 2.6em; text-align: right; font-size: .78rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
/* pantallas anchas: imagen a la izquierda y texto a la derecha (menos alto, nada se corta) */
@media (min-width: 760px) {
  .pp-con-img .pp-main { flex-direction: row; align-items: stretch; gap: 1.4rem; }
  .pp-con-img .pp-img { flex: 0 0 48%; align-self: center; }
  .pp-con-img .pp-img img { max-height: min(62vh, 460px); }
  .pp-con-img .pp-body { align-self: center; max-height: 100%; }
}
@media (max-height: 700px) {
  .pp-card { padding: 1.1rem 1.25rem 1rem; }
  .pp-top { margin-bottom: .7rem; }
  .pp-img img { max-height: 32vh; }
  .pp-title { font-size: 1.2rem; }
  .pp-text { font-size: .95rem; line-height: 1.5; }
}
@media (max-width: 640px) {
  .pp-card { padding: 1.3rem 1.2rem 1rem; border-radius: 20px; }
  .pp-title { font-size: 1.2rem; }
  .pp-text { font-size: .95rem; }
  .pp-img img { max-height: 34vh; }
}

/* ---------------------------------------------------------------- Visor de recursos (aula y panel) */
.viewer { min-height: 200px; }
.viewer-load { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; min-height: 46vh; padding: 2rem 1rem; text-align: center; color: var(--muted); border-radius: var(--r); background: var(--line-2); line-height: 1.5; }
.viewer-load .ico { color: var(--c); }
.viewer-err .ico { color: #b42318; }
.viewer-err span { color: var(--ink-2); max-width: 520px; }
.viewer-frame { display: block; width: 100%; height: 72vh; border: 0; border-radius: var(--r); background: var(--line-2); box-shadow: inset 0 0 0 1px var(--line); }
.viewer-img { display: grid; place-items: center; max-height: 72vh; overflow: auto; border-radius: var(--r); background: var(--line-2); }
.viewer-img img { max-width: 100%; max-height: 72vh; object-fit: contain; }
.viewer-media { display: block; width: 100%; max-height: 72vh; border-radius: var(--r); background: #000; }
.viewer-text { margin: 0; max-height: 72vh; overflow: auto; padding: 1rem 1.1rem; border-radius: var(--r); background: var(--line-2); font: .85rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.viewer-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin-top: 1rem; font-size: .82rem; }
.viewer-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pdf { border-radius: var(--r); background: var(--line-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.pdf-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .4rem .6rem; background: var(--white); border-bottom: 1px solid var(--line); font-size: .82rem; }
.pdf-bar .btn-icon { font-size: 1.1rem; font-weight: 600; line-height: 1; }
.pdf-pag { color: var(--muted); font-variant-numeric: tabular-nums; }
.pdf-pag b { color: var(--ink); }
.pdf-zoom { min-width: 3.2em; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.pdf-scroll { height: 68vh; overflow: auto; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; outline: none; -webkit-overflow-scrolling: touch; }
.pdf-page { flex: none; background: #fff; box-shadow: var(--sh-1); border-radius: 2px; max-width: none; }
.pdf-page canvas { display: block; }
@media (max-width: 640px) {
  .viewer-frame { height: 64vh; }
  .pdf-scroll { height: 62vh; padding: 8px; }
  /* visor a pantalla completa en celular: el documento ocupa todo el alto y los botones quedan visibles */
  .modal-wrap:has(.modal-xl) { padding: 0; }
  .modal-xl { width: 100%; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; display: flex; flex-direction: column; overflow: hidden; }
  .modal-xl .modal-head { padding: .8rem 1rem; }
  .modal-xl .modal-head h2 { font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .modal-xl .modal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: .7rem; }
  .modal-xl .viewer { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .modal-xl .viewer > * { flex: 1; min-height: 0; }
  .modal-xl .viewer > .hint { flex: none; }
  .modal-xl .pdf { display: flex; flex-direction: column; }
  .modal-xl .pdf-scroll { flex: 1; height: auto; min-height: 0; }
  .modal-xl .viewer-frame, .modal-xl .viewer-img, .modal-xl .viewer-text { height: auto; max-height: none; }
  .modal-xl .viewer-load { min-height: 0; }
  .pdf-bar { flex-wrap: nowrap; padding: .35rem .4rem; }
  .pdf-bar .row { flex-wrap: nowrap; gap: .15rem; }
  .pdf-pag { white-space: nowrap; }
  .viewer-foot { margin-top: .7rem; gap: .5rem; }
  .viewer-foot .row { width: 100%; flex-wrap: nowrap; }
  .viewer-foot .row .btn { flex: 1; justify-content: center; }
}

/* ---------------------------------------------------------------- Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
