:root {
  --bg: #0b0f16;
  --panel: #111823;
  --border: #1f2a3a;
  --text: #e6edf3;
  --muted: #93a1b1;
  --accent: #2dd4bf;
  --red: #e31337;
  --blue: #60a5fa;
}
* { box-sizing: border-box; }

/* Barras de desplazamiento a juego con el diseño (estándar; el bloque -webkit- es solo para navegadores antiguos) */
* { scrollbar-width: thin; scrollbar-color: #2b3a50 transparent; }
@supports not (scrollbar-color: auto) {
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-track { background: transparent; }
  *::-webkit-scrollbar-thumb { background: #2b3a50; border-radius: 8px; border: 2px solid var(--bg); }
  *::-webkit-scrollbar-thumb:hover { background: var(--accent); }
  *::-webkit-scrollbar-corner { background: transparent; }
}
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 1080px; margin: 0 auto; padding: 40px 24px 56px; }
.cols { display: grid; grid-template-columns: 1fr; gap: 0 48px; }
@media (min-width: 900px) {
  .cols { grid-template-columns: 1fr 1fr; align-items: start; }
  .lead { max-width: 70ch; font-size: 1.15rem; }
  h1 { font-size: 2rem; }
  .icon { width: 88px; height: 88px; }
}
.hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero > div:nth-child(2) { flex: 1; min-width: 0; }
.icon { border-radius: 16px; flex: none; }
h1 { margin: 0; font-size: 1.6rem; line-height: 1.2; overflow-wrap: anywhere; }
h2 { margin: 32px 0 8px; font-size: 1.05rem; color: var(--accent); letter-spacing: .02em; }
.lead { color: var(--muted); font-size: 1.05rem; margin: 20px 0 0; overflow-wrap: anywhere; }
.status { margin: 4px 0 0; color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.status.ok .dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(45, 212, 191, .18); }
.status.down .dot { background: var(--red); }
.lang { display: flex; gap: 4px; }
button {
  font: inherit; cursor: pointer; color: var(--text);
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px;
}
/* El «hover» solo con ratón: en pantallas táctiles se queda pegado tras tocar. */
@media (hover: hover) { button:hover { border-color: var(--accent); } }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang button { padding: 4px 10px; font-size: .85rem; color: var(--muted); }
.lang button[aria-pressed="true"] { color: var(--bg); background: var(--accent); border-color: var(--accent); font-weight: 700; }
.address { display: flex; gap: 8px; align-items: stretch; }
.address code {
  flex: 1; min-width: 0; padding: 10px 12px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; font: 0.95rem ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere;
}
.hint { color: var(--muted); font-size: .9rem; margin: 8px 0 0; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a {
  display: inline-block; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel); color: var(--text); text-decoration: none; font-size: .9rem;
}
@media (hover: hover) { .chips a:hover { border-color: var(--accent); } }
.chips b { color: var(--accent); }
.limits { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; margin: 0; }
.limits dt { color: var(--muted); }
.limits dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.rules { padding-left: 20px; margin: 0; }
.rules li { margin: 6px 0; }
a { color: var(--accent); }
footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; }
footer p { margin: 4px 0; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  h1 { font-size: 1.35rem; overflow-wrap: break-word; }
  /* el selector de idioma pasa a su propia fila para que el nombre del relé no se parta */
  .lang { order: -1; width: 100%; justify-content: flex-end; }
  .address { flex-direction: column; }
  .limits { grid-template-columns: 1fr; gap: 0; }
  .limits dt { margin-top: 8px; }
  .limits dd { text-align: left; }
}

/* Actividad: cifras agregadas y gráfica de 24 horas */
#activity { margin-top: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 1.5rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .85rem; }
.chart { margin: 14px 0 0; }
.chart svg { width: 100%; height: 84px; display: block; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.chart .bar-saved { fill: #fbbf24; } /* amber: teal sat too close to the blue of ephemerals */
.chart .bar-eph { fill: var(--blue); }
.chart .bar-base { fill: var(--border); }
.axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; padding: 2px 4px 0; }
.chart figcaption { color: var(--muted); font-size: .85rem; margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.key-saved { background: #fbbf24; }
.key-eph { background: var(--blue); margin-left: 10px; }
#kinds { margin-top: 12px; }
.pill { display: inline-block; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); font-size: .9rem; }
.pill b { color: var(--accent); }
@media (max-width: 480px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat b { font-size: 1.3rem; } }
