/* Lectura Privada — lenguaje visual Hemeroteca (archivo), paleta gris */

:root {
  --bg: #0d0d0d;
  --bg-soft: #151515;
  --bg-2: #101010;
  --paper: #d8d8d6;
  --paper-dim: #a3a3a3;
  --ink: #f2f2f2;
  --muted: #9a9a9a;
  --line: rgba(216, 216, 214, 0.22);
  --line-strong: rgba(216, 216, 214, 0.44);
  --panel: rgba(12, 12, 12, 0.78);
  --panel-solid: #101010;
  --accent: #c8c8c8;
  --accent-2: #a8a8a8;
  --amber: #d4d4d4;
  --accent-rgb: 100, 200, 50;
  --critical: #c98a8a;
  --danger: #c98a8a;
  --ok: #8aa38a;
  --shadow: rgba(0, 0, 0, 0.65);
  --font-ui: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Tinos", Georgia, "Times New Roman", serif;
  --reader-paper: #141414;
  --reader-ink: #f2f2f2;
  --reader-muted: #9a9a9a;
  --reader-panel: #101010;
  --reader-border: rgba(216, 216, 214, 0.22);
  --reader-stage: transparent;
  --noise-opacity: 0.16;
  --vignette-strength: 0.95;
  color-scheme: dark;
}

body.theme-claro {
  --bg: #e6e6e6;
  --bg-soft: #efefef;
  --bg-2: #f5f5f5;
  --paper: #2a2a2a;
  --paper-dim: #5c5c5c;
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --line: rgba(26, 26, 26, 0.16);
  --line-strong: rgba(26, 26, 26, 0.3);
  --panel: rgba(245, 245, 245, 0.92);
  --panel-solid: #f5f5f5;
  --accent: #4a4a4a;
  --accent-2: #333333;
  --amber: #666666;
  --accent-rgb: 100, 200, 50;
  --critical: #a85a5a;
  --danger: #a85a5a;
  --ok: #5a7a5a;
  --shadow: rgba(0, 0, 0, 0.18);
  --reader-paper: #fafafa;
  --reader-ink: #1a1a1a;
  --reader-muted: #5c5c5c;
  --reader-panel: #f5f5f5;
  --reader-border: rgba(26, 26, 26, 0.14);
  --reader-stage: transparent;
  --noise-opacity: 0.07;
  --vignette-strength: 0.28;
  color-scheme: light;
}

/* html también lleva el tema: evita franja negra (var(--bg) de :root) bajo el split */
html.theme-claro {
  --bg: #e6e6e6;
  --bg-soft: #efefef;
  background: #f2f2f2;
  color-scheme: light;
}

html.theme-oscuro {
  background: #151515;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(var(--accent-rgb), 0.08), transparent 28rem),
    radial-gradient(circle at 78% 0%, rgba(160, 160, 160, 0.06), transparent 25rem),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  font-family: var(--font-ui);
  overflow-x: hidden;
}

body.theme-claro {
  background:
    radial-gradient(circle at 18% 12%, rgba(var(--accent-rgb), 0.06), transparent 28rem),
    radial-gradient(circle at 78% 0%, rgba(0, 0, 0, 0.04), transparent 25rem),
    linear-gradient(180deg, #f2f2f2 0%, #e6e6e6 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

/* Capas archivo */
.archive-noise,
.archive-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.archive-noise {
  opacity: var(--noise-opacity);
  mix-blend-mode: screen;
  background-image:
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 37px 37px, 41px 41px;
}

body.theme-claro .archive-noise {
  mix-blend-mode: multiply;
  background-image:
    linear-gradient(0deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
}

.archive-vignette {
  box-shadow: inset 0 0 11rem rgba(0, 0, 0, var(--vignette-strength));
  z-index: 1;
}

.site-header,
.site-main,
.modal,
.pause-overlay {
  position: relative;
  z-index: 2;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--panel);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .82rem;
}

.brand__mark {
  width: 64px;
  height: 64px;
  display: block;
  flex-shrink: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  line-height: 0;
}

.brand__logo {
  width: 64px;
  height: 64px;
  display: block;
  object-fit: contain;
}

.brand__logo--claro {
  display: none;
}

body.theme-claro .brand__logo--oscuro {
  display: none;
}

body.theme-claro .brand__logo--claro {
  display: block;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: .82rem;
  font-weight: 700;
}

.brand small {
  margin-top: .15rem;
  color: var(--muted);
  font-size: .62rem;
  letter-spacing: .1em;
}

.site-header .header-nav {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  align-items: center;
  padding: .25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
}

body.theme-claro .site-header .header-nav {
  background: rgba(255, 255, 255, 0.35);
}

.site-header .header-nav a,
.site-header .header-nav .nav-link-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--paper);
  text-decoration: none;
  font: inherit;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .45rem .75rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  transition:
    border-color .28s ease,
    background .28s ease,
    color .28s ease;
}

.site-header .header-nav a svg,
.site-header .header-nav .nav-link-btn svg,
.theme-switch .btn svg,
.btn svg {
  flex-shrink: 0;
  display: block;
}

.theme-switch .btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

body.theme-claro .site-header .header-nav a,
body.theme-claro .site-header .header-nav .nav-link-btn {
  color: var(--ink);
}

.site-header .header-nav a:hover,
.site-header .header-nav .nav-link-btn:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}

.theme-switch {
  display: inline-flex;
  gap: .25rem;
  margin-left: .25rem;
}

.theme-switch .btn {
  padding: .4rem .55rem;
  font-size: .65rem;
}

.site-main {
  padding: 1.5rem;
  max-width: 95%;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* —— Marketing público (home / login / solicitud): split estilo Kit —— */
body.page-home,
body.page-login,
body.page-solicitud,
body.page-olvido,
body.page-cambiar-sena {
  --mkt-accent: #4a7a54;
  --mkt-accent-rgb: 74, 122, 84;
  --mkt-display: "Tinos", Georgia, "Times New Roman", serif;
  --mkt-header-h: 5.5rem;
  --noise-opacity: 0.08;
  --vignette-strength: 0.35;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: #151515;
}

html:has(body.page-home),
html:has(body.page-login),
html:has(body.page-solicitud),
html:has(body.page-olvido),
html:has(body.page-cambiar-sena) {
  background: #151515;
}

body.theme-oscuro.page-home,
body.theme-oscuro.page-login,
body.theme-oscuro.page-solicitud,
body.theme-oscuro.page-olvido,
body.theme-oscuro.page-cambiar-sena {
  background: #151515;
  --vignette-strength: 0.35;
}

html:has(body.theme-oscuro.page-home),
html:has(body.theme-oscuro.page-login),
html:has(body.theme-oscuro.page-solicitud),
html:has(body.theme-oscuro.page-olvido),
html:has(body.theme-oscuro.page-cambiar-sena) {
  background: #151515;
}

body.theme-claro.page-home,
body.theme-claro.page-login,
body.theme-claro.page-solicitud,
body.theme-claro.page-olvido,
body.theme-claro.page-cambiar-sena {
  --noise-opacity: 0.04;
  --vignette-strength: 0.12;
  background: #f2f2f2;
}

html:has(body.theme-claro.page-home),
html:has(body.theme-claro.page-login),
html:has(body.theme-claro.page-solicitud),
html:has(body.theme-claro.page-olvido),
html:has(body.theme-claro.page-cambiar-sena) {
  background: #f2f2f2;
}

body.page-home .site-header,
body.page-login .site-header,
body.page-solicitud .site-header,
body.page-olvido .site-header,
body.page-cambiar-sena .site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  border-bottom-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: linear-gradient(90deg,
      color-mix(in srgb, var(--bg) 88%, transparent) 0%,
      color-mix(in srgb, var(--bg) 55%, transparent) 42%,
      transparent 58%);
}

body.page-home .brand strong,
body.page-login .brand strong,
body.page-solicitud .brand strong,
body.page-olvido .brand strong,
body.page-cambiar-sena .brand strong {
  font-size: .72rem;
  letter-spacing: .04em;
}

body.page-home .brand small,
body.page-login .brand small,
body.page-solicitud .brand small,
body.page-olvido .brand small,
body.page-cambiar-sena .brand small {
  opacity: .7;
}

body.page-home .site-main,
body.page-login .site-main,
body.page-solicitud .site-main,
body.page-olvido .site-main,
body.page-cambiar-sena .site-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  min-height: 100vh;
}

.auth-split {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  width: 100%;
}

.auth-split__action {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3.25rem) clamp(1.25rem, 5vw, 4rem);
  padding-top: calc(var(--mkt-header-h) + .75rem);
  max-width: 36rem;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  animation: auth-action-in .7s ease both;
  background: #151515;
  min-height: 100%;
}

.auth-split--solicitud .auth-split__action {
  max-width: 40rem;
  justify-content: flex-start;
  padding-top: calc(var(--mkt-header-h) + .35rem);
  padding-bottom: 1rem;
}

body.theme-oscuro .auth-split__action {
  background: #151515;
}

body.theme-claro .auth-split__action {
  background: #f2f2f2;
}

@media (min-width: 900px) {
  body.theme-claro .auth-split__action {
    background: none;
    /* escritorio: deja ver el fondo de página si lo preferís */
  }
}

/* Pie: mismo ritmo que home/login (sin empujar al fondo con hueco negro) */
.auth-split .statement-footer {
  margin-top: clamp(1.8rem, 4vh, 3.2rem);
  flex-shrink: 0;
  background: transparent;
}

/* Solicitud: pie al fondo de la columna (gris y foto a altura completa) */
.auth-split--solicitud .statement-footer {
  margin-top: auto;
  padding-top: .85rem;
  background: transparent;
}

