/* ═══════════════════════════════════════════════════════════
   wb-master.css — Worldbuilding Design System v6
   Fuentes: Lora (headings) + Inter (UI/body)
   Importar Google Fonts en el HTML:
   https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,500;0,600;1,400&family=Inter:wght@300;400;500;600&display=swap
═══════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────
   1. RESET
─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }

/* ───────────────────────────────────────
   2. TOKENS — Modo Claro
─────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:           #F0EFEB;   /* página */
  --bg-top:       #FFFFFF;   /* topbar */
  --surface:      #FFFFFF;   /* cards, tabla */
  --surface-alt:  #F7F6F3;   /* thead, hover suave */

  /* Borders */
  --border:       #D4D1C9;
  --border-hi:    #B0ADA4;

  /* Texto */
  --text:         #0D0C09;
  --text-muted:   #46443E;
  --text-dim:     #7A7870;

  /* Acento único */
  --accent:       #3D5A80;
  --accent-soft:  #EBF0F6;
  --accent-ring:  rgba(61,90,128,.25);

  /* Semánticos */
  --danger:       #9B2226;
  --danger-soft:  rgba(155,34,38,.06);
  --success:      #2D6A4F;

  /* Layout */
  --topbar-h:     56px;
  --radius:       6px;
  --radius-lg:    10px;

  /* Tipografía */
  --font-ui:      'Inter', system-ui, -apple-system, sans-serif;
  --font-head:    'Lora', Georgia, 'Times New Roman', serif;

  /* Sombras — solo negro, sin gradientes */
  --shadow-sm:    0 1px 2px rgba(0,0,0,.06),  0 1px 4px rgba(0,0,0,.04);
  --shadow-md:    0 2px 6px rgba(0,0,0,.08),  0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:    0 4px 12px rgba(0,0,0,.10), 0 8px 32px rgba(0,0,0,.08);
  --shadow-top:   0 2px 8px rgba(0,0,0,.07),  0 1px 2px rgba(0,0,0,.04);
  --shadow-btn:   0 2px 6px rgba(61,90,128,.30), 0 1px 2px rgba(61,90,128,.18);
}

/* ───────────────────────────────────────
   3. TOKENS — Modo Oscuro
─────────────────────────────────────── */
[data-theme="dark"] {
  --bg:           #18171A;
  --bg-top:       #111013;
  --surface:      #211F25;
  --surface-alt:  #1A1820;

  --border:       #3C3A45;
  --border-hi:    #5A5768;

  --text:         #F2F0EC;
  --text-muted:   #B0AEA8;
  --text-dim:     #706E78;

  --accent:       #7B9EC4;
  --accent-soft:  #1A2535;
  --accent-ring:  rgba(123,158,196,.2);

  --danger:       #C1666B;
  --danger-soft:  rgba(193,102,107,.08);
  --success:      #52B788;

  --shadow-sm:    0 1px 2px rgba(0,0,0,.30), 0 1px 4px rgba(0,0,0,.20);
  --shadow-md:    0 2px 6px rgba(0,0,0,.40), 0 4px 16px rgba(0,0,0,.28);
  --shadow-lg:    0 4px 12px rgba(0,0,0,.50), 0 8px 32px rgba(0,0,0,.35);
  --shadow-top:   0 2px 8px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.30);
  --shadow-btn:   0 2px 6px rgba(123,158,196,.20), 0 1px 2px rgba(0,0,0,.30);
}

/* ───────────────────────────────────────
   4. BASE
─────────────────────────────────────── */
body {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ───────────────────────────────────────
   5. TOPBAR
─────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg-top);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-top);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 28px;
}

.topbar-brand {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
  padding-right: 24px;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}

.topbar-nav {
  display: flex;
  align-items: stretch;
  height: 100%;
  padding-left: 8px;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.topbar-nav::-webkit-scrollbar { display: none; }

.topbar-nav a {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color .12s, border-color .12s;
}
.topbar-nav a:hover  { color: var(--text); }
.topbar-nav a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }

.topbar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-left: 16px;
}

/* Mobile burger */
.burger {
  display: none;
  align-items: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text-muted);
}

