/* ==========================================================================
   Cloud & SRE Exam Arena · Design System
   Estilo Moderno, Elegante y Profesional (inspirado en Linear / Vercel / Stripe)
   Total compatibilidad multi-provider (SRE, GCP, Azure, AWS) y @fabianimv/study-tracker
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---------- 1. Variables CSS de Tema y Acentos Dinámicos ---------- */
:root,
:root[data-theme="light"] {
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Paleta Base - Modo Claro */
  --bg: #f4f6fb;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --txt: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface-2: #f1f5f9;

  /* Estados y Alertas */
  --ok: #16a34a;
  --ok-bg: rgba(22, 163, 74, 0.10);
  --bad: #dc2626;
  --bad-bg: rgba(220, 38, 38, 0.10);
  --tip: rgba(245, 158, 11, 0.12);
  --tip-border: #f59e0b;

  /* Elevaciones */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 10px -4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Paleta Base - Modo Oscuro */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f19;
    --bg-elev: rgba(17, 24, 39, 0.85);
    --card: #111827;
    --txt: #f1f5f9;
    --muted: #94a3b8;
    --line: #1e293b;
    --surface-2: #1e293b;

    --ok: #4ade80;
    --ok-bg: rgba(74, 222, 128, 0.12);
    --bad: #f87171;
    --bad-bg: rgba(248, 113, 113, 0.12);
    --tip: rgba(251, 191, 36, 0.12);
    --tip-border: #fbbf24;

    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 12px 30px -6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 45px -10px rgba(0, 0, 0, 0.65);
  }
}

:root[data-theme="dark"] {
  --bg: #0b0f19;
  --bg-elev: rgba(17, 24, 39, 0.85);
  --card: #111827;
  --txt: #f1f5f9;
  --muted: #94a3b8;
  --line: #1e293b;
  --surface-2: #1e293b;

  --ok: #4ade80;
  --ok-bg: rgba(74, 222, 128, 0.12);
  --bad: #f87171;
  --bad-bg: rgba(248, 113, 113, 0.12);
  --tip: rgba(251, 191, 36, 0.12);
  --tip-border: #fbbf24;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 30px -6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 45px -10px rgba(0, 0, 0, 0.65);
}

