@font-face {
    font-family: mc;
    src: url(../font/cmunrm.ttf); 
}

@font-face {
    font-family: ps_b;
    src: url(../font/productSans_bold.ttf);
    font-size: 20px;
    font-style: bold;
    font-weight: bold;
  }

.contProyectos {    
    margin-bottom: 2rem;
}

.latex {
    margin-top: 10px;
    margin-left: 15px;    
    color: var(--c2);
}

/* P1 */

.p1Descripcion {  
  max-width: 32rem;  
  margin-left: 1rem;
  font-size: 1.1rem;
  border-radius: 4px;
  line-height: 1.6;  
  text-align: justify;
}

.p1ContOptions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;  
  gap: 2rem;
  margin: 1rem;
}

.p1Option {
  font-family: ps_b;
  font-size: 1.2rem;  
  cursor: pointer;  
  color: var(--c1);
  transition: all 0.3s ease; /* Transición suave */
  padding: .5rem;
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: .3rem;
}

.p1Option:hover {  
  opacity: 0.8; /* Efecto sutil al pasar el mouse */
}

.p1OptionActive {  
  color: var(--c2);  
  background-color: var(--c1);
}

/* P2 */

.venn-circle path {
  fill-opacity: 0.5;
  stroke: var(--c2);    
  stroke-width: 2px;
}

.venn-label text {
  font-size: 14px;
  font-family: ps_b;
}

.venn-circle path {
  fill-opacity: 0.5;
  stroke: #000;
  stroke-width: 1px;
}

.venn-text {
  font-size: 12px;
  text-anchor: middle;
  font-family: ps_b;
  color: var(--c1);
}  

.p2subtitulo {
  margin-bottom: 1rem; 
}

.p2Option {
  margin: .5rem;     
}

.p2Options {    
  display: flex;
}

.p2icos{
  width: 25px; 
  height: 25px;
}

.p2input {
  font-family: mc;
  font-size: 1.2rem;
}

.math-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
  overflow-x: auto;
}

.p2Latex {
  display: block;
  text-align: center; 
}

.p2InputOption {
  width: 1.8rem;
  padding: .5rem;  
  border-radius: .3rem;
  margin-right: .3rem;
}

.p2OptionTopButton {    
  display: flex;
  margin-right: .3rem;
  margin-left: 1.2rem; 
}

.p2InputOption::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.p2InputSets {
  margin-top: .5rem; 
}

/* P3 */

#p3ggbContainer {
  border-radius: 0rem 3px 3px 0rem;  
  border-top: var(--c1) 3px solid; 
  border-bottom: var(--c1) 3px solid; 
  border-right: var(--c1) 3px solid; 
}

.p3MaximiseButton {
  position: absolute;
  background-color: red;
  width: 1rem;
  height: 2rem;
}

.p3Processp {
  margin-top: .5rem;
  margin-right: 1rem;  
}

#p3CalcContainer {
  margin-left: 16px;
  margin-top: 16px; 
  /* width: calc(759px); */
  margin-bottom: 2rem; 
}

@media screen and (min-width: 900px) {
  #p3CalcContainer {        
    width: 50%; 
  }
}

/* P4 */

.audioReproButton {
  margin-top: .5rem;
  margin-top: .5rem;    
}

/* P5 */

.inputFractions {
  font-family: cC;
}

#p5ShowImput { 
  margin-top: 1rem; 
  margin-left: 1rem;      
}

/* P10 */

.p10Processp {  
  font-size: .8rem;
  margin-left: 1rem; 
  margin-top: 1rem;  
}

/* P7 - P8 - P9 - P10*/

.ggbContainer {
  border-radius: 0rem 3px 3px 3px;
  border-top: var(--c1) 3px solid; 
  border-bottom: var(--c1) 3px solid; 
  border-right: var(--c1) 3px solid;     
}

.calcContainer {
  margin-left: 16px;
  margin-top: 16px; 
  width: 25rem;
}


/* P11 */

#p11Title{
  margin-top: 1rem;   
}

.p11Content {
  display: flex; 
  flex-wrap: wrap;    
  padding: 1rem;
}

#fractal {
  background-color:var(--ct);
}

.p11InputGroup{
  margin-top: 1rem;
}

.p11inputs {
  width: max-content; 
  display: flex; 
  flex-wrap: wrap; 
  height: max-content; 
}

