:root{
  --bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-100: #dbeafe;
  --card: #f9fafb;
   --header-height: 72px; /* ajusta si tu header cambia */
}

*{ box-sizing: border-box; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
html, body{
  height: 100%;
  overflow-y: auto;
}


.topbar{
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
.topbar__inner{
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 14px 24px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 18px;
}
.brand{
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  font-size: 22px;
}
.nav{
  flex: 1;
  display:flex;
  justify-content: center;   /* centra el bloque de links */
  gap: 12px;
  flex-wrap: wrap;
}
.nav__link{
  text-decoration:none;
  color: var(--muted);
  font-size: 14px;
  padding: 7px 10px;
  border-radius: 8px;
}
.nav__link.is-active{
  background: var(--primary-100);
  color: var(--primary);
  font-weight: 600;
}

.btn{
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}
.btn--primary{
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn--wide{
  width: 220px;
}

.page{
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px 18px 40px;
}

.hero{
  padding: 30px 0 10px;
  text-align: center;
}
.hero__title{
  font-size: 56px;
  margin: 12px 0 8px;
}
.hero__subtitle{
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}
.hero__badges{
  margin-top: 18px;
  display:flex;
  justify-content:center;
  gap: 24px;
  flex-wrap: wrap;
}
.badge{
  color: var(--muted);
  display:flex;
  gap: 8px;
  align-items:center;
}

.section{
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.section--muted{
  background: #f8fafc;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 34px 18px;
  margin: 0 -18px;
}
.section__title{
  text-align:center;
  font-size: 28px;
  margin: 0 0 18px;
}

.cards3{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.cards2{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.card--primary{
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.card--primary .card__text,
.card--primary .card__list{
  color: #fff;
}
.card__title{
  margin: 0 0 8px;
}
.card__text{
  margin: 0 0 12px;
  color: var(--muted);
}
.card__list{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.usecases{
  max-width: 700px;
  margin: 0 auto;
  text-align:center;
}
.usecases__title{ margin: 14px 0; }
.usecases__list{
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  color: var(--muted);
}
.usecases__list li{ margin: 8px 0; }

.footer{
  border-top: 1px solid var(--line);
  padding: 26px 0;
  color: var(--muted);
}
.footer__cols{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.footer h4{
  color: var(--text);
  margin: 0 0 8px;
}
.footer__copy{
  margin-top: 18px;
  font-size: 13px;
}

/* Responsive */
@media (max-width: 900px){
  .cards3{ grid-template-columns: 1fr; }
  .cards2{ grid-template-columns: 1fr; }
  .topbar__inner{ align-items:flex-start; }
  .hero__title{ font-size: 40px; }
}

/* Dropdown */
.dropdown{
  position: relative;
  display: inline-block;
}

.dropdown__menu{
  position: absolute;
  top: 150%;
  left: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,.10);
  padding: 8px;
  margin-top: 0;
  display: none;
  z-index: 999;
}

.dropdown__item{
  display: block;
  padding: 10px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
}

.dropdown__item:hover{
  background: var(--primary-100);
  color: var(--primary);
}

/* Mostrar al hover (desktop) */
.dropdown:hover .dropdown__menu{
  display: block;
}

/* Si quieres que el link de categoría también tenga hover similar */
.dropdown .nav__link:hover{
  background: var(--primary-100);
  color: var(--primary);
}
.dropdown::after{
  content: "";
  position: absolute;
  left: 0;
  top: 100%;
  width: 100%;
  height: 10px;   /* zona invisible */
}
.dropdown:hover > .nav__link{
  background: var(--primary-100);
  color: var(--primary);
}

.calculator{
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* GRID PRINCIPAL */

.calculator__bottom{
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  margin-bottom: 24px;
}


/* PANELES */
.panel{
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.panel__title{
  font-size: 18px;
  margin-bottom: 12px;
}


/* GRÁFICA */
.panel--graph{
  min-height: 500px;
  height: 100%;
  background: #f8fafc;
}


#graph-container{
  width: 100%;
  height: 100%;
  background: #f8fafc;
  border-radius: 10px;
}

/* INFO */
.panel--info{
  min-height: 160px;
}

/* RESULTADOS */
.panel--results{
  min-height: 160px;
}

/* CALCULADORA */
.calculator__keyboard{
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.math-keyboard{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  background: #f8fafc;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  width: 420px;
}

/* grupos */
.math-keyboard__group{
  display: grid;
  gap: 8px;
}

.math-keyboard__group--vars{
  grid-template-columns: repeat(4, 1fr);
}

.math-keyboard__group--nums{
  grid-template-columns: repeat(5, 1fr);
}

/* botones */
.math-keyboard button{
  height: 32px;
  min-width: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;   /* 🔥 centra texto */
}


.math-keyboard button:hover{
  background: var(--primary-100);
}

/* operadores */
.math-keyboard .op{
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.math-keyboard .op:hover{
  background: #1e4fd8;
}

/* especiales */
.math-keyboard .equal{
  grid-column: span 1;
  background: var(--primary);
  color: #fff;
  font-weight: bold;
}

.math-keyboard .clear{
  grid-column: span 1;
  background: #ef4444;
  color: #fff;
}

.math-keyboard .back{
  background: #e5e7eb;
}


/* ===== PAGE ===== */
.calculator-page{
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px 48px;
}



/* ===== TOP ===== */


/* stack izquierdo */
.left-stack{
  display: flex;
  flex-direction: column;
  gap: 16px;
}


/* stack izquierdo */
.left-stack{
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* =======================
   PANELS
======================= */

.panel{
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}

.panel__title{
  font-size: 18px;
  margin-bottom: 12px;
}

/* Inputs */
.panel--inputs{
  min-height: 160px;
}

/* Info */




#graph-container{
  width: 100%;
  height: 100%;
  background: #f8fafc;
  border-radius: 12px;
}

/* =======================
   BOTTOM SECTION
======================= */

.calculator-bottom{
  display: grid;
  grid-template-columns: 1fr minmax(300px, 420px);
  gap: 24px;
  align-items: start;
}


/* Procedimientos */
.panel--results{
  max-height: 280px;
  min-height: 200px;
  overflow-y: auto;
}

/* =======================
   KEYBOARD
======================= */

.panel--keyboard{
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.math-keyboard{
  width: 100%;
  max-width: 420px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  background: #f8fafc;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
}
.calculator-top {
    position: relative;
    height: 500px;
}


/* =======================
   RESPONSIVE
======================= */

@media (max-width: 1200px){
  .calculator-top{
    grid-template-columns: 300px 1fr;
  }

  .calculator-bottom{
    grid-template-columns: 1fr 360px;
  }
}

@media (max-width: 900px){
  .calculator-top,
  .calculator-bottom{
    grid-template-columns: 1fr;
  }

  .panel--keyboard{
    justify-content: center;
  }

  .panel--graph{
    max-height: 50vh;
  }

  .panel--results{
    max-height: 220px;
  }
}
@media (max-width: 900px){
  .calculator{
    gap: 16px;
  }

  .calculator-top,
  .calculator-bottom{
    grid-template-columns: 1fr;
  }

  .panel--graph{
    min-height: 320px;
  }

  .panel--keyboard{
    justify-content: center;
  }
}
.page--wide{
  max-width: 100%;
  padding: 20px 32px;
}

.math-keyboard .enter{
  grid-row: span 1;     /* ocupa dos filas */
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  border-radius: 12px;
}

.math-keyboard .enter:hover{
  background: #1e4fd8;
}

/*Plano cartesiano -- Estilos*/

#graph-container{
  width: 100%;
  height: 100%;
}

#cartesianChart{
  width: 100%;
  height: 100%;
}



/*Sección para formulario Ecuaciiones no lineales */
/* ===== PANEL INPUTS ===== */

.panel--inputs {
    padding: 12px;
}

/* Form más compacto */
#dynamic-form form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#dynamic-form label {
    font-size: 12px;
    margin-bottom: 2px;
}

#dynamic-form input {
    padding: 6px 8px;
    font-size: 12.5px;
    border-radius: 6px;
}

#dynamic-form button {
    padding: 7px;
    font-size: 12.5px;
    margin-top: 6px;
}

/* ===== METHOD INFO CARD ===== */

.method-card {
    background: #f5f6f8;
    border: 1px solid #e1e3e8;
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    font-size: 14px;
    line-height: 1.5;
}

/* Encabezado con icono */
.method-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

/* Icono circular tipo info */
.method-card-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e4e6eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
    color: #555;
}

/* Título del método */
.method-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: #2d3748;
}

/* Texto descriptivo */
.method-card p {
    margin: 6px 0;
    color: #555;
}

/* Resaltado en texto */
.method-card strong {
    font-weight: 600;
    color: #333;
}
/* ===== CONTENEDOR SUPERIOR ===== */

.calculator-top {
    position: relative;
    height: 500px; /* altura fija estable */
}

/* ===== PANEL GRÁFICO ===== */


/* Si tienes canvas o graph-container */
#graph-container {
    width: 100%;
    height: 100%;
}
.left-stack {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 320px;
    z-index: 5;
}

.calculator-bottom {
    margin-top: 0px;
}
.calculator-top {
    margin-bottom: 0px;
}
.calculator-top {
    position: relative;
    height: 65vh; /* dinámico pero estable */
}


.calculator-top {
    position: fixed;
    top: 70px; /* altura de tu header */
    left: 0;
    width: 100%;
    height: calc(100vh - 70px);
    z-index: 1;
}
.panel--graph,
#graph-container {
    width: 100%;
    height: 100%;
}
.left-stack {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 320px;
    z-index: 10;
}
.calculator-bottom {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 75%;
    display: flex;
    gap: 20px;
    z-index: 10;
}.left-stack {
    width: clamp(280px, 22vw, 360px);
}
.calculator-bottom {
    width: clamp(600px, 75vw, 1200px);
}
.calculator-bottom {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.calculator-bottom {
    position: fixed;
    bottom: 20px;
    right: 20px;   /* 👈 lo ancla a la derecha */
    display: flex;
    gap: 20px;
    z-index: 10;

    max-width: calc(100vw - 40px); /* evita desbordarse */
}
.calculator-bottom {
    position: fixed;
    bottom: 20px;
    right: 20px;

    width: clamp(500px, 55vw, 900px);
    display: flex;
    justify-content: flex-end;
    gap: 20px;
}
/* ===== FORM FILE ===== */

.file-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Labels */
.form-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Icono ayuda */
.help-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
}

/* Botón archivo */
.file-upload-btn {
    display: block;
    padding: 10px;
    border-radius: 8px;
    background: #e5e7eb;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.file-upload-btn:hover {
    background: #d1d5db;
}

/* Nombre archivo */
.file-name {
    font-size: 12px;
    color: #6b7280;
}

/* Inputs normales */
.file-form input[type="number"] {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 13px;
}

/* Botón principal */
.primary-btn {
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: #2563eb;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.primary-btn:hover {
    background: #1d4ed8;
}

.file-success {
    margin-top: 8px;
    padding: 8px;
    background-color: #e6f7ec;
    color: #1e7e34;
    border-radius: 6px;
    font-size: 0.9rem;
}

.file-error {
    margin-top: 8px;
    padding: 8px;
    background-color: #fdecea;
    color: #c82333;
    border-radius: 6px;
    font-size: 0.9rem;
}
/*Diseño para procedimiento de matiz para Sistema de Ec. Lineales*/

.matrix-table {
    border-collapse: collapse;
    margin-bottom: 20px;
}

.matrix-table td {
    border: 1px solid #ccc;
    padding: 6px 12px;
    text-align: center;
}

.matrix-b {
    border-left: 3px solid black;
}

.solution-box {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 6px;
}

/*Creamos un pop-up para poder ver los pasos de mejor manera*/

.modal-gauss{
  display:none;
  position:fixed;
  z-index:9999;
  left:0;
  top:0;
  width:100%;
  height:100%;
  background-color:rgba(0,0,0,0.6);
}

.modal-content-gauss{
  background:white;
  margin:5% auto;
  padding:25px;
  width: clamp(700px, 80vw, 1400px);
  border-radius:10px;
  max-height:80vh;
  overflow-y:auto;
}

.close-gauss{
  float:right;
  font-size:28px;
  cursor:pointer;
}

/* ===== CONTENEDOR DE PASOS ===== */

.gauss-steps{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 20px;
    width: 100%;
}

/* limitar a máximo 3 columnas en pantallas grandes */
@media (min-width: 1200px){
  .gauss-steps{
      grid-template-columns: repeat(3, 1fr);
  }
}

/* 2 columnas si el espacio lo permite */
@media (max-width: 1199px) and (min-width: 700px){
  .gauss-steps{
      grid-template-columns: repeat(2, 1fr);
  }
}

/* 1 columna en pantallas pequeñas */
@media (max-width: 699px){
  .gauss-steps{
      grid-template-columns: 1fr;
  }
}

/* ===== CADA PASO ===== */

.gauss-step{
    width: 100%;
    min-width: 0;
}

/* ===== TABLA MATRIZ ===== */

.matrix-table{
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    table-layout: fixed;
}

.matrix-table td{
    border: 1px solid #ccc;
    padding: 6px 10px;
    text-align: center;
    font-size: clamp(12px, 0.9vw, 14px);
}

/* línea del vector B */
.matrix-b{
    border-left: 3px solid black;
}

/* ===== OPERACIÓN ===== */

.row-operation{
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: #1f2937;
}

/* ===== SOLUCIÓN ===== */

.solution-box{
    display: inline-block;
    margin-top: 25px;
    background: #f5f5f5;
    padding: 15px 20px;
    border-radius: 6px;

    width: fit-content;
    max-width: 100%;
}
.gauss-step h3{
    text-align:center;
    font-size:16px;
    margin-bottom:8px;
}

.gauss-steps{
    display:grid;
    grid-template-columns: repeat(3, 1fr); /* máximo 3 por fila */
    gap:30px;
    margin-bottom:20px;
}

.row-operation{
    font-weight:600;
    margin-bottom:6px;
    font-size:14px;
    color:#1f2937;
}
.row-operation{
    font-weight:600;
    margin-bottom:6px;
    font-size:14px;
    color:#1f2937;
}


/* ===== PRODUCTO MATRIZ INVERSA ===== */

.matrix-product{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:25px;
    margin-top:15px;
    flex-wrap:wrap;
}

/* tablas del producto */
.matrix-product-table{
    border-collapse:collapse;
    background:#fff;
}

.matrix-product-table td{
    border:1px solid #ccc;
    padding:8px 14px;
    text-align:center;
    font-size:14px;
}

/* vector B más angosto */
.vector-b td{
    min-width:80px;
}

/* símbolo de multiplicación */
.matrix-multiply{
    font-size:28px;
    font-weight:600;
    color:#1f2937;
}

/* responsive */
@media (max-width:700px){

  .matrix-product{
      flex-direction:column;
      align-items:flex-start;
      gap:12px;
  }

  .matrix-multiply{
      font-size:22px;
  }

}



/* ===============================
   FACTORIZATION PROCEDURE (LU / Cholesky)
================================ */

/* Contenedor general del procedimiento */
#gauss-procedure-container{
  display:flex;
  flex-direction:column;
  gap:20px;
}

/* Cada paso del método */
.step-box{
  background:#ffffff;
  border:1px solid var(--line);
  border-radius:10px;
  padding:18px;
}

.step-box h4{
  margin:0 0 10px 0;
  font-size:16px;
  font-weight:600;
}

/* Resultado final */
.result-box{
  border-left:4px solid var(--primary);
  background:#f8fafc;
}

/* ===============================
   MATRICES EN PASOS
================================ */

.matrix-group{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:30px;
}

.matrix-product{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:20px;
}

/* símbolos = y × */
.matrix-equals,
.matrix-mult{
  font-size:26px;
  font-weight:600;
  color:#1f2937;
}

/* ===============================
   SISTEMA ORIGINAL
================================ */

.system-equations{
  font-family:monospace;
  font-size:14px;
}

.equation-line{
  margin:4px 0;
}

/* ecuaciones tipo Ly=b */
.equation{
  font-weight:600;
  margin-bottom:10px;
}

/* ===============================
   VECTOR SOLUCIÓN
================================ */

.solution-vector{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
}

.solution-item{
  background:#ffffff;
  border:1px solid var(--line);
  padding:8px 14px;
  border-radius:6px;
  font-weight:600;
  font-size:14px;
}
.matrix-table {
    width: auto;
    border-collapse: collapse;
}

.matrix-wrapper{
    display:inline-block;
}

.matrix-group{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:20px;
}

.matrix-product{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:20px;
}

.matrix-equals,
.matrix-mult{
    font-size:22px;
    font-weight:bold;
    margin:0 10px;
}

/* =========================
   FORMULARIOS DE MÉTODOS
========================= */
#method-form{
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 0;
  margin: 0;
}

#method-form label{
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

#method-form input{
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

#method-form input:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}

#method-form input::placeholder{
  color: var(--muted);
}