/* Colores de Acento por Defecto y Proveedor */
body[data-provider="claude-architect"],
.hub-card[data-provider="claude-architect"] {
  --blue: #d97757;
  --accent: #d97757;
  --accent-soft: rgba(217, 119, 87, 0.18);
  --accent-grad: linear-gradient(135deg, #d97757 0%, #ea580c 100%);
}
body[data-provider="databricks-genai"],
.hub-card[data-provider="databricks-genai"] {
  --blue: #ff3621;
  --accent: #ff3621;
  --accent-soft: rgba(255, 54, 33, 0.18);
  --accent-grad: linear-gradient(135deg, #ff3621 0%, #b91c1c 100%);
}
body[data-provider="databricks-de"],
.hub-card[data-provider="databricks-de"] {
  --blue: #e02424;
  --accent: #e02424;
  --accent-soft: rgba(224, 36, 36, 0.18);
  --accent-grad: linear-gradient(135deg, #e02424 0%, #991b1b 100%);
}
body[data-provider="nvidia-genl"],
.hub-card[data-provider="nvidia-genl"] {
  --blue: #76b900;
  --accent: #76b900;
  --accent-soft: rgba(118, 185, 0, 0.18);
  --accent-grad: linear-gradient(135deg, #76b900 0%, #4d7c0f 100%);
}
body[data-provider="k8s-kcna"],
.hub-card[data-provider="k8s-kcna"] {
  --blue: #326ce5;
  --accent: #326ce5;
  --accent-soft: rgba(50, 108, 229, 0.18);
  --accent-grad: linear-gradient(135deg, #326ce5 0%, #1d4ed8 100%);
}
body[data-provider="terraform-003"],
.hub-card[data-provider="terraform-003"] {
  --blue: #7b42bc;
  --accent: #7b42bc;
  --accent-soft: rgba(123, 66, 188, 0.18);
  --accent-grad: linear-gradient(135deg, #7b42bc 0%, #5b21b6 100%);
}

body[data-provider="claude-developer"],
.hub-card[data-provider="claude-developer"] {
  --blue: #c2410c;
  --accent: #c2410c;
  --accent-soft: rgba(194, 65, 12, 0.18);
  --accent-grad: linear-gradient(135deg, #c2410c 0%, #f59e0b 100%);
}

body[data-provider="claude-associate"],
.hub-card[data-provider="claude-associate"] {
  --blue: #e07a5f;
  --accent: #e07a5f;
  --accent-soft: rgba(224, 122, 95, 0.18);
  --accent-grad: linear-gradient(135deg, #e07a5f 0%, #f43f5e 100%);
}

:root,
body,
body[data-provider="sre-incidents"],
.hub-card[data-provider="sre-incidents"] {
  --blue: #ef4444;
  --accent: #ef4444;
  --accent-soft: rgba(239, 68, 68, 0.18);
  --accent-grad: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
}

body[data-provider="kafka-confluent"],
.hub-card[data-provider="kafka-confluent"] {
  --blue: #8b5cf6;
  --accent: #8b5cf6;
  --accent-soft: rgba(139, 92, 246, 0.18);
  --accent-grad: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
}

body[data-provider="gcp-genai-leader"],
.hub-card[data-provider="gcp-genai-leader"] {
  --blue: #2563eb;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.18);
  --accent-grad: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
}

body[data-provider="az-104"],
.hub-card[data-provider="az-104"] {
  --blue: #0284c7;
  --accent: #0284c7;
  --accent-soft: rgba(2, 132, 199, 0.18);
  --accent-grad: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
}

body[data-provider="aws-saa-c03"],
.hub-card[data-provider="aws-saa-c03"] {
  --blue: #d97706;
  --accent: #d97706;
  --accent-soft: rgba(217, 119, 6, 0.18);
  --accent-grad: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
}

:root[data-theme="dark"] body[data-provider="sre-incidents"],
:root[data-theme="dark"] .hub-card[data-provider="sre-incidents"] {
  --accent-soft: rgba(239, 68, 68, 0.24);
}

:root[data-theme="dark"] body[data-provider="kafka-confluent"],
:root[data-theme="dark"] .hub-card[data-provider="kafka-confluent"] {
  --accent-soft: rgba(139, 92, 246, 0.24);
}

:root[data-theme="dark"] body[data-provider="gcp-genai-leader"],
:root[data-theme="dark"] .hub-card[data-provider="gcp-genai-leader"] {
  --blue: #60a5fa;
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.24);
}

:root[data-theme="dark"] body[data-provider="az-104"],
:root[data-theme="dark"] .hub-card[data-provider="az-104"] {
  --blue: #38bdf8;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.24);
}

:root[data-theme="dark"] body[data-provider="aws-saa-c03"],
:root[data-theme="dark"] .hub-card[data-provider="aws-saa-c03"] {
  --blue: #fbbf24;
  --accent: #fbbf24;
  --accent-soft: rgba(251, 191, 36, 0.24);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body[data-provider="sre-incidents"],
  :root:not([data-theme="light"]) .hub-card[data-provider="sre-incidents"] {
    --accent-soft: rgba(239, 68, 68, 0.24);
  }

  :root:not([data-theme="light"]) body[data-provider="kafka-confluent"],
  :root:not([data-theme="light"]) .hub-card[data-provider="kafka-confluent"] {
    --accent-soft: rgba(139, 92, 246, 0.24);
  }

  :root:not([data-theme="light"]) body[data-provider="gcp-genai-leader"],
  :root:not([data-theme="light"]) .hub-card[data-provider="gcp-genai-leader"] {
    --blue: #60a5fa;
    --accent: #60a5fa;
    --accent-soft: rgba(96, 165, 250, 0.24);
  }

  :root:not([data-theme="light"]) body[data-provider="az-104"],
  :root:not([data-theme="light"]) .hub-card[data-provider="az-104"] {
    --blue: #38bdf8;
    --accent: #38bdf8;
    --accent-soft: rgba(56, 189, 248, 0.24);
  }

  :root:not([data-theme="light"]) body[data-provider="aws-saa-c03"],
  :root:not([data-theme="light"]) .hub-card[data-provider="aws-saa-c03"] {
    --blue: #fbbf24;
    --accent: #fbbf24;
    --accent-soft: rgba(251, 191, 36, 0.24);
  }
}

/* Sincronización con @fabianimv/study-tracker */
:root {
  --st-surface-custom: var(--card);
  --st-text-custom: var(--txt);
  --st-muted-custom: var(--muted);
  --st-line-custom: var(--line);
  --st-accent-custom: var(--blue);
}

/* ---------- 2. Reseteo y Base Tipográfica ---------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition), opacity var(--transition);
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1, h2, h3, h4 {
  color: var(--txt);
  font-weight: 700;
  line-height: 1.28;
}

h1 {
  font-size: 1.4rem;
  letter-spacing: -0.025em;
  margin: 0 0 0.45rem;
}

h2 {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  margin: 1.8rem 0 0.75rem;
}

h3 {
  font-size: 1.1rem;
  letter-spacing: -0.015em;
  margin: 0.2rem 0 0.4rem;
}

h4 {
  font-size: 0.98rem;
  margin: 1.1rem 0 0.4rem;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(127, 127, 127, 0.12);
  color: var(--txt);
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  border: 1px solid rgba(127, 127, 127, 0.08);
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.16rem 0.45rem;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--line);
  color: var(--txt);
}

/* ---------- 3. Header Glassmorphic ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 24px;
  background: var(--bg-elev);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background var(--transition-smooth), border-color var(--transition-smooth);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 800;
  color: var(--txt);
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: -0.025em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: color var(--transition);
}

.brand:hover {
  text-decoration: none;
  color: var(--blue);
}

#exam-picker {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--txt);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#exam-picker:hover,
#exam-picker:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

#tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 12px;
  border: 1px solid var(--line);
  flex-wrap: wrap;
}

#tabs button {
  background: transparent;
  border: 0;
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

#tabs button:hover {
  color: var(--txt);
  background: rgba(127, 127, 127, 0.08);
}

#tabs button.active {
  background: var(--accent-grad);
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 2px 10px var(--accent-soft);
}

.icon-btn,
#theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--txt);
  cursor: pointer;
  padding: 0;
  font-size: 1.05rem;
  transition: all var(--transition);
}

.icon-btn:hover,
#theme-toggle:hover {
  border-color: var(--blue);
  background: var(--surface-2);
  transform: translateY(-1px);
}

/* ---------- 4. Contenedor Principal y Footer ---------- */
main {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 20px 3.5rem;
  flex: 1;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
  padding: 1.5rem 20px 2.5rem;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

/* ---------- 5. Formularios y Botones Universales ---------- */
button {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--txt);
  border-radius: var(--radius-sm);
  padding: 0.55rem 1.05rem;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  outline: none;
}

button:hover:not(:disabled) {
  border-color: var(--blue);
  background: var(--surface-2);
}

button.primary {
  background: var(--accent-grad);
  color: #ffffff !important;
  border: 1px solid transparent;
  font-weight: 600;
  box-shadow: 0 2px 10px var(--accent-soft);
  margin-top: 0.8rem;
}

button.primary:hover:not(:disabled) {
  box-shadow: 0 4px 14px var(--accent-soft);
  transform: translateY(-1px);
  filter: brightness(1.04);
}

button.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}

button.link {
  background: none;
  border: 0;
  color: var(--blue);
  padding: 0;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

button.link:hover {
  background: none;
  opacity: 0.85;
}

select, input[type=search], input[type=text] {
  font-family: inherit;
  font-size: 0.92rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--txt);
  max-width: 100%;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

select:focus, input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type=search] {
  width: 100%;
  margin-bottom: 1.2rem;
}

/* ---------- 6. Hub General de Exámenes ---------- */
.hub-hero {
  background: radial-gradient(circle at top left, var(--accent-soft), transparent 70%), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.6rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.hub-hero h1 {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.45rem;
  line-height: 1.25;
}

.hub-hero p {
  color: var(--muted);
  margin: 0;
  max-width: 700px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.hub-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.85rem;
  margin-top: 1.4rem;
}

.kpi-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: var(--shadow-sm);
}

.kpi-card .kpi-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--txt);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.kpi-card .kpi-label {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

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

.hub-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem 1.45rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  overflow: hidden;
}

.hub-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-grad);
  opacity: 0.88;
  transition: opacity var(--transition), height var(--transition);
}

.hub-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue);
}

.hub-card:hover::before {
  opacity: 1;
  height: 5px;
}

.hub-card.current {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue), var(--shadow-sm);
}

