@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #07080c;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.07);
  --input: rgba(255, 255, 255, 0.04);
  --text: #eceef4;
  --text-2: #c3c7d4;
  --muted: #868c9e;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --accent-soft: rgba(34, 211, 238, 0.08);
  --accent-text: #05070b;
  --blue: #818cf8;
  --green: #a3e635;
  --grad: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  --glow: 0 0 0 1px rgba(34, 211, 238, 0.25), 0 10px 40px -10px rgba(34, 211, 238, 0.55);
  --radius: 18px;
  --radius-sm: 12px;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Rejilla técnica de fondo y aurora superior */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 70%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 70%);
}
body::after {
  content: "";
  position: absolute;
  top: -320px;
  left: 50%;
  width: min(1200px, 160vw);
  height: 720px;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(closest-side at 35% 50%, rgba(34, 211, 238, 0.20), transparent),
    radial-gradient(closest-side at 68% 45%, rgba(167, 139, 250, 0.20), transparent);
  filter: blur(30px);
}

a { color: var(--accent); text-underline-offset: 3px; }

::selection { background: var(--accent); color: var(--accent-text); }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header / footer */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(7, 8, 12, 0.6);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 64px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}
.logo {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo::before {
  content: "π";
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 10px;
  border-radius: 9px;
  background: var(--grad);
  color: var(--accent-text);
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 19px;
  box-shadow: 0 0 24px -4px rgba(34, 211, 238, 0.6);
}
.logo span { color: var(--accent); }
.site-nav {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin-left: auto;
}
.site-nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a[aria-current] { color: var(--text); }
.site-nav a[aria-current]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -13px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.8);
}

.site-footer {
  margin-top: 120px;
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
  color: var(--muted);
  font-size: 14px;
}
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* Typography */
h1, h2, h3 { font-family: var(--display); font-weight: 700; color: var(--text); }
h1 {
  font-size: clamp(38px, 6.4vw, 68px);
  line-height: 1.02;
  margin: 56px 0 18px;
  letter-spacing: -0.04em;
}
h2 { font-size: clamp(26px, 3.6vw, 36px); margin: 64px 0 14px; letter-spacing: -0.03em; line-height: 1.15; }
h3 { font-size: 19px; margin: 28px 0 8px; letter-spacing: -0.015em; }
.lead { font-size: clamp(17px, 2vw, 19px); color: var(--muted); margin: 0 0 32px; max-width: 620px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 6px 12px;
  border-radius: 999px;
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }

/* Cards / forms */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 3.5vw, 28px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field label, .label { font-weight: 500; font-size: 13px; color: var(--muted); }
.row { display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

input, select, button {
  font: inherit;
  color: inherit;
}
input[type="text"], input[type="number"], input[type="date"], select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--input);
  min-height: 50px;
  font-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
select option { background: #11131a; color: var(--text); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.6; }
input[type="text"]:hover, input[type="number"]:hover, input[type="date"]:hover, select:hover {
  border-color: rgba(255, 255, 255, 0.26);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.15);
}
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input[type="checkbox"] { accent-color: var(--accent); width: 17px; height: 17px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  min-height: 50px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--grad);
  color: var(--accent-text);
  font-weight: 650;
  font-size: 15.5px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--glow);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.15s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.4), 0 14px 48px -10px rgba(34, 211, 238, 0.7); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: none;
  font-weight: 550;
}
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-soft); box-shadow: none; filter: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn-ghost { min-height: 44px; font-size: 14.5px; }