.auth-split--solicitud .auth-lede--compact {
  margin-bottom: .7rem;
}

.auth-split--solicitud .auth-kicker {
  margin-bottom: .4rem;
}

.auth-split--solicitud .auth-title {
  margin-bottom: .4rem;
}

.auth-split--solicitud .auth-foot {
  margin-top: .7rem;
  margin-bottom: 0;
}

.auth-split--solicitud .auth-form label {
  gap: .18rem;
}

.auth-split--solicitud .solicitud-form {
  gap: .42rem .85rem;
}

.auth-split--solicitud .solicitud-form textarea {
  min-height: 3.2rem;
}

.solicitud-step[hidden] {
  display: none !important;
}

.solicitud-step .auth-form label input[readonly] {
  opacity: .85;
  cursor: default;
}

.solicitud-step .btn-ghost {
  width: 100%;
}

.auth-split__visual {
  position: relative;
  min-height: 14rem;
  overflow: hidden;
  isolation: isolate;
}

.auth-visual-layer {
  position: absolute;
  inset: -4%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  animation: auth-visual-breathe 14s ease-in-out infinite alternate;
}

.auth-visual-layer--home {
  background-color: #0c0e0d;
  background-image:
    linear-gradient(145deg, rgba(12, 16, 14, .45), rgba(8, 10, 9, .2)),
    url("../img/marketing/home-hero.webp"),
    radial-gradient(ellipse at 30% 20%, rgba(74, 122, 84, .4), transparent 55%),
    linear-gradient(160deg, #1a221c 0%, #0c0e0d 55%, #121816 100%);
  background-size: cover, cover, cover, cover;
  background-position: center;
}

.auth-visual-layer--login {
  background-color: #0a0c0b;
  background-image:
    linear-gradient(200deg, rgba(10, 14, 12, .35), rgba(8, 10, 9, .15)),
    url("../img/marketing/login-side.webp"),
    radial-gradient(ellipse at 70% 40%, rgba(74, 122, 84, .32), transparent 50%),
    linear-gradient(200deg, #161c18 0%, #0a0c0b 100%);
  background-size: cover, cover, cover, cover;
  background-position: center;
}

.auth-visual-layer--solicitud {
  background-color: #0b0d0c;
  background-image:
    linear-gradient(180deg, rgba(12, 16, 14, .4), rgba(8, 10, 9, .2)),
    url("../img/marketing/solicitud-side.webp"),
    radial-gradient(ellipse at 40% 70%, rgba(74, 122, 84, .28), transparent 55%),
    linear-gradient(180deg, #141a16 0%, #0b0d0c 100%);
  background-size: cover, cover, cover, cover;
  background-position: center;
}

.auth-visual-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(13, 13, 13, .55) 0%, transparent 42%),
    linear-gradient(180deg, transparent 55%, rgba(8, 10, 9, .45));
  pointer-events: none;
}

body.theme-claro .auth-visual-overlay {
  background:
    linear-gradient(90deg, rgba(246, 246, 244, .5) 0%, transparent 45%),
    linear-gradient(180deg, transparent 50%, rgba(230, 230, 226, .35));
}

.auth-kicker {
  margin: 0 0 .65rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mkt-accent);
}

.auth-brand {
  margin: 0 0 .85rem;
  font-family: var(--mkt-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ink);
}

.auth-title {
  margin: 0 0 .65rem;
  font-family: var(--mkt-display);
  font-weight: 700;
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-transform: none;
  color: var(--ink);
}

.auth-lede {
  margin: 0 0 1.35rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 32rem;
}

.auth-lede--compact {
  font-size: .75rem;
  margin-bottom: 1.1rem;
}

.auth-lede--welcome {
  font-size: .92rem;
  margin-bottom: .45rem;
  color: var(--ink);
}

.auth-lede--welcome + .auth-lede--compact {
  margin-top: 0;
}

.auth-note {
  margin: 1.35rem 0 0;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: 28rem;
}

.auth-cta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: .25rem 0 0;
}

.auth-form label {
  display: grid;
  gap: .3rem;
  font-size: .7rem;
  color: var(--muted);
}

.auth-form input,
.auth-form select,
.auth-form textarea {
  width: 100%;
  padding: .25rem .7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
}

body.theme-claro .auth-form input,
body.theme-claro .auth-form select,
body.theme-claro .auth-form textarea {
  background: rgba(255, 255, 255, .85);
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
  outline: none;
  border-color: rgba(var(--mkt-accent-rgb), .65);
  box-shadow: 0 0 0 3px rgba(var(--mkt-accent-rgb), .18);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 2.6rem;
}

.password-toggle {
  position: absolute;
  right: .2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.1rem;
  height: 2.1rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--ink);
  outline: none;
  background: rgba(var(--mkt-accent-rgb), .12);
}

.password-toggle-icon {
  width: 1.15rem;
  height: 1.15rem;
  background: currentColor;
  /* ojo abierto */
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/><circle cx='12' cy='12' r='3'/></svg>") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/><circle cx='12' cy='12' r='3'/></svg>") center / contain no-repeat;
}

.password-toggle[aria-pressed="true"] .password-toggle-icon {
  /* ojo tachado */
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/><line x1='1' y1='1' x2='23' y2='23'/></svg>") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/><line x1='1' y1='1' x2='23' y2='23'/></svg>") center / contain no-repeat;
}

.auth-form .note {
  font-size: .65rem;
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
  letter-spacing: normal;
}

.auth-check {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: .55rem;
  margin: .15rem 0 .25rem;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: none;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.auth-check input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--mkt-accent, #4a7a54);
  cursor: pointer;
}

.auth-check span {
  line-height: 1.3;
}

.auth-foot {
  margin: 1.15rem 0 0;
  font-size: .88rem;
  color: var(--muted);
}