.p11buttons {
  width: max-content;  
  display: flex;   
  height: max-content; 
  margin-top: 1rem;
  max-width: 1rem; 
}

.p11Button {
  margin-right: 1rem;  
  width: max-content;  
}

.p11Ref {
  display: inline-block;
  margin-left: 1rem; 
  margin-top: 1.6rem; 
  padding: .3rem .6rem; 
  background-color: var(--c3);
  color: var(--c1);
  text-decoration: none;
  border-radius: .3rem;   
  width: min-content;
  height: min-content;
}

.p11Ref:hover {  
  color: var(--c2);
}

.p11AreaSection {
  width: 100%;
  margin-top: 2rem;
  padding: 1rem;
  background-color: var(--c3);
  border-radius: 0.5rem;
  font-size: 1.4rem;
}

.p11AreaSection h3 {
  color: var(--c1);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.p11AreaCalc {
  background-color: var(--ct);
  padding: 1.5rem;
  border-radius: 0.3rem;
  font-family: 'Computer Modern', serif;
  line-height: 2.5;
  overflow-x: auto;
}

.p11AreaCalc .step {
  margin-bottom: 1.5rem;
  padding: 0.5rem;
  border-left: 3px solid var(--c2);
  padding-left: 1rem;
}

.p11AreaCalc .step:last-child {
  border-left-color: var(--c1);
  font-weight: bold;
}

.p11AreaCalc .label {
  color: var(--c2);
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

#p11i1, #p11i2, #p11i13 {
  width: 9rem;
}

#p11ResArea {
  margin-top: 5rem; 
  margin-left: 3rem; 
  font-size: 1.4rem;      
 }

/* P12 */

#p12GCont {
  background-color:var(--ct);
}

.p12ControlPanel {  
  display: flex; 
  flex-wrap: wrap;
  background-color: var(--c3); 
  padding: .5rem;
  border-radius: 1rem; 
}

.p12imput {
   width: 9rem;   
}

.p12button {
  display: flex;
  width: min-content;
  height: 3rem;  
  align-items: center; 
  margin-left: .6rem; 
  margin-top: .6rem; 
  padding-right: .8rem; 
}

.p12button img {  
  width: 1.8rem;
  margin-right: .3rem;
}


















/* P13 */

#p13container {
  display: block;
  /* height: 100vh; */
}

.p13title {
  position: fixed;
  top: 0;
  left: 0;  
  font-size: 1.3rem;
  width: 100vw;
  height: 3rem;
  display: flex;
  align-content: center;
  flex-wrap: wrap;
  justify-content: center;
}

#p13canvas {
  flex: 1;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1; 
}

.p13presets {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none; 
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background-color: rgba(0, 0, 0, 0.5);
  overflow-y: auto; 
  z-index: 1;
}

.p13prefunc {
  background-color: var(--c1);
  color: var(--c3);
  border: .1rem solid var(--c2);
  border-radius: .5rem;
  padding: .5rem; 
  cursor: pointer;
}

.p13inpu1 {
  margin-bottom: 1.5rem;
  position: absolute;
  top: 0;
  left: 0;
  width: min-content;
  font-size: 0.9rem;
  z-index: 2;
}

.control {
  display: flex; 
  flex-direction: row; 
  width: 20rem; 
  margin-left: 1rem;
}

.control label {  
  display: block;  
  width: 8rem; 
}

.control input[type="range"] {
  width: 100%;  
  padding: .5rem; 
  border: 0rem;   
}

.p13input2 {
  position: fixed;
  margin-bottom: 1.5rem;  
  bottom: -0.8rem; 
  left: 0;
  width: min-content;
  font-size: 0.9rem;
  z-index: 2;  
}

#p13i21, #p13i22 {
  width: 4.2rem;
}

.p13functions{
  display: flex;
  flex-direction: row; 
  align-items: center;
}

#p13i23 {
  width: fit-content;
  min-width: 50vw; 
  box-sizing: content-box;
}

#p13b21 {  
  margin-left: .5rem; 
}

#p13presetsBotton {
  cursor: pointer;
  width: max-content;  
  margin-left: 1rem;
  margin-top: 1.2rem;
  font-size: .9rem;
  color: var(--c1);
}

.p13output {
  display: flex;
  position: fixed;
  bottom: .5rem;  
  right: 0;   
  justify-content: space-between;
  margin-right: .5rem; 
  font-size: 0.9rem;
}

