html {
    scroll-behavior: smooth; 
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 97vh;
    font-family: Georgia, 'Times New Roman', Times, serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #eeeefa;
}

/*Navegación*/
/* ==== MENÚ LATERAL DESLIZABLE ==== */
header nav {
    display: flex;
    flex-direction: column;
    width: 300px;
    font-size: 16px;
    position: fixed;
    top: 160px;       /* debajo del logo y la barra */
    left: 10px;
    border-radius: 20px;
    background-color: #35424a;
    height: calc(100vh - 180px); /* resta altura del logo + búsqueda */
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #598aa8 #35424a;
}

/* Scrollbar WebKit */
header nav::-webkit-scrollbar {
    width: 8px;
}
header nav::-webkit-scrollbar-track {
    background: #35424a;
}
header nav::-webkit-scrollbar-thumb {
    background-color: #598aa8;
    border-radius: 10px;
}
header nav::-webkit-scrollbar-thumb:hover {
    background-color: #7ab1d0;
}

/* ==== LOGO FIJO ==== */
header img#Solids-Menu {
    width: 300px;
    height: 118px;
    position: fixed;
    top: 15px;
    left: 10px;
    border-radius: 20px;
    box-shadow: 0 2px 2px #adb7bd;
    z-index: 10;
}
header img#Solids-Menu:hover {
    transform: scale(1.03);
    transition: transform 0.1s ease-in-out;
}

/* ==== BARRA DE BÚSQUEDA FIJA ==== */
.search {
    position: fixed;
    top: 150px;        /* justo debajo del logo */
    left: 10px;
    width: 300px;
    height: 35px;
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 20px;
    border: 1.5px solid #598aa8;
    box-shadow: 0 2px 2px #bbe0f7;
    z-index: 20;
}

.search:focus-within {
    border: 2px solid #598aa8;
    box-shadow: 0 2px 2px #bbe0f7;
}

.barra {
    display: flex;
    align-items: center;
    height: 30px;
    width: 98%;
    position: relative;
}

.barra input {
    flex: 1;
    border: none;
    outline: none;
    background-color: white;
    font-size: 15px;
    border-radius: 20px;
    padding-right: 10px;
}

#lupa {
    padding: 10px 5px 10px 15px;
    font-size: 20px;
    font-weight: bolder;
    color: #35424a;
}

/* ==== ESTILO ORIGINAL DEL HISTORIAL ==== */
/* === Scrollbar del historial (estilo clásico claro) === */
.search-history::-webkit-scrollbar {
    width: 10px;
}

.search-history::-webkit-scrollbar-track {
    background: #f5f5f5; /* fondo suave, gris claro */
    border-radius: 10px;
}

.search-history::-webkit-scrollbar-thumb {
    background-color: #adb7bd; /* gris medio elegante */
    border-radius: 10px;
    border: 2px solid #f5f5f5; /* crea efecto “incrustado” */
}

.search-history::-webkit-scrollbar-thumb:hover {
    background-color: #909da5; /* un poco más oscuro al pasar el mouse */
}

/* Para Firefox */
.search-history {
    scrollbar-width: thin;
    scrollbar-color: #adb7bd #f5f5f5;
}

/*Logo*/
header nav img#Solids-Menu {
    width: 300px;
    height: 118px;
    position: fixed;
    top: 15px; 
    border-radius: 20px;
    box-shadow: 0 3px 4px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 2px #adb7bd;
}
header nav img#Solids-Menu:hover {
    transform: scale(1.03); 
    transition: transform 0.1s ease-in-out;
}

/*Search*/
.search {
    display: flex;
    align-items: center;
    height: 30px;
    background-color: white;
    border-radius: 20px;
    border: 1.5px solid #598aa8;
    box-shadow: 0 2px 2px #bbe0f7;
}
.search:focus-within {
    border: 2px solid #598aa8; 
    box-shadow: 0 2px 2px #bbe0f7;
}
.barra {
    display: flex; 
    align-items: center;
    height: 30px;
    width: 98%;
}
.barra input {
    flex: 1;
    border: none; 
    outline: none;
    background-color: white;
    font-size: 15px;
}
#lupa {
    padding: 10px 5px 10px 15px;
    font-size: 20px; 
    font-weight: bolder;
    color:#35424a;
}

/* --- MENÚ LATERAL PRINCIPAL --- */
.first-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 30px;
  padding-left: 0; /* 🔹 antes 10px */
  justify-content: space-around;
}