#method-form button{
  width: 100%;
  height: 46px;
  margin-top: 10px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
}

#method-form button:hover{
  background: #1d4ed8;
}

#method-form button:active{
  transform: scale(0.98);
}

#method-form button:focus{
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-100);
}

/* =========================================
   LAYOUT PRINCIPAL DE LA CALCULADORA
========================================= */


/* CONTENEDOR IZQUIERDO CON SCROLL */
.left-stack{
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  padding-right: 6px;
}

/* PANEL DEL FORMULARIO */
.panel--inputs{
  min-height: fit-content;
}

/* Scroll visual */
.left-stack::-webkit-scrollbar{
  width: 8px;
}

.left-stack::-webkit-scrollbar-track{
  background: transparent;
}

.left-stack::-webkit-scrollbar-thumb{
  background: #cbd5e1;
  border-radius: 999px;
}

.left-stack::-webkit-scrollbar-thumb:hover{
  background: #94a3b8;
} 
.left-stack{
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  padding-right: 6px;
}

.left-stack::-webkit-scrollbar{
  width: 6px;
}

.left-stack::-webkit-scrollbar-thumb{
  background: #cbd5e1;
  border-radius: 10px;
}

.left-stack::-webkit-scrollbar-thumb:hover{
  background: #94a3b8;
}