/* Mobile drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0;
  background: var(--bg-top);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 12px 16px;
  flex-direction: column;
  gap: 2px;
  z-index: 150;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background .1s, color .1s;
}
.mobile-nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.mobile-nav a:hover  { background: var(--surface-alt); color: var(--text); }

/* ───────────────────────────────────────
   6. PAGE HEADER
─────────────────────────────────────── */
.page-header {
  padding: 32px 36px 0;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.page-pretitle {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.page-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.page-title {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -.02em;
}

.page-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ───────────────────────────────────────
   7. CONTENT AREA
─────────────────────────────────────── */
.content {
  padding: 24px 36px 48px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ───────────────────────────────────────
   8. BOTONES
─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, border-color .12s, color .12s, opacity .12s, box-shadow .12s;
  line-height: 1.4;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover { opacity: .88; box-shadow: var(--shadow-md); }

.btn-outline {
  background: var(--surface);
  border-color: var(--border-hi);
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-dim);
  padding: 6px 8px;
  font-size: 15px;
}
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }

.btn-danger {
  background: transparent;
  border-color: transparent;
  color: var(--text-dim);
  padding: 6px 8px;
  font-size: 15px;
}
.btn-danger:hover { color: var(--danger); background: var(--danger-soft); }

/* Tamaños */
.btn-sm { font-size: 12px; padding: 5px 12px; }
.btn-lg { font-size: 16px; padding: 11px 24px; }

/* Deshabilitado */
.btn:disabled, .btn[disabled] {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ───────────────────────────────────────
   9. BADGES — Estados epistémicos
─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 3px;
  white-space: nowrap;
}

/* Canon: hecho establecido — dorado cálido */
.badge-canon {
  background: #FEF3C7;
  color: #78350F;
  border-left: 3px solid #D97706;
}
[data-theme="dark"] .badge-canon { background: #2D1F00; color: #FDE68A; border-left-color: #D97706; }

/* Rumor: no confirmado — neutro y punteado */
.badge-rumor {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border-hi);
}

/* Solo GM: secreto — violeta contenido */
.badge-secret {
  background: #EDE9FE;
  color: #4C1D95;
}
[data-theme="dark"] .badge-secret { background: #1E1040; color: #C4B5FD; }

/* Conocimiento PJ — verde contenido */
.badge-pc {
  background: #D1FAE5;
  color: #065F46;
}
[data-theme="dark"] .badge-pc { background: #052E1E; color: #6EE7B7; }

/* Estado vital */
.status-alive { color: var(--success); font-size: 14px; font-weight: 500; }
.status-dead  { color: var(--danger);  font-size: 14px; font-weight: 500; }

/* ───────────────────────────────────────
   10. FORMULARIOS
─────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .02em;
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  padding: 9px 14px;
  line-height: 1.5;
  transition: border-color .12s, box-shadow .12s;
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow-sm);
}
.form-input::placeholder,
input::placeholder,
textarea::placeholder { color: var(--text-dim); }

textarea { resize: vertical; min-height: 100px; }

/* Inputs de toolbar (más pequeños) */
.search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 8px 14px;
  min-width: 240px;
  transition: border-color .12s, box-shadow .12s;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow-sm);
}
.search-input::placeholder { color: var(--text-dim); }

.filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color .12s;
}
.filter-select:focus { outline: none; border-color: var(--accent); }

/* ───────────────────────────────────────
   11. TABLA
─────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 12px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--accent-soft); }

tbody td {
  padding: 13px 18px;
  vertical-align: middle;
  font-size: 15px;
  color: var(--text);
}

.td-name a {
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
}
.td-name a:hover { color: var(--accent); }

.td-alias {
  display: block;
  font-family: var(--font-head);
  font-style: italic;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 1px;
}

.td-muted   { color: var(--text-muted); }
.td-actions { text-align: right; white-space: nowrap; }

/* ───────────────────────────────────────
   12. CARDS GENÉRICAS
─────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.card-body { padding: 20px 22px; }

.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
}

/* ───────────────────────────────────────
   13. ALERTS
─────────────────────────────────────── */
.alert {
  padding: 13px 18px;
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.5;
  border-left: 4px solid transparent;
  box-shadow: var(--shadow-sm);
}