.auth-foot a {
  color: var(--mkt-accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-foot a:hover {
  text-decoration: underline;
}

.auth-forgot {
  margin: -.15rem 0 .35rem;
  font-size: .78rem;
  text-align: right;
}

.auth-forgot a {
  color: var(--mkt-accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-forgot a:hover {
  text-decoration: underline;
}

.btn-mkt {
  border-color: rgba(var(--mkt-accent-rgb), .75) !important;
  background: rgba(var(--mkt-accent-rgb), .72) !important;
  color: #f4faf5 !important;
  text-transform: none;
  letter-spacing: .02em;
  font-size: .9rem;
  padding: .65rem 1.15rem;
  border-radius: 10px;
}

.btn-mkt:hover,
.btn-mkt:focus-visible {
  background: rgba(var(--mkt-accent-rgb), .9) !important;
  border-color: var(--mkt-accent) !important;
  color: #fff !important;
}

.auth-expect {
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 2;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .45rem;
}

.auth-expect li {
  font-size: .82rem;
  line-height: 1.35;
  color: #e8efe9;
  padding: .45rem .65rem;
  border-radius: 8px;
  background: rgba(10, 14, 12, .55);
  border: 1px solid rgba(74, 122, 84, .35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

body.theme-claro .auth-expect li {
  color: #1a241c;
  background: rgba(255, 255, 255, .72);
  border-color: rgba(74, 122, 84, .4);
}

@keyframes auth-action-in {
  from {
    opacity: 0;
    transform: translateY(.6rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes auth-visual-breathe {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-split__action {
    animation: none;
  }

  .auth-visual-layer {
    animation: none;
  }
}

@media (min-width: 900px) {
  .auth-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    min-height: 100vh;
  }

  .auth-split__action {
    margin: 0;
    max-width: none;
    padding-right: clamp(1.5rem, 4vw, 3.5rem);
    padding-left: clamp(1.75rem, 5vw, 4.5rem);
  }

  .auth-split--solicitud .auth-split__action {
    justify-content: flex-start;
    max-width: 45rem;
    margin-left: auto;
    margin-right: 0;
    width: 100%;
    min-height: 100%;
    box-sizing: border-box;
  }

  .auth-split__visual {
    min-height: 100%;
    align-self: stretch;
  }

  .auth-split--solicitud {
    align-items: stretch;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .auth-split--solicitud .auth-split__visual {
    min-height: 100%;
  }

  /*
   * Grilla solicitud (6 cols):
   * nombre|email (3+3), tel|ciudad|país (2+2+2),
   * editorial|tiempo (3+3), pass|pass2 (3+3), mensaje/submit full
   */
  .auth-split--solicitud .solicitud-form {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .42rem .85rem;
    align-items: start;
  }

  .auth-split--solicitud .solicitud-form > .sf-nombre,
  .auth-split--solicitud .solicitud-form > .sf-email,
  .auth-split--solicitud .solicitud-form > .sf-editorial,
  .auth-split--solicitud .solicitud-form > .sf-tiempo,
  .auth-split--solicitud .solicitud-form > .sf-pass,
  .auth-split--solicitud .solicitud-form > .sf-pass2 {
    grid-column: span 3;
  }

  .auth-split--solicitud .solicitud-form > .sf-tel,
  .auth-split--solicitud .solicitud-form > .sf-ciudad,
  .auth-split--solicitud .solicitud-form > .sf-pais {
    grid-column: span 2;
  }

  .auth-split--solicitud .solicitud-form > .sf-mensaje,
  .auth-split--solicitud .solicitud-form > .sf-submit {
    grid-column: 1 / -1;
  }
}

@media (max-width: 899px) {

  /* Evita que la 1ª fila ocupe 100vh y el visual tape el formulario desbordado */
  .auth-split {
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #151515;
  }

  body.theme-oscuro .auth-split {
    background: #151515;
  }

  body.theme-claro .auth-split {
    background: #f2f2f2;
  }

  .auth-split__action {
    min-height: 0;
    flex: 0 0 auto;
    justify-content: flex-start;
    max-width: none !important;
    width: 100%;
    margin: 0;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
  }

  .auth-split--home .auth-split__visual,
  .auth-split--login .auth-split__visual {
    order: -1;
    min-height: min(38vh, 280px);
    flex: 0 0 auto;
    position: relative;
    z-index: 0;
  }

  /* Solicitud móvil: banner arriba; formulario a todo el ancho (sin franjas negras) */
  .auth-split--solicitud .auth-split__visual {
    order: -1;
    min-height: min(28vh, 200px);
    max-height: 220px;
    flex: 0 0 auto;
    position: relative;
    z-index: 0;
    width: 100%;
  }

  .auth-split--solicitud .auth-split__action {
    max-width: none !important;
    width: 100%;
    margin: 0;
    padding-left: 1.15rem;
    padding-right: 1.15rem;
    padding-bottom: 1.5rem;
    background: #151515;
  }

  body.theme-oscuro .auth-split--solicitud .auth-split__action {
    background: #151515;
  }

  body.theme-claro .auth-split--solicitud .auth-split__action {
    background: #f2f2f2;
  }

  body.page-home .site-main,
  body.page-login .site-main,
  body.page-solicitud .site-main {
    min-height: 0;
    background: inherit;
  }

  /* La viñeta oscurece los laterales en pantallas angostas */
  body.page-home .archive-vignette,
  body.page-login .archive-vignette,
  body.page-solicitud .archive-vignette {
    opacity: 0;
    visibility: hidden;
  }

  .auth-expect {
    display: none;
  }
}

.hero-panel,
.form-panel,
.admin-panel {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 12px 40px var(--shadow);
}

.hero-panel h1,
.form-panel h1,
.admin-panel h1 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 .75rem;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--paper);
}

body.theme-claro .hero-panel h1,
body.theme-claro .form-panel h1,
body.theme-claro .admin-panel h1 {
  color: var(--ink);
}

.lede {
  font-size: 1rem;
  color: var(--muted);
  max-width: 42rem;
  line-height: 1.55;
}

.note {
  color: var(--muted);
  font-size: .92rem;
}

.cta-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin: 1.25rem 0;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(216, 216, 214, 0.06);
  color: var(--paper);
  font-weight: 600;
  padding: .5rem .9rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
  transition:
    border-color .28s ease,
    background .28s ease,
    color .28s ease;
}

body.theme-claro .btn {
  background: rgba(26, 26, 26, 0.04);
  color: var(--ink);
}

.btn:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn:not(.btn-ghost):not(.btn-icon) {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
}

.btn:not(.btn-ghost):not(.btn-icon):hover,
.btn.reader-start-btn:hover,
.pause-resume-btn:hover {
  background: rgba(var(--accent-rgb), 0.28);
  color: var(--accent);
  border-color: var(--accent);
}

.btn.reader-start-btn,
.pause-resume-btn {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line);
}

body.theme-claro .btn-ghost {
  color: var(--ink);
}

.btn-ghost.is-active,
.btn-ghost:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}

.stack {
  display: grid;
  gap: .85rem;
}

.stack-tight {
  display: grid;
  gap: .35rem;
}

.form-span-2 {
  grid-column: 1 / -1;
}

#cmt-chooser[hidden],
#form-comment[hidden] {
  display: none !important;
}

#form-comment:not([hidden]) {
  margin-top: 1.25rem;
}

.narrow {
  max-width: 420px;
}

label {
  display: grid;
  gap: .35rem;
  font-size: .85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .28);
  color: var(--ink);
  padding: .65rem .75rem;
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
}

body.theme-claro input,
body.theme-claro select,
body.theme-claro textarea {
  background: rgba(255, 255, 255, .7);
}

.form-msg {
  min-height: 1.2em;
}

.form-msg.error {
  color: var(--danger);
}

.form-msg.ok {
  color: var(--ok);
}

.form-msg.olvido-no-encontrado {
  color: #7a1f1f;
}

.form-msg.olvido-no-encontrado a {
  color: #7a1f1f;
  text-decoration: underline;
  font-weight: 600;
}

/* Reader */
.page-reader {
  overflow: hidden;
  height: 100%;
}

.page-reader .header-hotzone {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 16px;
  z-index: 48;
}

.page-reader .site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 55;
  padding: .55rem 1rem;
  min-height: 0;
  transform: translateY(-100%);
  transition: transform .45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}

.page-reader:has(.header-hotzone:hover) .site-header,
.page-reader .site-header:hover,
.page-reader .site-header:focus-within,
.page-reader.header-revealed .site-header {
  transform: translateY(0);
}

.page-reader .brand strong {
  font-size: .75rem;
}

.page-reader .site-header .header-nav {
  gap: .2rem;
}

.page-reader .site-header .header-nav a,
.page-reader .site-header .header-nav .nav-link-btn {
  font-size: .65rem;
  padding: .35rem .55rem;
}

.page-reader .site-main {
  max-width: none;
  padding: 0;
  height: 100%;
}

.reader-shell {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  z-index: 2;
}

.reader-menu-btn {
  /* Ya no flota: vive en la barra de navegación */
  flex-shrink: 0;
}

.reader-menu-btn[aria-expanded="true"] {
  opacity: .55;
}

.reader-visor {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  order: 3;
}

/* Barra superpuesta: progreso + nav + fullscreen sobre el texto */
.reader-visor-chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .28rem;
  padding: .35rem .45rem .55rem;
  box-sizing: border-box;
  pointer-events: none;
  background: linear-gradient(180deg,
      color-mix(in srgb, var(--reader-paper) 82%, transparent) 0%,
      color-mix(in srgb, var(--reader-paper) 38%, transparent) 70%,
      transparent 100%);
}

.reader-visor-progress {
  pointer-events: none;
  padding: 0 .1rem;
}

.reader-visor-progress .progress-wrap {
  margin: 0;
  height: 4px;
  background: rgba(74, 122, 84, .22);
}

body.theme-claro .reader-visor-progress .progress-wrap {
  background: rgba(74, 122, 84, .18);
}

.reader-visor-toolbar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding-right: 0;
  pointer-events: none;
}

.reader-visor-chrome .reader-menu-btn,
.reader-visor-chrome .reader-actions-nav,
.reader-visor-chrome .reader-fs-btn {
  pointer-events: auto;
}

.reader-visor-chrome .reader-menu-btn {
  justify-self: start;
}

.reader-visor-chrome .reader-fs-btn {
  justify-self: end;
}

.reader-visor-chrome .reader-actions-nav {
  justify-self: center;
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  flex-wrap: nowrap;
  padding: .28rem .45rem;
  border-radius: 999px;
  background: rgba(18, 18, 18, .42);
  box-shadow: inset 0 0 0 1px rgba(216, 216, 214, .12);
}

body.theme-claro .reader-visor-chrome .reader-actions-nav {
  background: rgba(255, 255, 255, .38);
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, .1);
}

/* Verde mediano al 60% de opacidad */
.reader-visor-chrome .reader-nav-btn,
.reader-visor-chrome .reader-fs-btn {
  background: rgba(74, 122, 84, .6) !important;
  border: 1px solid rgba(52, 96, 62, .7) !important;
  color: #f4faf5 !important;
  opacity: 1;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .16);
}

body.theme-claro .reader-visor-chrome .reader-nav-btn,
body.theme-claro .reader-visor-chrome .reader-fs-btn {
  background: rgba(74, 122, 84, .6) !important;
  color: #f4faf5 !important;
}

.reader-visor-chrome .reader-nav-btn.is-primary {
  background: rgba(56, 108, 68, .68) !important;
  border-color: rgba(40, 88, 52, .78) !important;
  color: #fff !important;
}

/* Atrás / Adelante: azul apagado (fondo + borde) */
.reader-visor-chrome .reader-nav-btn-dir,
body.theme-claro .reader-visor-chrome .reader-nav-btn-dir {
  background: rgba(72, 112, 138, .6) !important;
  border-color: rgba(52, 92, 118, .72) !important;
}

/* Pausa: naranja apagado (fondo + borde) */
.reader-visor-chrome .reader-nav-btn-pause,
body.theme-claro .reader-visor-chrome .reader-nav-btn-pause {
  background: rgba(168, 112, 70, .6) !important;
  border-color: rgba(140, 88, 52, .72) !important;
}

.reader-visor-chrome .reader-nav-btn:hover,
.reader-visor-chrome .reader-nav-btn:focus-visible,
.reader-visor-chrome .reader-fs-btn:hover,
.reader-visor-chrome .reader-fs-btn:focus-visible {
  background: rgba(62, 112, 74, .75) !important;
  opacity: 1;
}

.reader-visor-chrome .reader-nav-btn-dir:hover,
.reader-visor-chrome .reader-nav-btn-dir:focus-visible,
body.theme-claro .reader-visor-chrome .reader-nav-btn-dir:hover,
body.theme-claro .reader-visor-chrome .reader-nav-btn-dir:focus-visible {
  background: rgba(62, 104, 132, .75) !important;
}

.reader-visor-chrome .reader-nav-btn-pause:hover,
.reader-visor-chrome .reader-nav-btn-pause:focus-visible,
body.theme-claro .reader-visor-chrome .reader-nav-btn-pause:hover,
body.theme-claro .reader-visor-chrome .reader-nav-btn-pause:focus-visible {
  background: rgba(158, 104, 62, .75) !important;
}

.reader-visor-chrome .reader-nav-btn:disabled {
  opacity: .42;
}

.reader-visor-chrome .reader-menu-btn[aria-expanded="true"] {
  opacity: .65;
}