.p13output .label {
  width: max-content; 
}

.p13output .value {
  margin-left: .5rem;   
}




/* P14 */

.p14t1 {
  margin-left: 1rem;
  text-align: left;
}

#p14container {
  display: block;
}

.p14title {
  position: absolute;
  top: -3.5rem;   
  z-index: -10;    
  left: 0;  
  font-size: 1.8rem;
  width: 100vw;
  height: 3rem;
  display: flex;
  align-content: center;
  flex-wrap: wrap;
  justify-content: center;
  margin-right: 10rem ;
}

.p14Cont {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#p14i1 {
  margin-left: 1rem; 
}

#p14r1 {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.p14-section {    
    border-radius: 8px;        
    margin-left: 2rem;
    margin-right: 1rem;
}

.p14ul {
  margin-left: 1.2rem; 
}

.p14-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
    margin: 0 0 0.5rem;
}

.p14-struct {
    font-size: 1.1rem;
    font-family: monospace;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin: 0 0 0.5rem;
}

.p14-desc {
    font-size: 0.85rem;
    opacity: 0.7;
    margin: 0;
    font-style: italic;
}

.p14-op-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

.p14-sub {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.25rem;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.04);
}

.p14-op {
    font-weight: bold;
    font-size: 1rem;
}

.p14-union  { color: #f0f; } 
.p14-concat { color: #f00; }
  
.p14-star {
    color: var(--c1);
    font-size: 1.2rem;
    vertical-align: super;
    line-height: 0;
}

.p14-symbol {
    color: var(--c2);
    font-family: monospace;
    font-size: 1.1rem;
}

.p14-upper {
    color: #f472b6;
    border-bottom: 1px dashed #f472b6;
    cursor: help;
}

.p14-lambda { color: #94a3b8; font-family: monospace; }
.p14-empty  { color: #ef4444; font-family: monospace; }

.p14-starred {
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 3px;
}

.p14-strings {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.p14-str {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 4px;
    padding: 0.2rem 0.6rem;
    font-family: monospace;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.p14-str:hover {
    background: rgba(255, 255, 255, 0.15);
}

.p14-hint  { opacity: 0.6; font-style: italic; }
.p14-error { opacity: 0.6; font-style: italic; color: #ef4444; }

#p14extraAlphabets {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}


/* P15 */

#p15alphabet {
  width: 20rem; 
}

/* ── P15 container ── */
.p15Cont {
  font-family: "IBM Plex Mono", "Fira Code", "Courier New", monospace;
  max-width: 720px;
  margin: 0 auto;  
  color: var(--color-text-primary);
}

#p15container {
  display: block;
}

/* ── Header ── */
.p15title {
  position: absolute;
  top: -3rem;   
  z-index: -10;    
  left: 0;  
  font-size: 1.8rem;
  width: 100vw;
  height: 3rem;
  display: flex;
  align-content: center;
  flex-wrap: wrap;
  justify-content: center;
  margin-right: 10rem ;
}

/* ── Controls ── */
.p15-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.75rem;
  align-items: center;
}

.p15-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: center;
}

@media (max-width: 520px) {
  .p15-row { grid-template-columns: 1fr; }
}

.p15-select-arrow {
  position: absolute;
  right: 10px;
  font-size: 11px;
  color: var(--color-text-secondary);
  pointer-events: none;
}

/* ── Results header ── */
.p15-results-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.p15t1 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-secondary);
  margin: 0;
  font-family: inherit;
}

/* ── Result area ── */
.p15-result-area {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.p15-hint {
  font-size: 0.8rem;
  color: var(--color-text-tertiary);
  padding: 1.5rem 0;
  text-align: center;
  font-family: inherit;
}

/* ── Direction badge ── */
.p15-direction-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text-info);
  background: var(--color-background-info);
  border: 0.5px solid var(--color-border-info);
  border-radius: var(--border-radius-md);
  padding: 4px 10px;
  margin-bottom: 0.75rem;
  font-family: inherit;
}

/* ── Steps ── */
.p15-step {
  background: var(--color-background-secondary);
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: var(--border-radius-md);
  padding: 0.75rem 1rem;
  animation: p15-fadein 0.25s ease both;
  transition: border-color 0.15s;
}

.p15-step:hover {
  border-color: var(--color-border-secondary);
}

@keyframes p15-fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.p15-step-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.p15-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-border-secondary);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.p15-step-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-secondary);
}

