*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color-scheme: light;
  background: var(--page);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink-950);
  background:
    radial-gradient(circle at 85% 0%, rgba(9, 81, 162, 0.10), transparent 25rem),
    var(--page);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

[hidden] {
  display: none !important;
}

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

.network-status {
  position: sticky;
  z-index: 50;
  top: 0;
  padding: 0.7rem 1rem;
  color: var(--ink-950);
  background: var(--warning-100);
  text-align: center;
  font-size: 0.875rem;
  font-weight: 700;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-5);
  color: var(--ink-600);
}

.brand-mark {
  position: relative;
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 15px;
  color: var(--white);
  background: var(--ink-900);
  box-shadow: 0 12px 26px rgba(11, 43, 66, 0.22);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: -0.45rem;
  bottom: -0.65rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--accent-500);
}

.brand-mark span {
  position: relative;
  z-index: 1;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-copy strong {
  color: var(--ink-900);
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.brand-copy span {
  margin-top: 0.18rem;
  color: var(--ink-600);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.brand-company-mobile,
.brand-site-mobile {
  display: none;
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(27rem, 0.9fr);
  background: var(--white);
}

.login-intro {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(2rem, 6vw, 5rem);
  color: var(--white);
  background:
    linear-gradient(145deg, rgba(7, 29, 44, 0.15), transparent 55%),
    var(--ink-900);
}

.login-intro::before,
.login-intro::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.login-intro::before {
  top: -11rem;
  right: -9rem;
  width: 31rem;
  height: 31rem;
  border: 5rem solid rgba(255, 255, 255, 0.035);
}

.login-intro::after {
  right: 10%;
  bottom: -8rem;
  width: 22rem;
  height: 22rem;
  background: var(--accent-500);
  opacity: 0.12;
}

.login-brand,
.login-message,
.login-proof {
  position: relative;
  z-index: 1;
}

.login-intro .brand-mark {
  color: var(--ink-900);
  background: var(--white);
}

.login-intro .brand-copy strong,
.login-intro .brand-copy span {
  color: var(--white);
}

.login-message {
  max-width: 42rem;
  margin: auto 0;
  padding: var(--space-12) 0;
}

.eyebrow {
  margin: 0 0 var(--space-4);
  color: var(--accent-400);
  font-size: 0.77rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.login-message h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(2.7rem, 6vw, 5.5rem);
  font-weight: 760;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.login-message p:last-child {
  max-width: 35rem;
  margin: var(--space-6) 0 0;
  color: var(--ink-200);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
}

.login-proof {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--ink-200);
  font-size: 0.9rem;
}

.proof-dot {
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #5ee0a1;
  box-shadow: 0 0 0 0.35rem rgba(94, 224, 161, 0.12);
}

.login-panel {
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 6vw, 5rem);
  background: var(--surface-muted);
}

.login-card {
  width: min(100%, 29rem);
}

.login-card h2 {
  margin: 0;
  color: var(--ink-900);
  font-size: clamp(1.75rem, 4vw, 2.2rem);
  letter-spacing: -0.045em;
}

.login-card > p {
  margin: var(--space-2) 0 var(--space-8);
  color: var(--ink-600);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.field {
  display: grid;
  gap: 0.45rem;
  margin-bottom: var(--space-4);
}

.field label {
  color: var(--ink-800);
  font-size: 0.84rem;
  font-weight: 800;
}

.input,
.select {
  width: 100%;
  min-height: 3.25rem;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  color: var(--ink-950);
  background: var(--white);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input:hover,
.select:hover {
  border-color: var(--ink-300);
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--accent-500);
  box-shadow: var(--shadow-focus);
}

.input::placeholder {
  color: var(--ink-500);
}

.button {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  text-decoration: none;
  font-weight: 850;
  transition: transform 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.button-primary {
  color: var(--white);
  background: var(--accent-600);
  box-shadow: 0 10px 22px rgba(9, 81, 162, 0.22);
}

.button-primary:hover {
  background: var(--accent-700);
}

.button-secondary {
  color: var(--ink-900);
  background: var(--ink-100);
}

.button-ghost {
  color: var(--ink-700);
  background: transparent;
}

.button-block {
  width: 100%;
  margin-top: var(--space-2);
}

.button-small {
  min-height: 2.5rem;
  padding: 0.55rem 0.8rem;
  font-size: 0.88rem;
}

.button-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.form-note {
  margin: var(--space-5) 0 0;
  color: var(--ink-500);
  font-size: 0.78rem;
  text-align: center;
}

.alert {
  margin: 0 0 var(--space-5);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  font-weight: 650;
}

.alert-error {
  color: var(--danger-700);
  background: var(--danger-100);
}

.alert-info {
  color: var(--ink-800);
  background: var(--ink-100);
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(11, 43, 66, 0.08);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.header-inner {
  width: min(calc(100% - 2rem), var(--content-max));
  min-height: 4.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin: 0 auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.tenant-chip {
  display: grid;
  justify-items: end;
  line-height: 1.2;
}

.tenant-chip strong {
  color: var(--ink-800);
  font-size: 0.84rem;
}

.tenant-chip span {
  color: var(--ink-500);
  font-size: 0.74rem;
}

.avatar {
  width: 2.55rem;
  height: 2.55rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--ink-800);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

button.avatar {
  border: 0;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.avatar-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.page {
  width: min(calc(100% - 2rem), var(--content-max));
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3.5rem) 0 calc(5rem + env(safe-area-inset-bottom));
}

.welcome {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--space-8);
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 5vw, 3.25rem);
  color: var(--white);
  background: var(--ink-900);
  box-shadow: var(--shadow-md);
}

.welcome::after {
  content: "";
  position: absolute;
  right: -4.5rem;
  bottom: -6rem;
  width: 18rem;
  height: 18rem;
  border: 3.5rem solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.welcome-copy,
.welcome-stat {
  position: relative;
  z-index: 1;
}

.welcome h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.7rem);
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.welcome-copy > p:last-child {
  max-width: 38rem;
  margin: var(--space-4) 0 0;
  color: var(--ink-200);
}

.welcome-stat {
  min-width: 9rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  background: rgba(255, 255, 255, 0.075);
  text-align: center;
}

.welcome-stat-content {
  width: 100%;
  display: grid;
  justify-items: center;
  text-align: center;
}

.welcome-stat strong {
  display: block;
  font-size: 2.4rem;
  letter-spacing: -0.06em;
  line-height: 1;
}

.welcome-stat span {
  display: block;
  margin-top: var(--space-2);
  color: var(--ink-200);
  font-size: 0.8rem;
  font-weight: 700;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-4);
  margin: var(--space-10) 0 var(--space-5);
}

.section-heading h2 {
  margin: 0;
  color: var(--ink-900);
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.04em;
}

.section-heading p {
  margin: var(--space-1) 0 0;
  color: var(--ink-600);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.course-card {
  min-height: 20rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(11, 43, 66, 0.08);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.course-card:hover {
  transform: translateY(-3px);
  border-color: rgba(9, 81, 162, 0.4);
  box-shadow: var(--shadow-md);
}

.course-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.course-code,
.module-type {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.65rem;
  color: var(--ink-700);
  background: var(--ink-100);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.completion-badge {
  color: var(--success-700);
  background: var(--success-100);
}

.course-card h3 {
  margin: var(--space-6) 0 var(--space-3);
  color: var(--ink-900);
  font-size: 1.3rem;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.course-summary {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink-600);
  font-size: 0.92rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.course-progress {
  margin-top: auto;
  padding-top: var(--space-6);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  color: var(--ink-600);
  font-size: 0.78rem;
  font-weight: 750;
}

.progress-track {
  height: 0.45rem;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--ink-100);
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-600), var(--accent-400));
}

.course-open {
  width: 100%;
  margin-top: var(--space-5);
}

.empty-state,
.error-state {
  border: 1px dashed var(--ink-300);
  border-radius: var(--radius-md);
  padding: clamp(2rem, 7vw, 4rem);
  background: var(--surface);
  text-align: center;
}

.empty-icon {
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  place-items: center;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  color: var(--ink-700);
  background: var(--ink-100);
  font-size: 1.4rem;
  font-weight: 900;
}

.empty-state h2,
.error-state h2 {
  margin: 0;
  color: var(--ink-900);
}

.empty-state p,
.error-state p {
  max-width: 34rem;
  margin: var(--space-2) auto var(--space-5);
  color: var(--ink-600);
}

.skeleton {
  overflow: hidden;
  background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-50) 50%, var(--ink-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.skeleton-card {
  height: 20rem;
  border-radius: var(--radius-md);
}

.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.back-button {
  min-height: 2.7rem;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  color: var(--ink-800);
  background: transparent;
  font-weight: 800;
}

.back-button:hover {
  background: var(--ink-100);
}

.course-hero {
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 5vw, 3rem);
  color: var(--white);
  background:
    radial-gradient(circle at 92% 30%, rgba(23, 104, 191, 0.24), transparent 17rem),
    var(--ink-900);
}

.course-hero h1 {
  max-width: 19ch;
  margin: var(--space-4) 0 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.course-hero .course-code {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
}

.course-hero .course-progress {
  max-width: 28rem;
}

.course-hero .progress-label {
  color: var(--ink-200);
}

.course-hero .progress-track {
  background: rgba(255, 255, 255, 0.14);
}

.content-list {
  display: grid;
  gap: var(--space-5);
}

.course-section {
  overflow: hidden;
  border: 1px solid rgba(11, 43, 66, 0.09);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.course-section-head {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--ink-100);
}

.course-section-head h2 {
  margin: 0;
  color: var(--ink-900);
  font-size: 1.15rem;
  letter-spacing: -0.025em;
}

.course-section-head p {
  margin: var(--space-2) 0 0;
  color: var(--ink-600);
  font-size: 0.88rem;
}

.module-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.module-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
}

.module-item + .module-item {
  border-top: 1px solid var(--ink-100);
}

.module-symbol {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent-700);
  background: var(--accent-100);
  font-size: 1.1rem;
  font-weight: 900;
}

.module-main {
  min-width: 0;
}

.module-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.module-heading h3 {
  margin: 0;
  color: var(--ink-900);
  font-size: 1rem;
  line-height: 1.35;
}

.module-description {
  margin: var(--space-2) 0 0;
  color: var(--ink-600);
  font-size: 0.86rem;
}

.file-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.file-link {
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  text-decoration: none;
  background: var(--surface-muted);
  transition: border-color 150ms ease, background-color 150ms ease;
}

.file-link:hover {
  border-color: var(--accent-400);
  background: var(--white);
}

.file-info {
  min-width: 0;
  display: grid;
}

.file-name {
  overflow: hidden;
  color: var(--ink-800);
  font-size: 0.88rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta,
.future-note {
  color: var(--ink-500);
  font-size: 0.74rem;
}

.file-action {
  flex: 0 0 auto;
  color: var(--accent-700);
  font-size: 0.82rem;
  font-weight: 850;
}

.future-note {
  display: inline-block;
  margin-top: var(--space-3);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.6rem;
  background: var(--ink-50);
}

.install-banner {
  position: fixed;
  z-index: 40;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(calc(100% - 2rem), 24rem);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  color: var(--white);
  background: var(--ink-950);
  box-shadow: var(--shadow-md);
}

.install-banner p {
  flex: 1;
  margin: 0;
  font-size: 0.82rem;
}

.install-banner .button {
  min-height: 2.35rem;
  padding: 0.45rem 0.7rem;
  color: var(--ink-950);
  background: var(--white);
  font-size: 0.78rem;
}

.icon-button {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: currentColor;
  background: transparent;
  font-size: 1.2rem;
}

.toast-region {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  width: min(calc(100% - 2rem), 28rem);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  color: var(--white);
  background: var(--ink-950);
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  text-align: center;
  animation: toast-in 180ms ease both;
}

.noscript {
  position: fixed;
  inset: 1rem;
  z-index: 100;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  padding: 2rem;
  color: var(--danger-700);
  background: var(--danger-100);
  text-align: center;
  font-weight: 800;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(0.5rem); }
}

@media (max-width: 960px) {
  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-intro {
    min-height: auto;
    padding: 2rem;
  }

  .login-message {
    padding: 4rem 0 3rem;
  }

  .login-message h1 {
    max-width: 13ch;
    font-size: clamp(2.5rem, 11vw, 4.5rem);
  }

  .login-proof {
    display: none;
  }

  .login-panel {
    padding: 2.5rem 1.25rem 4rem;
  }

  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .field-row,
  .course-grid {
    grid-template-columns: 1fr;
  }

  .header-inner,
  .page {
    width: min(calc(100% - 1.25rem), var(--content-max));
  }

  .header-inner {
    min-height: 4.25rem;
  }

  .brand-copy span,
  .tenant-chip,
  .header-actions .button-ghost {
    display: none;
  }

  .welcome {
    grid-template-columns: 1fr;
  }

  .welcome-stat {
    width: fit-content;
    min-width: 8rem;
  }

  .section-heading {
    align-items: flex-start;
  }

  .course-card {
    min-height: 18rem;
  }

  .module-item {
    grid-template-columns: 1fr;
    padding: var(--space-5);
  }

  .module-symbol {
    width: 2.4rem;
    height: 2.4rem;
  }

  .module-heading {
    display: grid;
  }

  .course-section-head {
    padding: var(--space-5);
  }
}

.profile-layer {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.profile-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 24, 40, 0.48);
  backdrop-filter: blur(4px);
}

.profile-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 31rem);
  max-height: min(44rem, calc(100dvh - 2rem));
  overflow: auto;
  border: 1px solid var(--ink-100);
  border-radius: 1.5rem;
  padding: 1.35rem;
  color: var(--ink-900);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.profile-panel-head,
.profile-identity,
.profile-photo-form,
.profile-detail {
  display: flex;
  align-items: center;
}

.profile-panel-head {
  justify-content: space-between;
  gap: 1rem;
}

.profile-panel h2,
.profile-info-title h3 {
  margin: 0;
  font-family: var(--font-display);
}

.profile-panel .eyebrow {
  margin: 0 0 0.25rem;
}

.profile-identity {
  gap: 0.9rem;
  margin: 1.25rem 0 1rem;
}

.profile-photo {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: var(--blue-700);
  background: var(--blue-50);
  box-shadow: inset 0 0 0 1px var(--blue-100);
  font-family: var(--font-display);
  font-weight: 800;
}

.profile-photo-large {
  width: 4.5rem;
  height: 4.5rem;
  font-size: 1.25rem;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-identity strong,
.profile-identity span {
  display: block;
}

.profile-identity strong {
  font-size: 1rem;
}

.profile-identity span,
.profile-info-title p,
.profile-photo-form p {
  color: var(--ink-500);
  font-size: 0.78rem;
}

.profile-identity span {
  margin-top: 0.2rem;
}

.profile-photo-form {
  flex-wrap: wrap;
  gap: 0.55rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--ink-100);
}

.profile-photo-form p {
  width: 100%;
  margin: 0.15rem 0 0;
}

.profile-info-title {
  margin: 1.2rem 0 0.75rem;
}

.profile-info-title p {
  margin: 0.25rem 0 0;
}

.profile-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0;
}