.reader-fs-btn {
  position: static;
  top: auto;
  right: auto;
  transform: none;
  z-index: 21;
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  min-width: 1.85rem !important;
  min-height: 1.85rem;
  padding: 0 !important;
  border-radius: 9px;
}

.reader-fs-btn svg {
  width: 14px;
  height: 14px;
}

.reader-fs-btn .reader-fs-icon {
  display: grid;
  place-items: center;
}

.reader-fs-btn .reader-fs-icon[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.reader-panel-backdrop {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(8, 6, 4, .5);
  border: 0;
  padding: 0;
  cursor: pointer;
}

body.theme-claro .reader-panel-backdrop {
  background: rgba(0, 0, 0, .28);
}

.reader-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 45;
  width: max-content;
  max-width: 44vw;
  padding: .75rem .4rem 1rem;
  border-right: 1px solid rgba(74, 122, 84, .45);
  background: var(--panel-solid);
  box-shadow: 8px 0 28px var(--shadow);
  overflow: auto;
  transform: translateX(-105%);
  transition: transform .22s ease;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .45rem;
}

.reader-panel.has-aa-flyout {
  overflow: visible;
}

.reader-panel-logout {
  display: none;
}

.reader-logout-btn {
  display: none;
}

body.reader-panel-open .reader-panel {
  transform: translateX(0);
}

.reader-obra-select.is-single {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Drawer: acciones con label, una debajo de otra */
.reader-drawer-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .28rem;
  margin-top: .1rem;
  flex: 1 1 auto;
  width: max-content;
  max-width: 100%;
}

.reader-drawer-row {
  display: flex;
  align-items: center;
  gap: .35rem;
  position: relative;
}

.reader-drawer-item {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: .45rem;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  text-decoration: none;
  text-transform: none;
  letter-spacing: .02em;
  font-size: .82rem;
  font-weight: 600;
  padding: .48rem .55rem;
  border-radius: 10px;
  white-space: nowrap;
}

.reader-drawer-item svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* Evita que .reader-start-btn { gap: 0 } pegue el ojo al texto */
.reader-drawer-item.reader-start-btn,
.reader-drawer-nav .reader-start-btn {
  gap: .45rem;
  width: 100%;
}

.reader-drawer-exit {
  color: color-mix(in srgb, var(--danger) 85%, var(--ink));
  margin-top: .15rem;
}

/* Mostrar solo el tema contrario al activo */
body.theme-oscuro .reader-theme-swap[data-reader-theme="oscuro"],
body.theme-claro .reader-theme-swap[data-reader-theme="claro"] {
  display: none !important;
}

/* Solo el estado del pie: no ensancha el panel (el ancho lo marcan los botones) */
#reader-status.form-msg,
#reader-status.reader-drawer-status {
  margin-top: auto;
  padding-top: .65rem;
  min-height: 0;
  width: 0;
  min-width: 100%;
  box-sizing: border-box;
  font-size: .625rem;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.reader-font-size-value {
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
}

.reader-font-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background:
    linear-gradient(90deg, rgba(var(--accent-rgb), .35), rgba(var(--accent-rgb), .85)),
    rgba(255, 255, 255, .08);
  outline: none;
  margin: .15rem 0 .1rem;
  cursor: pointer;
}

body.theme-claro .reader-font-slider {
  background:
    linear-gradient(90deg, rgba(var(--accent-rgb), .25), rgba(var(--accent-rgb), .7)),
    rgba(26, 26, 26, .1);
}

.reader-font-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 1px 4px var(--shadow);
  cursor: grab;
}

.reader-font-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 1px 4px var(--shadow);
  cursor: grab;
}

.reader-font-slider:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.reader-font-stations {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .15rem;
  font-size: .62rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.reader-font-stations .is-active {
  color: var(--accent);
  font-weight: 600;
}

.reader-icon-bar,
.mode-switch.reader-icon-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: .35rem;
  margin-top: .15rem;
}

.reader-icon-bar .btn {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  justify-content: center;
  align-items: center;
  padding: .55rem .35rem;
  gap: 0;
}

.reader-start-btn,
.reader-help-btn {
  width: auto;
  gap: 0;
}

.reader-icon-bar .btn.is-active:not(.theme-alt-btn) {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.35);
}

.reader-permisos {
  margin-top: .1rem;
  padding: .45rem .55rem .5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, .22);
}

body.theme-claro .reader-permisos {
  background: rgba(26, 26, 26, .04);
}

.reader-permisos[hidden] {
  display: none !important;
}

.reader-permisos-body {
  display: grid;
  gap: .28rem;
  font-size: .78rem;
  line-height: 1.35;
  color: var(--ink);
}

.reader-permisos-line {
  margin: 0;
}

.reader-permisos-k {
  display: inline-block;
  min-width: 4.6rem;
  margin-right: .35rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .66rem;
}

.reader-permisos-units {
  margin: .2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .05rem;
  max-height: none;
  overflow: visible;
}

.reader-unit-btn,
.reader-unit-label {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.25;
  padding: .18rem .3rem;
  border-radius: 5px;
  color: inherit;
}

.reader-unit-titulo {
  margin: 0 0 .2rem;
  flex: 0 0 100%;
  width: 100%;
  font-size: .92rem;
  font-weight: 700;
  font-style: normal;
  line-height: 1.3;
  color: var(--ink);
}

.reader-unit-desc {
  margin: 0 0 .35rem;
  flex: 0 0 100%;
  width: 100%;
  font-size: .68rem;
  line-height: 1.35;
  color: var(--muted);
}

#progreso-modal-meta {
  margin: .15rem 0 .35rem;
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink);
}

.progreso-modal-hint {
  margin: .15rem 0 .5rem;
  font-size: .72rem;
  line-height: 1.4;
}

.reader-permisos-cta {
  margin-top: .25rem;
  width: 100%;
  justify-content: center;
  font-size: .72rem;
  padding: .35rem .5rem;
}

.modal-card-progreso {
  width: min(560px, 96vw);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.progreso-modal-body {
  overflow: visible;
  max-height: none;
  margin: .35rem 0 .75rem;
  padding-right: 0;
}

.progreso-modal-body:has(.prog-acc) {
  overflow: visible;
}

/* Acordeón obra completa (progreso) */
.prog-acc {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.prog-acc-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(128, 128, 128, .12);
  overflow: hidden;
}

body.theme-claro .prog-acc-item {
  background: rgba(0, 0, 0, .04);
}

.prog-acc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: .55rem .7rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.prog-acc-item.is-leido .prog-acc-head {
  color: #6f9b6e;
}

.prog-acc-item.is-parcial .prog-acc-head {
  color: #c9a227;
}

.prog-acc-item.is-pendiente .prog-acc-head {
  color: #c97878;
}

.prog-acc-item.is-capitulos .prog-acc-head {
  color: var(--ink);
}

.prog-acc-chevron {
  width: .55rem;
  height: .55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: .7;
  transition: transform .15s ease;
  flex-shrink: 0;
  margin-left: .5rem;
}

.prog-acc-item.is-open .prog-acc-chevron {
  transform: rotate(-135deg);
  margin-top: .2rem;
}

.prog-acc-panel {
  padding: .15rem .65rem .65rem;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, .18);
}

body.theme-claro .prog-acc-panel {
  background: rgba(255, 255, 255, .72);
}

.prog-acc-panel[hidden] {
  display: none !important;
}

.prog-unit-parte {
  margin: .25rem 0 .1rem;
  font-size: .68rem;
  line-height: 1.35;
  color: var(--muted);
  text-transform: none;
}

.prog-unit-label-line {
  margin: .1rem 0;
  font-size: .78rem;
  color: var(--muted);
}

.prog-acc-panel .reader-unit-titulo {
  margin: .15rem 0 .25rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.prog-acc-panel .reader-unit-desc {
  margin: 0 0 .45rem;
  font-size: .78rem;
  line-height: 1.4;
  color: var(--ink);
}

.prog-cap-nums {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .15rem .05rem;
  margin: .2rem 0 .55rem;
  padding: .35rem .4rem;
  border-radius: 4px;
  background: rgba(128, 128, 128, .14);
  line-height: 1.2;
}

body.theme-claro .prog-cap-nums {
  background: rgba(0, 0, 0, .05);
}

.prog-cap-dot {
  color: var(--muted);
  font-size: .65rem;
  user-select: none;
  padding: 0 .05rem;
}

.prog-cap-num {
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 .12rem;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.prog-cap-num.is-leido {
  color: #6f9b6e;
}

.prog-cap-num.is-parcial {
  color: #c9a227;
}

.prog-cap-num.is-pendiente {
  color: #c97878;
}

.prog-cap-num.is-active {
  border-color: var(--ink);
  background: rgba(255, 255, 255, .08);
}

body.theme-claro .prog-cap-num.is-active {
  background: rgba(0, 0, 0, .06);
}

.prog-cap-num:hover {
  border-color: var(--accent);
}

.prog-cap-detail {
  min-height: 2rem;
}

.prog-cap-pages {
  display: flex;
  flex-wrap: wrap;
  gap: .18rem;
  max-height: min(28vh, 220px);
  overflow: auto;
  padding: .1rem 0 .15rem;
}

.prog-cap-pages .reader-unit-page {
  min-width: 1.35rem;
  height: 1.35rem;
}

.reader-unit {
  margin: 0;
  border-radius: 6px;
}

.reader-unit.is-leido .reader-unit-btn,
.reader-unit.is-leido .reader-unit-label {
  color: #6f9b6e;
}

.reader-unit.is-parcial .reader-unit-btn,
.reader-unit.is-parcial .reader-unit-label {
  color: #c9a227;
}

.reader-unit.is-pendiente .reader-unit-label {
  color: #c97878;
  cursor: default;
}

.reader-unit.is-pendiente .reader-unit-btn {
  color: #c97878;
}

.reader-unit.is-link .reader-unit-btn {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: .15em;
}

.reader-unit.is-link .reader-unit-btn:hover {
  background: rgba(var(--accent-rgb), 0.1);
}

.reader-unit-pages {
  display: flex;
  flex-wrap: wrap;
  gap: .18rem;
  padding: .05rem .2rem .3rem .35rem;
}

.reader-unit-pages[hidden] {
  display: none !important;
}

.reader-unit-page {
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .2rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .25);
  color: var(--ink);
  font: inherit;
  font-size: .62rem;
  line-height: 1;
  cursor: pointer;
}

body.theme-claro .reader-unit-page {
  background: rgba(255, 255, 255, .65);
}

.reader-unit-page:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.reader-unit-page.is-disabled,
.reader-unit-page:disabled {
  opacity: .38;
  cursor: not-allowed;
  color: var(--muted);
  border-color: var(--line);
  background: rgba(128, 128, 128, .12);
  pointer-events: none;
}

.reader-unit-page.is-disabled:hover,
.reader-unit-page:disabled:hover {
  border-color: var(--line);
  color: var(--muted);
}

.reader-permisos-unidades {
  margin-top: .15rem;
}

/* Solo mostrar el tema contrario al activo */
.theme-alt-btn.is-active {
  display: none !important;
}

.reader-theme {
  display: grid;
  gap: .35rem;
}

.reader-theme-toggle {
  display: flex;
  gap: .4rem;
}

.reader-theme-toggle .btn {
  flex: 1;
  justify-content: center;
  gap: .35rem;
  padding: .45rem .5rem;
}

.reader-theme-toggle .btn.is-active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.35);
}