.hub-card h3 {
  margin: 0.35rem 0 0.35rem;
  font-size: 1.16rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--txt);
}

.hub-cov {
  margin: 0.65rem 0 0.25rem;
}

.hub-cov-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.hub-cov-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.hub-cov-fill {
  height: 100%;
  background: var(--accent-grad);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

.hub-domains {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.65rem 0 0.45rem;
}

.domain-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
  transition: all var(--transition);
}

.domain-chip:hover {
  border-color: var(--blue);
  color: var(--txt);
}

.hub-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0.85rem 0;
  padding: 0.75rem 0.6rem;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  text-align: center;
}

.hub-stat b {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--txt);
  letter-spacing: -0.01em;
}

.hub-stat span {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
  display: block;
  margin-top: 0.2rem;
  line-height: 1.3;
}

.hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.5rem;
}

.hub-actions button {
  flex: 1;
  min-width: 90px;
  padding: 0.52rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 0;
  border-radius: var(--radius-sm);
}

/* ---------- 7. Banner de Examen, Temas y Glosario ---------- */
.exam-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.45rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.exam-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 160px;
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  pointer-events: none;
}

.exam-banner h1 {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0.15rem 0 0.25rem;
  color: var(--txt);
}

.exam-banner p {
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--blue);
  margin-bottom: 0.45rem;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Temas (Acordeones y Tablas) */