.alert-info    { background: var(--accent-soft); border-left-color: var(--accent); color: var(--text); }
.alert-success { background: #F0FDF4; border-left-color: #22C55E; color: #14532D; }
.alert-warning { background: #FFFBEB; border-left-color: #F59E0B; color: #78350F; }
.alert-danger  { background: #FFF1F2; border-left-color: var(--danger); color: var(--danger); }

[data-theme="dark"] .alert-success { background: #052E16; color: #86EFAC; }
[data-theme="dark"] .alert-warning { background: #2D1E00; color: #FDE68A; }
[data-theme="dark"] .alert-danger  { background: #2D0A0B; color: #FCA5A5; }

/* ───────────────────────────────────────
   14. EMPTY STATE
─────────────────────────────────────── */
.empty-state {
  padding: 64px 24px;
  text-align: center;
}
.empty-state-title {
  font-family: var(--font-head);
  font-size: 20px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.empty-state-sub {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

/* ───────────────────────────────────────
   15. TOOLBAR
─────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.toolbar-sep  { flex: 1; }
.result-count { font-size: 13px; color: var(--text-dim); white-space: nowrap; }

/* ───────────────────────────────────────
   16. UTILIDADES
─────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.font-head   { font-family: var(--font-head); }
.italic      { font-style: italic; }

/* ───────────────────────────────────────
   17. RESPONSIVE
─────────────────────────────────────── */
@media (max-width: 768px) {
  .topbar-nav    { display: none; }
  .burger        { display: flex; }
  .page-header   { padding: 24px 20px 0; }
  .content       { padding: 20px 20px 40px; }
  .page-title    { font-size: 26px; }
  .search-input  { min-width: 0; width: 100%; }
  .toolbar       { flex-direction: column; align-items: stretch; }
  .filter-select { width: 100%; }
}

/* ───────────────────────────────────────
   18. TEMA: botón toggle
─────────────────────────────────────── */
.theme-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 5px 12px;
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ───────────────────────────────────────
   19. AVATARES
─────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
  text-transform: uppercase;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-xs  { width: 24px;  height: 24px;  font-size: 10px; }
.avatar-sm  { width: 32px;  height: 32px;  font-size: 12px; }
.avatar-md  { width: 40px;  height: 40px;  font-size: 14px; }
.avatar-lg  { width: 56px;  height: 56px;  font-size: 18px; }
.avatar-xl  { width: 80px;  height: 80px;  font-size: 24px; }
.avatar-2xl { width: 112px; height: 112px; font-size: 32px; }
.avatar-wrap { position: relative; display: inline-block; }
.avatar-status {
  position: absolute; bottom: 2px; right: 2px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--surface);
}
.avatar-status.online  { background: var(--success); }
.avatar-status.offline { background: var(--text-dim); }
.avatar-group { display: flex; }
.avatar-group .avatar { margin-left: -8px; border: 2px solid var(--surface); }
.avatar-group .avatar:first-child { margin-left: 0; }

/* ───────────────────────────────────────
   20. TABS
─────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
  margin-bottom: 24px;
}
.tab {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  font-size: 14px; font-weight: 400;
  color: var(--text-muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  cursor: pointer; background: none;
  border-top: none; border-left: none; border-right: none;
  font-family: var(--font-ui);
  transition: color .12s, border-color .12s;
  white-space: nowrap;
}
.tab:hover  { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }

/* ───────────────────────────────────────
   21. BREADCRUMB
─────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.breadcrumb a { font-size: 13px; color: var(--text-muted); text-decoration: none; transition: color .1s; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep     { font-size: 12px; color: var(--text-dim); }
.breadcrumb-current { font-size: 13px; color: var(--text); font-weight: 500; }

/* ───────────────────────────────────────
   22. PAGINACIÓN
─────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; margin-top: 24px; }
.page-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text-muted);
  font-family: var(--font-ui); font-size: 14px;
  cursor: pointer;
  transition: background .1s, border-color .1s, color .1s;
}
.page-btn:hover  { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* ───────────────────────────────────────
   23. MODAL
─────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px;
  display: flex; flex-direction: column;
  max-height: 90vh;
}
.modal-sm { max-width: 380px; }
.modal-lg { max-width: 720px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: var(--font-head); font-size: 18px; font-weight: 600; color: var(--text);
}
.modal-close {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 20px; line-height: 1; padding: 2px 6px;
  border-radius: var(--radius); transition: color .1s, background .1s;
}
.modal-close:hover { color: var(--text); background: var(--surface-alt); }
.modal-body {
  padding: 20px 24px; overflow-y: auto;
  font-size: 15px; line-height: 1.65; color: var(--text);
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
  background: var(--surface-alt);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ───────────────────────────────────────
   24. PROSE — lectura prolongada
─────────────────────────────────────── */
.prose {
  font-family: var(--font-ui); font-size: 16px;
  line-height: 1.75; color: var(--text); max-width: 68ch;
}
.prose h1 { font-family: var(--font-head); font-size: 28px; font-weight: 600; margin: 0 0 16px; letter-spacing: -.02em; line-height: 1.2; }
.prose h2 { font-family: var(--font-head); font-size: 22px; font-weight: 600; margin: 32px 0 12px; letter-spacing: -.01em; line-height: 1.25; }
.prose h3 { font-family: var(--font-head); font-size: 18px; font-weight: 600; margin: 24px 0 10px; line-height: 1.3; }
.prose p  { margin: 0 0 16px; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 24px; }
.prose li { margin-bottom: 6px; }
.prose blockquote {
  margin: 20px 0; padding: 12px 20px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted); font-style: italic;
}
.prose hr  { border: none; border-top: 1px solid var(--border); margin: 28px 0; }
.prose strong { font-weight: 600; color: var(--text); }
.reading-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  padding: 32px 36px;
}
.prose-cols { columns: 2; column-gap: 40px; column-rule: 1px solid var(--border); }
@media (max-width: 640px) { .prose-cols { columns: 1; } }

/* ───────────────────────────────────────
   25. POST / BLOG / ARTÍCULO
─────────────────────────────────────── */
.post-pretitle {
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.post-title {
  font-family: var(--font-head); font-size: 30px; font-weight: 600;
  color: var(--text); line-height: 1.2; letter-spacing: -.02em; margin-bottom: 12px;
}
.post-lead {
  font-size: 17px; line-height: 1.65; color: var(--text-muted); margin-bottom: 20px;
}
.post-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-dim);
  padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 24px;
}
.post-meta-author { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.post-meta-sep    { color: var(--border-hi); }
.post-cover {
  width: 100%; aspect-ratio: 16/7;
  border-radius: var(--radius); overflow: hidden;
  margin-bottom: 24px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-alt); border: 1px solid var(--border);
}
.img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-dim); background: var(--surface-alt);
}
.img-placeholder-sm {
  width: 100%; aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-dim);
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ───────────────────────────────────────
   26. HERO
─────────────────────────────────────── */
.hero {
  background: var(--bg-top); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  padding: 64px 48px; text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: var(--surface-alt); opacity: .5; pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero-pretitle {
  font-size: 11px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.hero-title {
  font-family: var(--font-head); font-size: 40px; font-weight: 600;
  color: var(--text); line-height: 1.15; letter-spacing: -.03em;
  margin: 0 auto 16px; max-width: 600px;
}
.hero-subtitle {
  font-size: 17px; line-height: 1.65; color: var(--text-muted);
  max-width: 480px; margin: 0 auto 32px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; }
.stat-row  { display: flex; gap: 32px; justify-content: center; flex-wrap: wrap; }
.stat-item { text-align: center; }
.stat-value { font-family: var(--font-head); font-size: 26px; font-weight: 600; color: var(--text); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* ───────────────────────────────────────
   27. FORM SECTION (formulario agrupado)
─────────────────────────────────────── */
.form-section {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-sm);
  margin-bottom: 20px; overflow: hidden;
}
.form-section-header {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}
.form-section-icon {
  width: 36px; height: 36px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 16px;
}
.form-section-title {
  font-family: var(--font-head); font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.3;
}
.form-section-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.form-section-body { padding: 20px 22px; }
.form-hint  { font-size: 12px; color: var(--text-dim); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; }
.input-error { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(155,34,38,.12) !important; }


/* ───────────────────────────────────────
   28. FOOTER DEL SITIO
─────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 0 28px;
  flex-shrink: 0;
}
.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 48px;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.site-footer-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.site-footer-links a {
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: color .12s, background .12s;
  white-space: nowrap;
}
.site-footer-links a + a::before {
  content: '·';
  margin-right: 4px;
  color: var(--border-hi);
}
.site-footer-links a:hover { color: var(--accent); background: var(--accent-soft); }
.site-footer-copy {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Ajuste para layout con sidebar */
.main > .site-footer {
  margin-top: auto;
}

/* ─────────────────────────────────────────
   29. SITEMAP / ROADMAP
───────────────────────────────────────── */
.sm-wrap { max-width: 900px; margin: 0 auto; padding: 48px 28px 80px; }
.sm-hero { margin-bottom: 40px; }
.sm-hero h1 { font-family: var(--font-head); font-size: 1.8rem; font-weight: 600; color: var(--text); letter-spacing: -.02em; margin-bottom: 8px; }
.sm-hero p { font-size: 15px; color: var(--text-muted); }
.sm-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 32px; }
.sm-tab { padding: 10px 20px; font-size: 14px; font-weight: 500; cursor: pointer; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; color: var(--text-muted); font-family: var(--font-ui); transition: color .12s, border-color .12s; }
.sm-tab.active { border-bottom-color: var(--accent); color: var(--accent); }
.sm-tab:hover:not(.active) { color: var(--text); }
.sm-panel { display: none; }
.sm-panel.active { display: block; }
.sm-progress { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.sm-progress-bar { flex: 1; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.sm-progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.sm-progress-text { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.sm-progress-pct { font-family: var(--font-head); font-weight: 600; color: var(--accent); margin-left: 4px; }
.sm-section { margin-bottom: 28px; }
.sm-section-title { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); padding: 0 0 10px; margin-bottom: 2px; display: flex; align-items: center; gap: 8px; }
.sm-section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sm-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.sm-item { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: var(--radius); font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); transition: border-color .12s, box-shadow .12s; }
.sm-item:hover { border-color: var(--border-hi); box-shadow: var(--shadow-sm); }
.sm-item a { color: var(--accent); text-decoration: none; flex: 1; }
.sm-item a:hover { text-decoration: underline; }
.sm-item.pending { opacity: .75; }
.sm-item.pending .sm-item-name { color: var(--text-muted); flex: 1; }
.sm-icon { font-size: 14px; flex-shrink: 0; width: 20px; text-align: center; }
.sm-icon.done { color: var(--success); }
.sm-icon.soon { color: var(--text-dim); }
.sm-badge { font-size: 10px; font-weight: 600; letter-spacing: .06em; padding: 2px 8px; border-radius: 99px; flex-shrink: 0; white-space: nowrap; }
.sm-badge-new  { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-ring); }
.sm-badge-soon { background: var(--surface-alt); color: var(--text-dim); border: 1px solid var(--border); }

/* ─────────────────────────────────────────
   29. SITEMAP / ROADMAP
───────────────────────────────────────── */
.sm-wrap { max-width: 900px; margin: 0 auto; padding: 48px 28px 80px; }
.sm-hero { margin-bottom: 40px; }
.sm-hero h1 { font-family: var(--font-head); font-size: 1.8rem; font-weight: 600; color: var(--text); letter-spacing: -.02em; margin-bottom: 8px; }
.sm-hero p { font-size: 15px; color: var(--text-muted); }
.sm-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 32px; }
.sm-tab { padding: 10px 20px; font-size: 14px; font-weight: 500; cursor: pointer; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; color: var(--text-muted); font-family: var(--font-ui); transition: color .12s, border-color .12s; }
.sm-tab.active { border-bottom-color: var(--accent); color: var(--accent); }
.sm-tab:hover:not(.active) { color: var(--text); }
.sm-panel { display: none; }
.sm-panel.active { display: block; }
.sm-progress { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.sm-progress-bar { flex: 1; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.sm-progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.sm-progress-text { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.sm-progress-pct { font-family: var(--font-head); font-weight: 600; color: var(--accent); margin-left: 4px; }
.sm-section { margin-bottom: 28px; }
.sm-section-title { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); padding: 0 0 10px; margin-bottom: 2px; display: flex; align-items: center; gap: 8px; }
.sm-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.sm-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.sm-item { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: var(--radius); font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); transition: border-color .12s, box-shadow .12s; }
.sm-item:hover { border-color: var(--border-hi); box-shadow: var(--shadow-sm); }
.sm-item a { color: var(--accent); text-decoration: none; flex: 1; }
.sm-item a:hover { text-decoration: underline; }
.sm-item.pending { opacity: .75; }
.sm-item.pending .sm-item-name { color: var(--text-muted); flex: 1; }
.sm-icon { font-size: 14px; flex-shrink: 0; width: 20px; text-align: center; }
.sm-icon.done { color: var(--success); }
.sm-icon.soon { color: var(--text-dim); }
.sm-badge { font-size: 10px; font-weight: 600; letter-spacing: .06em; padding: 2px 8px; border-radius: 99px; flex-shrink: 0; white-space: nowrap; }
.sm-badge-new  { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-ring); }
.sm-badge-soon { background: var(--surface-alt); color: var(--text-dim); border: 1px solid var(--border); }

/* ─────────────────────────────────────────
   30. MAPA DE RELACIONES
───────────────────────────────────────── */
.mr-body { display: flex; min-height: calc(100vh - 56px - 48px); }
.mr-nav { width: 220px; flex-shrink: 0; position: sticky; top: 56px; height: calc(100vh - 56px - 48px); overflow-y: auto; border-right: 1px solid var(--border); background: var(--surface); padding: 24px 0; }
.mr-nav-title { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); padding: 0 18px 12px; }
.mr-nav-list { list-style: none; }
.mr-nav-list a { display: block; padding: 7px 18px; font-size: 13px; color: var(--text-muted); text-decoration: none; border-left: 2px solid transparent; transition: color .1s, border-color .1s, background .1s; }
.mr-nav-list a:hover { color: var(--accent); background: var(--accent-soft); border-left-color: var(--accent); }
.mr-nav-list a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 500; }
.mr-content { flex: 1; min-width: 0; padding: 48px 48px 80px; }
.mr-header { margin-bottom: 40px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.mr-header h1 { font-family: var(--font-head); font-size: 1.9rem; font-weight: 600; color: var(--text); letter-spacing: -.02em; margin-bottom: 8px; }
.mr-header p { font-size: 15px; color: var(--text-muted); font-style: italic; font-family: var(--font-head); }
.mr-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 40px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); font-size: 13px; color: var(--text-muted); }
.mr-legend-item { display: flex; align-items: center; gap: 7px; }
.mr-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.mr-section { margin-bottom: 56px; scroll-margin-top: 72px; }
.mr-section-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.mr-section-header h2 { font-family: var(--font-head); font-size: 1.1rem; font-weight: 600; color: var(--text); letter-spacing: -.01em; white-space: nowrap; }
.mr-section-header::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }
.mr-arrow { display: flex; flex-direction: column; align-items: center; margin: 8px auto 20px; width: 2px; height: 40px; background: linear-gradient(to bottom, var(--border-hi), transparent); position: relative; }
.mr-arrow::after { content: '▾'; position: absolute; bottom: -4px; color: var(--border-hi); font-size: 12px; transform: translateX(-50%); }
.mr-center { display: flex; justify-content: center; }
.mr-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.mr-grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.mr-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mr-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mr-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; position: relative; overflow: hidden; transition: box-shadow .2s, border-color .2s; }
.mr-card:hover { box-shadow: var(--shadow-md); }
.mr-card-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.mr-card-title { font-family: var(--font-head); font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; letter-spacing: -.01em; }
.mr-card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.55; font-style: italic; }
.mr-card-lg { max-width: 480px; padding: 20px 22px; }
.mr-card-lg .mr-card-title { font-size: 16px; }
.mr-card-lg .mr-card-desc  { font-size: 14px; }
.mr-card-xl { max-width: 380px; padding: 22px 24px; }
.mr-card-xl .mr-card-title { font-size: 17px; }
.mr-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mr-role { font-size: 11px; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-ring); font-weight: 500; }
.mc-cuenta     { border-color: #B08D57; }
.mc-cuenta     .mr-card-accent { background: #B08D57; }
.mc-cuenta     .mr-card-title  { color: #7A6030; }
[data-theme="dark"] .mc-cuenta .mr-card-title { color: #D4A843; }
.mc-mundo      { border-color: var(--accent); }
.mc-mundo      .mr-card-accent { background: var(--accent); }
.mc-mundo      .mr-card-title  { color: var(--accent); }
.mc-lugar      { border-color: #5B8DB8; }
.mc-lugar      .mr-card-accent { background: #5B8DB8; }
.mc-lugar      .mr-card-title  { color: #2D6A9F; }
[data-theme="dark"] .mc-lugar .mr-card-title { color: #7ab8d8; }
.mc-personaje  { border-color: #5A9E73; }
.mc-personaje  .mr-card-accent { background: #5A9E73; }
.mc-personaje  .mr-card-title  { color: #2D6A4F; }
[data-theme="dark"] .mc-personaje .mr-card-title { color: #7ac89a; }
.mc-objeto     { border-color: #A07850; }
.mc-objeto     .mr-card-accent { background: #A07850; }
.mc-objeto     .mr-card-title  { color: #7A5230; }
[data-theme="dark"] .mc-objeto .mr-card-title { color: #c8a07a; }
.mc-evento     { border-color: #A05858; }
.mc-evento     .mr-card-accent { background: #A05858; }
.mc-evento     .mr-card-title  { color: #7A3030; }
[data-theme="dark"] .mc-evento .mr-card-title { color: #c87a7a; }
.mc-criatura   { border-color: #5A9898; }
.mc-criatura   .mr-card-accent { background: #5A9898; }
.mc-criatura   .mr-card-title  { color: #2D6A6A; }
[data-theme="dark"] .mc-criatura .mr-card-title { color: #7ac8c8; }
.mc-faccion    { border-color: #9A5878; }
.mc-faccion    .mr-card-accent { background: #9A5878; }
.mc-faccion    .mr-card-title  { color: #6A2A48; }
[data-theme="dark"] .mc-faccion .mr-card-title { color: #c87aaa; }
.mc-aventura   { border-color: #5868A0; }
.mc-aventura   .mr-card-accent { background: #5868A0; }
.mc-aventura   .mr-card-title  { color: #2A3A70; }
[data-theme="dark"] .mc-aventura .mr-card-title { color: #7a8ac8; }
.mc-mision     { border-color: #7A9050; }
.mc-mision     .mr-card-accent { background: #7A9050; }
.mc-mision     .mr-card-title  { color: #4A6020; }
[data-theme="dark"] .mc-mision .mr-card-title { color: #a8c87a; }
.mc-cronologia { border-color: #508898; }
.mc-cronologia .mr-card-accent { background: #508898; }
.mc-cronologia .mr-card-title  { color: #205868; }
[data-theme="dark"] .mc-cronologia .mr-card-title { color: #7ab8c8; }
.mc-relato     { border-color: #985068; }
.mc-relato     .mr-card-accent { background: #985068; }
.mc-relato     .mr-card-title  { color: #68203A; }
[data-theme="dark"] .mc-relato .mr-card-title { color: #c87a8a; }
.mc-sesion     { border-color: #907040; }
.mc-sesion     .mr-card-accent { background: #907040; }
.mc-sesion     .mr-card-title  { color: #604020; }
[data-theme="dark"] .mc-sesion .mr-card-title { color: #c8a84a; }
.mc-relacion   { border-color: var(--border-hi); background: var(--surface-alt); }
.mc-relacion   .mr-card-accent { background: var(--border-hi); }
.mc-relacion   .mr-card-title  { color: var(--text-muted); }
.mc-soporte    { border-color: var(--border); background: var(--surface-alt); }
.mc-soporte    .mr-card-accent { background: var(--border); }
.mc-soporte    .mr-card-title  { color: var(--text-dim); }
.mr-footnote { margin-top: 48px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); font-size: 13px; color: var(--text-muted); line-height: 1.7; font-style: italic; }
@media (max-width: 1100px) { .mr-grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .mr-nav { display: none; } .mr-content { padding: 32px 24px 60px; } .mr-grid-5 { grid-template-columns: repeat(2, 1fr); } .mr-grid-4 { grid-template-columns: repeat(2, 1fr); } .mr-grid-3 { grid-template-columns: 1fr; } }

/* ── Wikilinks: links inline en vistas de lectura ───────────────────────── */
.wb-wikilink { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); transition: border-color .15s; }
.wb-wikilink:hover { border-bottom-color: var(--accent); }
[data-theme="dark"] .wb-wikilink { color: var(--accent-light, #7ab3f5); border-bottom-color: color-mix(in srgb, var(--accent-light, #7ab3f5) 35%, transparent); }
@media (max-width: 600px)  { .mr-grid-6, .mr-grid-5, .mr-grid-4 { grid-template-columns: 1fr; } }