.reader-stage {
  display: flex;
  flex-direction: column;
  padding: .55rem .85rem .75rem;
  min-height: 0;
  height: 100%;
  background: var(--reader-stage);
  position: relative;
}

.reader-meta {
  order: 1;
}

.cmt-select-bar {
  order: 2;
}

.reader-footer {
  order: 4;
}

.reader-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  color: var(--reader-muted);
  font-size: .75rem;
  margin-bottom: .35rem;
  min-height: 1.2em;
  max-height: calc(1.25em * 3);
  overflow: hidden;
  padding-right: .25rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  line-height: 1.25;
}

#unit-title,
.watermark {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  line-height: 1.25;
  max-height: calc(1.25em * 3);
}

#unit-title {
  flex: 1 1 auto;
}

.watermark {
  flex: 0 1 42%;
  text-align: right;
  opacity: .45;
  font-size: .72rem;
  user-select: none;
}

.page-text {
  flex: 1;
  overflow: auto;
  font-family: var(--font-body);
  line-height: 1.55;
  white-space: normal;
  user-select: none;
  -webkit-user-select: none;
  padding: 1.35rem 1.5rem;
  padding-top: 3.85rem;
  /* hueco bajo progreso + barra nav */
  border-radius: 12px;
  color: var(--reader-ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .03), transparent),
    var(--reader-paper);
  border: 1px solid var(--reader-border);
  min-height: 0;
}

.reader-visor.is-page-sliding {
  overflow: hidden;
}

.page-text.page-slide-ready {
  transition: transform .32s ease, opacity .32s ease;
  will-change: transform, opacity;
}

.page-text.is-slide-exit-next {
  transform: translateX(-22%);
  opacity: 0;
}

.page-text.is-slide-exit-prev {
  transform: translateX(22%);
  opacity: 0;
}

.page-text.is-slide-enter-next {
  transform: translateX(22%);
  opacity: 0;
}

.page-text.is-slide-enter-prev {
  transform: translateX(-22%);
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .page-text.page-slide-ready {
    transition: none;
  }
}

.page-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: .55rem;
  z-index: 15;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--reader-paper) 72%, transparent);
  color: #4a7a54;
  opacity: .85;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 0 1px rgba(74, 122, 84, .35);
  animation: page-scroll-hint-bob 1.35s ease-in-out infinite;
}

.page-scroll-hint[hidden] {
  display: none !important;
}

.page-scroll-hint svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.page-scroll-hint:hover,
.page-scroll-hint:focus-visible {
  opacity: 1;
  outline: none;
  color: #3a6a44;
  box-shadow: 0 0 0 1px rgba(74, 122, 84, .55);
}

/* Hints inferiores: anterior / siguiente (complementan la barra) */
.page-nav-hints {
  position: absolute;
  left: 0;
  right: 0;
  bottom: .55rem;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 .85rem;
  pointer-events: none;
}

.page-nav-hints[hidden] {
  display: none !important;
}

.page-nav-hint {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--reader-paper) 72%, transparent);
  color: #4a7a54;
  opacity: .85;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(74, 122, 84, .35);
  animation: page-scroll-hint-bob 1.35s ease-in-out infinite;
}

.page-nav-hint[hidden] {
  display: none !important;
}

.page-nav-hint svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.page-nav-hint:hover,
.page-nav-hint:focus-visible {
  opacity: 1;
  outline: none;
  color: #3a6a44;
  box-shadow: 0 0 0 1px rgba(74, 122, 84, .55);
}

.page-nav-hint-prev {
  animation-name: page-nav-hint-bob-left;
}

.page-nav-hint-next {
  animation-name: page-nav-hint-bob-right;
}

@keyframes page-nav-hint-bob-left {

  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(-5px);
  }
}

@keyframes page-nav-hint-bob-right {

  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(5px);
  }
}

@keyframes page-scroll-hint-bob {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
    opacity: .65;
  }

  50% {
    transform: translateX(-50%) translateY(.35rem);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-scroll-hint,
  .page-nav-hint {
    animation: page-scroll-hint-blink 1.6s ease-in-out infinite;
  }

  @keyframes page-scroll-hint-blink {

    0%,
    100% {
      opacity: .4;
    }

    50% {
      opacity: .95;
    }
  }
}

body.theme-claro .page-text {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .55), transparent 40%),
    var(--reader-paper);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .08);
}

.page-text:not(.is-html) {
  white-space: pre-wrap;
}

/* HTML de obra: justificado + silabeo nativo del navegador (es) */
.page-text.is-html {
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: break-word;
}

.page-text.is-html p {
  margin: 0 0 .7em;
  text-align: justify;
  text-justify: inter-word;
  text-align-last: left;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.page-text.is-html p:last-child {
  margin-bottom: 0;
}

.page-text.is-html br {
  line-height: inherit;
}

.page-text.allow-select {
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: none;
}

.cmt-select-bar {
  position: relative;
  z-index: 36;
  flex-shrink: 0;
  margin: 0 0 .35rem;
  padding: .65rem .75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  box-shadow: 0 8px 24px var(--shadow);
}

.cmt-select-bar[hidden] {
  display: none !important;
}

.cmt-select-bar-hint {
  margin: 0 0 .5rem;
  font-size: .72rem;
  line-height: 1.35;
  color: var(--muted);
}

.cmt-select-bar-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.cmt-select-bar-actions .btn {
  flex: 1 1 auto;
  min-width: 7rem;
  justify-content: center;
  min-height: 2.6rem;
}

body.theme-oscuro .page-text h3.cdli,
body.theme-oscuro .page-text h4.cdli,
body.theme-oscuro .page-text h5.cdli {
  color: var(--muted);
}

body.theme-oscuro .page-text h1.cdli,
body.theme-oscuro .page-text h2.cdli {
  color: var(--ink);
}

.reader-footer {
  flex-shrink: 0;
  margin-top: .45rem;
}

.reader-return-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: 100%;
  margin: 0 0 .55rem;
  background: transparent !important;
  border: 1px solid var(--accent) !important;
  color: var(--accent) !important;
  font-weight: 600;
}

.reader-return-btn:hover {
  background: rgba(var(--accent-rgb), .12) !important;
}

.reader-return-btn[hidden] {
  display: none !important;
}

.progress-wrap {
  height: 5px;
  background: rgba(255, 255, 255, .08);
  border-radius: 99px;
  margin: 0 0 .3rem;
  overflow: hidden;
}

body.theme-claro .progress-wrap {
  background: rgba(26, 26, 26, .1);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(74, 122, 84, .75), rgba(56, 108, 68, .95));
  transition: width .2s linear;
}