.topics-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 1.2rem;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.topics-toolbar button {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  margin-top: 0;
}

.topic {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 0.65rem 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.topic[open] {
  border-color: var(--line);
  box-shadow: var(--shadow-md);
}

.topic summary {
  padding: 0.95rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.98rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  user-select: none;
  transition: background var(--transition);
  color: var(--txt);
}

.topic summary::-webkit-details-marker {
  display: none;
}

.topic summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--muted);
  transition: transform 0.2s ease, color var(--transition);
  margin-left: 0.5rem;
  line-height: 1;
}

.topic[open] summary::after {
  content: '−';
  font-weight: 700;
  color: var(--blue);
}

.topic summary:hover {
  background: var(--surface-2);
}

.topic .body {
  padding: 0.8rem 1.25rem 1.25rem;
  overflow-x: auto;
  font-size: 0.94rem;
  line-height: 1.65;
  border-top: 1px solid var(--line);
  color: var(--txt);
}

.keytable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
  margin: 0.6rem 0 1.2rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
}

.keytable th,
.keytable td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0.65rem 0.85rem;
  text-align: left;
  vertical-align: top;
}

.keytable th:last-child,
.keytable td:last-child {
  border-right: none;
}

.keytable tr:last-child td {
  border-bottom: none;
}

.keytable th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--txt);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.keytable tr:hover td {
  background: rgba(127, 127, 127, 0.04);
}

.tip {
  background: var(--tip);
  border-left: 4px solid var(--tip-border);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin: 0.85rem 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--txt);
}

/* Glosario */
.glossary-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.cat-pill {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
}

.cat-pill:hover {
  border-color: var(--blue);
  color: var(--txt);
}

.cat-pill.active {
  background: var(--accent-grad);
  color: #ffffff !important;
  border-color: transparent;
  box-shadow: 0 2px 8px var(--accent-soft);
}