.segmented {
  display: inline-flex;
  border-radius: 10px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 7px 16px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Results */
.result {
  position: relative;
  margin-top: 22px;
  padding: clamp(18px, 3.5vw, 24px);
  border-radius: 14px;
  background:
    radial-gradient(500px 160px at 0% 0%, rgba(34, 211, 238, 0.12), transparent 70%),
    radial-gradient(400px 160px at 100% 100%, rgba(167, 139, 250, 0.12), transparent 70%),
    rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(34, 211, 238, 0.22);
  animation: rise 0.35s ease-out;
}
.result > .small.muted:first-child {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11.5px;
}
.result-big {
  font-family: var(--display);
  font-size: clamp(36px, 7.5vw, 56px);
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  margin-top: 4px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 18px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.stat b {
  display: block;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat span { font-size: 12.5px; color: var(--muted); }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Pi hero */
.hero { position: relative; padding: 24px 0 8px; }
.hero-grid {
  display: grid;
  gap: 32px 56px;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: start;
  padding-top: 24px;
}
.hero-copy .eyebrow { margin-top: 8px; }
.hero h1 { margin-top: 22px; font-size: clamp(38px, 5.2vw, 60px); }
.hero-facts {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.hero-facts div { font-size: 13px; color: var(--muted); }
.hero-facts b {
  display: block;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}
.pi-stream {
  font-family: var(--mono);
  color: var(--accent);
  opacity: 0.35;
  white-space: nowrap;
  overflow: hidden;
  font-size: 12px;
  letter-spacing: 0.3em;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
}
.pi-stream span { display: inline-block; animation: scroll 160s linear infinite; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .pi-stream span, .result, .eyebrow::before { animation: none; }
}

.finder {
  text-align: left;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 40px 80px -30px rgba(0, 0, 0, 0.8), 0 0 80px -40px rgba(34, 211, 238, 0.5);
}
.digits-context {
  font-family: var(--mono);
  font-size: clamp(14px, 3.4vw, 17px);
  word-break: break-all;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 16px 0;
  line-height: 1.7;
  color: var(--muted);
}
.digits-context mark {
  background: var(--grad);
  color: var(--accent-text);
  border-radius: 5px;
  padding: 1px 4px;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.5);
}
.progress {
  height: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 16px;
}
.progress div { height: 100%; width: 0; background: var(--grad); border-radius: 999px; transition: width 0.2s; box-shadow: 0 0 12px var(--accent); }

/* Bento de herramientas */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head p { margin: 0 0 18px; }
.bento {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.bento .wide { grid-column: span 2; }
.tool-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: transform 0.25s, background 0.25s;
}
/* Borde con degradado al pasar el ratón */
.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.tool-card:hover { transform: translateY(-3px); background: linear-gradient(180deg, rgba(34, 211, 238, 0.07), rgba(255, 255, 255, 0.015)); }
.tool-card:hover::before { opacity: 1; }
.tool-card .art {
  height: 120px;
  margin: -6px -6px 14px;
  border-radius: 12px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 20px 20px,
    rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
}
.tool-card .art svg { width: 100%; height: 100%; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.art .a { stroke: var(--accent); }
.art .b { stroke: var(--blue); }
.art .g { stroke: var(--green); }
.art .m { stroke: var(--muted); }
.art .t { stroke: var(--text); }
.art .thick { stroke-width: 3; }
.art .lead { stroke-width: 5; }
.art .dash { stroke-dasharray: 4 6; opacity: 0.7; }
.art .fa { fill: var(--accent); stroke: none; }
.art .fb { fill: var(--blue); stroke: none; }
.art .fm { fill: var(--muted); stroke: none; }
.art .glow { filter: drop-shadow(0 0 6px var(--accent)); }
.tool-card h3 { margin: 4px 0 6px; font-size: 21px; }
.tool-card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.tool-card .go {
  margin-top: auto;
  padding-top: 16px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}
.tool-card .go::after { content: "→"; display: inline-block; margin-left: 6px; transition: transform 0.2s; }
.tool-card:hover .go::after { transform: translateX(4px); }
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Espacios de anuncios: ocultos hasta que consent.js inserta un bloque de AdSense */
.ad-slot { display: none; margin: 32px 0; min-height: 90px; }
.ad-slot.on { display: block; }

/* Aviso de cookies */
.cc {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 50;
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px;
  border-radius: var(--radius);
  background: rgba(14, 16, 22, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9), 0 0 60px -30px rgba(34, 211, 238, 0.6);
  animation: rise 0.3s ease-out;
}
.cc-title { font-family: var(--display); font-weight: 700; font-size: 17px; margin: 0 0 6px; }
.cc-text { font-size: 14px; color: var(--text-2); margin: 0 0 14px; line-height: 1.55; }
.cc-prefs { margin-bottom: 12px; }
.cc-opt { align-items: flex-start; font-size: 13.5px; line-height: 1.45; }
.cc-opt input { margin-top: 2px; flex: none; }
.cc .btn-row .btn { flex: 1 1 auto; min-height: 42px; font-size: 14px; padding: 8px 14px; }

.linklike {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linklike:hover { color: var(--text); }

/* Selector de idioma */
.lang { position: relative; }
.lang summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: " ▾"; color: var(--muted); }
.lang[open] summary { border-color: var(--accent); }
.lang ul {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  margin: 0;
  padding: 6px;
  list-style: none;
  min-width: 150px;
  background: rgba(14, 16, 22, 0.97);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8);
}
.lang a {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
}
.lang a:hover { background: var(--surface-2); color: var(--text); }
.lang a[aria-current] { color: var(--accent); }
.header-end { display: flex; align-items: center; gap: 10px; }

/* Página legal */
.legal-data {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.legal-data dt { color: var(--muted); font-size: 14px; }
.legal-data dd { margin: 0; font-family: var(--mono); font-size: 14px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; background: var(--surface); }
td:first-child { font-family: var(--mono); white-space: nowrap; }

.prose { margin-top: 72px; max-width: 720px; }
.prose p, .prose li { color: var(--text-2); }
.prose strong { color: var(--text); }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--accent); }

/* Preguntas frecuentes y herramientas relacionadas */
.faq { margin-top: 48px; }
.faq h3 { margin-top: 28px; font-size: 18px; }
.related { margin-top: 72px; }

.formula {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text);
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.08), rgba(167, 139, 250, 0.04));
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 10px;
  padding: 14px 18px;
  overflow-x: auto;
  white-space: nowrap;
}