.calculator-bottom{
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 22px;
  margin-top: 18px;

  /* mueve ligeramente todo el bloque hacia la izquierda */
  transform: translateX(-70px);
}


/* SELECT DEL FORMULARIO */
#method-form select{
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  cursor: pointer;

  transition: border-color .2s ease, box-shadow .2s ease;

  /* elimina el estilo nativo */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* flecha personalizada */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%2364758b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;

  padding-right: 36px;
}

#method-form select:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.panel__header--results{
  display:flex;
  justify-content:space-between;
  align-items:center;
}

/* botón */
.expand-btn{
  border:1px solid var(--line);
  background:#fff;
  padding:6px 12px;
  border-radius:8px;
  font-size:13px;
  cursor:pointer;
  transition:all .2s ease;
}

.expand-btn:hover{
  border-color:var(--primary);
  color:var(--primary);
}

/* animación del panel */
.panel--results{
  transition: all .35s ease;
}

/* estado expandido */
.panel--results.expanded{
  transform: scale(1.45);
  z-index: 10;
}

.help-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  vertical-align: middle;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.help-icon:hover,
.help-icon:focus{
  background: var(--primary);
  color: #fff;
  transform: scale(1.08);
  outline: none;
}

/* Tooltip global */
.global-tooltip{
  position: fixed;
  top: 0;
  left: 0;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 500;
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  z-index: 9999;
}