.gitem {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1.15rem;
  margin: 0.6rem 0;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), transform var(--transition);
}

.gitem:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
}

.gitem b {
  font-size: 1.02rem;
  color: var(--txt);
}

.gitem p {
  margin: 0.35rem 0 0;
  color: var(--txt);
  font-size: 0.92rem;
  line-height: 1.55;
}

.gtip {
  margin-top: 0.55rem;
  font-size: 0.86rem;
  background: var(--tip);
  border-left: 3px solid var(--tip-border);
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  color: var(--txt);
}

/* ---------- 8. Experiencia de Prueba y Feedback ---------- */
.setup label {
  display: block;
  margin: 1rem 0;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--txt);
}

.setup select {
  margin-top: 0.4rem;
  width: 100%;
  font-weight: 400;
}

.testbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
}

.testbar b {
  color: var(--txt);
}

.progress {
  height: 7px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 1.25rem;
  border: 1px solid var(--line);
}

.progress div {
  height: 100%;
  background: var(--accent-grad);
  border-radius: var(--radius-pill);
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.45rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.q-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qtext {
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.7;
  margin: 0.4rem 0 1.15rem;
  color: var(--txt);
}

.kb-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.35rem 0 0.75rem;
}

.opts {
  display: grid;
  gap: 0.65rem;
  margin: 0.85rem 0 1.2rem;
}

.opt {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  text-align: left;
  padding: 0.95rem 1.15rem;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--txt);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  font-size: 0.98rem;
  line-height: 1.55;
  outline: none;
}

.opt:hover:not(.locked .opt) {
  border-color: var(--blue);
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--blue);
}

.opt .letter {
  flex: none;
  width: 1.85rem;
  height: 1.85rem;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.84rem;
  font-weight: 700;
  transition: all var(--transition);
  background: var(--surface-2);
  color: var(--muted);
}

.opt:hover:not(.locked .opt) .letter {
  background: var(--accent-grad);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 2px 8px var(--accent-soft);
}

.opt.sel {
  border-color: var(--blue);
  background: linear-gradient(135deg, var(--accent-soft) 0%, rgba(99, 102, 241, 0.08) 100%);
  box-shadow: 0 0 0 2px var(--blue), var(--shadow-sm);
}

.opt.sel .letter {
  background: var(--accent-grad);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 3px 10px var(--accent-soft);
}

.opts.locked .opt {
  cursor: default;
  transform: none !important;
}

.opt.right {
  background: var(--ok-bg) !important;
  border-color: var(--ok) !important;
  box-shadow: 0 0 0 1.5px var(--ok) !important;
  color: var(--txt);
}

.opt.right .letter {
  background: var(--ok) !important;
  border-color: var(--ok) !important;
  color: #ffffff !important;
}

.opt.wrong {
  background: var(--bad-bg) !important;
  border-color: var(--bad) !important;
  box-shadow: 0 0 0 1.5px var(--bad) !important;
  color: var(--txt);
}

.opt.wrong .letter {
  background: var(--bad) !important;
  border-color: var(--bad) !important;
  color: #ffffff !important;
}

/* Animaciones y Jerarquía de Feedback */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fb {
  margin-top: 1.1rem;
  padding: 1.1rem 1.25rem;
  border-radius: 12px;
  border-left: 4px solid;
  animation: fadeSlideIn 0.22s ease-out;
}

.fb.good {
  border-color: var(--ok);
  background: var(--ok-bg);
}

.fb.bad {
  border-color: var(--bad);
  background: var(--bad-bg);
}

.fb p {
  margin: 0.25rem 0 0.65rem;
  line-height: 1.55;
}

.fb p:last-child {
  margin-bottom: 0;
}

.fb-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.fb.good .fb-title {
  color: var(--ok);
}

.fb.bad .fb-title {
  color: var(--bad);
}

.fb-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.fb-opt {
  font-weight: 600;
  color: var(--txt);
}

.fb-block {
  padding: 0.35rem 0;
}