.timer-label {
  color: var(--muted);
  font-size: .75rem;
  margin: 0;
  min-height: 1.1em;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.reader-actions {
  display: flex;
  gap: .55rem;
  justify-content: center;
  align-items: center;
}

.reader-nav-btn {
  width: 1.85rem;
  height: 1.85rem;
  min-width: 1.85rem !important;
  min-height: 1.85rem;
  border-radius: 9px;
  padding: 0 !important;
  color: var(--ink) !important;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
}

.reader-nav-btn svg {
  width: 14px;
  height: 14px;
}

.reader-nav-btn.is-primary {
  color: var(--accent) !important;
}

.reader-nav-btn:disabled {
  opacity: .35;
}

/* AA: deslizador vertical de tamaño (a la derecha del ítem en el drawer) */
.reader-aa-wrap {
  position: relative;
  flex-shrink: 0;
  width: 100%;
}

.reader-font-flyout {
  position: absolute;
  top: 50%;
  left: calc(100% + .4rem);
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: .45rem .4rem .55rem;
  border-radius: 12px;
  background: rgba(74, 122, 84, .92);
  border: 1px solid rgba(52, 96, 62, .95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  pointer-events: auto;
}

.reader-font-flyout[hidden] {
  display: none !important;
}

.reader-font-flyout-big,
.reader-font-flyout-small {
  color: #f4faf5;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif, Arial, Helvetica, sans-serif;
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

.reader-font-flyout-big {
  font-size: 1rem;
}

.reader-font-flyout-small {
  font-size: .7rem;
}

.reader-font-slider-live {
  writing-mode: vertical-lr;
  direction: rtl;
  appearance: slider-vertical;
  -webkit-appearance: slider-vertical;
  width: 1.35rem;
  height: 6.5rem;
  margin: 0;
  padding: 0;
  background: transparent;
  accent-color: #dceadf;
  cursor: pointer;
}

.reader-aa-wrap.is-open #btn-reader-aa {
  opacity: 1;
  border-color: rgba(74, 122, 84, .65);
  background: rgba(74, 122, 84, .18);
}

/* Pantalla completa del visor (área de texto + barra) */
body.reader-fs {
  overflow: hidden;
}

body.reader-fs .site-header,
body.reader-fs .header-hotzone {
  display: none !important;
}

body.reader-fs .reader-meta,
body.reader-fs .timer-label,
body.reader-fs .reader-return-btn,
body.reader-fs .reader-footer {
  visibility: hidden;
  pointer-events: none;
}

body.reader-fs .reader-visor {
  position: fixed;
  inset: 0;
  z-index: 88;
  width: 100%;
  height: 100%;
  max-width: none;
  background: var(--reader-paper);
}

body.reader-fs .reader-visor .page-text {
  border-radius: 0;
  border: 0;
  height: 100%;
  padding-top: max(3.9rem, calc(env(safe-area-inset-top, 0px) + 3.4rem));
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  padding-left: max(1.15rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.15rem, env(safe-area-inset-right, 0px));
}

body.reader-fs .reader-visor-chrome {
  position: absolute;
  top: max(0px, env(safe-area-inset-top, 0px));
  left: max(0px, env(safe-area-inset-left, 0px));
  right: max(0px, env(safe-area-inset-right, 0px));
  bottom: auto;
  width: auto;
}

body.reader-fs .reader-fs-btn {
  position: absolute;
  top: 50%;
  right: 0;
  left: auto;
  bottom: auto;
  margin: 0;
  transform: translateY(-50%);
}

/* Menú / modales / pausa por encima del visor en fullscreen */
body.reader-fs.reader-panel-open .reader-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 130;
}

body.reader-fs.reader-panel-open .reader-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 131;
}

body.reader-fs .pause-overlay,
body.reader-fs .modal {
  z-index: 140;
}

/* Modal info de lectura */
.reader-info-list {
  margin: 0;
  display: grid;
  gap: .75rem;
}

.reader-info-list>div {
  display: grid;
  gap: .15rem;
}