.global-tooltip.is-visible{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Flechita */
.global-tooltip::after{
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: rotate(45deg);
}

/* Flecha cuando sale a la derecha */
.global-tooltip.tooltip-right::after{
  left: -6px;
  top: 16px;
}

/* Flecha cuando sale a la izquierda */
.global-tooltip.tooltip-left::after{
  right: -6px;
  top: 16px;
  transform: rotate(225deg);
}

/* En móviles */
@media (max-width: 768px){
  .global-tooltip{
    max-width: 220px;
    font-size: 12px;
    padding: 9px 11px;
  }

  .help-icon{
    width: 17px;
    height: 17px;
    font-size: 11px;
  }
}


/*boton de detalles*/
/* ==============================
   MODAL DETALLES
============================== */
.details-modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2000;
}

.details-modal.show{
  display: block;
}

.details-modal__overlay{
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}

.details-modal__content{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, 92vw);
  max-height: 85vh;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  animation: detailsFadeIn .25s ease;
}

@keyframes detailsFadeIn{
  from{
    opacity: 0;
    transform: translate(-50%, -48%);
  }
  to{
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.details-modal__close{
  position: absolute;
  top: 14px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: #f3f4f6;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  transition: background .2s ease, transform .15s ease;
}

.details-modal__close:hover{
  background: #e5e7eb;
  transform: scale(1.03);
}

.details-modal__header{
  padding: 24px 24px 14px;
  border-bottom: 1px solid var(--line);
}

.details-modal__header h2{
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.details-modal__header p{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.details-tabs{
  display: flex;
  gap: 10px;
  padding: 16px 24px 0;
}

.details-tab{
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 12px 12px 0 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

.details-tab.active{
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.details-body{
  padding: 20px 24px 24px;
  overflow-y: auto;
}

.details-panel{
  display: none;
}

.details-panel.active{
  display: block;
}

/* Bloques internos */
.details-section{
  margin-bottom: 18px;
}

.details-section h3{
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.details-card{
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.details-card strong{
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text);
}

.details-card p{
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #334155;
}

.details-list{
  margin: 0;
  padding-left: 18px;
}

.details-list li{
  margin-bottom: 8px;
  line-height: 1.5;
  color: #334155;
}

.details-code{
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  font-family: Consolas, monospace;
  font-size: 13px;
  overflow-x: auto;
}