.fb-block + .fb-block {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

/* Pantalla de Resultados */
.result {
  text-align: center;
  padding: 2.2rem 1.5rem;
}

.result button {
  margin-top: 0.85rem;
}

.score {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 0.85rem 0;
  letter-spacing: -0.03em;
}

.score.good {
  color: var(--ok);
}

.score.bad {
  color: var(--bad);
}

.review {
  text-align: left;
  margin-top: 1rem;
}

/* ---------- 9. Montaje de @fabianimv/study-tracker ---------- */
#st-mount {
  margin-top: 1rem;
}

#st-mount .st-view,
#st-mount [class*="st-"] {
  font-family: var(--font-sans);
}

/* ---------- 10. Responsividad en Dispositivos Móviles ---------- */
@media (max-width: 640px) {
  .top {
    padding: 0.65rem 14px;
    gap: 0.5rem;
  }

  #tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }

  main {
    padding: 1rem 14px 2.5rem;
  }

  .card {
    padding: 1.15rem;
  }

  .exam-banner {
    flex-direction: column;
    padding: 1.15rem;
  }

  .hub-stats {
    gap: 0.35rem;
    padding: 0.55rem 0.35rem;
  }

  .score {
    font-size: 2.85rem;
  }
}

/* ---------- 11. Acciones Superiores, Internacionalización y Cloud Sync ---------- */

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.icon-btn.lang-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--txt);
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--txt);
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.2;
  white-space: nowrap;
}

.sync-pill:hover {
  border-color: var(--blue);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.sync-pill.sync-ok {
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
}

.sync-pill.sync-busy {
  border-color: var(--blue);
  background: var(--accent-soft);
  color: var(--blue);
  animation: sync-pulse 1.4s infinite ease-in-out;
}

.sync-pill.sync-err {
  border-color: var(--bad);
  background: var(--bad-bg);
  color: var(--bad);
}

@keyframes sync-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.75;
    transform: scale(0.97);
  }
}

/* ---------- 12. Presentación Enriquecida de Preguntas y Términos Técnicos ---------- */

/* Tarjeta destacada de pregunta con borde de acento del proveedor */
.card.q-card {
  border-top: 4px solid var(--blue);
  box-shadow: var(--shadow-md);
  background: radial-gradient(600px circle at 0% 0%, var(--accent-soft), transparent 45%), var(--card);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.card.review.q-card {
  margin-bottom: 1.25rem;
}

/* Cabecera enriquecida de pregunta */
.q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.q-header-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.q-domain-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-grad);
  color: #ffffff !important;
  border: none;
  box-shadow: 0 3px 10px var(--accent-soft);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.q-domain-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
  display: inline-block;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
}

.q-topic-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
  background: var(--accent-soft);
  border: 1.5px solid var(--blue);
  padding: 0.32rem 0.8rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

:root[data-theme="dark"] .q-topic-badge {
  color: #f8fafc;
  border-color: var(--blue);
  background: var(--accent-soft);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .q-topic-badge {
    color: #f8fafc;
    border-color: var(--blue);
    background: var(--accent-soft);
  }
}

.q-pick-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--txt);
  background: var(--surface-2);
  padding: 0.32rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--line);
  margin-left: auto;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

/* Escenario / Contexto */
.q-scenario {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.9rem;
}

:root[data-theme="dark"] .q-scenario {
  background: rgba(30, 41, 59, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .q-scenario {
    background: rgba(30, 41, 59, 0.55);
  }
}

.q-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.q-section-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
}

.q-scenario-body {
  font-size: 1.04rem;
  font-weight: 450;
  line-height: 1.75;
  color: var(--txt);
}

/* Caja de Pregunta Clave (.q-ask) */
.q-ask {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: linear-gradient(135deg, var(--accent-soft) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1.5px solid var(--blue);
  border-left: 6px solid var(--blue);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  box-shadow: 0 4px 16px -4px var(--accent-soft);
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.q-ask-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  margin-top: 0.1rem;
  box-shadow: 0 2px 8px var(--accent-soft);
  flex-shrink: 0;
}

.q-ask-content {
  flex: 1;
  min-width: 0;
}

.q-ask-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin-bottom: 0.25rem;
}

