/* Tipografía y colores */
:root{
  --neg: #CC0C00FF;   /* corregido: 0 (cero) en lugar de O */
  --pos: #00AF66FF;
  --neu: #5C88DAFF;
  --bar: #5C88DAFF;
  --bg: #0f1220;
  --card: #171a2b;
  --text: #eef2ff;
  --muted: #b6bed7;
  --axis: #8a93ad;
}

*{ box-sizing: border-box; }

html, body{
  margin:0; padding:0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Roboto Mono', monospace;
}

h1, h2, h3{
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 0 0 .25rem 0;
}

.app-header{
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.subtitle{ color: var(--muted); margin: .25rem 0 0; }

main{
  max-width: 1100px;
  margin: 1.25rem auto;
  padding: 0 1rem 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.card{
  background: var(--card);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 1rem 1rem 1.25rem;
  box-shadow: 0 6px 22px rgba(0,0,0,.25);
}

.card-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.controls{
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--muted);
}
.controls select, .controls input{
  background: #0c0f1c;
  border: 1px solid #2a2f47;
  color: var(--text);
  padding: .4rem .5rem;
  border-radius: 10px;
  outline: none;
}
.controls input[type=number]{ width: 6rem; }

.explain{
  color: var(--muted);
  margin: .35rem 0 .75rem;
  line-height: 1.35;
}

.viz{
  width: 100%;
  min-height: 280px;
}

.app-footer{
  color: var(--muted);
  padding: .75rem 1.5rem 2rem;
  text-align: center;
  font-size: .9rem;
}

.legend.neg{ color: var(--neg); }
.legend.neu{ color: var(--neu); }
.legend.pos{ color: var(--pos); }

/* Axes */
.axis path, .axis line{ stroke: var(--axis); }
.axis text{ fill: var(--muted); font-size: 12px; }

/* Tooltips */
.tooltip{
  position: absolute;
  pointer-events: none;
  background: rgba(15,18,32,.98);
  border: 1px solid #2a2f47;
  padding: .5rem .6rem;
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
  box-shadow: 0 6px 22px rgba(0,0,0,.35);
  opacity: 0;
  transform: translate(-50%,-100%);
  white-space: nowrap;
}

.dot{ stroke: rgba(255,255,255,.7); stroke-width: .5px; }