.first-list li {
  list-style: none;
  line-height: 40px;
  width: 100%;
  padding: 0 0 0 15px; /* 🔹 alineación más limpia */
  box-sizing: border-box;
  border-left: 4px solid transparent; /* 🔹 indicador lateral */
  transition: all 0.3s ease-in-out;
}

/* 🔥 Cambiar color del texto en hover */
.first-list li:hover > a {
    color: black !important;
}

.first-list li:hover {
  background-color: #d3d3d3 !important;
  border-left: 4px solid #598aa8 !important; /* 🔹 mantiene rectángulo */
  box-shadow: 0 2px 2px #bbe0f7 !important;
}

.first-list li.active {
  background-color: #d3d3d3;
  border-left: 4px solid #0e8168; /* 🔹 color al seleccionar */
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.1);
}

.first-list a {
  text-decoration: none;
  color: #d3d3d3;
  display: block;
  width: 100%;
  height: 100%;
  padding-left: 10px;
  box-sizing: border-box;
  transition: color 0.2s ease;
}

.first-list li.active > a {
  color: #023658;
}

/* --- SUBMENÚ --- */
.second-list {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  padding-left: 18px;            /* 🔹 antes 35px */
  margin-top: 2px;
  overflow: hidden;
  max-height: 0;
  background-color: #f5f6fb;     /* 🔹 tono más suave */
  border-left: none;             /* 🔹 elimina línea verde */
  border-radius: 6px;
  transition: all 0.25s ease-in-out;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.05); /* 🔹 leve relieve interior */
}

.second-list.active {
  display: flex;
  max-height: 300px;            /* 🔹 más compacto */
  padding: 4px 0;
}

.second-list li {
  list-style: none;
  line-height: 22px;            /* 🔹 antes 30px */
  margin: 2px 0;
  width: 100%;
}

.second-list a {
  color: #333;
  font-size: 15px;
  padding: 3px 0 3px 10px;
  text-decoration: none;
  width: 100%;
  display: block;
  transition: all 0.2s ease-in-out;
}

/* === Submenú activo (scroll-spy) === */
.second-list a.active {
  color: #0e8168;
  transform: translateX(4px);
  background-color: #e9edf8;
  border-radius: 4px;
  font-weight: bold;
}

/* --- TERCER NIVEL (third list) --- */
.tirth-list{
  display: none;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 2px;
  margin-left: 10px;
  padding-left: 14px;
  overflow: hidden;
  max-height: 0;
  background-color: #f5f6fb;
  border-radius: 6px;
  transition: all 0.25s ease-in-out;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.05);
}

.tirth-list.active{
  display: flex;
  max-height: 220px;
  padding: 4px 0;
}

.tirth-list li{
  list-style: none;
  line-height: 20px;
  margin: 2px 0;
  width: 100%;
}

.tirth-list a{
  color: #333;
  font-size: 14px;
  padding: 3px 0 3px 12px;
  text-decoration: none;
  width: 100%;
  display: block;
  transition: all 0.2s ease-in-out;
}

/* Triangulito para items de second-list que contienen third list */
.second-list > li.has-third > a{
  position: relative;
  padding-right: 26px;
}

.second-list > li.has-third > a::after{
  content: "▸";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  font-size: 16px;
  color: #adb7bd;
  transition: transform 0.25s ease, color 0.25s ease;
}

/* Cuando se despliega el tercer nivel */
.second-list > li.has-third.active-third > a::after{
  transform: translateY(-50%) rotate(90deg);
  color: #0e8168;
}

/*Menu*/
.burger-menu {
    display: none; 
}

/* === Chevron (v) en los títulos del menú === */
.first-list > li > a {
  position: relative;
  padding-right: 30px;   /* espacio para la v */
}

/* v por defecto (cerrado) */
.first-list > li > a::after {
  content: "▾";          /* v hacia abajo */
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  font-size: 20px;
  color: #adb7bd;
  transition: transform 0.25s ease, color 0.25s ease;
}

/* cuando el menú está abierto */
.first-list > li.active > a::after {
  transform: translateY(-50%) rotate(180deg); /* v hacia arriba */
  color: #0e8168;
}