.p15-step-body {
  padding-left: 1.6rem;
}

.p15-step-value {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.p15-line {
  font-size: 0.82rem;
  color: var(--color-text-primary);
  font-family: "IBM Plex Mono", monospace;
  line-height: 1.6;
  word-break: break-all;
}

.p15-step-detail {
  font-size: 0.72rem;
  color: var(--color-text-secondary);
  margin-top: 0.35rem;
  border-left: 2px solid var(--color-border-tertiary);
  padding-left: 0.6rem;
  line-height: 1.5;
}

/* ── Error step ── */
.p15-step-error {
  border-color: var(--color-border-danger);
  background: var(--color-background-danger);
}

.p15-step-error .p15-step-label {
  color: var(--color-text-danger);
}

.p15-step-error .p15-step-value {
  color: var(--color-text-danger);
  font-size: 0.82rem;
}

/* ── Final result step ── */
.p15-result-step {
  background: var(--color-background-primary);
  border: 1.5px solid var(--color-border-info);
  border-radius: var(--border-radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  animation: p15-fadein 0.3s ease both;
  animation-delay: 0.35s;
} 

.p15-final-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-info);
}

.p15-final-value {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: "IBM Plex Mono", monospace;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
  word-break: break-all;
  text-align: right;
}

/* ── Block visualization ── */
.p15-block-vis {
  margin-top: 0.85rem;
  border: 1px solid var(--color-border-tertiary);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  font-family: "IBM Plex Mono", monospace;
}

.p15-block-vis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  background: var(--color-background-tertiary, var(--color-border-tertiary));
  border-bottom: 1px solid var(--color-border-tertiary);
}

.p15-block-vis-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
}

.p15-block-vis-meta {
  font-size: 0.65rem;
  color: var(--color-text-tertiary);
}

.p15-block-vis-ruler {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0.75rem;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-tertiary);
  border-bottom: 1px solid var(--color-border-tertiary);
  background: var(--color-background-secondary);
}

.p15-block-items {
  display: flex;
  flex-direction: column;
  max-height: 220px;
  overflow-y: auto;
}

.p15-block-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  border-bottom: 0.5px solid var(--color-border-tertiary);
  transition: background 0.1s;
}

.p15-block-item:last-child {
  border-bottom: none;
}

.p15-block-item:hover {
  background: var(--color-background-secondary);
}

.p15-block-item--active {
  background: var(--color-background-info) !important;
  border-left: 3px solid var(--color-border-info);
  padding-left: calc(0.75rem - 3px);
}

.p15-block-item--active .p15-block-item-str {
  color: var(--color-text-info);
  font-weight: 700;
}

.p15-block-item--active .p15-block-item-idx {
  color: var(--color-text-info);
  font-weight: 700;
}

.p15-block-item-str {
  color: var(--color-text-primary);
  font-family: "IBM Plex Mono", monospace;
}

.p15-block-item-idx {
  color: var(--color-text-secondary);
  font-size: 0.7rem;
}

.p15-block-ellipsis {
  font-size: 0.68rem;
  color: var(--color-text-tertiary);
  text-align: center;
  padding: 0.3rem 0.75rem;
  font-style: italic;
  border-bottom: 0.5px solid var(--color-border-tertiary);
}

.p15-block-ellipsis--top {
  border-bottom: 0.5px solid var(--color-border-tertiary);
}

/* ── Wrapper del strip (va dentro de .p15-step-body) ── */
.p15-strip-wrap {
    margin-top: .75rem;
}

/* ── Tabla de bloques ── */
.p15-block-strip {
    font-family: "IBM Plex Mono", "Fira Code", "Courier New", monospace;
    font-size: .72rem;
    border: 1px solid var(--c1);
    border-radius: .5rem;
    overflow: hidden;
    box-shadow: .15rem .15rem 0 var(--c1);
}

/* Cabecera de columnas */
.p15-bheader {
    display: grid;
    grid-template-columns: 9rem 12rem 1fr;
    padding: .35rem .75rem;
    background-color: var(--c1);
    color: var(--c3);
    font-weight: 700;
    font-size: .68rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    gap: .5rem;
}

/* Cada fila de bloque */
.p15-brow {
    display: grid;
    grid-template-columns: 9rem 12rem 1fr;
    padding: .38rem .75rem;
    gap: .5rem;
    border-top: 1px solid rgba(0, 136, 136, .12);
    transition: background .15s;
    align-items: center;
}