.reader-info-list dt {
  margin: 0;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.reader-info-list dd {
  margin: 0;
  color: var(--ink);
  font-size: .95rem;
  line-height: 1.4;
  word-break: break-word;
}

.reader-info-permisos {
  margin-top: 1rem;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: .45rem;
  background: color-mix(in srgb, var(--bg-soft) 80%, transparent);
}

.reader-info-permisos-line {
  margin: 0;
  font-size: .88rem;
  line-height: 1.35;
  color: var(--ink);
}

.reader-info-permisos-k {
  display: inline-block;
  min-width: 4.6rem;
  margin-right: .35rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Aviso: girá el teléfono (landscape en móvil) */
.rotate-device {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(10, 12, 10, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rotate-device[hidden] {
  display: none !important;
}

.rotate-device-card {
  text-align: center;
  max-width: 18rem;
  color: #f4faf5;
}

.rotate-device-icon {
  display: inline-grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  margin: 0 auto .85rem;
  border-radius: 14px;
  background: rgba(74, 122, 84, .55);
  border: 1px solid rgba(52, 96, 62, .7);
  color: #f4faf5;
}

.rotate-device-icon svg {
  width: 22px;
  height: 22px;
}

.rotate-device-title {
  margin: 0 0 .35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: .02em;
}

.rotate-device-hint {
  margin: 0;
  font-size: .92rem;
  opacity: .82;
  line-height: 1.4;
}

/* Pausa */
.pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(10, 8, 6, .55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body.theme-claro .pause-overlay {
  background: rgba(0, 0, 0, .4);
}

.pause-overlay[hidden] {
  display: none !important;
}

.pause-card {
  width: min(420px, 100%);
  text-align: center;
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  box-shadow: 0 20px 60px var(--shadow);
}

.pause-title {
  margin: 0 0 .35rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.pause-countdown {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: clamp(2.8rem, 12vw, 4.2rem);
  line-height: 1;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  margin: .5rem 0 1rem;
}

.pause-hint {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
}

.pause-resume-btn {
  min-width: 12rem;
}

.modal-card-rating {
  width: min(520px, 96vw);
}

.rating-modal-meta {
  margin: 0 0 .65rem;
  font-weight: 700;
  color: var(--ink);
}

.rating-modal-question {
  margin: 0 0 .85rem;
  text-align: center;
  color: var(--muted);
}

.rating-emojis {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .55rem .4rem;
  margin: .15rem 0 .65rem;
  padding: .35rem 0 .15rem;
  border: 0;
}

.rating-emoji-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  width: 4.25rem;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.rating-emoji-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Sprite CDLI-huellas-ranking.png: 6 mosaicos 128×128 → 48×48 */
.rating-huella {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background-color: transparent;
  background-image: url('../img/CDLI-huellas-ranking.png');
  background-repeat: no-repeat;
  background-size: 288px 48px; /* 768×128 × 0.375 */
  border: 2px solid transparent;
  box-sizing: content-box;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.rating-huella--0 { background-position: 0 0; }       /* Poca */
.rating-huella--1 { background-position: -48px 0; }   /* Algo */
.rating-huella--2 { background-position: -96px 0; }   /* Bastante */
.rating-huella--3 { background-position: -144px 0; }  /* Mucha */
.rating-huella--4 { background-position: -192px 0; }  /* Profunda */
.rating-huella--5 { background-position: -240px 0; }  /* Paso */

.rating-emoji-label {
  font-size: .62rem;
  line-height: 1.15;
  text-align: center;
  /*color: var(--muted);*/
  color: rgba(0, 0, 0, .55) !important;
}

.rating-emoji-opt:hover .rating-huella,
.rating-emoji-opt:focus-within .rating-huella {
  transform: scale(1.08);
  border-color: rgba(74, 122, 84, .55);
}

.rating-emoji-opt:has(input:checked) .rating-huella {
  border-color: #4a7a54;
  transform: scale(1.1);
  box-shadow: 0 0 0 2px rgba(74, 122, 84, .25);
}

.rating-emoji-opt:has(input:checked) .rating-emoji-label {
  color: var(--ink, #e8e4dc);
  font-weight: 600;
}

body.theme-claro .rating-emoji-opt:has(input:checked) .rating-emoji-label {
  color: var(--ink);
}

.admin-calif-huella {
  display: inline-block;
  vertical-align: middle;
  margin-right: .35rem;
  width: 32px;
  height: 32px;
  background-size: 192px 32px;
  border-radius: 6px;
}

.admin-calif-huella.rating-huella--0 { background-position: 0 0; }
.admin-calif-huella.rating-huella--1 { background-position: -32px 0; }
.admin-calif-huella.rating-huella--2 { background-position: -64px 0; }
.admin-calif-huella.rating-huella--3 { background-position: -96px 0; }
.admin-calif-huella.rating-huella--4 { background-position: -128px 0; }
.admin-calif-huella.rating-huella--5 { background-position: -160px 0; }

.rating-comment-label {
  display: grid;
  gap: .3rem;
  font-size: .85rem;
}

.rating-comment-heading {
  display: inline;
  white-space: nowrap;
}

.rating-comment-heading .note {
  display: inline;
  margin-left: .25rem;
}

.rating-actions {
  justify-content: flex-end;
}

.rating-comment-label textarea {
  width: 100%;
  resize: vertical;
  min-height: 4.5rem;
}

#rating-submit:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Modales */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 6, .55);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  /* Por encima del header de la Sala (z-index 55) y del panel lateral */
  z-index: 70;
  padding: 1rem;
}

.modal .btn svg {
  pointer-events: none;
}

.modal[hidden] {
  display: none !important;
}

.modal-card {
  width: min(520px, 100%);
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
}

.modal-card-help {
  width: min(90vw, 1400px);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem 1.15rem;
}

.modal-card-auth {
  width: min(420px, 100%);
  text-align: center;
  padding: 1.75rem 1.5rem 1.5rem;
  background: #f5f5f5;
  border: 1px solid #c0c0c0;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}

.auth-modal-title {
  margin: 0 0 .85rem;
  font-family: var(--mkt-display, Georgia, serif);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  color: #2f5d38;
}

.auth-modal-text {
  margin: 0 0 1.35rem;
  font-family: var(--mkt-display, Georgia, serif);
  font-size: .95rem;
  line-height: 1.55;
  color: #505050;
}

.auth-modal-close {
  min-width: 9rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .78rem;
}

body.page-solicitud .modal--auth {
  background: rgba(40, 40, 40, .45);
}

.help-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .35rem;
}

.help-head h2 {
  font-family: var(--font-display);
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.help-body {
  overflow: auto;
  padding-right: .35rem;
  margin: .35rem 0 .75rem;
  font-size: 1.25rem;
  line-height: 1.5;
}

.help-intro {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

.help-body h3 {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.1rem 0 .45rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.help-body ul {
  margin: 0 0 .35rem;
  padding-left: 1.25rem;
  color: var(--muted);
  line-height: 1.5;
  font-size: 1.15rem;
}

.help-body li {
  margin: 0 0 .45rem;
}

.help-body strong {
  color: var(--ink);
  font-weight: 600;
}

.help-foot {
  margin: 0;
}

.btn-cancel-danger {
  color: var(--danger) !important;
  border-color: rgba(201, 120, 120, .55) !important;
}

.btn-cancel-danger:hover {
  background: rgba(201, 120, 120, .12) !important;
  color: var(--danger) !important;
  border-color: var(--danger) !important;
}

.pause-resume-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.quote {
  margin: 0;
  padding: .75rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(0, 0, 0, .25);
  color: var(--ink);
  font-family: var(--font-body);
}

body.theme-claro .quote {
  background: rgba(26, 26, 26, .05);
}

.admin-calif-nivel {
  white-space: nowrap;
  font-weight: 600;
}

.table-wrap {
  overflow: auto;
  margin-top: 1rem;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

table.data th,
table.data td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: .55rem .4rem;
  vertical-align: top;
}

table.data th {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .72rem;
}

table.data tr.is-inactive td {
  opacity: .55;
}

/* Listado admin — estado y progreso de lectura */
.data-usuarios .th-estado,
.data-usuarios .td-estado {
  width: 1.75rem;
  padding-left: .25rem;
  padding-right: .25rem;
  text-align: center;
}

.usuario-email-cell {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  min-width: 10rem;
}

.usuario-email-text {
  word-break: break-word;
  line-height: 1.35;
}

.usuario-estado-cuadro {
  display: inline-block;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 3px;
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.usuario-estado-cuadro.is-sin-obra { background: #c0392b; }
.usuario-estado-cuadro.is-sin-leer { background: #d8d8d8; }
.usuario-estado-cuadro.is-inicio { background: #3d8b4f; }
.usuario-estado-cuadro.is-mitad { background: #e6b800; }
.usuario-estado-cuadro.is-completo { background: #2f6fb8; }
.usuario-estado-cuadro.is-admin { background: transparent; box-shadow: none; }

.usuario-progreso-track {
  position: relative;
  height: .55rem;
  width: min(100%, 12rem);
  border-radius: 999px;
  overflow: visible;
}

.usuario-progreso-track__bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #c0392b 0%,
    #c0392b 16.5%,
    #e67e22 16.5%,
    #e67e22 33%,
    #e6b800 33%,
    #e6b800 50%,
    #7cb342 50%,
    #7cb342 66.5%,
    #26a69a 66.5%,
    #26a69a 83%,
    #2f6fb8 83%,
    #2f6fb8 100%
  );
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.usuario-progreso-track__needle {
  position: absolute;
  top: -.1rem;
  bottom: -.1rem;
  width: 2px;
  margin-left: -1px;
  background: #555;
  border-radius: 1px;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.acciones-iconos {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  white-space: nowrap;
}

.btn.btn-icon {
  padding: .35rem .4rem;
  min-width: 2rem;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 10px;
  letter-spacing: 0;
  text-transform: none;
}

.btn.btn-icon:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.btn.btn-icon.is-on {
  color: var(--ok);
  border-color: rgba(142, 164, 125, .5);
}

.btn.btn-icon.is-off {
  color: var(--danger);
  border-color: rgba(201, 120, 120, .5);
}

.btn.btn-icon svg {
  display: block;
  pointer-events: none;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: .35rem 0 0;
  max-height: min(42vh, 280px);
  overflow: auto;
  flex-shrink: 0;
}

.comment-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .55rem .65rem;
  margin-bottom: .4rem;
  font-size: .85rem;
  color: var(--muted);
  cursor: pointer;
  background: rgba(0, 0, 0, .18);
  text-transform: none;
  letter-spacing: normal;
}

body.theme-claro .comment-list li {
  background: rgba(255, 255, 255, .45);
}

.comment-list li:last-child {
  margin-bottom: 0;
}

.comment-list li strong {
  color: var(--accent);
  font-weight: 600;
}

.comment-list li .comment-meta {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  margin: .15rem 0 .25rem;
  opacity: .9;
}

.comment-list li:hover,
.comment-list li:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  outline: none;
}

.comment-list .comment-flag {
  color: var(--danger);
  font-style: normal;
  font-size: .75rem;
  margin-left: .35rem;
}

.comment-list li.note {
  cursor: default;
  border-style: dashed;
  background: transparent;
}

.comment-list li.note:hover,
.comment-list li.note:focus-visible {
  border-color: var(--line);
  color: var(--muted);
}

.modal-card-comment {
  max-width: 28rem;
  width: min(100%, 28rem);
}

.cmt-section-label {
  margin: 1rem 0 .35rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.cmt-mine {
  margin-top: .35rem;
}

.comment-disclaimer {
  margin: 0 0 .35rem;
  line-height: 1.4;
}

.cmt-form-actions {
  justify-content: space-between;
  align-items: center;
  margin: .85rem 0 0;
}

.cmt-chooser-modes {
  display: flex;
  gap: 1.75rem;
  margin: 1.1rem 0 0;
  justify-content: center;
  flex-wrap: wrap;
}

.cmt-mode-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-width: 5.5rem;
  padding: .75rem .9rem !important;
  border-radius: 999px;
  text-transform: none;
  letter-spacing: .02em;
  font-size: .78rem;
  font-weight: 600;
}

.cmt-mode-btn svg {
  width: 18px;
  height: 18px;
}

.comment-detail-body {
  white-space: pre-wrap;
  line-height: 1.45;
  margin: .75rem 0 1rem;
  max-height: 40vh;
  overflow: auto;
  font-size: .95rem;
}

.page-text mark.comment-highlight {
  background: rgba(var(--accent-rgb), .55);
  color: inherit;
  border-radius: 3px;
  padding: 0 .08em;
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .35);
}

body.theme-claro .page-text mark.comment-highlight {
  background: rgba(var(--accent-rgb), .65);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .25);
}

.page-text .page-continuity {
  opacity: .42;
  filter: saturate(.7);
  line-height: 1.35;
  margin-bottom: .55em;
}

body.theme-claro .page-text .page-continuity {
  opacity: .48;
  color: #6a6a6a;
}

.page-text .page-continuity+ :not(.page-continuity) {
  margin-top: .55em;
}

.badge-warn {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  color: #1a1410;
  background: var(--accent);
  border-radius: 6px;
  padding: .15rem .4rem;
  margin-left: .35rem;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: .04em;
}

table.data tr.has-solicitud-borrado td {
  background: rgba(201, 120, 120, .08);
}

.admin-tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.wizard-steps {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.wizard-step {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .2);
  color: var(--muted);
  border-radius: 999px;
  padding: .45rem .9rem;
  cursor: pointer;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
}

body.theme-claro .wizard-step {
  background: rgba(255, 255, 255, .4);
}

.wizard-step.is-active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.18);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.35);
}

.wizard-step:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.wizard-pane h2,
.contenido-form h3 {
  font-family: var(--font-display);
  margin: 0 0 .5rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 1.05rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem 1rem;
}

.form-grid>label.full,
.form-grid>.field-block,
.form-grid>.cta-row,
.form-grid>.form-msg,
.form-grid>h3,
.form-grid>.obra-publicacion-fields {
  grid-column: 1 / -1;
}

.contenido-form {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .5rem .75rem;
  margin-top: .35rem;
  color: var(--ink);
}

.check-grid label {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  font-size: .85rem;
  color: var(--ink);
  text-transform: none;
  letter-spacing: normal;
}

.check-grid input[type="checkbox"] {
  margin-top: .2rem;
  width: auto;
}

.field-block {
  display: grid;
  gap: .35rem;
}

.field-block-label {
  font-size: .85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.field-block-hint {
  margin: 0;
  font-size: .78rem;
}

.hab-obras-list {
  display: grid;
  gap: .85rem;
  margin-top: .35rem;
  color: var(--ink);
  max-height: min(70vh, 640px);
  overflow: auto;
  padding: .15rem .1rem .4rem;
}

.hab-obras-list input[type="checkbox"],
.hab-obras-list input[type="radio"] {
  width: auto;
  min-width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.hab-obra {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .75rem .85rem .85rem;
  background: rgba(0, 0, 0, .18);
}

body.theme-claro .hab-obra {
  background: rgba(26, 26, 26, .04);
}

.hab-obra-toggle {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .9rem;
  color: var(--ink);
  text-transform: none;
  letter-spacing: normal;
  margin: 0;
  cursor: pointer;
}

.hab-obra-toggle span {
  min-width: 0;
  line-height: 1.35;
}

.hab-obra-detail {
  display: grid;
  gap: .75rem;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px dashed var(--line);
}

.hab-obra-detail[hidden] {
  display: none !important;
}

.hab-vigencia {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 12rem));
  gap: .65rem 1rem;
  align-items: end;
}

.hab-vigencia label {
  display: grid;
  gap: .3rem;
  font-size: .72rem;
  margin: 0;
}

.hab-vigencia input[type="date"] {
  width: 100%;
  max-width: 12rem;
  padding: .45rem .55rem;
}

.hab-alcance-row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1.1rem;
  align-items: center;
}

.hab-alcance-row label {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .82rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  margin: 0;
  cursor: pointer;
}

.hab-unidades {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .12);
  max-height: 16rem;
  overflow: auto;
}

body.theme-claro .hab-unidades {
  background: rgba(26, 26, 26, .03);
}

.hab-unidades[hidden] {
  display: none !important;
}

.hab-unidades label,
.hab-unidades .hab-unidad-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: .6rem;
  width: 100%;
  box-sizing: border-box;
  padding: .4rem .5rem;
  border-radius: 6px;
  font-size: .8rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  margin: 0;
  cursor: pointer;
}

.hab-unidades label:hover,
.hab-unidades .hab-unidad-row:hover {
  background: rgba(var(--accent-rgb), 0.1);
}

.hab-unidades label span,
.hab-unidades .hab-unidad-row span {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
  text-align: left;
}

.usuario-form {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.obra-detalle-form.form-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.obra-detalle-form>label.field-titulo {
  grid-column: span 3;
}

.obra-detalle-form>label.field-subtitulo {
  grid-column: span 3;
}

.obra-detalle-form>label.field-autor {
  grid-column: span 2;
}

.obra-detalle-form>label.field-meta {
  grid-column: span 1;
}

.obra-detalle-form>label.field-meta .note,
.obra-detalle-form>label.field-dnda .note {
  display: block;
  margin-top: .25rem;
}

.obra-detalle-form>label.field-dnda {
  grid-column: 1 / -1;
}

.obra-detalle-form>label.field-media {
  grid-column: span 3;
}

.obra-detalle-form>label.field-css {
  grid-column: 1 / -1;
}

.obra-publicacion-fields {
  margin: .25rem 0 .5rem;
  padding: .85rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, .15);
}

body.theme-claro .obra-publicacion-fields {
  background: rgba(255, 255, 255, .4);
}

.obra-publicacion-fields h3 {
  font-family: var(--font-display);
  font-size: .95rem;
  margin: 0 0 .75rem;
}

.obra-pub-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {

  .obra-detalle-form.form-grid,
  .obra-pub-grid {
    grid-template-columns: 1fr 1fr;
  }

  .obra-detalle-form>label.field-titulo,
  .obra-detalle-form>label.field-subtitulo,
  .obra-detalle-form>label.field-autor,
  .obra-detalle-form>label.field-media,
  .obra-detalle-form>label.field-meta {
    grid-column: span 1;
  }
}

@media (max-width: 720px) {

  .obra-detalle-form.form-grid,
  .obra-pub-grid {
    grid-template-columns: 1fr;
  }

  .obra-detalle-form>label.field-titulo,
  .obra-detalle-form>label.field-subtitulo,
  .obra-detalle-form>label.field-autor,
  .obra-detalle-form>label.field-media,
  .obra-detalle-form>label.field-meta {
    grid-column: 1 / -1;
  }
}

.contenido-form.form-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.contenido-form>label.field-titulo {
  grid-column: span 3;
}

.contenido-form>label.field-parte {
  grid-column: span 2;
}

.contenido-editor {
  margin-top: .5rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--reader-paper);
}

.editor-hint {
  margin: .4rem 0 0;
}

#contenido-texto[hidden],
.contenido-editor[hidden] {
  display: none !important;
}

.EasyMDEContainer .CodeMirror {
  background: var(--reader-paper);
  color: var(--ink);
  border-color: var(--line);
  border-radius: 0 0 10px 10px;
  min-height: 320px;
}

.EasyMDEContainer .CodeMirror-cursor {
  border-left-color: var(--accent);
}

.EasyMDEContainer .editor-toolbar {
  background: var(--bg-soft);
  border-color: var(--line);
  border-radius: 10px 10px 0 0;
  opacity: 1;
}

.EasyMDEContainer .editor-toolbar button {
  color: var(--muted) !important;
}

.EasyMDEContainer .editor-toolbar button:hover,
.EasyMDEContainer .editor-toolbar button.active {
  background: rgba(var(--accent-rgb), .12);
  border-color: transparent;
}

.EasyMDEContainer .editor-toolbar i.separator {
  border-left-color: var(--line);
  border-right-color: var(--line);
}

.EasyMDEContainer .editor-preview,
.EasyMDEContainer .editor-preview-side {
  background: var(--bg);
  color: var(--ink);
}

.EasyMDEContainer .editor-statusbar {
  color: var(--muted);
}

.contenido-editor .ql-toolbar.ql-snow {
  background: var(--bg-soft);
  border-color: var(--line);
  color: var(--muted);
}

.contenido-editor .ql-container.ql-snow {
  border-color: var(--line);
  min-height: 320px;
  font-family: var(--font-body);
  font-size: 1.05rem;
}

.contenido-editor .ql-editor {
  color: var(--ink);
  min-height: 300px;
}

.contenido-editor .ql-stroke {
  stroke: var(--muted);
}

.contenido-editor .ql-fill {
  fill: var(--muted);
}

.contenido-editor .ql-picker {
  color: var(--muted);
}

.contenido-editor .ql-picker-options {
  background: var(--panel-solid);
  border-color: var(--line);
}

.contenido-editor .ql-htmlSource {
  width: auto !important;
  padding: 0 .35rem;
}

.contenido-editor .ql-htmlSource::before {
  content: "</>";
  font-family: Consolas, "Courier New", monospace;
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent);
}

.html-source-textarea {
  width: 100%;
  margin: .75rem 0 1rem;
  min-height: 280px;
  font-family: Consolas, "Courier New", monospace;
  font-size: .9rem;
  line-height: 1.45;
  white-space: pre;
  tab-size: 2;
}

.file-preview {
  margin-top: .5rem;
}

.thumb-preview {
  display: block;
  max-width: 180px;
  max-height: 180px;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
}

.char-count {
  display: block;
  text-align: right;
  margin-top: .25rem;
  font-variant-numeric: tabular-nums;
}

.char-count.is-limit {
  color: var(--danger);
}

.modal-card-wide {
  width: min(820px, 100%);
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .35rem;
}

.preview-head h2 {
  font-family: var(--font-display);
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.preview-body {
  margin-top: .75rem;
  overflow: auto;
  max-height: min(65vh, 640px);
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: var(--reader-paper);
  border: 1px solid var(--line);
}

.preview-plain {
  white-space: pre-wrap;
  font-family: var(--font-body);
  line-height: 1.55;
}

.preview-html {
  font-family: var(--font-body);
  line-height: 1.55;
}

.preview-html h1,
.preview-html h2,
.preview-html h3 {
  font-family: var(--font-display);
  margin: 1rem 0 .5rem;
}

.preview-html p {
  margin: 0 0 .85rem;
}

.preview-html ul,
.preview-html ol {
  margin: 0 0 .85rem 1.2rem;
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .contenido-form.form-grid {
    grid-template-columns: 1fr;
  }

  .contenido-form>label.field-titulo,
  .contenido-form>label.field-parte {
    grid-column: 1 / -1;
  }

  .site-header {
    flex-wrap: wrap;
  }
}

@media print {
  body * {
    display: none !important;
  }

  body::after {
    content: "Impresión no permitida.";
    display: block;
    padding: 2rem;
  }
}

/* Móvil vertical y horizontal (phones landscape suelen superar 860px de ancho) */
@media (max-width: 860px),
(orientation: landscape) and (max-height: 520px) {
  .reader-stage {
    padding: .45rem .65rem .65rem;
  }

  /* Controles arriba: lejos del buscador de Google / barra del navegador */
  .reader-meta {
    order: 1;
  }

  .reader-footer {
    order: 2;
    margin-top: 0;
    margin-bottom: .35rem;
  }

  .cmt-select-bar {
    order: 3;
  }

  .reader-visor {
    order: 4;
  }

  .page-text {
    padding: 1.1rem 1.15rem;
    padding-top: 3.55rem;
  }

  /* Meta compacta: sin marca de agua; título a 2 líneas */
  .reader-meta {
    max-height: calc(1.25em * 2);
    margin-bottom: .25rem;
    padding-right: .15rem;
  }

  .reader-meta .watermark {
    display: none;
  }

  #unit-title {
    -webkit-line-clamp: 2;
    max-height: calc(1.25em * 2);
    flex: 1 1 100%;
  }

  /* Continuidad: el recorte con «…» al inicio lo arma el servidor */
  .page-text .page-continuity {
    display: block !important;
    max-height: none;
    -webkit-line-clamp: unset;
  }

  .reader-footer .timer-label {
    font-size: .68rem;
    margin-bottom: 0;
  }

  /* Botones de navegación ~75% (misma línea que fullscreen) */
  .reader-visor-chrome {
    gap: .22rem;
    padding: .28rem .35rem .45rem;
  }

  .reader-visor-toolbar {
    padding-right: 0;
  }

  .reader-actions-nav {
    gap: .45rem;
    padding: .22rem .38rem;
  }

  .reader-nav-btn,
  .reader-fs-btn {
    width: 1.7rem;
    height: 1.7rem;
    min-width: 1.7rem;
    min-height: 1.7rem;
    border-radius: 8px;
  }

  .reader-nav-btn svg,
  .reader-fs-btn svg {
    width: 13px;
    height: 13px;
  }

  .reader-fs-btn {
    right: auto;
  }

  /* Barra de comentario: fija al tope del viewport (por encima del widget de Google) */
  body.is-cmt-selecting .cmt-select-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    margin: 0;
    border-radius: 0 0 12px 12px;
    padding: .75rem .85rem calc(.75rem + env(safe-area-inset-top, 0px));
    padding-top: calc(.75rem + env(safe-area-inset-top, 0px));
    box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  }

  body.is-cmt-selecting .reader-stage {
    padding-top: 6.5rem;
  }

  .reader-panel-head h1 {
    font-size: 1rem;
  }
}

.statement-footer {
  display: grid;
  gap: 0.22rem;
  margin-top: clamp(1.8rem, 4vh, 3.2rem);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(0.62rem, 0.9vw, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.35;
  text-transform: uppercase;
  /*text-shadow: 0 0 10px rgba(244, 241, 234, 0.88), 0 0 18px rgba(244, 241, 234, 0.72);*/
  color: rgba(110, 110, 110, 0.82) !important;
}