.hidden { display: none !important; }

/* Herramientas gráficas */
.page-head { padding-top: 32px; }
.page-head h1 { margin-top: 18px; }

.tool {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: start;
}
.tool-main { min-width: 0; }
.viz-card { padding: 14px; }
.viz-card canvas { display: block; width: 100%; touch-action: pan-y; }
.viz-card canvas + canvas {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.viz-title {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 2px 4px 10px;
}
.legend {
  display: flex;
  gap: 6px 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
  padding: 10px 4px 2px;
}
.legend i {
  display: inline-block;
  width: 16px;
  height: 3px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 6px;
}
.legend i.dash { background-image: linear-gradient(90deg, currentColor 50%, transparent 50%); background-size: 6px 3px; }

.controls { position: sticky; top: 84px; }
.ctrl { margin-bottom: 20px; }
.ctrl label, .ctrl .label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--muted);
}
.ctrl output {
  font-family: var(--mono);
  color: var(--accent);
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
}
.check {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 12px;
  cursor: pointer;
}
.controls .btn-row .btn { flex: 1 1 auto; min-height: 44px; }
.controls select { min-height: 44px; padding: 8px 12px; font-size: 14.5px; margin-top: 8px; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  margin: 14px 0 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) var(--p, 50%), rgba(255, 255, 255, 0.1) var(--p, 50%));
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.25), 0 0 16px rgba(34, 211, 238, 0.6);
  transition: box-shadow 0.15s;
}
input[type="range"]:hover::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.3), 0 0 20px rgba(34, 211, 238, 0.8); }
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.25), 0 0 16px rgba(34, 211, 238, 0.6);
}
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }

.tool .stats { margin-top: 14px; }
.stat b.accent { color: var(--accent); }

/* Selector de colores (resistencias) */
.band-row { margin-bottom: 14px; }
.band-row .label { margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s;
}
.chip:hover { transform: scale(1.12); }
.chip[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent), 0 0 14px rgba(34, 211, 238, 0.6); }
.resistor-svg { display: block; width: 100%; height: auto; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool { grid-template-columns: 1fr; }
  .controls { position: static; }
}

@media (max-width: 600px) {
  .bento { grid-template-columns: 1fr; }
  .bento .wide { grid-column: auto; }
  .site-header .lang { order: 1; }
  .site-nav {
    order: 2;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
  .site-nav a[aria-current]::after { bottom: -9px; }
  .finder .btn-row .btn { flex: 1 1 auto; }
}
.art .fv { fill: var(--accent-2); stroke: none; }
.art .v { stroke: var(--accent-2); }
.art .fire-t { fill: var(--green); }
.art .fg { fill: var(--green); stroke: none; }

/* Panel para compartir en redes */
.share { margin-top: 4px; }
.share-title {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}
.share-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.net {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.net:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-1px); }
.net .ico {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text);
}
.net svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.net svg .fill, .net svg .dot { fill: currentColor; stroke: none; }
.net .ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); color: #fff; }
.net .tt { background: #000; color: #fff; }
.net .tt svg { filter: drop-shadow(1.2px 0 0 #25f4ee) drop-shadow(-1.2px 0 0 #fe2c55); }
.net .wa { background: #25d366; color: #fff; }
.net .fb { background: #1877f2; color: #fff; }
.net .xx { background: #000; color: #fff; border: 1px solid rgba(255, 255, 255, 0.25); }
.net .tg { background: #29a9eb; color: #fff; }
#share-hint { color: var(--text-2); }