.profile-detail {
  min-height: 4.2rem;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.22rem;
  border: 1px solid var(--ink-100);
  border-radius: 0.85rem;
  padding: 0.75rem;
  background: var(--page);
}

.profile-detail dt {
  color: var(--ink-500);
  font-size: 0.7rem;
  font-weight: 800;
}

.profile-detail dd {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink-900);
  font-size: 0.85rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-session-actions {
  margin-top: 1.1rem;
  border-top: 1px solid var(--ink-100);
  padding-top: 1.1rem;
}

.profile-logout-button {
  width: 100%;
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border: 0;
  border-radius: 1rem;
  padding: 0.8rem 1rem;
  color: var(--white);
  background: linear-gradient(135deg, #a82120, var(--danger-700));
  box-shadow: 0 0.7rem 1.4rem rgba(193, 47, 44, 0.2);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.profile-logout-button:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: 0 0.85rem 1.55rem rgba(193, 47, 44, 0.28);
}

.profile-logout-button:focus-visible {
  outline: 3px solid rgba(193, 47, 44, 0.24);
  outline-offset: 3px;
}

.profile-logout-button > span:last-child,
.profile-logout-button strong,
.profile-logout-button small {
  display: block;
}

.profile-logout-button strong {
  font-size: 0.92rem;
}

.profile-logout-button small {
  margin-top: 0.16rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
}

.profile-logout-icon {
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.14);
}

.profile-logout-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.profile-detail-email {
  grid-column: 1 / -1;
}

.profile-detail-email dd {
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

@media (max-width: 700px) {
  .profile-layer {
    place-items: end center;
    padding: 0;
  }

  .profile-panel {
    width: 100%;
    max-height: min(85dvh, 44rem);
    border-radius: 1.5rem 1.5rem 0 0;
    padding: 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* F4: progreso fiable, visor PDF y centro de avisos */
progress.progress-track {
  width: 100%;
  display: block;
  overflow: hidden;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  color: var(--blue-500);
}

progress.progress-track::-webkit-progress-bar {
  border-radius: inherit;
  background: var(--surface-sunken);
}

progress.progress-track::-webkit-progress-value {
  border-radius: inherit;
  background: var(--gradient-brand);
}

progress.progress-track::-moz-progress-bar {
  border-radius: inherit;
  background: var(--gradient-brand);
}

.course-hero progress.progress-track::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.22);
}

.course-hero progress.progress-track::-webkit-progress-value {
  background: var(--white);
}

.course-hero progress.progress-track::-moz-progress-bar {
  background: var(--white);
}

.notification-bell {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--ink-200);
  border-radius: 50%;
  color: var(--blue-700);
  background: var(--white);
  cursor: pointer;
  font-size: 1rem;
  box-shadow: var(--shadow-xs);
}

.notification-bell:hover {
  border-color: var(--blue-200);
  background: var(--blue-50);
}

.notification-bell-glyph {
  color: #c88912;
  font-family: "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
  font-size: 1.05rem;
  font-variant-emoji: text;
  line-height: 1;
}

.notification-bell-glyph::before,
.notification-bell-glyph::after {
  content: none;
}

.notification-bell:focus-visible,
.notification-item:focus-visible,
.notification-drawer-actions button:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.notification-count {
  position: absolute;
  top: -0.2rem;
  right: -0.25rem;
  min-width: 1.15rem;
  height: 1.15rem;
  display: inline-grid;
  place-items: center;
  padding: 0 0.22rem;
  border: 2px solid var(--white);
  border-radius: var(--radius-pill);
  color: var(--white);
  background: var(--danger-700);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
}

.notification-layer {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.notification-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 23, 38, 0.42);
  backdrop-filter: blur(3px);
}

.notification-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(28rem, 94vw);
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  color: var(--ink-800);
  background: var(--white);
  box-shadow: -18px 0 55px rgba(12, 23, 38, 0.2);
  animation: notification-enter 180ms ease-out;
}

.notification-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1.35rem 1rem;
  border-bottom: 1px solid var(--ink-100);
}

.notification-drawer-header span {
  color: var(--blue-600);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.notification-drawer-header h2 {
  margin: 0.15rem 0 0;
  font-size: 1.45rem;
}

.notification-close {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: var(--ink-700);
  background: var(--ink-50);
}

.notification-drawer-actions {
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.35rem;
  color: var(--ink-500);
  background: var(--surface-muted);
  font-size: 0.78rem;
}

.notification-drawer-actions button {
  border: 0;
  color: var(--blue-600);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.notification-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.notification-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: start;
  border: 0;
  border-bottom: 1px solid var(--ink-100);
  padding: 1rem 1.35rem;
  color: inherit;
  background: var(--white);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.notification-item:hover,
.notification-item.is-unread {
  background: var(--blue-50);
}

.notification-symbol {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--blue-700);
  background: var(--blue-100);
  font-weight: 800;
}

.notification-copy {
  min-width: 0;
  display: grid;
  gap: 0.3rem;
  color: var(--ink-600);
  font-size: 0.82rem;
  line-height: 1.45;
}

.notification-title-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--ink-900);
}

.notification-title-row time {
  flex: 0 0 auto;
  color: var(--ink-500);
  font-size: 0.68rem;
  font-weight: 600;
}

.notification-unread-dot {
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--blue-500);
}

.notification-empty {
  min-height: 18rem;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.55rem;
  padding: 2rem;
  color: var(--ink-500);
  text-align: center;
}

.notification-empty > span {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--success-700);
  background: var(--success-100);
  font-size: 1.3rem;
}

.notification-empty strong { color: var(--ink-900); }
.notification-empty p { max-width: 28ch; margin: 0; font-size: 0.84rem; }

.file-link[type="button"] {
  width: 100%;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.pdf-shell {
  height: 100dvh;
  overflow: hidden;
  background: var(--blue-900);
}

.pdf-workspace {
  height: calc(100dvh - 4.75rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.pdf-toolbar {
  min-height: 4.75rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem max(1.25rem, calc((100vw - var(--content-max)) / 2));
  color: var(--white);
  background: var(--gradient-brand);
}

.pdf-toolbar .back-button {
  color: var(--white);
}

.pdf-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}

.button-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pdf-toolbar-title {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 0.1rem;
}

.pdf-toolbar-title span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.pdf-toolbar-title strong {
  max-width: 46rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
}

.pdf-fullscreen-open,
.pdf-download {
  white-space: nowrap;
}

.pdf-fullscreen-exit {
  position: fixed;
  top: max(0.8rem, env(safe-area-inset-top));
  right: max(0.8rem, env(safe-area-inset-right));
  z-index: 1002;
  min-height: 2.8rem;
  display: none;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-pill);
  padding: 0.65rem 0.9rem;
  color: var(--white);
  background: rgba(15, 32, 58, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 12px 32px rgba(12, 23, 38, 0.3);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
}

.pdf-fullscreen-exit:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(31, 67, 113, 0.88);
}

body.pdf-fullscreen-active {
  overflow: hidden;
}

.pdf-shell.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100vw;
  height: 100dvh;
  background: #202936;
}

.pdf-shell.is-fullscreen > .app-header,
.pdf-shell.is-fullscreen .pdf-toolbar {
  display: none;
}

.pdf-shell.is-fullscreen .pdf-workspace {
  height: 100dvh;
  grid-template-rows: minmax(0, 1fr);
}

.pdf-shell.is-fullscreen .pdf-frame-wrap {
  height: 100dvh;
  background: #202936;
  scrollbar-gutter: auto;
}

.pdf-shell.is-fullscreen .pdf-pages {
  padding: 0.75rem;
}

.pdf-shell.is-fullscreen .pdf-page {
  width: min(100%, 1500px);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
}

.pdf-shell.is-fullscreen .pdf-fullscreen-exit {
  display: inline-flex;
}

.pdf-frame-wrap {
  position: relative;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: #dfe4ec;
  scrollbar-gutter: stable;
}

.pdf-pages {
  display: grid;
  gap: 1.5rem;
  justify-items: center;
  padding: 1.5rem;
}

.pdf-page {
  position: relative;
  width: min(100%, 1280px);
  min-height: 18rem;
  aspect-ratio: 1 / 1.414;
  margin: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 0.35rem;
  background: var(--white);
  box-shadow: 0 12px 38px rgba(12, 23, 38, 0.2);
}

.pdf-page canvas {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  background: var(--white);
}

.pdf-page.is-ready {
  min-height: 0;
  aspect-ratio: auto;
}

.skeleton-course-hero { height: 18rem; border-radius: var(--radius-lg); }
.skeleton-course-content { height: 16rem; border-radius: var(--radius-md); }
.skeleton-quiz { height: 20rem; border-radius: var(--radius-lg); }

.pdf-page figcaption {
  position: absolute;
  right: 0.65rem;
  bottom: 0.55rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-pill);
  color: var(--ink-600);
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.64rem;
  box-shadow: var(--shadow-xs);
}

.pdf-status {
  position: sticky;
  top: calc(50% - 4rem);
  z-index: 2;
  width: min(24rem, calc(100% - 2rem));
  min-height: 8rem;
  margin: 1rem auto -9rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
}

.pdf-status.is-error {
  color: var(--danger-700);
}

@keyframes notification-enter {
  from { transform: translateX(1.5rem); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 700px) {
  .notification-bell {
    width: 2.4rem;
    height: 2.4rem;
  }

  .notification-drawer {
    top: auto;
    bottom: 0;
    width: 100%;
    height: min(78dvh, 44rem);
    border-radius: 1.5rem 1.5rem 0 0;
    box-shadow: 0 -18px 55px rgba(12, 23, 38, 0.22);
    animation-name: notification-enter-mobile;
  }

  .notification-drawer-header {
    padding-top: 1.1rem;
  }

  .notification-title-row {
    display: grid;
    gap: 0.2rem;
  }

  .pdf-workspace {
    height: calc(100dvh - 4.25rem);
  }

  .pdf-toolbar {
    min-height: 7rem;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem 0.75rem;
    padding: 0.65rem 0.75rem;
  }

  .pdf-toolbar .back-button {
    min-width: 0;
    justify-self: start;
    padding-inline: 0.4rem;
    font-size: 0.78rem;
  }

  .pdf-download {
    min-height: 2.5rem;
    padding-inline: 0.75rem;
    font-size: 0.74rem;
  }

  .pdf-toolbar-actions {
    grid-column: 2;
    grid-row: 1;
    gap: 0.35rem;
  }

  .pdf-fullscreen-open {
    width: 2.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: 0;
  }

  .pdf-fullscreen-open span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .pdf-toolbar-title {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-items: start;
  }

  .pdf-toolbar-title strong {
    width: 100%;
    max-width: none;
    font-size: 0.78rem;
  }

  .pdf-pages {
    gap: 0.8rem;
    padding: 0.75rem;
  }

  .pdf-page {
    min-height: 12rem;
    border-radius: 0.2rem;
  }

  .pdf-fullscreen-exit {
    width: 2.8rem;
    justify-content: center;
    padding: 0;
  }

  .pdf-fullscreen-exit span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .pdf-shell.is-fullscreen .pdf-pages {
    gap: 0.45rem;
    padding: 0.35rem;
  }
}

@keyframes notification-enter-mobile {
  from { transform: translateY(1.5rem); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

.module-unavailable {
  opacity: 0.78;
}

.module-action {
  width: fit-content;
  min-width: 10rem;
  margin-top: var(--space-4);
}

.module-action:disabled {
  color: var(--ink-500);
  background: var(--ink-100);
  box-shadow: none;
}

.restriction-note {
  margin: var(--space-3) 0 0;
  border-left: 3px solid var(--accent-400);
  padding-left: var(--space-3);
  color: var(--ink-600);
  font-size: 0.82rem;
}

.activity-page {
  max-width: 980px;
}

.activity-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-8);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 5vw, 3rem);
  color: var(--white);
  background:
    radial-gradient(circle at 88% 20%, rgba(23, 104, 191, 0.25), transparent 15rem),
    var(--ink-900);
  box-shadow: var(--shadow-md);
}