:root[data-theme="dark"] .q-ask-label {
  color: #a5b4fc;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .q-ask-label {
    color: #a5b4fc;
  }
}

.q-ask-text {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.58;
  color: var(--txt);
}

/* Resaltado con color y pastilla moderna para términos técnicos (hl-term) */
.hl-term,
.qtext strong,
.opt strong,
.explain-body strong,
.fb strong,
.gitem strong {
  display: inline;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.92em;
  font-weight: 700;
  color: #4f46e5;
  background: linear-gradient(135deg, var(--accent-soft), rgba(99, 102, 241, 0.14));
  border: 1px solid var(--blue);
  padding: 0.12rem 0.48rem;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  letter-spacing: -0.01em;
  word-break: break-word;
}

:root[data-theme="dark"] .hl-term,
:root[data-theme="dark"] .qtext strong,
:root[data-theme="dark"] .opt strong,
:root[data-theme="dark"] .explain-body strong,
:root[data-theme="dark"] .fb strong,
:root[data-theme="dark"] .gitem strong {
  color: #ffffff;
  background: var(--accent-soft);
  border: 1px solid var(--blue);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hl-term,
  :root:not([data-theme="light"]) .qtext strong,
  :root:not([data-theme="light"]) .opt strong,
  :root:not([data-theme="light"]) .explain-body strong,
  :root:not([data-theme="light"]) .fb strong,
  :root:not([data-theme="light"]) .gitem strong {
    color: #ffffff;
    background: var(--accent-soft);
    border: 1px solid var(--blue);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  }
}

/* Pastilla distintiva para métricas, SLAs y estados técnicos (.hl-metric) */
.hl-metric {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.90em;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  letter-spacing: 0.02em;
  word-break: break-word;
}

:root[data-theme="dark"] .hl-metric {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hl-metric {
    background: rgba(245, 158, 11, 0.22);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.5);
  }
}

.hl-term .hl-metric {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  color: inherit;
}

/* En opciones seleccionadas o reveladas (correcta/incorrecta), mantener contraste perfecto */
.opt.right .hl-term,
.opt.right strong {
  background: rgba(34, 197, 94, 0.18);
  color: var(--ok);
  border-color: rgba(34, 197, 94, 0.32);
}

.opt.wrong .hl-term,
.opt.wrong strong {
  background: rgba(239, 68, 68, 0.18);
  color: var(--bad);
  border-color: rgba(239, 68, 68, 0.32);
}

@media (max-width: 640px) {
  .q-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .q-pick-badge {
    margin-left: 0;
  }
  .q-ask {
    padding: 0.85rem 1rem;
    font-size: 1rem;
  }
  .q-scenario {
    padding: 0.85rem 1rem;
  }
}

/* Modal de Cloud Sync */
.sync-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
  animation: modal-fade 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sync-modal {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
  color: var(--txt);
  animation: modal-slide 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sync-modal h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--txt);
}

.sync-modal p.sync-desc {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.sync-field {
  margin-bottom: 1rem;
}

.sync-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.sync-field input[type="text"],
.sync-field input[type="email"],
.sync-field input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--txt);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.sync-field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.sync-status-box {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sync-status-box.ok {
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
}

.sync-status-box.err {
  border-color: var(--bad);
  background: var(--bad-bg);
  color: var(--bad);
}

.sync-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.sync-actions button {
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
}

.sql-copy-box {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px dashed var(--line);
  font-size: 0.82rem;
}

.sql-copy-box code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-slide {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  .sync-modal {
    padding: 1.25rem;
    max-height: 94vh;
  }
  .sync-actions {
    flex-direction: column;
    width: 100%;
  }
  .sync-actions button {
    width: 100%;
  }
}

/* ---------- 11. Apoyos Visuales, Diagramas SVG y Gráficos de Telemetría ---------- */
.q-visual-card {
  margin: 0.75rem 0 1rem;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.q-visual-card[open] {
  border-color: var(--blue);
  box-shadow: 0 6px 20px -6px var(--accent-soft);
}

.q-visual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: linear-gradient(90deg, var(--accent-soft) 0%, transparent 100%);
  border-bottom: 1px solid transparent;
}

.q-visual-card[open] .q-visual-header {
  border-bottom-color: var(--line);
}

.q-visual-header::-webkit-details-marker {
  display: none;
}

.q-visual-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.q-visual-eyebrow {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--blue);
}