/* Barra superior */
.top-bar {
    display: flex;
    justify-content: space-between;  
    align-items: center;
    color: #333;
    font-size: 16px;
    margin-bottom: -46px;
    margin-top: -20px; 
    position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    padding-top: 20px;
    padding-bottom: 20px;
    margin-right: 10px; 
    padding-right: -2px;
}
.left-content {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;      /* evita que baje a otra línea */
    white-space: nowrap;    /* evita saltos dentro del texto */
    flex: 1 1 auto;
    min-width: 0; 
}
.right-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.right-content .view-more p {
  margin: 0;              
  white-space: nowrap;     
}

.home-icon,
.settings-icon {
    color: #490734;
    font-size: 20px;
    display: flex;
    align-items: center;
    line-height: 1;
    background-color: #ffffff;
}
.home-icon:hover,
.settings-icon:hover {
    color: #9832a3;
    transform: scale(1.1);
}
.separator {
    margin: 0 5px;
    color: #490734;
}
.left-content .page-title p{
    color: #9832a3;
}
.right-content .view-more p{
    color: #0e8168;
}
.right-content .view-more p:hover {
    transform: scale(1.1); 
}
.settings-link {
    margin-left: 5px;            
}
.divider {
    margin-top: 30px;
    border-top: 1px solid #490734;
    position: sticky;
    top: 50px;
    z-index: 100;
    background: #ffffff;
    margin-bottom: -10px;
}
/*Contenido*/
.content {
    flex: 1;
    margin-left: 340px;   
    margin-right: 60px;     
    margin-top: 18px;
    padding: 20px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 2px 2px #adb7bd;
    max-width: none;            
}

.content a{
    text-decoration: none;
}
.texto a{
    color: #0e8168;
}
.texto a:hover {
    color:#9832a3;
}
.texto > div {
    display: none;
}

.texto > .Introduction {
    display: block;
}

.content h1{
    color: #110846;
}
.content h2{
    color: #110846;
}

h1, h2, h3, h4, h5, h6 {
    scroll-margin-top: 120px; 
}

/*Introducción*/
.image-container {
    display: flex; 
    justify-content: center; 
    margin: 20px 0; 
}
.Images {
    width: 100%; 
    max-width: 700px; 
    height: auto; 
    border-radius: 10px; 
    box-shadow: 0 3px 4px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 2px #adb7bd;
}
.Images:hover {
    transform: scale(1.03); 
    transition: transform 0.1s ease-in-out;
}
.lista-larga{
    margin-bottom: 35px;
    margin-top: 15px;
    margin-left: 100px;
    line-height: 20px;
}

/* Código python*/
.code-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 25px auto;
  font-size: 0.9em;
  width: 60%;
  max-width: 700px;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f5f5f5;
  padding: 10px 15px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.code-header .buttons {
  display: flex;
  gap: 6px;
}