.activity-kicker {
  display: block;
  margin-bottom: var(--space-3);
  color: var(--accent-400);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.activity-hero h1 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.activity-hero p {
  max-width: 42rem;
  margin: var(--space-4) 0 0;
  color: var(--ink-200);
}

.activity-status {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  padding: 0.45rem 0.8rem;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  font-weight: 850;
}

.activity-status.is-complete,
.activity-status.is-passed {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-color: #a8dfbf;
  color: #0b6638;
  background: #e8f8ef;
  box-shadow: 0 5px 16px rgba(15, 134, 73, 0.16);
}

.activity-status.is-complete::before,
.activity-status.is-passed::before {
  content: "✓";
  font-weight: 900;
}

.activity-status.is-failed {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-color: #f1a9a5;
  color: #9f2f2b;
  background: #fff0ef;
  box-shadow: 0 5px 16px rgba(180, 59, 54, 0.16);
}

.activity-status.is-failed::before {
  content: "×";
  font-size: 1.05em;
  font-weight: 900;
}

.quiz-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin: var(--space-5) 0;
}

.metric-card {
  min-height: 7.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(11, 43, 66, 0.09);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-card span {
  color: var(--ink-600);
  font-size: 0.8rem;
  font-weight: 750;
}

.metric-card strong {
  color: var(--ink-900);
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  letter-spacing: -0.04em;
}

.metric-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.metric-score-visual {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.metric-score-ring {
  width: 3.25rem;
  height: 3.25rem;
  flex: 0 0 auto;
  overflow: visible;
}

.metric-score-track,
.metric-score-value {
  fill: none;
  stroke-width: 5;
}

.metric-score-track {
  stroke: var(--ink-100);
}

.metric-score-value {
  stroke: var(--blue-500);
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
}

.metric-score-visual.score-tone .metric-score-value {
  stroke: var(--score-color);
}

.activity-panel {
  border: 1px solid rgba(11, 43, 66, 0.09);
  border-radius: var(--radius-md);
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.activity-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.activity-details div {
  display: grid;
  gap: var(--space-1);
}

.activity-details span {
  color: var(--ink-500);
  font-size: 0.75rem;
  font-weight: 750;
}

.activity-details strong {
  color: var(--ink-800);
  font-size: 0.92rem;
}

.quiz-restrictions {
  margin: var(--space-5) 0;
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  color: var(--ink-800);
  background: var(--warning-100);
  font-size: 0.86rem;
}

.quiz-restrictions ul {
  margin: var(--space-2) 0 0;
  padding-left: 1.2rem;
}

.activity-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  border-top: 1px solid var(--ink-100);
  padding-top: var(--space-6);
}

.activity-cta > div {
  display: grid;
  gap: var(--space-1);
}

.activity-cta strong {
  color: var(--ink-900);
}

.activity-cta span {
  color: var(--ink-500);
  font-size: 0.82rem;
}

.quiz-attempt-history {
  margin: var(--space-7) 0;
}

.quiz-attempt-history .section-heading {
  align-items: center;
  margin: 0 0 var(--space-4);
}

.section-kicker {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--blue-600);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quiz-attempt-count {
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  padding: 0.48rem 0.8rem;
  color: var(--blue-700);
  background: var(--blue-50);
  box-shadow: inset 0 0 0 1px var(--blue-100);
  font-size: 0.76rem;
  font-weight: 800;
}

.quiz-attempt-list {
  display: grid;
  gap: 0.8rem;
}

.quiz-attempt-card {
  overflow: hidden;
  border: 1px solid var(--ink-200);
  border-radius: 1.15rem;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.quiz-attempt-card[open] {
  border-color: var(--blue-100);
  box-shadow: var(--shadow-sm);
}

.quiz-attempt-card summary {
  min-height: 5.25rem;
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr) auto minmax(4rem, auto);
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.2rem;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.quiz-attempt-card summary::-webkit-details-marker {
  display: none;
}

.quiz-attempt-card summary:hover {
  background: var(--blue-50);
}

.quiz-attempt-chevron {
  width: 0.7rem;
  height: 0.7rem;
  border-right: 2px solid var(--ink-500);
  border-bottom: 2px solid var(--ink-500);
  transform: rotate(45deg) translate(-0.1rem, -0.1rem);
  transition: transform 160ms ease;
}

.quiz-attempt-card[open] .quiz-attempt-chevron {
  transform: rotate(225deg) translate(-0.1rem, -0.1rem);
}

.quiz-attempt-title,
.quiz-attempt-title strong,
.quiz-attempt-title small {
  min-width: 0;
  display: block;
}

.quiz-attempt-title strong {
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 1rem;
}

.quiz-attempt-title small {
  margin-top: 0.22rem;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiz-attempt-state {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 0.32rem 0.62rem;
  font-size: 0.7rem;
  font-weight: 850;
}

.quiz-attempt-state.is-finished {
  color: var(--success-700);
  background: var(--success-100);
}

.quiz-attempt-state.is-progress {
  color: var(--blue-700);
  background: var(--blue-50);
}

.quiz-attempt-state.is-overdue {
  color: var(--warning-700);
  background: var(--warning-100);
}

.quiz-attempt-state.is-abandoned {
  color: var(--danger-700);
  background: var(--danger-100);
}

.quiz-attempt-state.is-neutral {
  color: var(--ink-600);
  background: var(--ink-100);
}

.quiz-attempt-score {
  justify-self: end;
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.quiz-attempt-body {
  border-top: 1px solid var(--ink-100);
  padding: 1.2rem;
  background: linear-gradient(180deg, var(--page), var(--surface));
}

.quiz-attempt-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0;
}

.quiz-attempt-details > div {
  min-height: 5rem;
  border: 1px solid var(--ink-100);
  border-radius: 0.85rem;
  padding: 0.75rem;
  background: var(--surface);
}

.quiz-attempt-details dt {
  margin-bottom: 0.35rem;
  color: var(--ink-500);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.quiz-attempt-details dd {
  margin: 0;
  color: var(--ink-900);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
}

.quiz-attempt-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.quiz-attempt-actions p {
  margin: 0;
  color: var(--ink-500);
  font-size: 0.78rem;
}

.quiz-attempt-review {
  gap: 0.45rem;
}

.quiz-attempt-review svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.9;
}

.quiz-attempt-empty {
  border: 1px dashed var(--ink-200);
  border-radius: 1.1rem;
  padding: 1.5rem;
  color: var(--ink-700);
  background: var(--surface);
  text-align: center;
}

.quiz-attempt-empty p {
  margin: 0.35rem 0 0;
  color: var(--ink-500);
  font-size: 0.82rem;
}

@media (max-width: 720px) {
  .quiz-attempt-history .section-heading {
    align-items: flex-start;
  }

  .quiz-attempt-card summary {
    grid-template-columns: 1rem minmax(0, 1fr) auto;
    gap: 0.65rem;
    padding: 0.9rem;
  }

  .quiz-attempt-title {
    grid-column: 2;
  }

  .quiz-attempt-state {
    grid-column: 2;
  }

  .quiz-attempt-score {
    grid-column: 3;
    grid-row: 1;
  }

  .quiz-attempt-body {
    padding: 0.9rem;
  }

  .quiz-attempt-details {
    grid-template-columns: 1fr;
  }

  .quiz-attempt-details > div {
    min-height: 0;
  }

  .quiz-attempt-review {
    width: 100%;
  }
}

.embed-shell {
  height: 100vh;
  overflow: hidden;
  background: var(--ink-950);
}

.embed-workspace {
  height: calc(100vh - 4.75rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.embed-toolbar {
  min-height: 4.5rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  padding: 0.7rem max(1rem, calc((100vw - var(--content-max)) / 2));
  color: var(--white);
  background: var(--ink-950);
}

.embed-toolbar .back-button {
  color: var(--white);
}

.embed-toolbar .back-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.embed-toolbar > div {
  min-width: 0;
  display: grid;
  justify-items: center;
  line-height: 1.25;
}

.embed-toolbar > div span {
  color: var(--ink-300);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.embed-toolbar > div strong {
  max-width: 38rem;
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secure-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-200);
  font-size: 0.72rem;
  font-weight: 800;
}

.secure-chip span {
  color: #5ee0a1;
  font-size: 0.6rem;
}

.embed-frame-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--white);
}

.moodle-embed {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: var(--white);
}

.embed-loader {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-3);
  color: var(--ink-800);
  background: var(--surface-muted);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.embed-loader.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.embed-loader small {
  color: var(--ink-500);
}

.embed-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 4px solid var(--ink-100);
  border-top-color: var(--accent-500);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@media (max-width: 640px) {
  .activity-hero,
  .activity-cta {
    align-items: stretch;
    flex-direction: column;
  }

  .quiz-summary,
  .activity-details {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 6.5rem;
  }

  .activity-cta .button {
    width: 100%;
  }

  .embed-workspace {
    height: calc(100vh - 4.25rem);
  }

  .embed-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .secure-chip {
    display: none;
  }
}

/* F2 nativa: evaluación */
.native-quiz-shell {
  min-height: 100vh;
  background: var(--page);
}

.native-quiz-page {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: var(--space-6) clamp(1rem, 4vw, 2.5rem) var(--space-12);
}

.native-quiz-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-5);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  color: var(--white);
  background: var(--ink-950);
  box-shadow: var(--shadow-sm);
}

.native-quiz-toolbar .back-button {
  color: var(--white);
}

.native-quiz-toolbar .back-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.native-quiz-title {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 0.15rem;
}

.native-quiz-title span,
.quiz-clock span {
  color: var(--ink-300);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.native-quiz-title strong {
  max-width: 42rem;
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiz-clock {
  min-width: 7rem;
  display: grid;
  justify-items: end;
}

.quiz-clock strong {
  color: var(--white);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.quiz-clock strong.is-warning {
  color: #ffd08a;
}

.native-quiz-progress {
  margin: var(--space-5) 0;
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.native-quiz-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
  color: var(--ink-600);
  font-size: 0.78rem;
  font-weight: 750;
}

.native-compatibility-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
  border: 1px solid #f1d58e;
  border-radius: var(--radius-md);
  padding: var(--space-5);
  background: var(--warning-100);
}

.native-compatibility-callout > div {
  display: grid;
  gap: var(--space-1);
}

.native-compatibility-callout span {
  color: var(--ink-600);
  font-size: 0.84rem;
}

.native-question-list,
.native-review {
  display: grid;
  gap: var(--space-5);
}

.native-question {
  overflow: hidden;
  border: 1px solid rgba(11, 43, 66, 0.1);
  border-radius: var(--radius-md);
  padding: clamp(1.2rem, 4vw, 2rem);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.native-question.is-blocked {
  opacity: 0.65;
}

.native-question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--ink-100);
  padding-bottom: var(--space-4);
}

.native-question-head > div {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.native-question-head span {
  color: var(--ink-500);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.native-question-head strong {
  color: var(--ink-900);
  font-size: 1.15rem;
}

.native-question-status {
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.65rem;
  color: var(--ink-700) !important;
  background: var(--ink-50);
  letter-spacing: normal !important;
  text-transform: none !important;
}

.native-question.is-review-correct {
  border-color: rgba(15, 134, 73, 0.32);
  background: linear-gradient(135deg, var(--surface) 72%, var(--success-100));
  box-shadow: inset 0.28rem 0 0 var(--success-700), var(--shadow-sm);
}

.native-question.is-review-incorrect {
  border-color: rgba(193, 47, 44, 0.32);
  background: linear-gradient(135deg, var(--surface) 72%, var(--danger-100));
  box-shadow: inset 0.28rem 0 0 var(--danger-700), var(--shadow-sm);
}

.native-question.is-review-partial {
  border-color: rgba(204, 133, 10, 0.34);
  background: linear-gradient(135deg, var(--surface) 72%, var(--warning-100));
  box-shadow: inset 0.28rem 0 0 var(--warning-700), var(--shadow-sm);
}

.native-question-status.is-review-correct {
  color: var(--success-700) !important;
  background: var(--success-100);
  box-shadow: inset 0 0 0 1px rgba(15, 134, 73, 0.16);
}

.native-question-status.is-review-incorrect {
  color: var(--danger-700) !important;
  background: var(--danger-100);
  box-shadow: inset 0 0 0 1px rgba(193, 47, 44, 0.16);
}

.native-question-status.is-review-partial {
  color: var(--warning-700) !important;
  background: var(--warning-100);
  box-shadow: inset 0 0 0 1px rgba(204, 133, 10, 0.18);
}

.moodle-question-content .answer .correct,
.moodle-question-content .correct {
  border-color: rgba(15, 134, 73, 0.25) !important;
  color: var(--success-700) !important;
  background-color: var(--success-100) !important;
}

.moodle-question-content .answer .incorrect,
.moodle-question-content .incorrect {
  border-color: rgba(193, 47, 44, 0.25) !important;
  color: var(--danger-700) !important;
  background-color: var(--danger-100) !important;
}

.moodle-question-content .rightanswer {
  border-left: 0.22rem solid var(--success-700);
  border-radius: 0.55rem;
  padding: 0.65rem 0.8rem;
  color: var(--success-700);
  background: var(--success-100);
}

.question-clear {
  margin-top: var(--space-4);
  border: 0;
  padding: 0.4rem 0;
  color: var(--ink-600);
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}

.question-clear:hover {
  color: var(--accent-700);
}

.moodle-question-content {
  color: var(--ink-800);
  line-height: 1.55;
}

.moodle-question-content .que,
.moodle-question-content .content,
.moodle-question-content .formulation,
.moodle-question-content .ablock {
  width: 100% !important;
  margin: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

.moodle-question-content .que .info,
.moodle-question-content .questionflag,
.moodle-question-content .submitbtns,
.moodle-question-content [data-action="clearchoice"],
.moodle-question-content input[type="submit"],
.moodle-question-content button[type="submit"] {
  display: none !important;
}

.native-question-list.is-busy {
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.moodle-question-content .qtext {
  margin-bottom: var(--space-5) !important;
  color: var(--ink-900);
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  font-weight: 720;
  line-height: 1.45;
}

.moodle-question-content .accesshide {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 0 0.8rem !important;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
  color: var(--ink-500) !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  line-height: 1.3 !important;
}

.moodle-question-content .answer,
.moodle-question-content .subquestion {
  display: grid;
  gap: var(--space-3);
}

.moodle-question-content .answer > div,
.moodle-question-content .r0,
.moodle-question-content .r1 {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  background: var(--surface-muted);
}

.moodle-question-content label {
  color: var(--ink-800);
  cursor: pointer;
}

.moodle-question-content input[type="radio"],
.moodle-question-content input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  margin-top: 0.15rem;
  accent-color: var(--accent-500);
}

.moodle-question-content input[type="text"],
.moodle-question-content input[type="number"],
.moodle-question-content textarea,
.moodle-question-content select {
  width: 100%;
  min-height: 2.8rem;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
  color: var(--ink-900);
  background: var(--white);
  font: inherit;
}

.moodle-question-content textarea {
  min-height: 9rem;
  resize: vertical;
}

.moodle-question-content input:focus,
.moodle-question-content textarea:focus,
.moodle-question-content select:focus {
  border-color: var(--accent-500);
  outline: none;
  box-shadow: var(--shadow-focus);
}

.moodle-question-content img,
.moodle-question-content video {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.moodle-question-content table {
  width: 100%;
  border-collapse: collapse;
}

.moodle-question-content th,
.moodle-question-content td {
  border-bottom: 1px solid var(--ink-100);
  padding: var(--space-3);
  text-align: left;
}

.moodle-question-content .feedback,
.moodle-question-content .rightanswer,
.moodle-question-content .outcome {
  margin-top: var(--space-4);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  background: var(--ink-50);
}

.native-quiz-actions {
  position: sticky;
  z-index: 3;
  bottom: var(--space-3);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
  border: 1px solid rgba(11, 43, 66, 0.1);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.native-quiz-actions > :last-child {
  justify-self: end;
}

.native-quiz-actions > span {
  color: var(--ink-500);
  font-size: 0.78rem;
  font-weight: 750;
}

.native-result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-8);
  margin-bottom: var(--space-6);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 5vw, 3rem);
  color: var(--white);
  background: var(--ink-900);
  box-shadow: var(--shadow-md);
}

.native-result-hero.is-passed {
  background: linear-gradient(135deg, var(--ink-900), #155c4b);
}

.native-result-hero > div:first-child > span {
  color: var(--accent-400);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.native-result-hero h1 {
  margin: var(--space-2) 0;
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: -0.045em;
}

.native-result-hero p {
  max-width: 42rem;
  margin: 0;
  color: var(--ink-200);
}

.result-score {
  min-width: 10rem;
  display: grid;
  justify-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  background: rgba(255, 255, 255, 0.08);
}

.result-score span {
  color: var(--ink-200);
  font-size: 0.72rem;
  font-weight: 750;
}

.result-score strong {
  font-size: 2rem;
}

.review-information-list {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.review-information {
  border-radius: var(--radius-md);
  padding: var(--space-5);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.review-information h3 {
  margin: 0 0 var(--space-2);
}

.native-result-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

/* F2 nativa: certificado */
.certificate-shell {
  height: 100vh;
  overflow: hidden;
  background: var(--ink-950);
}

.certificate-workspace {
  height: calc(100vh - 4.75rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.certificate-toolbar {
  min-height: 4.5rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-3) max(var(--space-5), calc((100vw - var(--content-max)) / 2));
  color: var(--white);
  background: var(--ink-950);
}

.certificate-toolbar .back-button {
  color: var(--white);
}

.certificate-toolbar > div {
  min-width: 0;
  display: grid;
  justify-items: center;
}

.certificate-toolbar > div span {
  color: var(--ink-300);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.certificate-toolbar > div strong {
  max-width: 42rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.certificate-frame-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: #e9ecef;
}

.certificate-pdf {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #e9ecef;
}

.certificate-mobile-help {
  display: none;
}

@media (max-width: 700px) {
  .native-quiz-page {
    padding: var(--space-3) var(--space-3) var(--space-8);
  }

  .native-quiz-toolbar {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .native-quiz-toolbar .back-button {
    grid-row: 1;
    justify-self: start;
    min-height: 2.6rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
  }

  .native-quiz-title {
    grid-row: 2;
    width: 100%;
    justify-items: start;
  }

  .native-quiz-title strong {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    font-size: 0.9rem;
    line-height: 1.3;
    text-overflow: clip;
    white-space: normal;
  }

  .quiz-clock {
    grid-row: 3;
    width: 100%;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: var(--space-3);
  }

  .native-compatibility-callout,
  .native-result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .native-quiz-actions {
    grid-template-columns: 1fr 1fr;
  }

  .native-quiz-actions > span {
    display: none;
  }

  .native-quiz-actions .button {
    width: 100%;
  }

  .native-result-hero {
    grid-template-columns: 1fr;
  }

  .result-score {
    justify-items: start;
  }

  .certificate-workspace {
    height: calc(100vh - 4.25rem);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .certificate-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .certificate-toolbar > .button {
    display: none;
  }

  .certificate-toolbar > div {
    justify-items: end;
  }

  .certificate-mobile-help {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-4);
    color: var(--ink-800);
    background: var(--white);
    font-size: 0.82rem;
  }
}

/* F3 visual: sistema de marca Link Advance */
body {
  color: var(--ink-800);
  background:
    radial-gradient(circle at 8% 3%, rgba(23, 104, 191, 0.12), transparent 28rem),
    radial-gradient(circle at 96% 16%, rgba(9, 81, 162, 0.08), transparent 24rem),
    var(--page);
}

h1,
h2,
h3,
.brand-copy strong,
.welcome-stat strong,
.result-score strong,
.metric-card strong {
  font-family: var(--font-display);
}

.brand-mark {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  box-shadow: 0 10px 24px rgba(9, 81, 162, 0.25);
  font-family: var(--font-display);
}

.brand-mark::after {
  right: -0.7rem;
  bottom: -0.9rem;
  width: 2.8rem;
  height: 2.8rem;
  border: 0.65rem solid rgba(255, 255, 255, 0.14);
  background: transparent;
}

.brand-copy strong {
  color: var(--ink-950);
  font-size: 0.98rem;
  font-weight: 800;
}

.brand-copy span {
  color: var(--blue-600);
}

.button {
  min-height: 2.85rem;
  border-radius: var(--radius-pill);
  padding-inline: 1.2rem;
  font-weight: 750;
  transition: transform 180ms ease-out, background-color 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out;
}

.button-primary {
  background: var(--blue-500);
  box-shadow: var(--shadow-brand);
}

.button-primary:hover {
  background: var(--blue-600);
}

.button-secondary {
  border: 1px solid var(--blue-100);
  color: var(--blue-700);
  background: var(--blue-50);
}

.button-secondary:hover,
.button-ghost:hover {
  color: var(--blue-700);
  background: var(--blue-50);
}

.button:disabled {
  box-shadow: none;
}

.input,
.select {
  border-color: var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.input:focus,
.select:focus {
  border-color: var(--blue-400);
}

.app-header {
  border-color: rgba(9, 81, 162, 0.11);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 0 rgba(12, 23, 38, 0.03);
  backdrop-filter: blur(18px) saturate(1.25);
}

.header-inner {
  min-height: 4.6rem;
}

.avatar {
  color: var(--blue-700);
  background: var(--blue-50);
  box-shadow: inset 0 0 0 1px var(--blue-100);
  font-family: var(--font-display);
}

.page {
  padding-top: clamp(1.25rem, 4vw, 3rem);
}

.login-intro {
  background:
    linear-gradient(145deg, rgba(12, 23, 38, 0.12), transparent 55%),
    var(--gradient-brand);
}

.login-intro::before {
  border-color: rgba(255, 255, 255, 0.06);
}

.login-intro::after {
  background: rgba(255, 255, 255, 0.13);
}

.login-intro .brand-mark {
  color: var(--blue-600);
  background: var(--white);
}

.login-message h1 {
  font-family: var(--font-display);
  font-weight: 800;
}

.login-message p:last-child,
.login-proof {
  color: rgba(255, 255, 255, 0.8);
}

.eyebrow,
.login-message .eyebrow {
  color: var(--blue-100);
  font-weight: 800;
}

.proof-dot {
  background: #7ae4ae;
}

.login-panel {
  background: var(--page);
}

.login-card {
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-xl);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.welcome {
  border-radius: var(--radius-xl);
  background: var(--gradient-brand);
  box-shadow: 0 24px 60px rgba(7, 68, 134, 0.2);
}

.welcome::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(12, 23, 38, 0.12), transparent 62%);
  pointer-events: none;
}

.welcome::after {
  right: -3rem;
  bottom: -7.5rem;
  width: 21rem;
  height: 21rem;
  border: 3.8rem solid rgba(255, 255, 255, 0.1);
}

.welcome-dashboard {
  grid-template-columns: minmax(0, 1fr) minmax(21rem, 0.58fr);
  align-items: center;
}

.welcome h1 {
  font-family: var(--font-display);
  font-weight: 800;
}

.welcome-copy > p:last-child,
.welcome-stat span {
  color: rgba(255, 255, 255, 0.8);
}

.welcome-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(8px);
}

.welcome-stat {
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 1.15rem 0.75rem;
  background: transparent;
}

.welcome-stat + .welcome-stat {
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-stat strong {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  letter-spacing: -0.04em;
}

.welcome-stat span {
  font-size: 0.72rem;
}

.section-heading h2 {
  color: var(--ink-950);
  font-family: var(--font-display);
  font-weight: 800;
}

.section-heading p,
.course-summary,
.module-description,
.course-section-head p {
  color: var(--ink-500);
}

.course-list-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.course-discovery-controls {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(13rem, 0.42fr);
  gap: 0.75rem;
  margin: -0.25rem 0 1.35rem;
}

.course-search-control,
.course-category-control {
  position: relative;
  min-width: 0;
}

.course-search-control input,
.course-category-control select {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  color: var(--ink-900);
  background-color: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.course-search-control input {
  padding: 0.7rem 1rem 0.7rem 2.85rem;
}

.course-search-control input::placeholder {
  color: var(--ink-500);
}

.course-category-control select {
  padding: 0.7rem 2.5rem 0.7rem 0.95rem;
}

.course-search-control input:hover,
.course-category-control select:hover {
  border-color: var(--blue-300);
  background-color: var(--surface-muted);
}

.course-search-control input:focus-visible,
.course-category-control select:focus-visible {
  border-color: var(--blue-500);
}

.course-search-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 1rem;
  width: 0.85rem;
  height: 0.85rem;
  transform: translateY(-60%);
  border: 2px solid var(--ink-500);
  border-radius: 50%;
  pointer-events: none;
}

.course-search-icon::after {
  content: "";
  position: absolute;
  right: -0.35rem;
  bottom: -0.25rem;
  width: 0.45rem;
  height: 2px;
  transform: rotate(45deg);
  border-radius: var(--radius-pill);
  background: var(--ink-500);
}

.course-filters {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-pill);
  padding: 0.25rem;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.course-filters button {
  min-height: 2.2rem;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.75rem;
  color: var(--ink-500);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 700;
}

.course-filters button[aria-pressed="true"] {
  color: var(--blue-700);
  background: var(--blue-50);
  box-shadow: inset 0 0 0 1px var(--blue-100);
}

.course-card-top {
  flex-wrap: wrap;
}

.course-category-label {
  max-width: 58%;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 0.7rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-filter-empty {
  margin-top: 0.25rem;
}

.course-grid {
  gap: 1.35rem;
}

.skeleton-card {
  height: 31.5rem;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-xl);
}

.course-card {
  min-height: 31.5rem;
  border-color: var(--ink-200);
  border-radius: var(--radius-xl);
  padding: 0;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  animation: card-rise 420ms ease-out both;
}

.course-card:nth-child(2) { animation-delay: 45ms; }
.course-card:nth-child(3) { animation-delay: 90ms; }
.course-card:nth-child(4) { animation-delay: 135ms; }
.course-card:nth-child(5) { animation-delay: 180ms; }
.course-card:nth-child(6) { animation-delay: 225ms; }

.course-card:hover {
  border-color: var(--blue-200);
  box-shadow: 0 20px 45px rgba(24, 48, 77, 0.14);
}

.course-cover {
  position: relative;
  height: 11.5rem;
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--gradient-brand);
}

.course-cover img,
.course-hero-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease-out;
}

.course-card:hover .course-cover img {
  transform: scale(1.035);
}

.course-cover-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.3rem;
  padding: 1.25rem;
  color: var(--white);
  background:
    radial-gradient(circle at 80% 12%, rgba(255, 255, 255, 0.2), transparent 30%),
    var(--gradient-brand);
}

.course-cover-fallback::after {
  content: "";
  position: absolute;
  top: -2.8rem;
  right: -2rem;
  width: 9rem;
  height: 9rem;
  border: 1.7rem solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.course-cover-fallback span {
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.course-cover-fallback strong {
  max-width: 22ch;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-cover-shade {
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(12, 23, 38, 0.45));
  pointer-events: none;
}

.course-status {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 1;
  min-height: 1.75rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.65rem;
  color: var(--white);
  background: rgba(12, 23, 38, 0.56);
  backdrop-filter: blur(8px);
  font-size: 0.68rem;
  font-weight: 750;
}

.course-status.completion-badge {
  color: #dff9ea;
  background: rgba(15, 134, 73, 0.78);
}

.course-card-body {
  min-height: 20rem;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.25rem;
}

.course-code,
.module-type {
  min-height: 1.65rem;
  color: var(--blue-700);
  background: var(--blue-50);
  font-weight: 750;
}

.course-card h3 {
  margin: 1rem 0 0.55rem;
  color: var(--ink-950);
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 750;
  line-height: 1.35;
}

.course-summary {
  -webkit-line-clamp: 2;
  font-size: 0.86rem;
}

.course-card .course-progress {
  padding-top: 1rem;
}

.progress-track {
  height: 0.5rem;
  background: var(--surface-sunken);
}

.progress-bar {
  background: var(--gradient-brand);
  transition: width 500ms ease-out;
}

.course-open {
  margin-top: 1rem;
}

.detail-topbar {
  margin-bottom: 1rem;
}

.back-button {
  min-height: 2.75rem;
  border-radius: var(--radius-pill);
  color: var(--blue-700);
}

.back-button:hover {
  background: var(--blue-50);
}

.course-hero-rich {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 0.75fr);
  gap: 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  background: var(--gradient-brand);
  box-shadow: 0 24px 60px rgba(7, 68, 134, 0.2);
}

.course-hero-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(0.5rem, 3vw, 1.5rem);
}

.course-hero h1 {
  max-width: 24ch;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 800;
}

.course-hero .course-code {
  width: fit-content;
  color: var(--white);
  background: rgba(255, 255, 255, 0.16);
}

.course-hero-summary {
  display: -webkit-box;
  max-width: 60ch;
  overflow: hidden;
  margin: 0.8rem 0 0;
  color: rgba(255, 255, 255, 0.8);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.course-hero .course-progress {
  width: min(100%, 35rem);
  margin-top: 1.5rem;
  padding-top: 0;
}

.course-hero .progress-label {
  color: rgba(255, 255, 255, 0.88);
}

.course-hero .progress-track {
  background: rgba(255, 255, 255, 0.22);
}

.course-hero .progress-bar {
  background: var(--white);
}

.course-hero-visual {
  position: relative;
  min-height: 17rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.course-section,
.activity-panel,
.metric-card,
.native-question,
.review-information {
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
}

.module-symbol {
  color: var(--blue-700);
  background: var(--blue-50);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

.module-type.completion-badge,
.completion-badge {
  color: var(--success-700);
  background: var(--success-100);
}

.file-link {
  border-color: var(--ink-200);
  border-radius: var(--radius-md);
}

.file-link:hover {
  border-color: var(--blue-200);
}

.file-action {
  color: var(--blue-600);
}

.activity-hero,
.native-quiz-toolbar,
.native-result-hero,
.certificate-toolbar {
  background: var(--gradient-brand);
}

.activity-hero,
.native-result-hero {
  border-radius: var(--radius-xl);
}

.native-result-hero.is-passed {
  background: linear-gradient(135deg, #123b37, var(--success-700));
}

.native-result-hero.is-failed {
  background: linear-gradient(135deg, #421b26, var(--danger-700));
}

.native-result-hero.is-finished {
  background: var(--gradient-brand);
}

.native-quiz-actions {
  border-color: var(--ink-200);
  border-radius: var(--radius-xl);
}

.certificate-shell {
  background: var(--blue-900);
}

.certificate-frame-wrap {
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
  .welcome-dashboard {
    grid-template-columns: 1fr;
  }

  .welcome-metrics {
    width: min(100%, 34rem);
  }

  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .course-hero-rich {
    grid-template-columns: minmax(0, 1.1fr) minmax(15rem, 0.9fr);
  }
}

@media (max-width: 700px) {
  body {
    background: var(--page);
  }

  .app-header {
    position: sticky;
  }

  .header-inner {
    width: 100%;
    min-height: 4.25rem;
    padding: 0.55rem 0.75rem;
  }

  .brand-mark {
    width: 2.65rem;
    height: 2.65rem;
  }

  .brand-lockup {
    min-width: 0;
    flex: 1 1 auto;
    gap: 0.6rem;
  }

  .brand-copy {
    min-width: 0;
  }

  .brand-copy strong {
    font-size: 0.88rem;
  }

  .brand-name-default,
  .brand-subtitle-default,
  .tenant-chip {
    display: none;
  }

  .brand-company-mobile,
  .brand-site-mobile {
    display: block;
    max-width: clamp(6.3rem, 30vw, 9rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-company-mobile {
    color: var(--ink-900);
    font-size: 0.78rem !important;
  }

  .brand-site-mobile {
    margin-top: 0.16rem !important;
    color: var(--ink-500) !important;
    font-size: 0.66rem !important;
    font-weight: 650 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
  }

  .brand-copy strong.brand-site-mobile {
    display: block;
    color: var(--ink-500) !important;
    font-size: 0.66rem !important;
    font-weight: 650 !important;
    letter-spacing: 0 !important;
  }

  .header-actions {
    flex: 0 0 auto;
    gap: 0.45rem;
  }

  .notification-bell {
    width: 2.4rem;
    height: 2.4rem;
  }

  .notification-bell-glyph {
    transform: scale(0.94);
  }

  .avatar {
    width: 2.4rem;
    height: 2.4rem;
  }

  .page,
  .header-inner {
    width: 100%;
  }

  .page {
    padding: 0.8rem 0.65rem calc(4rem + env(safe-area-inset-bottom));
  }

  .login-intro {
    min-height: 20rem;
    padding: 1.25rem;
    border-radius: 0 0 1.75rem 1.75rem;
  }

  .login-message {
    padding: 2.25rem 0 1.25rem;
  }

  .login-message h1 {
    max-width: 12ch;
    font-size: clamp(2.15rem, 12vw, 3rem);
  }

  .login-message p:last-child {
    margin-top: 1rem;
    font-size: 0.92rem;
  }

  .login-panel {
    padding: 0.8rem 0.65rem 2.5rem;
  }

  .login-card {
    border-radius: 1.25rem;
    padding: 1.25rem;
  }

  .welcome {
    gap: 1.2rem;
    border-radius: 1.25rem;
    padding: 1.35rem 1.1rem;
  }

  .welcome h1 {
    font-size: clamp(1.85rem, 10vw, 2.55rem);
  }

  .welcome-copy > p:last-child {
    margin-top: 0.65rem;
    font-size: 0.88rem;
  }

  .welcome .eyebrow {
    margin-bottom: 0.65rem;
    font-size: 0.66rem;
  }

  .welcome-metrics {
    width: 100%;
    border-radius: var(--radius-md);
  }

  .welcome-stat {
    padding: 0.85rem 0.35rem;
    display: grid;
    place-items: center;
    text-align: center;
  }

  .welcome-stat-content {
    place-items: center;
  }

  .welcome-stat strong {
    width: 100%;
    font-size: 1.35rem;
    text-align: center;
  }

  .welcome-stat span {
    width: 100%;
    font-size: 0.62rem;
    text-align: center;
  }

  .section-heading {
    align-items: center;
    margin: 1.6rem 0 0.8rem;
    padding-inline: 0.15rem;
  }

  .section-heading h2 {
    font-size: 1.35rem;
  }

  .section-heading p {
    font-size: 0.8rem;
  }

  .section-heading .button {
    min-width: 5.25rem;
    min-height: 2.6rem;
    padding-inline: 0.75rem;
  }

  .course-list-heading {
    display: grid;
    gap: 0.75rem;
  }

  .course-list-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    align-items: center;
    gap: 0.4rem;
  }

  .course-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    gap: 0.12rem;
    padding: 0.28rem;
    justify-content: normal;
  }

  .course-filters button {
    min-height: 2.75rem;
    min-width: 0;
    overflow: hidden;
    padding-inline: 0.22rem;
    font-size: clamp(0.59rem, 2.5vw, 0.68rem);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .course-list-controls > .button {
    min-width: auto;
    min-height: 2.75rem;
    align-self: center;
    padding-inline: 0.5rem;
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .course-discovery-controls {
    grid-template-columns: 1fr;
    gap: 0.55rem;
    margin: 0 0 0.85rem;
  }

  .course-search-control input,
  .course-category-control select {
    min-height: 3.1rem;
    font-size: 0.88rem;
  }

  .course-category-label {
    max-width: 62%;
    font-size: 0.66rem;
  }

  .course-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .course-card {
    min-height: 0;
    border-radius: 1.25rem;
  }

  .skeleton-card {
    height: 28rem;
    border-radius: 1.25rem;
  }

  .course-cover {
    height: 10rem;
  }

  .course-card-body {
    min-height: 18rem;
    padding: 1rem;
  }

  .course-card h3 {
    margin-top: 0.8rem;
    font-size: 1rem;
  }

  .course-summary {
    font-size: 0.82rem;
  }

  .course-open {
    min-height: 3rem;
  }

  .detail-topbar {
    margin-bottom: 0.65rem;
  }

  .detail-topbar .button-small {
    min-height: 2.65rem;
  }

  .course-hero-rich {
    grid-template-columns: 1fr;
    gap: 0;
    border-radius: 1.25rem;
    padding: 0;
  }

  .course-hero-visual {
    min-height: 11rem;
    order: -1;
    border: 0;
    border-radius: 0;
  }

  .course-hero-copy {
    padding: 1.25rem;
  }

  .course-hero h1 {
    margin-top: 0.75rem;
    font-size: clamp(1.55rem, 7.5vw, 2.2rem);
  }

  .course-hero-summary {
    font-size: 0.84rem;
  }

  .course-hero .course-progress {
    margin-top: 1rem;
  }

  .content-list {
    gap: 0.8rem;
  }

  .course-section {
    border-radius: 1.25rem;
  }

  .course-section-head,
  .module-item {
    padding: 1rem;
  }

  .module-item {
    gap: 0.75rem;
  }

  .module-heading {
    gap: 0.55rem;
  }

  .module-heading h3 {
    font-size: 0.92rem;
  }

  .file-link {
    min-height: 3.5rem;
  }

  .module-action {
    width: 100%;
    margin-top: 0.8rem;
  }

  .activity-hero,
  .native-result-hero,
  .activity-panel,
  .native-question,
  .metric-card,
  .native-quiz-actions {
    border-radius: 1.25rem;
  }

  .activity-hero .activity-kicker {
    color: rgba(255, 255, 255, 0.78);
  }

  .activity-status.is-complete,
  .activity-status.is-passed,
  .activity-status.is-failed {
    min-height: 3rem;
    justify-content: flex-start;
    border-width: 1px;
    padding-inline: 1rem;
    font-size: 0.8rem;
  }

  .quiz-summary {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .native-question {
    padding: 1rem;
  }

  .native-quiz-actions {
    bottom: max(0.5rem, env(safe-area-inset-bottom));
    padding: 0.7rem;
  }

  .native-quiz-actions .button {
    min-height: 3rem;
    padding-inline: 0.75rem;
  }

  .certificate-mobile-help {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

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

  .course-cover img,
  .progress-bar {
    transition: none;
  }
}

/* Material translúcido para controles: una capa sutil, legible y consistente. */
.button,
.back-button,
.icon-button,
.notification-bell,
.avatar {
  border: 1px solid rgba(255, 255, 255, 0.68);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(234, 242, 252, 0.62));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(9, 81, 162, 0.08),
    0 8px 22px rgba(12, 23, 38, 0.1);
  backdrop-filter: blur(16px) saturate(1.35);
  -webkit-backdrop-filter: blur(16px) saturate(1.35);
}

.button-primary {
  border-color: rgba(255, 255, 255, 0.32);
  color: var(--white);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.26), transparent 44%),
    linear-gradient(135deg, var(--blue-500), var(--blue-700));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    inset 0 -1px 0 rgba(10, 45, 88, 0.24),
    0 10px 25px rgba(9, 81, 162, 0.26);
}

.button-secondary,
.button-ghost {
  border-color: rgba(158, 188, 224, 0.52);
  color: var(--blue-700);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(230, 240, 252, 0.68));
}

.button:active,
.back-button:active,
.icon-button:active,
.notification-bell:active,
.avatar:active {
  transform: translateY(1px) scale(0.985);
  box-shadow:
    inset 0 1px 2px rgba(12, 23, 38, 0.12),
    0 4px 12px rgba(12, 23, 38, 0.1);
}

.button:focus-visible,
.back-button:focus-visible,
.icon-button:focus-visible,
.notification-bell:focus-visible,
.avatar:focus-visible,
.pdf-fullscreen-exit:focus-visible {
  outline: 3px solid rgba(139, 198, 255, 0.92);
  outline-offset: 3px;
}

.pdf-toolbar .back-button,
.pdf-toolbar .pdf-fullscreen-open {
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--white);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.27),
    0 7px 18px rgba(18, 55, 101, 0.18);
}

.pdf-toolbar .pdf-download {
  border-color: rgba(255, 255, 255, 0.88);
  color: #153b69;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(220, 236, 255, 0.88));
  box-shadow:
    inset 0 1px 0 var(--white),
    inset 0 -1px 0 rgba(9, 81, 162, 0.16),
    0 10px 24px rgba(9, 35, 71, 0.22);
}

@media (hover: hover) {
  .button-primary:hover {
    border-color: rgba(255, 255, 255, 0.48);
    color: var(--white);
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.3), transparent 44%),
      linear-gradient(135deg, var(--blue-400), var(--blue-700));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.42),
      0 13px 30px rgba(9, 81, 162, 0.32);
  }

  .button-secondary:hover,
  .button-ghost:hover,
  .back-button:hover,
  .icon-button:hover {
    border-color: rgba(142, 180, 224, 0.76);
    color: var(--blue-800);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(220, 236, 255, 0.86));
    box-shadow:
      inset 0 1px 0 var(--white),
      0 11px 26px rgba(8, 56, 109, 0.15);
  }

  .pdf-toolbar .back-button:hover,
  .pdf-toolbar .pdf-fullscreen-open:hover {
    border-color: rgba(255, 255, 255, 0.48);
    color: var(--white);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.14));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.38),
      0 11px 25px rgba(9, 35, 71, 0.24);
  }

  .pdf-toolbar .pdf-download:hover {
    border-color: var(--white);
    color: #0d315d;
    background: var(--white);
    box-shadow:
      inset 0 1px 0 var(--white),
      0 13px 28px rgba(9, 35, 71, 0.3);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .button,
  .back-button,
  .icon-button,
  .notification-bell,
  .avatar,
  .pdf-fullscreen-exit {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .pdf-toolbar .back-button,
  .pdf-toolbar .pdf-fullscreen-open,
  .pdf-fullscreen-exit {
    background: #074486;
  }

  .pdf-toolbar .pdf-download {
    background: var(--white);
  }
}

@media (prefers-contrast: more) {
  .button,
  .back-button,
  .icon-button,
  .pdf-fullscreen-exit {
    border-width: 2px;
  }
}

/* Continuidad de aprendizaje y documentos disponibles sin conexión. */
.continue-learning {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
  margin: 1.25rem 0 0;
  border: 1px solid rgba(126, 170, 220, 0.42);
  border-radius: var(--radius-xl);
  padding: 1rem 1.1rem;
  background:
    radial-gradient(circle at 92% 10%, rgba(23, 104, 191, 0.2), transparent 12rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(226, 239, 253, 0.88));
  box-shadow: var(--shadow-sm);
}

.continue-learning-icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 1rem;
  color: var(--white);
  background: var(--gradient-brand);
  box-shadow: var(--shadow-brand);
}

.continue-learning-icon span {
  width: 0;
  height: 0;
  margin-left: 0.18rem;
  border-top: 0.42rem solid transparent;
  border-bottom: 0.42rem solid transparent;
  border-left: 0.66rem solid currentColor;
}

.continue-learning-copy {
  min-width: 0;
}

.continue-learning-copy > span {
  color: var(--blue-600);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.continue-learning h2,
.continue-learning p {
  margin: 0;
}

.continue-learning h2 {
  margin-top: 0.16rem;
  overflow: hidden;
  color: var(--ink-900);
  font-size: clamp(1rem, 2.6vw, 1.25rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continue-learning p {
  margin-top: 0.2rem;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: stretch;
  gap: 0.5rem;
}

.file-row .file-link {
  width: 100%;
}

.offline-file-button {
  min-width: 8.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  color: var(--blue-700);
  background: rgba(238, 244, 250, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.offline-file-button svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.offline-file-button .offline-icon-saved {
  display: none;
}

.offline-file-button.is-saved {
  border-color: #9bd8b5;
  color: #0b6638;
  background: #e8f8ef;
}

.offline-file-button.is-saved .offline-icon-download {
  display: none;
}

.offline-file-button.is-saved .offline-icon-saved {
  display: block;
}

.offline-file-button.is-outdated {
  border-color: #f1d58e;
  color: #8a5b08;
  background: #fff8e9;
}

.offline-file-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.file-row.is-offline-saved .file-link {
  border-color: rgba(15, 134, 73, 0.28);
}

.file-meta [data-offline-status] {
  color: var(--success-700);
  font-weight: 750;
}

.module-item.is-next-activity {
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(238, 244, 250, 0.9), rgba(255, 255, 255, 0.98));
  box-shadow: inset 4px 0 0 var(--blue-500), var(--shadow-sm);
}

.pdf-offline-badge {
  border-radius: var(--radius-pill);
  padding: 0.16rem 0.42rem;
  color: #dff9ea;
  background: rgba(15, 134, 73, 0.34);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Preferencias de accesibilidad y apariencia. */
.accessibility-settings {
  display: grid;
  gap: 0.55rem;
}

.accessibility-select,
.accessibility-toggle,
.offline-profile-summary {
  min-height: 3.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border: 1px solid var(--ink-100);
  border-radius: 0.9rem;
  padding: 0.7rem 0.8rem;
  background: var(--page);
}

.accessibility-select > span,
.accessibility-toggle strong {
  color: var(--ink-800);
  font-size: 0.78rem;
  font-weight: 800;
}

.accessibility-select select {
  width: min(58%, 16rem);
  min-height: 2.35rem;
  border: 1px solid var(--ink-200);
  border-radius: 0.7rem;
  padding: 0.35rem 0.55rem;
  color: var(--ink-800);
  background: var(--surface);
  font: inherit;
  font-size: 0.72rem;
}

.accessibility-toggle {
  position: relative;
  cursor: pointer;
}

.accessibility-toggle > span,
.accessibility-toggle strong,
.accessibility-toggle small {
  display: block;
}

.accessibility-toggle small {
  margin-top: 0.12rem;
  color: var(--ink-500);
  font-size: 0.66rem;
}

.accessibility-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.accessibility-toggle i {
  position: relative;
  width: 2.65rem;
  height: 1.5rem;
  flex: 0 0 auto;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-pill);
  background: var(--ink-200);
  transition: background-color 160ms ease, border-color 160ms ease;
}

.accessibility-toggle i::after {
  content: "";
  position: absolute;
  top: 0.17rem;
  left: 0.18rem;
  width: 1.02rem;
  height: 1.02rem;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-xs);
  transition: transform 160ms ease;
}

.accessibility-toggle input:checked + i {
  border-color: var(--blue-500);
  background: var(--blue-500);
}

.accessibility-toggle input:checked + i::after {
  transform: translateX(1.12rem);
}

.accessibility-toggle input:focus-visible + i {
  outline: 3px solid rgba(23, 104, 191, 0.3);
  outline-offset: 2px;
}

.offline-profile-summary > div {
  display: grid;
}

.offline-profile-summary strong {
  color: var(--ink-900);
  font-size: 1.2rem;
}

.offline-profile-summary span {
  color: var(--ink-500);
  font-size: 0.7rem;
}

html[data-text-size="large"] {
  font-size: 112.5%;
}

html[data-text-size="xlarge"] {
  font-size: 125%;
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --blue-50: #172a42;
  --blue-100: #274667;
  --blue-200: #3c638d;
  --blue-400: #73a9de;
  --blue-500: #5a95d2;
  --blue-600: #79afe2;
  --blue-700: #a4cdf3;
  --blue-800: #c2ddf7;
  --ink-900: #f0f4fa;
  --ink-800: #dce5f1;
  --ink-700: #c9d5e4;
  --ink-600: #b1bfd1;
  --ink-500: #94a5ba;
  --ink-300: #506077;
  --ink-200: #34445a;
  --ink-100: #27364a;
  --ink-50: #1b293b;
  --page: #0c1420;
  --surface: #142133;
  --surface-muted: #18273a;
  --surface-sunken: #0f1b2a;
  --success-100: #123b2b;
  --success-700: #70d9a1;
  --danger-100: #421f27;
  --danger-700: #ff928d;
  --warning-100: #402f16;
  --warning-700: #f1c46d;
  --gradient-brand: linear-gradient(135deg, #074486 0%, #0951a2 55%, #1768bf 100%);
  --shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.22);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 22px 58px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .app-header,
html[data-theme="dark"] .login-layout,
html[data-theme="dark"] .notification-drawer,
html[data-theme="dark"] .profile-panel {
  background: rgba(20, 33, 51, 0.96);
}

html[data-theme="dark"] .brand-mark,
html[data-theme="dark"] .login-intro,
html[data-theme="dark"] .welcome,
html[data-theme="dark"] .course-hero,
html[data-theme="dark"] .activity-hero,
html[data-theme="dark"] .native-result-hero {
  color: var(--white);
  background-color: #122036;
}

/* Contraste nocturno WCAG AA: títulos, etiquetas sobre azul y texto auxiliar. */
html[data-theme="dark"] .brand-copy strong,
html[data-theme="dark"] .section-heading h2,
html[data-theme="dark"] .course-card h3 {
  color: #f8fbff;
}

html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .activity-kicker,
html[data-theme="dark"] .native-result-hero > div:first-child > span {
  color: #dbeaff;
}

html[data-theme="dark"] .activity-hero p,
html[data-theme="dark"] .native-result-hero p {
  color: rgba(240, 247, 255, 0.86);
}

html[data-theme="dark"] .embed-toolbar > div span,
html[data-theme="dark"] .certificate-toolbar > div span,
html[data-theme="dark"] .native-quiz-title span,
html[data-theme="dark"] .quiz-clock span {
  color: #b9cce2;
}

html[data-theme="dark"] :is(
  .course-search-control input,
  .course-category-control select,
  .course-filters,
  .accessibility-select select,
  .accessibility-toggle,
  .offline-profile-summary,
  .file-link,
  .offline-file-button
) {
  border-color: #586f8c;
}

html[data-theme="dark"] .input,
html[data-theme="dark"] .select {
  border-color: #586f8c;
  color: var(--ink-900);
  background: var(--surface-sunken);
}

html[data-theme="dark"] .input::placeholder {
  color: var(--ink-500);
}

html[data-theme="dark"] .notification-item {
  color: var(--ink-800);
  background: var(--surface);
}

html[data-theme="dark"] .notification-item:hover,
html[data-theme="dark"] .notification-item.is-unread,
html[data-theme="dark"] .file-link:hover {
  background: #1d3048;
}

html[data-theme="dark"] .certificate-mobile-help {
  color: var(--ink-800);
  background: var(--surface);
}

html[data-theme="dark"] .pdf-page figcaption {
  color: #344864;
  background: rgba(255, 255, 255, 0.94);
}

html[data-theme="dark"] .continue-learning {
  border-color: var(--ink-200);
  background: linear-gradient(135deg, #17273b, #1d3048);
}

html[data-theme="dark"] .button,
html[data-theme="dark"] .back-button,
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .notification-bell,
html[data-theme="dark"] .avatar {
  border-color: #586f8c;
  color: var(--ink-800);
  background: linear-gradient(145deg, rgba(50, 70, 96, 0.88), rgba(25, 40, 60, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 22px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .button-primary {
  color: var(--white);
  background: var(--gradient-brand);
}

html[data-theme="dark"] .pdf-toolbar .back-button,
html[data-theme="dark"] .pdf-toolbar .pdf-fullscreen-open {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .pdf-toolbar .pdf-download {
  color: #dbeaff;
  background: rgba(17, 43, 72, 0.84);
}

html[data-theme="dark"] .native-quiz-actions {
  border-color: var(--ink-200);
  background: rgba(20, 33, 51, 0.96);
}

html[data-theme="dark"] .native-result-hero.is-passed {
  background: linear-gradient(135deg, #123b37, #155c4b);
}

html[data-theme="dark"] .native-result-hero.is-failed {
  background: linear-gradient(135deg, #421b26, #9f263a);
}

html[data-theme="dark"] .moodle-question-content input,
html[data-theme="dark"] .moodle-question-content textarea,
html[data-theme="dark"] .moodle-question-content select {
  color: var(--ink-800);
  background: var(--surface-sunken);
}

html[data-theme="dark"] .offline-file-button {
  border-color: var(--ink-200);
  color: var(--blue-700);
  background: var(--surface-sunken);
  box-shadow: none;
}

html[data-theme="dark"] .offline-file-button.is-saved {
  color: #8fe0b5;
  background: #123b2b;
}

html[data-theme="dark"] .module-item.is-next-activity {
  background: linear-gradient(135deg, #172a42, #142133);
}

@media (hover: hover) {
  html[data-theme="dark"] .button-secondary:hover,
  html[data-theme="dark"] .button-ghost:hover,
  html[data-theme="dark"] .back-button:hover,
  html[data-theme="dark"] .icon-button:hover,
  html[data-theme="dark"] .notification-bell:hover {
    border-color: #7f9bbb;
    color: #f8fbff;
    background: linear-gradient(145deg, #354b68, #243852);
  }

  html[data-theme="dark"] .pdf-toolbar .back-button:hover,
  html[data-theme="dark"] .pdf-toolbar .pdf-fullscreen-open:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.2);
  }

  html[data-theme="dark"] .pdf-toolbar .pdf-download:hover {
    border-color: #a9c8eb;
    color: #f8fbff;
    background: #08386d;
  }
}

html.a11y-high-contrast {
  --ink-500: #4a5870;
  --ink-200: #9eabc0;
  --shadow-focus: 0 0 0 4px rgba(9, 81, 162, 0.48);
}

html[data-theme="dark"].a11y-high-contrast {
  --ink-500: #c5d2e2;
  --ink-200: #93a7c1;
}

html.a11y-high-contrast :is(.course-card, .course-section, .module-item, .metric-card, .native-question, .profile-detail, .accessibility-select, .accessibility-toggle) {
  border-width: 2px;
}

html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

html.a11y-reduce-transparency .profile-backdrop,
html.a11y-reduce-transparency .notification-layer,
html.a11y-reduce-transparency :is(.button, .back-button, .icon-button, .notification-bell, .avatar, .native-quiz-actions) {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html.a11y-reduce-transparency :is(.button, .back-button, .icon-button, .notification-bell, .avatar) {
  background-image: none;
  background-color: var(--surface-sunken);
}

@media (max-width: 700px) {
  .continue-learning {
    grid-template-columns: auto minmax(0, 1fr);
    border-radius: 1.25rem;
    padding: 0.9rem;
  }

  .continue-learning .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .file-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .file-download-link {
    width: 2.75rem;
    min-width: 2.75rem;
    padding: 0;
  }

  .file-download-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .offline-file-button {
    width: 3.25rem;
    min-width: 3.25rem;
    padding: 0;
  }

  .offline-file-button [data-offline-label] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .accessibility-select {
    align-items: stretch;
    flex-direction: column;
    gap: 0.4rem;
  }

  .accessibility-select select {
    width: 100%;
  }

  .offline-profile-summary {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Branding v4 final · Link Advance Academia */
.brand-mark {
  position: relative;
  display: block;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: clamp(0.7rem, 24%, 1rem);
  padding: 0;
  color: var(--white);
  background: var(--gradient-brand-radial);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 10px 25px rgba(9, 81, 162, 0.28);
}

.brand-mark::after {
  display: none;
}

.brand-mark > img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand-mark-loading {
  width: clamp(4.75rem, 14vw, 6rem);
  height: clamp(4.75rem, 14vw, 6rem);
  border-radius: 1.35rem;
  box-shadow: var(--shadow-brand);
}

.boot-screen {
  padding: max(1.5rem, env(safe-area-inset-top)) 1.5rem max(1.5rem, env(safe-area-inset-bottom));
  text-align: center;
}

.boot-screen p {
  margin: 0;
  color: var(--ink-600);
  font-weight: 700;
}

.login-intro {
  isolation: isolate;
  background:
    radial-gradient(circle at 78% 20%, rgba(67, 149, 222, 0.72), transparent 30rem),
    linear-gradient(145deg, rgba(6, 24, 46, 0.12), transparent 56%),
    var(--gradient-brand);
}

.login-intro .brand-mark {
  width: 4rem;
  height: 4rem;
  border-color: rgba(255, 255, 255, 0.48);
  background: var(--gradient-brand-radial);
  box-shadow: 0 14px 34px rgba(4, 33, 72, 0.34);
}

.login-intro .brand-copy strong,
.login-intro .brand-copy span {
  color: var(--white);
}

.login-intro .brand-copy span {
  letter-spacing: 0.15em;
}

.login-brand-artwork {
  position: absolute;
  z-index: 0;
  right: clamp(-8rem, -5vw, -3rem);
  bottom: clamp(-7rem, -8vh, -3rem);
  width: min(35vw, 31rem);
  height: auto;
  border-radius: 24%;
  opacity: 0.14;
  filter: saturate(0.92) contrast(1.04);
  pointer-events: none;
  user-select: none;
}

.login-message,
.login-proof,
.login-brand {
  position: relative;
  z-index: 1;
}

.app-header .brand-mark {
  background: var(--gradient-brand-radial);
}

.brand-copy span,
.brand-subtitle-default {
  color: var(--blue-600);
}

.course-cover-fallback {
  background:
    radial-gradient(circle at 78% 18%, rgba(67, 149, 222, 0.78), transparent 55%),
    var(--gradient-brand);
}

@media (min-width: 961px) and (pointer: fine) {
  .login-layout {
    min-height: 100dvh;
  }

  .login-intro {
    min-height: 100dvh;
  }

  .app-header .brand-mark {
    width: 3.2rem;
    height: 3.2rem;
  }
}

@media (max-width: 960px) {
  .login-brand-artwork {
    right: -3.5rem;
    bottom: -5.5rem;
    width: min(48vw, 22rem);
    opacity: 0.1;
  }
}

@media (max-width: 700px) {
  .login-intro {
    padding-top: max(1.5rem, env(safe-area-inset-top));
  }

  .login-intro .brand-mark {
    width: 3.35rem;
    height: 3.35rem;
  }

  .login-brand .brand-copy span {
    display: block;
    margin-top: 0.12rem;
    color: var(--white);
    font-size: 0.65rem;
    letter-spacing: 0.14em;
  }

  .login-brand-artwork {
    display: none;
  }

  .login-panel,
  .page {
    padding-bottom: max(4rem, calc(2.5rem + env(safe-area-inset-bottom)));
  }
}

@media (pointer: coarse) {
  .button,
  .back-button,
  .icon-button,
  .notification-bell,
  .avatar {
    min-height: 3rem;
  }
}

@media (display-mode: standalone) {
  .app-header {
    padding-top: env(safe-area-inset-top);
  }

  .page {
    padding-bottom: max(5rem, calc(3rem + env(safe-area-inset-bottom)));
  }
}

html[data-platform="ios"] .input,
html[data-platform="ios"] .select,
html[data-platform="ios"] .course-search-control input,
html[data-platform="ios"] .course-category-control select {
  font-size: max(1rem, 16px);
}

html[data-platform="android"] body {
  overscroll-behavior-y: none;
}

html[data-theme="dark"] .brand-mark,
html[data-theme="dark"] .app-header .brand-mark,
html[data-theme="dark"] .login-intro .brand-mark {
  background: var(--gradient-brand-radial);
}

html[data-theme="dark"] .brand-copy span,
html[data-theme="dark"] .brand-subtitle-default {
  color: var(--blue-700);
}

/* Cursos destacados y catálogo móvil de alta densidad. */
.course-favorite {
  position: absolute;
  z-index: 3;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  padding: 0;
  color: var(--white);
  background: rgba(6, 24, 46, 0.58);
  box-shadow: 0 6px 18px rgba(6, 24, 46, 0.24);
  backdrop-filter: blur(10px) saturate(1.25);
  -webkit-backdrop-filter: blur(10px) saturate(1.25);
}

.course-favorite svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.course-favorite path {
  fill: transparent;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: fill 160ms ease-out, transform 160ms ease-out;
}

.course-favorite.is-favorite {
  border-color: rgba(255, 221, 118, 0.88);
  color: #ffd65e;
  background: rgba(35, 42, 54, 0.78);
}

.course-favorite.is-favorite path {
  fill: currentColor;
  transform: scale(1.04);
}

.course-favorite:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 3px;
}

.course-favorite:disabled {
  cursor: wait;
  opacity: 0.72;
}

.course-card.is-favorite {
  border-color: rgba(9, 81, 162, 0.52);
  box-shadow: 0 16px 38px rgba(9, 81, 162, 0.17);
}

.notification-bell,
.avatar {
  aspect-ratio: 1;
  border-radius: 50%;
}

.avatar,
.avatar-image {
  overflow: hidden;
  border-radius: 50%;
}

@media (max-width: 700px) {
  .course-filters {
    display: flex;
    gap: 0.15rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .course-filters::-webkit-scrollbar {
    display: none;
  }

  .course-filters button {
    min-width: max-content;
    flex: 0 0 auto;
    padding-inline: 0.65rem;
  }

  .course-grid {
    gap: 0.65rem;
  }

  .course-card {
    min-height: 10.5rem;
    display: grid;
    grid-template-columns: 7.25rem minmax(0, 1fr);
    grid-template-rows: minmax(10.5rem, auto);
    align-items: stretch;
    border-radius: 1rem;
    content-visibility: auto;
    contain-intrinsic-size: auto 10.5rem;
  }

  .course-cover {
    width: 100%;
    height: 100%;
    min-height: 10.5rem;
    grid-column: 1;
    grid-row: 1;
  }

  .course-cover-fallback {
    justify-content: flex-end;
    padding: 0.65rem 0.65rem 2.55rem;
  }

  .course-cover-fallback strong {
    display: none;
  }

  .course-cover-fallback span {
    font-size: 0.56rem;
  }

  .course-card-body {
    min-height: 0;
    grid-column: 2;
    grid-row: 1;
    padding: 0.75rem;
  }

  .course-card-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.22rem;
  }

  .course-code {
    width: fit-content;
    max-width: 100%;
    min-height: 1.45rem;
    overflow: hidden;
    padding: 0.18rem 0.48rem;
    font-size: 0.58rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .course-category-label {
    max-width: 100%;
    font-size: 0.58rem;
  }

  .course-card h3 {
    display: -webkit-box;
    overflow: hidden;
    margin: 0.48rem 0 0;
    font-size: 0.88rem;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .course-summary {
    display: none;
  }

  .course-card .course-progress {
    margin-top: auto;
    padding-top: 0.55rem;
  }

  .progress-label {
    margin-bottom: 0.28rem;
    font-size: 0.62rem;
  }

  .course-card .progress-track {
    height: 0.36rem;
  }

  .course-open {
    min-height: 2.75rem;
    margin-top: 0.55rem;
    padding-inline: 0.65rem;
    font-size: 0.72rem;
  }

  .course-status {
    right: auto;
    bottom: 0.5rem;
    left: 0.5rem;
    min-height: 1.45rem;
    padding: 0.18rem 0.45rem;
    font-size: 0.56rem;
  }

  .course-favorite {
    top: 0.5rem;
    right: 0.5rem;
    width: 2.75rem;
    height: 2.75rem;
  }

  .course-favorite svg {
    width: 1.2rem;
    height: 1.2rem;
  }

  .skeleton-card {
    height: 10.5rem;
    border-radius: 1rem;
  }

  .notification-bell,
  .avatar {
    width: 3rem;
    min-width: 3rem;
    height: 3rem;
    min-height: 3rem;
    flex-basis: 3rem;
  }
}

@media (max-width: 370px) {
  .course-card {
    grid-template-columns: 6.35rem minmax(0, 1fr);
  }

  .course-category-label {
    display: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .course-favorite {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--ink-900);
  }
}

/* Permisos y estado de notificaciones del sistema. */
.notification-drawer {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.notification-system-setting {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--ink-100);
  padding: 0.85rem 1.35rem;
  color: var(--ink-600);
  background: var(--surface);
}

.notification-system-icon {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--blue-700);
  background: var(--blue-100);
  font-weight: 900;
}

.notification-system-setting strong,
.notification-system-setting p {
  display: block;
}

.notification-system-setting strong {
  color: var(--ink-900);
  font-size: 0.78rem;
}

.notification-system-setting p {
  margin: 0.16rem 0 0;
  font-size: 0.69rem;
  line-height: 1.4;
}

.notification-system-setting button {
  min-height: 2.35rem;
  border: 1px solid var(--blue-200);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.75rem;
  color: var(--blue-700);
  background: var(--blue-50);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
}

.notification-system-setting[data-state="granted"] .notification-system-icon {
  color: var(--success-700);
  background: var(--success-100);
}

.notification-system-setting[data-state="denied"] .notification-system-icon {
  color: var(--danger-700);
  background: var(--danger-100);
}

.notification-system-setting[data-state="unsupported"] .notification-system-icon {
  color: var(--warning-700);
  background: var(--warning-100);
}

html[data-theme="dark"] .notification-system-setting {
  border-color: var(--ink-200);
  background: var(--surface);
}

@media (max-width: 700px) {
  .notification-system-setting {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 0.75rem 1rem;
  }

  .notification-system-setting button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* V21 · repaso adaptativo de respuestas incorrectas */
.mistake-review-callout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-5);
  margin: 0 0 var(--space-6);
  border: 1px solid var(--blue-200);
  border-radius: var(--radius-xl);
  padding: clamp(1.1rem, 3vw, 1.6rem);
  background: linear-gradient(135deg, var(--blue-50), var(--surface) 70%);
  box-shadow: var(--shadow-sm);
}

.mistake-review-icon {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  border-radius: 1rem;
  color: var(--blue-700);
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--blue-100), var(--shadow-xs);
}

.mistake-review-icon svg {
  width: 1.75rem;
  height: 1.75rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.mistake-review-callout h2 {
  margin: 0 0 0.3rem;
  color: var(--ink-900);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
}

.mistake-review-callout p {
  max-width: 46rem;
  margin: 0;
  color: var(--ink-700);
  font-size: 0.88rem;
  line-height: 1.5;
}

.mistake-review-callout small {
  display: block;
  margin-top: 0.45rem;
  color: var(--ink-500);
  font-size: 0.72rem;
  font-weight: 700;
}

.mistake-practice-toolbar .mistake-practice-round {
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  padding: 0.42rem 0.7rem;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.mistake-practice-progress {
  border: 1px solid var(--ink-100);
}

.mistake-practice-intro {
  max-width: 48rem;
  margin: 0 auto var(--space-5);
  color: var(--ink-600);
  font-size: 0.84rem;
  line-height: 1.55;
  text-align: center;
}

.mistake-practice-card {
  max-width: 52rem;
  margin: 0 auto;
}

.mistake-practice-content .correct,
.mistake-practice-content .incorrect {
  border-color: var(--ink-100) !important;
  color: var(--ink-800) !important;
  background-color: var(--surface-muted) !important;
}

.mistake-practice-card:not(.is-revealed) .mistake-practice-content :is(
  .feedback,
  .specificfeedback,
  .generalfeedback,
  .rightanswer,
  .outcome,
  .correctness,
  .validationerror
),
.mistake-practice-content .correctness {
  display: none !important;
}

.mistake-practice-fallback {
  display: grid;
  gap: 0.55rem;
  margin-top: var(--space-5);
}

.mistake-practice-fallback[hidden] {
  display: none;
}

.mistake-practice-fallback label {
  color: var(--ink-800);
  font-size: 0.82rem;
  font-weight: 800;
}

.mistake-practice-fallback textarea {
  width: 100%;
  min-height: 7rem;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  color: var(--ink-900);
  background: var(--surface-sunken);
  font: inherit;
  resize: vertical;
}

.mistake-practice-fallback textarea:focus {
  border-color: var(--accent-500);
  outline: none;
  box-shadow: var(--shadow-focus);
}

.mistake-practice-reveal-note {
  display: grid;
  gap: 0.2rem;
  margin-top: var(--space-5);
  border-left: 0.25rem solid var(--blue-600);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  color: var(--ink-800);
  background: var(--blue-50);
}

.mistake-practice-reveal-note[hidden] {
  display: none;
}

.mistake-practice-reveal-note span {
  color: var(--ink-600);
  font-size: 0.8rem;
}

.mistake-practice-card.is-revealed .moodle-question-content :is(.feedback, .specificfeedback, .generalfeedback, .rightanswer, .outcome) {
  display: block;
}

.mistake-practice-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-6);
  border-top: 1px solid var(--ink-100);
  padding-top: var(--space-5);
}

.mistake-practice-rating {
  display: flex;
  gap: var(--space-3);
}

.mistake-practice-rating[hidden] {
  display: none;
}

.mistake-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.mistake-summary-stats article {
  display: grid;
  gap: 0.35rem;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.mistake-summary-stats span {
  color: var(--ink-500);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mistake-summary-stats strong {
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 1.45rem;
}

/* V21 · fotografía ampliable y cierre circular de Mi perfil */
.notification-close,
.profile-close,
.profile-photo-dialog-close {
  width: 2.75rem;
  min-width: 2.75rem;
  max-width: 2.75rem;
  height: 2.75rem;
  min-height: 2.75rem;
  max-height: 2.75rem;
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 0;
  line-height: 1;
  box-sizing: border-box;
  flex: 0 0 2.75rem;
}

.notification-close svg,
.profile-close svg,
.profile-photo-dialog-close svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.9;
}

/* V23 · escala continua de desempeño y estados de avance */
.score-tone {
  color: var(--score-color) !important;
}

.score-tone-0 { --score-color: #b42318; }
.score-tone-10 { --score-color: #b93815; }
.score-tone-20 { --score-color: #b24d0d; }
.score-tone-30 { --score-color: #a66107; }
.score-tone-40 { --score-color: #947000; }
.score-tone-50 { --score-color: #817600; }
.score-tone-60 { --score-color: #6a7c0d; }
.score-tone-70 { --score-color: #4f811d; }
.score-tone-80 { --score-color: #33812f; }
.score-tone-90 { --score-color: #1d7c3f; }
.score-tone-100 { --score-color: #0f7646; }

.module-type.progress-badge {
  color: var(--warning-700);
  background: var(--warning-100);
}

html[data-theme="dark"] .score-tone-0 { --score-color: #ff928d; }
html[data-theme="dark"] .score-tone-10 { --score-color: #ff9a7b; }
html[data-theme="dark"] .score-tone-20 { --score-color: #f3a969; }
html[data-theme="dark"] .score-tone-30 { --score-color: #e8b658; }
html[data-theme="dark"] .score-tone-40 { --score-color: #d8c34b; }
html[data-theme="dark"] .score-tone-50 { --score-color: #c4cc48; }
html[data-theme="dark"] .score-tone-60 { --score-color: #a8cf50; }
html[data-theme="dark"] .score-tone-70 { --score-color: #87cd5e; }
html[data-theme="dark"] .score-tone-80 { --score-color: #63c873; }
html[data-theme="dark"] .score-tone-90 { --score-color: #43bd87; }
html[data-theme="dark"] .score-tone-100 { --score-color: #2fb18b; }

button.profile-photo {
  position: relative;
  border: 0;
  padding: 0;
  font: inherit;
}

button.profile-photo:disabled {
  cursor: default;
  opacity: 1;
}

.profile-photo.is-zoomable {
  cursor: zoom-in;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.profile-photo.is-zoomable:hover {
  transform: scale(1.04);
  box-shadow: inset 0 0 0 2px var(--blue-200), 0 8px 20px rgba(9, 81, 162, 0.18);
}

.profile-photo.is-zoomable:focus-visible {
  outline: 3px solid var(--accent-400);
  outline-offset: 3px;
}

.profile-photo-lightbox {
  position: fixed;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2rem);
}

.profile-photo-lightbox[hidden] {
  display: none;
}

.profile-photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(5, 16, 29, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: zoom-out;
}

.profile-photo-dialog {
  position: relative;
  z-index: 1;
  width: min(82vw, 32rem);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: var(--ink-950);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  animation: profile-photo-zoom-in 180ms ease-out both;
}

.profile-photo-dialog > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-photo-dialog-close {
  position: absolute;
  z-index: 2;
  top: 1rem;
  right: 1rem;
  border-color: rgba(255, 255, 255, 0.48);
  color: var(--white);
  background: rgba(8, 25, 44, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.profile-photo-preview-open {
  overflow: hidden;
}

@keyframes profile-photo-zoom-in {
  from { opacity: 0; transform: scale(0.86); }
  to { opacity: 1; transform: scale(1); }
}

html[data-theme="dark"] .mistake-review-callout {
  border-color: #486d99;
  background: linear-gradient(135deg, #18304d, var(--surface) 72%);
}

html[data-theme="dark"] .mistake-review-icon {
  color: #dbeaff;
  background: #1d3048;
}

html[data-theme="dark"] .mistake-review-callout h2 {
  color: #f8fbff;
}

html[data-theme="dark"] .mistake-practice-reveal-note {
  background: #1d3048;
}

@media (max-width: 700px) {
  .mistake-review-callout {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .mistake-review-callout .button {
    width: 100%;
    grid-column: 1 / -1;
  }

  .mistake-practice-toolbar .mistake-practice-round {
    grid-row: 3;
  }

  .mistake-practice-rating,
  .mistake-practice-rating .button,
  .mistake-practice-actions > .button {
    width: 100%;
  }

  .mistake-practice-rating {
    flex-direction: column-reverse;
  }

  .mistake-summary-stats {
    grid-template-columns: 1fr;
  }

  .profile-photo-dialog {
    width: min(88vw, 28rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-photo-dialog {
    animation: none;
  }
}

/* ---------------------------------------------------------------------------
   Verificación de identidad: consentimiento, enrolamiento, actas y revisión.
   --------------------------------------------------------------------------- */

.alert-ok {
  color: var(--success-700);
  background: var(--success-100);
}

.identidad-legal {
  max-height: 46vh;
  overflow-y: auto;
  margin-bottom: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--ink-700);
  font-size: 0.94rem;
  line-height: 1.65;
}

.identidad-legal p {
  margin: 0 0 var(--space-4);
}

.identidad-legal p:last-child {
  margin-bottom: 0;
}

.identidad-legal:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.identidad-version {
  color: var(--ink-500);
  font-size: 0.82rem;
}

.identidad-check {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  margin-bottom: var(--space-5);
  color: var(--ink-700);
  font-size: 0.94rem;
  line-height: 1.5;
  cursor: pointer;
}

.identidad-check input {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  accent-color: var(--accent-500);
}

.identidad-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.identidad-nota {
  margin-top: var(--space-4);
  color: var(--ink-500);
  font-size: 0.85rem;
}

.identidad-enlace {
  margin-top: var(--space-5);
  padding: 0;
  border: 0;
  background: none;
  color: var(--danger-700);
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

.identidad-pasos {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.identidad-paso {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-5);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.identidad-paso p {
  margin: var(--space-1) 0 0;
  color: var(--ink-600);
  font-size: 0.88rem;
  line-height: 1.5;
}

.identidad-paso-marca {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-pill);
  background: var(--ink-100);
  color: var(--ink-500);
  font-weight: 800;
}

.identidad-paso.is-listo .identidad-paso-marca {
  background: var(--success-100);
  color: var(--success-700);
}

.identidad-gesto {
  margin-bottom: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--blue-200);
  border-radius: var(--radius-md);
  background: var(--blue-50);
}

.identidad-gesto-etiqueta {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--accent-500);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.identidad-gesto strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.3;
}

.identidad-gesto p {
  margin: var(--space-2) 0 0;
  color: var(--ink-600);
  font-size: 0.85rem;
}

.identidad-declaracion {
  margin: 0 0 var(--space-5);
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid var(--accent-500);
  background: var(--surface-sunken);
  color: var(--ink-800);
  font-size: 0.98rem;
  font-style: italic;
  line-height: 1.6;
}

/* ---------------------------------- Actas -------------------------------- */

.actas-lista {
  display: grid;
  gap: var(--space-4);
}

.acta-card {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.acta-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
  align-items: flex-start;
}

.acta-card-head strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.acta-folio {
  display: block;
  color: var(--ink-500);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.acta-curso {
  color: var(--ink-600);
  font-size: 0.88rem;
}

.acta-nivel {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--ink-100);
  color: var(--ink-700);
  font-size: 0.75rem;
  font-weight: 700;
}

.acta-datos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3) var(--space-5);
}

.acta-datos span {
  display: block;
  color: var(--ink-500);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.acta-datos strong {
  font-size: 0.95rem;
}

.acta-sello {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: baseline;
  padding-top: var(--space-3);
  border-top: 1px solid var(--ink-200);
  color: var(--ink-500);
  font-size: 0.75rem;
}

.acta-sello code {
  color: var(--ink-700);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  word-break: break-all;
}

/* -------------------------- Panel de revisión ---------------------------- */

.revision-lista {
  display: grid;
  gap: var(--space-4);
}

.revision-card {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.revision-imagenes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.revision-imagenes figure {
  margin: 0;
}

.revision-imagenes img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  object-fit: cover;
}

.revision-imagenes figcaption {
  margin-top: var(--space-2);
  color: var(--ink-500);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.revision-datos {
  display: grid;
  gap: 0.2rem;
  color: var(--ink-600);
  font-size: 0.88rem;
}

.revision-datos strong {
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 1.02rem;
}

.revision-estado {
  margin-top: var(--space-2);
  color: var(--ink-600);
  font-size: 0.8rem;
  font-weight: 700;
}

.revision-estado.is-coincide {
  color: var(--success-700);
}

.revision-estado.is-no_coincide {
  color: var(--danger-700);
}

/* ------------------------------- Cámara ---------------------------------- */

.sin-scroll {
  overflow: hidden;
}

.camara-capa {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: #05101d;
  color: #ffffff;
}

.camara-marco {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.camara-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camara-video.is-espejo {
  transform: scaleX(-1);
}

.camara-guia {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(70vw, 260px);
  height: min(70vw, 260px);
  transform: translate(-50%, -50%);
  border: 2px dashed rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  pointer-events: none;
}

.camara-marco.is-documento .camara-guia {
  width: min(88vw, 460px);
  height: min(56vw, 290px);
  border-radius: var(--radius-md);
}

.camara-cuenta {
  position: absolute;
  top: var(--space-5);
  left: 50%;
  margin: 0;
  padding: 0.3rem 0.9rem;
  transform: translateX(-50%);
  border-radius: var(--radius-pill);
  background: rgba(5, 16, 29, 0.72);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
}

.camara-panel {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom));
  background: #0b1a2c;
}

.camara-texto strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.camara-texto span {
  display: block;
  margin-top: var(--space-1);
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.88rem;
  line-height: 1.5;
}

.camara-error {
  margin: 0;
  color: #ffc4c2;
  font-size: 0.85rem;
}

.camara-acciones {
  display: flex;
  gap: var(--space-3);
}

.camara-acciones .button {
  flex: 1;
}

@media (max-width: 640px) {
  .identidad-paso {
    grid-template-columns: auto 1fr;
  }

  .identidad-paso .button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* Fila de archivo: enlace pequeño de descarga junto al botón "Ver documento" */
.file-download-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line, #d5dce8);
  border-radius: var(--radius-lg, 14px);
  background: var(--white, #fff);
  color: var(--ink-600);
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.file-download-link svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-download-link:hover,
.file-download-link:focus-visible {
  color: var(--accent-700);
  border-color: var(--accent-300, #9dbdf0);
  background: var(--accent-050, #eef4ff);
}

html[data-theme="dark"] .file-download-link {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--ink-400, #b8c2d3);
}

html[data-theme="dark"] .file-download-link:hover,
html[data-theme="dark"] .file-download-link:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Visor de Word (.docx): páginas renderizadas por docx-preview dentro del marco del visor PDF */
.docx-pages {
  min-height: 100%;
}

.docx-pages .docx-wrapper {
  background: transparent !important;
  padding: 1.5rem !important;
  display: flex;
  flex-flow: column;
  align-items: center !important;
  gap: 1.5rem;
  box-sizing: border-box;
  width: max-content;
  min-width: 100%;
}

/* La hoja conserva su ancho real (tamaño de página de Word); en pantallas angostas el marco se desplaza
   horizontalmente en lugar de recortar tablas o fotos. */
.docx-pages .docx-wrapper > section.docx {
  box-sizing: border-box;
  margin: 0 auto !important;
  background: #fff;
  color: #1a1f2b;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(16, 32, 64, 0.16);
}

/* docx-preview ancla las imágenes flotantes dentro de un div de 0×0; un max-width:100% las colapsaría. */
.docx-pages .docx-wrapper > section.docx img {
  max-width: none;
}

.docx-pages .docx-wrapper > section.docx table {
  max-width: 100%;
}

@media (max-width: 700px) {
  .docx-pages .docx-wrapper {
    padding: 0.75rem !important;
    gap: 0.75rem;
  }

  .docx-pages .docx-wrapper > section.docx {
    padding: 1.25rem !important;
    min-height: 0 !important;
  }
}

.docx-pages .docx-anchor-flow {
  margin: 0.35rem 0;
}

.docx-pages .docx-image-fallback {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  max-width: 100%;
  padding: 0.75rem;
  box-sizing: border-box;
  border: 1px dashed #9aa7bd;
  border-radius: 6px;
  background: #f3f5f9;
  color: #4a5568;
  font-family: inherit;
  font-size: 0.8rem;
  text-align: center;
  vertical-align: top;
}

.docx-pages .docx-image-fallback small {
  font-size: 0.72rem;
  color: #6b778c;
}