.q-visual-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-grad);
  color: #ffffff;
}

.q-visual-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--txt);
}

.q-visual-toggle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.q-visual-body {
  padding: 0.9rem 1.1rem;
  background: var(--card);
}

.q-visual-canvas {
  width: 100%;
  overflow-x: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  background: #0f172a;
  padding: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.q-visual-canvas svg {
  width: 100%;
  max-width: 720px;
  height: auto;
  display: block;
}

.q-visual-caption {
  margin-top: 0.65rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
  border-left: 3px solid var(--blue);
  padding-left: 0.75rem;
}

/* Featured Badges for Novel/Priority Simulators */
.hub-card-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.hub-card-badges .badge {
  margin-bottom: 0;
}

.featured-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--accent-grad);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--accent-soft);
}

.hub-card.is-featured {
  border-color: rgba(217, 119, 87, 0.45);
  background: radial-gradient(480px circle at 100% 0%, var(--accent-soft), transparent 55%), var(--card);
}

/* ---------- 13. Logotipos SVG de Certificación y Emblemas ---------- */

/* Base SVG / Logo Container */
.cert-logo {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  line-height: 1;
}

.cert-logo svg,
svg.cert-logo {
  display: block;
  width: 100%;
  height: 100%;
}

/* Hub Cards: Cabecera con Emblema de Certificación y Badges */
.hub-card-top,
.hub-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.35rem;
}

.hub-card-logo-box {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md, 12px);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  overflow: hidden;
}

.hub-card:hover .hub-card-logo-box {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: var(--shadow-sm);
}

.hub-card-head-content,
.hub-card-head-body,
.hub-card-top-content {
  flex: 1;
  min-width: 0;
}

.hub-card-head-content h3,
.hub-card-head-body h3 {
  margin: 0.2rem 0 0.25rem;
}

.hub-cert-logo,
.hub-card-logo-box .cert-logo {
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  display: block;
}

/* Proveedor Badge: Logotipo de Certificación Incrustado */
.badge .cert-logo,
.badge-cert-logo {
  width: 15px;
  height: 15px;
  max-width: 15px;
  max-height: 15px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.badge {
  line-height: 1.25;
}

/* Banner Activo de Examen: Emblema y Badge */
.exam-banner-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
}

.exam-banner-text {
  flex: 1;
  min-width: 0;
}

.banner-logo-box {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md, 12px);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.banner-cert-logo,
.banner-logo-box .cert-logo {
  width: 28px;
  height: 28px;
  max-width: 28px;
  max-height: 28px;
  display: block;
}

.exam-banner .badge .badge-cert-logo,
.exam-banner .badge .cert-logo {
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
}

/* Barra de Quiz (Testbar) Inline Logo */
.inline-cert-logo,
.testbar .cert-logo {
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
  display: inline-block;
  vertical-align: -0.18em;
  flex-shrink: 0;
}

/* Pulido en Modo Oscuro para Contenedores de Logo */
:root[data-theme="dark"] .hub-card-logo-box,
:root[data-theme="dark"] .banner-logo-box {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hub-card-logo-box,
  :root:not([data-theme="light"]) .banner-logo-box {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.10);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  }
}

/* Adaptación Responsiva Móvil */
@media (max-width: 520px) {
  .hub-card-top,
  .hub-card-head {
    gap: 0.7rem;
  }

  .hub-card-logo-box {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .hub-cert-logo,
  .hub-card-logo-box .cert-logo {
    width: 32px;
    height: 32px;
  }

  .banner-logo-box {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .banner-cert-logo,
  .banner-logo-box .cert-logo {
    width: 24px;
    height: 24px;
  }
}