.p15-brow:hover {
    background-color: rgba(0, 136, 136, .05);
}

/* Fila activa (el bloque donde cae n o α) */
.p15-brow--active {
    background-color: rgba(0, 136, 136, .1);
    border-left: 3px solid var(--c1);
    padding-left: calc(.75rem - 3px);
}

.p15-brow--active:hover {
    background-color: rgba(0, 136, 136, .16);
}

/* Fila de puntos suspensivos */
.p15-brow--dots {
    color: var(--c4);
    font-size: .8rem;
    padding-top: .2rem;
    padding-bottom: .2rem;
    border-top: 1px dashed rgba(0, 136, 136, .2);
}

/* Celda k=N */
.p15-bcell {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}

.p15-bcell--k {
    flex-direction: column;
    align-items: flex-start;
    gap: .05rem;
}

.p15-bk-label {
    font-weight: 700;
    color: var(--c1);
    font-size: .75rem;
}

.p15-brow--active .p15-bk-label {
    color: var(--c1);
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

.p15-bsize {
    color: var(--c4);
    font-size: .65rem;
}

/* Celda de rango */
.p15-bcell--range {
    color: var(--c2);
    font-size: .72rem;
    gap: .3rem;
}

/* Pin que marca exactamente dónde cae n */
.p15-n-pin {
    color: var(--c1);
    font-weight: 700;
    font-size: .68rem;
    white-space: nowrap;
    animation: p15-pin-pulse 1.2s ease infinite alternate;
}

@keyframes p15-pin-pulse {
    from { opacity: 1; }
    to   { opacity: .5; }
}

/* Ejemplos de cadenas */
.p15-bcell--examples {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
}

.p15-bex {
    display: inline-block;
    padding: .1rem .35rem;
    border-radius: .25rem;
    background-color: rgba(136, 136, 136, .08);
    border: 1px solid rgba(136, 136, 136, .15);
    color: var(--c2);
    font-size: .7rem;
    transition: background .15s;   
}

/* Cadenas del bloque activo */
.p15-bex--active {
    background-color: rgba(0, 136, 136, .12);
    border-color: rgba(0, 136, 136, .35);
    color: var(--c1);
    font-weight: 700;
}

/* Ajuste responsive */
@media (max-width: 520px) {
    .p15-bheader,
    .p15-brow {
        grid-template-columns: 7rem 9rem 1fr;
        font-size: .65rem;
    }
}

/* p16 */

/* ─── Contenedor principal ──────────────────────────────────── */
.p16Cont {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.p16title {
  position: absolute;
  top: -3rem;   
  z-index: -10;    
  left: 0;  
  font-size: 1.8rem;
  width: 100vw;
  height: 3rem;
  display: flex;
  align-content: center;
  flex-wrap: wrap;
  justify-content: center;
  margin-right: 10rem ;
}

.p16t1 {
    text-align: center;
    margin-top: 10px;
    color: var(--c1);
    font-family: ps_b;
    cursor: default;
}

.p16inputsCont {
  display: flex;
  flex-direction: row;  
  justify-content: center;
  gap: 3rem;
}

#p16r1 { 
  margin-top: .5rem; 
}

/* ─── Tarjeta de paso ───────────────────────────────────────── */
@keyframes p16-slide-in {
    from {
        opacity: 0;
        transform: translateY(.6rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.p16-step {
    margin-left: 1rem;
    margin-right: 1rem;
    border: .2rem solid var(--c1);
    border-radius: .5rem;
    box-shadow: .2rem .2rem 0rem var(--c1);
    overflow: hidden;
    animation: p16-slide-in .35s ease forwards;
}

.p16-step--result {
    border-color: var(--c1);
    box-shadow: .25rem .25rem 0rem var(--c1), 0 0 18px rgba(0, 136, 136, .15);
}

.p16-step--base {
    border-style: dashed;
}

/* ─── Cabecera del paso ─────────────────────────────────────── */
.p16-step-head {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .8rem;
    background-color: rgba(0, 136, 136, .08);
    border-bottom: 1px solid rgba(0, 136, 136, .2);
}

.p16-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: .3rem;
    font-family: ps_b;
    font-size: .8rem;
    border: .15rem solid currentColor;
    flex-shrink: 0;
}

.p16-badge--rec  { color: #a78bfa; }
.p16-badge--base { color: #60a5fa; }
.p16-badge--ok   { color: var(--c1); }

.p16-step-type {
    font-family: ps_b;
    font-size: .9rem;
    color: var(--c1);
    flex: 1;
}

.p16-step-counter {
    font-family: ps;
    font-size: .8rem;
    color: var(--c4);
}

/* ─── Leyenda de colores ────────────────────────────────────── */
.p16-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .5rem .8rem .25rem;
}

.p16-legend-item {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.p16-dot-color {
    width: .7rem;
    height: .7rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.p16-legend-val {
    font-family: cC;
    font-size: .82rem;
    color: var(--c2);
}

/* ─── Fila de cadenas ───────────────────────────────────────── */
.p16-strings-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .6rem .8rem;
}

.p16-sblock {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
}

.p16-sblock--res {
    background-color: rgba(0, 136, 136, .06);
    border: 1px solid rgba(0, 136, 136, .2);
    border-radius: .3rem;
    padding: .2rem .5rem;
}

.p16-slabel {
    font-family: cmunrm;
    font-size: .75rem;
    color: var(--c4);
}

.p16-sval {
    font-size: 1.15rem;
    letter-spacing: .05em;
}

.p16-sval--mono {
    font-family: cC;
}

.p16-cdot {
    font-family: cmunrm;
    font-size: 1.4rem;
    color: var(--c1);
    align-self: flex-end;
    margin-bottom: .2rem;
}

.p16-arrow {
    font-size: 1.2rem;
    color: var(--c4);
    align-self: flex-end;
    margin-bottom: .2rem;
}

/* ─── Caja de fórmula ───────────────────────────────────────── */
.p16-formula-box {
    margin: .25rem .8rem .5rem;
    padding: .5rem .8rem;
    border-left: .2rem solid var(--c1);
    border-radius: 0 .3rem .3rem 0;
    background-color: rgba(0, 136, 136, .05);
}

.p16-formula {
    font-family: cmunrm;
    font-size: 1.1rem;
    color: var(--c2);
    letter-spacing: .03em;
}

/* ─── Descripción ───────────────────────────────────────────── */
.p16-step-desc {
    font-family: ps;
    font-size: .88rem;
    color: var(--c4);
    font-style: italic;
    padding: 0 .8rem .6rem;
    margin: 0;
}

/* ─── Barra de progreso ─────────────────────────────────────── */
.p16-progress {
    height: 3px;
    background-color: rgba(0, 136, 136, .12);
}

.p16-progress-fill {
    height: 100%;
    background-color: var(--c1);
    border-radius: 0 2px 2px 0;
    transition: width .4s ease;
}

/* ─── Colores de roles ──────────────────────────────────────── */
/* α  – teal (c1) */
.p16-c-alpha {
    color: var(--c1);
    font-weight: bold;
}

/* β  – azul suave */
.p16-c-beta {
    color: #60a5fa;
}

/* γ  – violeta */
.p16-c-gamma {
    color: #a78bfa;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

/* a (último símbolo) – rosa */
.p16-c-a {
    color: #f472b6;
    font-weight: bold;
}

/* resultado – teal claro */
.p16-c-result {
    color: var(--c1);
    font-family: cC;
}

/* resto sin rol específico */
.p16-c-rest {
    color: var(--c2);
    opacity: .7;
}

/* ─── Lambda ────────────────────────────────────────────────── */
.p16-lambda {
    color: #94a3b8;
    font-family: cmunrm;
}

/* ─── Dot-color (leyenda) mapeado a roles ───────────────────── */
.p16-legend-item .p16-c-alpha { background-color: var(--c1);    border-radius: 50%; }
.p16-legend-item .p16-c-beta  { background-color: #60a5fa;      border-radius: 50%; }
.p16-legend-item .p16-c-gamma { background-color: #a78bfa;      border-radius: 50%; }
.p16-legend-item .p16-c-a     { background-color: #f472b6;      border-radius: 50%; }

/* ─── Mensajes de estado ────────────────────────────────────── */
.p16-hint {
    font-family: ps;
    font-size: 1rem;
    color: var(--c4);
    font-style: italic;
    margin-left: 1rem;
}

.p16-error {
    font-family: ps;
    font-size: 1rem;
    color: #ef4444;
    font-style: italic;
    margin-left: 1rem;
}