.code-header .button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.button.red { background-color: #ff5f56; }
.button.yellow { background-color: #ffbd2e; }
.button.green { background-color: #27c93f; }

.copy-code {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.85em;
  color: #333;
  transition: all 0.2s ease-in-out;
}
.copy-code ion-icon {
  margin-right: 4px;
}
.copy-code:hover {
  color: #0e8168;
  transform: scale(1.05);
}

.code-container pre {
  width: calc(100% - 0px);
  background-color: #2d2d2d;
  color: #f8f8f2;
  margin: 0 !important;
  padding: 12px 15px;  
  overflow-x: auto;
  border-radius: 0 0 10px 10px; 
  box-shadow: 0 2px 2px #adb7bd;
  font-family: 'Fira Code', monospace;
}

.code-container pre code {
    margin: 0 !important;    
    padding: 0 !important; 
    display: block;                    
}

code.highLine{
    background-color: #d0e0ead5;
    color: #da0d0d;
    font-size: 14px;
    padding: 0.15em 0.3em;
    border-radius: 4px; 
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}

th, td {
  border: 1px solid #ccc;
  padding: 0.5em 0.75em;
  text-align: left;
}

th {
  background-color: #f2f2f2;
  font-weight: 600;
}

tbody tr:nth-child(even) {
  background-color: #fafafa;
}
/* =========================
   PDF Modal (Preview + Download)
   ========================= */

.pdf-actions{
  margin-top: 12px;
  margin-bottom: 10px;
}

.btn-pdf{
  border: none;
  cursor: pointer;
  background: #0e8168;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-pdf:hover{
  transform: translateY(-1px);
  opacity: 0.95;
}

.pdf-modal{
  position: fixed;
  inset: 0;
  display: none;         /* se activa con .is-open */
  z-index: 9999;
}

.pdf-modal.is-open{
  display: block;
}

.pdf-modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}

.pdf-modal__dialog{
  position: relative;
  width: min(1200px, 92vw);
  height: min(100vh, 720px);
  margin: 0.2vh auto 0 auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pdf-modal__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 7px;
  border-bottom: 1px solid #e9e9ef;
  background: #ffffff;
}

.pdf-modal__header h3{
  margin: 0;
  font-size: 1rem;
  color: #110846;
}

.pdf-modal__header-actions{
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-download{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: #110846;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-download:hover{
  transform: translateY(-1px);
  opacity: 0.95;
}

.btn-close{
  border: none;
  cursor: pointer;
  background: transparent;
  color: #333;
  font-size: 1.2rem;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.btn-close:hover{
  background: #f2f2f6;
}

.pdf-modal__body{
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pdf-frame{
  flex: 1;
  width: 100%;
  border: none;
}

.pdf-fallback{
  margin: 0;
  padding: 10px 14px;
  font-size: 0.9rem;
  background: #fafafe;
  border-top: 1px solid #e9e9ef;
}

@media (max-width: 520px){
  .pdf-modal__dialog{
    margin-top: 6vh;
    height: 84vh;
  }
}

/* Botón Scroll to Top */
#scrollTopBtn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background-color: #0e8168;
  color: white;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease-in-out;
  z-index: 9999;
}

/* Mostrar botón */
#scrollTopBtn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  animation: floatUp 1.6s ease-in-out infinite;
}

/* Hover */
#scrollTopBtn:hover {
  background-color: #490734;
  transform: scale(1.1);
}

/*Final*/
footer {
    margin-left: 335px; 
    margin-right: 58px; 
    padding: 2px 0; 
    height: 25px; 
}
.version{
    color: #ffffff;
    text-align: center;
    background: #35424a;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    height: 25px;
}


/* =====================================================
   CSS VARIABLES — THEME SYSTEM
   ===================================================== */
:root {
  --th-bg:      #eeeefa;
  --th-content: #ffffff;
  --th-nav:     #35424a;
  --th-text:    #222222;
  --th-link:    #0e8168;
  --th-heading: #110846;
  --th-code:    #d0e0ea;
  --th-border:  #e0e0e0;
}

/* ─── DARK THEME ──────────────────────────────────── */
[data-theme="dark"] body            { background-color: #0d1117; }
[data-theme="dark"] .content        { background-color: #161b22 !important; color: #e6edf3 !important; }
[data-theme="dark"] .content h1,
[data-theme="dark"] .content h2,
[data-theme="dark"] .content h3,
[data-theme="dark"] .content h4     { color: #cdd9e5 !important; }
[data-theme="dark"] .content p,
[data-theme="dark"] .content li,
[data-theme="dark"] .content td,
[data-theme="dark"] .content th     { color: #e6edf3 !important; }
[data-theme="dark"] .texto a        { color: #58a6ff !important; }
[data-theme="dark"] .texto a:hover  { color: #79c0ff !important; }
[data-theme="dark"] code.highLine   { background-color: #2d3748 !important; color: #79c0ff !important; }
[data-theme="dark"] table           { border-color: #30363d; }
[data-theme="dark"] th              { background-color: #21262d !important; color: #cdd9e5 !important; border-color: #30363d; }
[data-theme="dark"] td              { border-color: #30363d; }
[data-theme="dark"] tbody tr:nth-child(even) { background-color: #1c2128 !important; }
[data-theme="dark"] .top-bar        { background: #161b22 !important; }
[data-theme="dark"] .divider        { border-color: #30363d !important; background: #161b22 !important; }
[data-theme="dark"] .code-container .code-header { background-color: #21262d !important; }
[data-theme="dark"] .copy-code      { color: #8b949e !important; }
[data-theme="dark"] .copy-code:hover { color: #58a6ff !important; }
[data-theme="dark"] .separator,
[data-theme="dark"] #pg-section     { color: #79c0ff !important; }
[data-theme="dark"] #sub-label      { color: #8b949e !important; }
[data-theme="dark"] .home-icon,
[data-theme="dark"] .settings-icon  { color: #58a6ff !important; background: #161b22 !important; }
[data-theme="dark"] .right-content .view-more p { color: #58a6ff !important; }
[data-theme="dark"] #mobile-title-bar { background: #161b22 !important; border-color: #30363d !important; color: #79c0ff !important; }
[data-theme="dark"] footer .version { background: #0d1117 !important; }
[data-theme="dark"] #reading-progress { background: linear-gradient(90deg, #58a6ff, #79c0ff) !important; }

/* ─── SEPIA THEME ─────────────────────────────────── */
[data-theme="sepia"] body            { background-color: #f4ecd8; }
[data-theme="sepia"] .content        { background-color: #fdf6e3 !important; color: #3b2a1a !important; }
[data-theme="sepia"] .content h1,
[data-theme="sepia"] .content h2,
[data-theme="sepia"] .content h3    { color: #2a1a0a !important; }
[data-theme="sepia"] .texto a       { color: #8b5e3c !important; }
[data-theme="sepia"] code.highLine  { background-color: #e8dcc8 !important; color: #5a3010 !important; }

/* ─── HIGH CONTRAST ───────────────────────────────── */
[data-theme="contrast"] .content     { background-color: #ffffff !important; color: #000000 !important; }
[data-theme="contrast"] .content h1,
[data-theme="contrast"] .content h2,
[data-theme="contrast"] .content h3  { color: #000000 !important; }
[data-theme="contrast"] .texto a     { color: #0000cc !important; }

/* ─── NO ANIMATIONS ──────────────────────────────── */
body.no-animations * { animation: none !important; transition: none !important; }
body.no-animations [data-aos] { opacity: 1 !important; transform: none !important; }

/* =====================================================
   READING PROGRESS BAR
   ===================================================== */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #0e8168, #9832a3);
  z-index: 99999;
  transition: width 0.1s ease;
  border-radius: 0 2px 2px 0;
}

/* =====================================================
   IMAGE ZOOM OVERLAY
   ===================================================== */
#img-zoom-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 99998;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 24px;
}
#img-zoom-overlay.open { display: flex; }
#img-zoom-img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  object-fit: contain;
  animation: zoomIn 0.2s ease;
}
@keyframes zoomIn { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#img-zoom-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-size: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
#img-zoom-close:hover { background: rgba(255,255,255,0.28); }

/* =====================================================
   BREADCRUMB SUBSECTION
   ===================================================== */
.sub-sep { color: #adb7bd; margin: 0 2px; }
#sub-label {
  color: #9832a3;
  font-size: 0.9em;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* =====================================================
   SEARCH RESULTS PANEL
   ===================================================== */
#search-results-panel {
  position: fixed;
  top: 195px;
  left: 10px;
  width: 300px;
  max-height: 440px;
  background: #ffffff;
  border-radius: 16px;
  border: 1.5px solid #598aa8;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  z-index: 5000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: Georgia, serif;
  animation: srp-in 0.18s ease;
}
#search-results-panel.open { display: flex; }
@keyframes srp-in { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }

.srp-header {
  display: flex; align-items: center; padding: 9px 12px;
  background: #35424a; border-radius: 14px 14px 0 0; gap: 8px; flex-shrink: 0;
}
.srp-title  { color: #d3d3d3; font-size: 13px; font-weight: bold; flex: 1; }
.srp-count  { color: #0e8168; font-size: 12px; white-space: nowrap; }
.srp-close  {
  background: transparent; border: none; color: #aaa; cursor: pointer;
  font-size: 15px; width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.srp-close:hover { background: rgba(255,255,255,0.18); color: #fff; }

.srp-list {
  overflow-y: auto; padding: 4px 0; flex: 1;
  scrollbar-width: thin; scrollbar-color: #adb7bd #f5f5f5;
}
.srp-list::-webkit-scrollbar { width: 5px; }
.srp-list::-webkit-scrollbar-thumb { background: #adb7bd; border-radius: 10px; }

.srp-group { padding-bottom: 4px; border-bottom: 1px solid #eee; margin-bottom: 2px; }
.srp-group:last-child { border-bottom: none; }
.srp-group-title {
  display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: bold; color: #598aa8; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 4px 12px; background: #f0f4f8;
}
.srp-item {
  display: flex; align-items: flex-start; gap: 4px;
  font-size: 12.5px; color: #333; padding: 5px 12px;
  cursor: pointer; border-left: 3px solid transparent; transition: all 0.14s; line-height: 1.4;
}
.srp-item:hover { background: #f0f4f8; border-left-color: #0e8168; color: #0e8168; }
.srp-item mark { background: #d8b9f2; color: #490734; padding: 0 1px; border-radius: 2px; font-style: normal; }
.srp-heading  { font-weight: bold; }
.srp-type     { color: #9832a3; font-weight: bold; flex-shrink: 0; }
.srp-more     { font-size: 11px; color: #9832a3; padding: 2px 12px; font-style: italic; }
.srp-empty    { padding: 16px 12px; font-size: 13px; color: #888; text-align: center; }

/* History items */
.srp-history { justify-content: space-between; }
.srp-hist-term { flex: 1; color: #555; }
.srp-hist-del  {
  background: none; border: none; color: #bbb; cursor: pointer;
  font-size: 16px; line-height: 1; padding: 0 2px; flex-shrink: 0;
}
.srp-hist-del:hover { color: #e05050; }

/* Highlight in content */
.srp-highlight { background: #d8b9f2; color: #490734; border-radius: 2px; }
.srp-highlight.srp-active {
  background: #9832a3; color: #fff; outline: 2px solid #490734; border-radius: 3px;
}

/* =====================================================
   SETTINGS PANEL
   ===================================================== */
#settings-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 8000;
  animation: fade-in 0.2s ease;
}
#settings-backdrop.open { display: block; }
@keyframes fade-in { from { opacity:0; } to { opacity:1; } }

#settings-panel {
  position: fixed; top: 0; right: -380px; width: 340px; height: 100vh;
  background: #fff; box-shadow: -6px 0 30px rgba(0,0,0,0.2);
  z-index: 8001; transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto; display: flex; flex-direction: column;
  font-family: Georgia, serif;
}
#settings-panel.open { right: 0; }

.sp-header {
  display: flex; align-items: center; padding: 16px 18px;
  background: #35424a; gap: 10px; position: sticky; top: 0; z-index: 2; flex-shrink: 0;
}
.sp-title { color: #fff; font-size: 16px; font-weight: bold; flex: 1; letter-spacing: 0.3px; }
.sp-close {
  background: transparent; border: 2px solid rgba(255,255,255,0.25); color: #fff;
  cursor: pointer; font-size: 15px; width: 32px; height: 32px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.sp-close:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.5); }

.sp-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.sp-section {
  border: 1px solid #e8eef3; border-radius: 12px; padding: 12px 14px;
  background: #fafbfc;
}
.sp-section-title {
  font-size: 10.5px; font-weight: bold; text-transform: uppercase;
  letter-spacing: 1px; color: #598aa8; margin-bottom: 12px;
}
.sp-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid #f0f0f0; gap: 12px;
}
.sp-row:last-child { border-bottom: none; padding-bottom: 0; }
.sp-row label { font-size: 13px; color: #444; flex: 1; }

/* Font +/− controls */
.sp-control { display: flex; align-items: center; gap: 8px; }
.sp-font-btn {
  width: 32px; height: 32px; border: 1.5px solid #ddd; border-radius: 8px;
  background: #fff; cursor: pointer; font-weight: bold; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; color: #35424a;
}
.sp-font-btn:hover { border-color: #0e8168; color: #0e8168; background: #f0faf7; }
#sp-font-label { font-size: 13px; color: #666; min-width: 36px; text-align: center; }

/* Theme buttons */
.sp-theme-row { flex-direction: column; align-items: flex-start; gap: 8px; }
.sp-themes { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-theme-btn {
  padding: 6px 11px; border: 1.5px solid #ddd; border-radius: 8px;
  cursor: pointer; background: #fff; font-size: 12px;
  transition: all 0.18s; color: #444;
}
.sp-theme-btn:hover { border-color: #0e8168; color: #0e8168; }
.sp-theme-btn.active { border-color: #0e8168; background: #0e8168; color: #fff; }

/* Toggle switch */
.sp-toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.sp-toggle input { opacity: 0; width: 0; height: 0; }
.sp-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #ccc; border-radius: 24px; transition: 0.28s;
}
.sp-slider::before {
  content: ""; position: absolute;
  width: 18px; height: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: 0.28s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.sp-toggle input:checked + .sp-slider { background: #0e8168; }
.sp-toggle input:checked + .sp-slider::before { transform: translateX(18px); }

/* About section */
.sp-about { text-align: center; }
.sp-about-text { font-size: 13px; color: #555; margin: 4px 0; line-height: 1.5; }
.sp-webmaster {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 12px 0 6px;  padding: 10px 14px;
  background: linear-gradient(135deg, #110846 0%, #490734 100%);
  border-radius: 10px;
}
.sp-wm-badge { font-size: 12px; color: #adb7bd; flex-shrink: 0; }
.sp-wm-name  { color: #fff; font-weight: bold; font-size: 14px; text-decoration: none; }
.sp-wm-name:hover { text-decoration: underline; color: #bbe0f7; }
.sp-github-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: #0e8168; text-decoration: none;
  padding: 5px 12px; border: 1.5px solid #0e8168; border-radius: 20px;
  transition: all 0.2s; margin-top: 6px;
}
.sp-github-link:hover { background: #0e8168; color: #fff; }
.sp-version { font-size: 11px; color: #aaa; margin-top: 8px; }

/* =====================================================
   RESPONSIVE — RIGHT-CONTENT margins
   ===================================================== */
@media (min-width: 1201px) and (max-width: 1500px) { .right-content { margin-left: 75%; } }
@media (min-width: 901px)  and (max-width: 1200px) { .right-content { margin-left: 60%; } }
@media (min-width: 801px)  and (max-width: 900px)  { .right-content { margin-left: 38%; } }

/* =====================================================
   TABLET (801 – 1000px) — sidebar still shows, smaller
   ===================================================== */
@media (min-width: 801px) and (max-width: 1000px) {
  header nav { width: 220px; font-size: 14px; top: 138px; left: 8px; height: calc(100vh - 158px); }
  header img#Solids-Menu { width: 220px; height: auto; top: 12px; left: 8px; }
  .search { top: 126px; left: 8px; width: 220px; }
  .content { margin-left: 240px; margin-right: 14px; }
  footer  { margin-left: 240px; margin-right: 14px; }
  .burger-menu { display: none !important; }
}

/* =====================================================
   MOBILE (≤ 800px) — full rebuild
   ===================================================== */
@media (max-width: 800px) {

  /* ── NAV BAR ─── */
  header nav {
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    width: 100% !important;
    height: 60px !important;
    min-height: 60px;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-radius: 0 !important;
    z-index: 9999 !important;
    padding: 0 12px !important;
    box-sizing: border-box;
    overflow: visible !important;
    background-color: #35424a !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  }
  [data-theme="dark"] header nav { background-color: #0d1117 !important; }

  /* Logo */
  header img#Solids-Menu {
    position: static !important;
    width: 42px !important; height: 42px !important;
    border-radius: 10px !important;
    margin: 0 !important;
    object-fit: cover;
    order: 1; flex-shrink: 0;
  }

  /* Hide desktop search in nav */
  header nav .search { display: none !important; }

  /* Hamburger */
  .burger-menu {
    display: flex !important; order: 3; flex-shrink: 0;
    align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border: 2px solid rgba(255,255,255,0.2) !important;
    border-radius: 10px;
    background: transparent !important;
    color: #ffffff !important;
    font-size: 1.5rem !important;
    cursor: pointer; margin: 0 !important;
    transition: background 0.2s, border-color 0.2s;
  }
  .burger-menu:hover, .burger-menu:focus {
    background: rgba(255,255,255,0.12) !important;
    border-color: rgba(255,255,255,0.4) !important;
    outline: none;
  }

  /* Nav title (center of nav bar) */
  .nav-mobile-title {
    display: flex; order: 2; flex: 1;
    justify-content: center; align-items: center;
    color: #d3d3d3; font-size: 14px; font-weight: bold;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px;
  }

  /* ── DROPDOWN MENU ─── */
  .first-list {
    position: fixed !important;
    top: 60px !important; left: 0 !important; right: 0 !important;
    width: 100% !important; z-index: 9998 !important;
    background: #2b363d !important;
    flex-direction: column !important; align-items: stretch !important;
    text-align: left !important; margin: 0 !important; padding: 0 !important;
    display: none !important;
    max-height: calc(100vh - 60px); overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  }
  [data-theme="dark"] .first-list { background: #0d1117 !important; }

  .first-list.active { display: flex !important; }

  .first-list > li {
    width: 100% !important; border-left: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.07) !important;
    padding: 0 !important; line-height: 1 !important;
    opacity: 0; transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .first-list > li.show { opacity: 1 !important; transform: translateY(0) !important; }

  .first-list > li > a {
    display: flex !important; align-items: center;
    justify-content: space-between; padding: 15px 20px !important;
    font-size: 15px !important; color: #d3d3d3 !important;
    box-sizing: border-box; width: 100%;
  }
  .first-list > li > a::after { right: 18px !important; }
  .first-list > li:hover > a { color: #fff !important; background: rgba(255,255,255,0.06) !important; }
  .first-list > li.active > a { color: #0e8168 !important; background: rgba(14,129,104,0.1) !important; }

  .second-list {
    background: rgba(0,0,0,0.2) !important;
    padding-left: 0 !important; border-left: 3px solid #0e8168 !important;
    margin-left: 20px !important; border-radius: 0 !important;
  }
  .second-list li { line-height: 1 !important; }
  .second-list a  { color: #b0bec5 !important; font-size: 14px !important; padding: 10px 14px !important; }
  .second-list a:hover { color: #0e8168 !important; }
  .second-list a.active { color: #0e8168 !important; font-weight: bold; }

  /* ── CONTENT ─── */
  .content {
    margin-left: 8px !important; margin-right: 8px !important;
    margin-top: 106px !important; /* 60px nav + 46px title bar */
    margin-bottom: 16px !important;
    padding: 16px 14px !important;
    border-radius: 14px !important; box-sizing: border-box;
  }
  .top-bar {
    position: sticky !important; top: 60px !important; z-index: 800 !important;
    margin-top: 0 !important; margin-bottom: -30px !important;
    padding-top: 10px !important; padding-bottom: 10px !important;
    font-size: 13px;
  }
  #sub-label { max-width: 120px; font-size: 12px; }
  .right-content { margin-left: auto !important; gap: 6px; }
  .right-content .view-more { display: none; }

  /* ── MOBILE TITLE BAR ─── */
  #mobile-title-bar {
    display: flex; align-items: center;
    position: fixed; top: 60px; left: 0; right: 0;
    height: 38px; z-index: 899;
    background: #ffffff; border-bottom: 2px solid #490734;
    padding: 0 14px; font-size: 13px; font-weight: bold; color: #9832a3;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  [data-theme="dark"] #mobile-title-bar { background: #161b22 !important; border-color: #30363d !important; color: #79c0ff !important; }
  #mobile-current-section::before { content: "📍 "; }

  /* ── TABLES ─── */
  table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 13px; }
  th, td { padding: 6px 10px; min-width: 80px; }

  /* ── CODE BLOCKS ─── */
  .code-container { width: 100% !important; margin: 16px 0 !important; }
  .code-container pre { font-size: 12px !important; padding: 10px 12px !important; overflow-x: auto; }

  /* ── IMAGES ─── */
  .Images { max-width: 100% !important; }

  /* ── TYPOGRAPHY ─── */
  .content h1 { font-size: 1.5rem; }
  .content h2 { font-size: 1.25rem; }
  .content h3 { font-size: 1.1rem; }

  /* ── FOOTER ─── */
  footer { margin-left: 8px !important; margin-right: 8px !important; }
  .version { font-size: 11.5px; }

  /* ── SCROLL TOP BTN ─── */
  #scrollTopBtn { bottom: 16px; right: 14px; width: 42px; height: 42px; font-size: 18px; }

  /* ── SEARCH PANEL (mobile) ─── */
  #search-results-panel {
    left: 8px !important; right: 8px !important;
    width: auto !important; transform: none !important;
    top: 60px !important; max-height: 55vh;
  }

  /* ── SETTINGS PANEL (mobile — full width) ─── */
  #settings-panel { width: 100vw !important; right: -100vw !important; }
  #settings-panel.open { right: 0 !important; }
  /* Ensure close button is always visible */
  .sp-header { position: sticky !important; top: 0 !important; z-index: 10 !important; }
  .sp-close  { border: 2px solid rgba(255,255,255,0.5) !important; }

  /* ── IMAGE ZOOM ─── */
  #img-zoom-overlay { padding: 12px; }
}

/* =====================================================
   VERY SMALL PHONES (≤ 400px)
   ===================================================== */
@media (max-width: 400px) {
  .content { margin-left: 4px !important; margin-right: 4px !important; padding: 12px 10px !important; }
  .content h1 { font-size: 1.3rem; }
  header img#Solids-Menu { width: 36px !important; height: 36px !important; }
}
