    * { box-sizing: border-box; }
    body {
      background-color: #f0f0f0;
      color: #1a1a1a;
      font-family: 'Inter', sans-serif;
      line-height: 1.7;
    }
    .container-custom {
      max-width: 1200px;
      margin: 0 auto;
      padding: 1.5rem 1rem;
    }
    h1, h2, h3, .display-6 {
      font-family: 'Playfair Display', serif;
      font-weight: 600;
      color: #1a1a1a;
    }
    .badge-andalus {
      background: #8b5a2b;
      color: #f5efe3;
      padding: 0.4rem 1.2rem;
      border-radius: 30px;
      font-size: 0.85rem;
      letter-spacing: 0.5px;
      display: inline-block;
      margin-bottom: 0.75rem;
    }
    .badge-andalus i { margin-right: 0.4rem; }
    .badge-count {
      background: #8b5a2b;
      color: #fff;
      border-radius: 30px;
      padding: 0.1rem 0.6rem;
      font-size: 0.65rem;
      font-weight: 600;
      margin-left: 0.3rem;
    }
    .card-didactica {
      background: #ffffff;
      border-radius: 20px;
      padding: 2rem 1.8rem;
      margin-bottom: 2.5rem;
      box-shadow: 0 8px 30px rgba(0,0,0,0.04);
      border: 1px solid #dde1e6;
      transition: box-shadow 0.2s;
    }
    .card-didactica:hover { box-shadow: 0 12px 40px rgba(0,0,0,0.07); }
    .icon-category {
      font-size: 2rem;
      margin-right: 0.75rem;
      color: #8b5a2b;
    }
    .andalus-icon { color: #8b5a2b; }
    .cita-lateral {
      background: #eef2f5;
      border-left: 4px solid #8b5a2b;
      padding: 1rem 1.5rem;
      border-radius: 0 12px 12px 0;
      margin: 1.5rem 0;
      font-style: italic;
      color: #1e2a3a;
    }
    .cita-lateral strong { color: #8b5a2b; }
    .historical-quote {
      background: #e8edf2;
      padding: 1.5rem 2rem;
      border-radius: 40px 12px 40px 12px;
      font-family: 'Merriweather', serif;
      font-size: 1.2rem;
      color: #1a1a1a;
      margin: 2rem 0;
      position: relative;
    }
    .historical-quote .source {
      display: block;
      margin-top: 0.5rem;
      font-size: 0.9rem;
      font-family: 'Inter', sans-serif;
      color: #4a5a6a;
      font-style: normal;
    }
    .contenedor-imagen {
      margin: 1.5rem 0;
      border-radius: 20px;
      overflow: hidden;
      background: #e8edf2;
    }
    .contenedor-imagen img { width: 100%; height: auto; display: block; }
    .leyenda-mapa {
      background: #eef2f5;
      padding: 0.5rem 1rem;
      font-size: 0.85rem;
      color: #3a4a5a;
      border-top: 1px solid #d0d7e0;
      text-align: center;
    }
    .legado-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 1rem;
      margin: 1.5rem 0;
      text-align: center;
    }
    .legado-grid .col-3 {
      background: #eef2f5;
      padding: 1rem 0.5rem;
      border-radius: 16px;
      font-size: 0.9rem;
      color: #1e2a3a;
    }
    .legado-grid .col-3 i { font-size: 2rem; display: block; margin-bottom: 0.3rem; color: #8b5a2b; }
    .footnote {
      margin-top: 1.5rem;
      border-top: 1px solid #dde1e6;
      padding-top: 1rem;
      display: flex;
      gap: 0.6rem;
      align-items: flex-start;
      font-size: 0.95rem;
      color: #1e2a3a;
    }
    .footnote span { font-size: 1.4rem; line-height: 1; }
    .footer-imperial {
      background-color: #0d0d0d;
      margin-top: 3rem;
      color: #f5efe3;
      padding: 2rem 0;
      text-align: center;
    }
    .footer-imperial a { color: #b8860b; text-decoration: none; }
    .footer-imperial a:hover { text-decoration: underline; }
    #btnSubir {
      position: fixed;
      bottom: 2rem;
      right: 2rem;
      background: #8b5a2b;
      color: #fff;
      border: none;
      border-radius: 50%;
      width: 48px;
      height: 48px;
      font-size: 1.8rem;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
      z-index: 999;
      transition: background 0.2s, transform 0.2s;
      cursor: pointer;
    }
    #btnSubir:hover { background: #a06b33; transform: scale(1.05); }
    .toc-sidebar {
      background: #f8f9fa;
      border-radius: 20px;
      padding: 1.5rem 1.2rem;
      border: 1px solid #dde1e6;
      position: sticky;
      top: 1.5rem;
      max-height: calc(100vh - 3rem);
      overflow-y: auto;
    }
    .toc-sidebar::-webkit-scrollbar { width: 4px; }
    .toc-sidebar::-webkit-scrollbar-thumb { background: #b0b8c0; border-radius: 10px; }
    .toc-title {
      font-family: 'Playfair Display', serif;
      font-size: 1.4rem;
      font-weight: 600;
      margin-bottom: 1.2rem;
      color: #1a1a1a;
      border-bottom: 2px solid #dde1e6;
      padding-bottom: 0.6rem;
    }
    .toc-category {
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      color: #6a7a8a;
      margin-top: 1.2rem;
      margin-bottom: 0.3rem;
      font-weight: 600;
    }
    .toc-item {
      display: block;
      padding: 0.3rem 0 0.3rem 1.2rem;
      color: #1e2a3a;
      text-decoration: none;
      font-size: 0.88rem;
      border-left: 2px solid transparent;
      transition: all 0.1s;
      margin-bottom: 0.1rem;
    }
    .toc-item:hover, .toc-item.active {
      border-left-color: #8b5a2b;
      color: #8b5a2b;
      font-weight: 500;
    }
    .toc-item i { margin-right: 0.5rem; color: #8b5a2b; width: 1.2rem; }
    .biografia-card {
      background: #f8f9fa;
      border-radius: 16px;
      padding: 1.2rem 1.5rem;
      margin-bottom: 1rem;
      border: 1px solid #dde1e6;
      transition: background 0.2s, box-shadow 0.2s;
    }
    .biografia-card:hover { background: #f0f4f8; box-shadow: 0 4px 12px rgba(0,0,0,0.04); }
    .biografia-card.highlight {
      background: #e8edf2;
      border-left: 4px solid #8b5a2b;
      box-shadow: 0 4px 20px rgba(139,90,43,0.12);
    }
    .biografia-card h3 {
      font-family: 'Playfair Display', serif;
      font-size: 1.2rem;
      margin-bottom: 0.2rem;
      color: #1e2a3a;
    }
    .biografia-card .periodo {
      font-size: 0.85rem;
      color: #4a5a6a;
      margin-bottom: 0.5rem;
    }
    .biografia-card .periodo i { margin-right: 0.3rem; }
    .biografia-card p { margin-bottom: 0.4rem; font-size: 0.95rem; }
    .biografia-card .fuentes {
      font-size: 0.8rem;
      color: #4a5a6a;
      margin-top: 0.5rem;
      border-top: 1px dashed #d0d7e0;
      padding-top: 0.5rem;
    }
    .biografia-card .fuentes i { margin-right: 0.3rem; }
    .biografia-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 0.8rem;
    }

    /* ===== BUSCADOR MODERNO ===== */
    .search-wrapper {
      background: #1e2a3a;
      border-radius: 60px;
      padding: 0.5rem 1.5rem;
      margin-bottom: 2.5rem;
      box-shadow: 0 8px 32px rgba(0,0,0,0.10);
      width: 100%;
      transition: all 0.3s ease;
    }
    .search-wrapper:focus-within {
      box-shadow: 0 8px 40px rgba(139,90,43,0.25);
    }
    .search-inner {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      width: 100%;
    }
    .search-inner i {
      color: #b8860b;
      font-size: 1.2rem;
      opacity: 0.8;
    }
    .search-inner input {
      background: transparent;
      border: none;
      color: #f5efe3;
      font-size: 1.05rem;
      padding: 0.6rem 0;
      width: 100%;
      outline: none;
      font-family: 'Inter', sans-serif;
    }
    .search-inner input::placeholder {
      color: #8a9aaa;
      font-weight: 300;
      letter-spacing: 0.3px;
    }
    .search-inner input:focus {
      outline: none;
      box-shadow: none;
    }
    .search-clear {
      background: none;
      border: none;
      color: #8a9aaa;
      font-size: 1.2rem;
      padding: 0 0.2rem;
      cursor: pointer;
      display: none;
      transition: color 0.2s;
    }
    .search-clear:hover { color: #f5efe3; }
    .search-clear.visible { display: block; }
    .search-results-container {
      position: relative;
      width: 100%;
    }
    .search-results-dropdown {
      position: absolute;
      top: calc(100% + 0.5rem);
      left: 0;
      right: 0;
      background: #ffffff;
      border-radius: 16px;
      box-shadow: 0 12px 40px rgba(0,0,0,0.15);
      max-height: 480px;
      overflow-y: auto;
      display: none;
      z-index: 1000;
      border: 1px solid #dde1e6;
    }
    .search-results-dropdown.show { display: block; }
    .search-results-dropdown::-webkit-scrollbar { width: 4px; }
    .search-results-dropdown::-webkit-scrollbar-thumb { background: #b0b8c0; border-radius: 10px; }
    .result-item {
      display: block;
      padding: 0.8rem 1.2rem;
      color: #1a1a1a;
      text-decoration: none;
      border-bottom: 1px solid #eef2f5;
      transition: background 0.15s;
      cursor: pointer;
    }
    .result-item:hover { background: #f0f4f8; }
    .result-item .result-title {
      font-weight: 500;
      font-family: 'Playfair Display', serif;
      font-size: 1rem;
    }
    .result-item .result-sub {
      font-size: 0.8rem;
      color: #6a7a8a;
      display: block;
      margin-top: 0.15rem;
    }
    .result-item .result-category {
      font-size: 0.65rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: #8b5a2b;
      background: #eef2f5;
      padding: 0.1rem 0.6rem;
      border-radius: 20px;
      display: inline-block;
      margin-right: 0.5rem;
    }
    .result-empty {
      padding: 1.5rem;
      text-align: center;
      color: #6a7a8a;
      font-style: italic;
    }

    /* ===== NAVEGACIÓN SUPERIOR ===== */
    .top-nav {
      background: #1e2a3a;
      padding: 0.8rem 1.5rem;
      border-radius: 16px;
      margin-bottom: 2rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 0.8rem;
    }
    .top-nav a {
      color: #f5efe3;
      text-decoration: none;
      font-size: 0.95rem;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.4rem 0.8rem;
      border-radius: 30px;
      transition: background 0.2s;
    }
    .top-nav a:hover {
      background: rgba(139,90,43,0.2);
      color: #b8860b;
    }
    .top-nav .nav-brand {
      font-family: 'Playfair Display', serif;
      font-size: 1.1rem;
      font-weight: 600;
      color: #b8860b;
    }
    .top-nav .nav-brand i { margin-right: 0.5rem; }

    @media (max-width: 992px) {
      .toc-sidebar { display: none; }
      .search-wrapper { border-radius: 40px; padding: 0.4rem 1.2rem; }
      .search-inner input { font-size: 0.95rem; }
    }
    @media (max-width: 768px) {
      .card-didactica { padding: 1.5rem 1rem; }
      .legado-grid { grid-template-columns: repeat(2, 1fr); }
      #btnSubir { width: 40px; height: 40px; font-size: 1.4rem; bottom: 1rem; right: 1rem; }
      .search-wrapper { border-radius: 30px; padding: 0.3rem 1rem; margin-bottom: 1.8rem; }
      .search-inner input { font-size: 0.9rem; padding: 0.4rem 0; }
      .search-results-dropdown { max-height: 350px; }
      .top-nav { padding: 0.6rem 1rem; }
      .top-nav a { font-size: 0.85rem; padding: 0.3rem 0.6rem; }
    }
    @media (max-width: 576px) {
      .container-custom { padding: 1rem 0.75rem; }
      .search-wrapper { border-radius: 24px; padding: 0.2rem 0.8rem; }
      .search-inner input { font-size: 0.85rem; }
      .result-item { padding: 0.6rem 1rem; }
      .top-nav { flex-direction: column; align-items: stretch; text-align: center; }
      .top-nav .nav-brand { text-align: center; }
    }