:root {
  --bg: #0b1220;
  --surface: #111c2e;
  --surface-2: #16243a;
  /* Alias para tarjetas heredadas de la página principal. */
  --card: var(--surface);
  --card2: var(--surface-2);
  --text: #f8fafc;
  --muted: #aebdd0;
  --line: rgba(148, 163, 184, .18);
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, .14);
  --green: #10b981;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  background: radial-gradient(700px 350px at 50% -80px, rgba(59,130,246,.17), transparent 70%);
}
.wrap { width: min(100% - 32px, 960px); margin: 0 auto; padding: 34px 0 54px; }
header { max-width: 720px; margin: 0 auto 22px; text-align: center; }
h1 { margin: 8px 0; font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.12; letter-spacing: -.04em; }
h2 { margin: 0 0 8px; font-size: clamp(1.25rem, 2.5vw, 1.55rem); line-height: 1.25; letter-spacing: -.02em; }
h3 { color: #bfdbfe; }
p, li { color: var(--muted); }
a { color: #93c5fd; }

nav {
  position: sticky;
  z-index: 10;
  top: 10px;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 22px;
  padding: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(17, 28, 46, .84);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 26px rgba(0,0,0,.12);
  backdrop-filter: blur(12px);
}
nav::-webkit-scrollbar { display: none; }
nav a { flex: 0 0 auto; padding: 8px 11px; color: var(--muted); text-decoration: none; font-size: .88rem; font-weight: 700; border-radius: 10px; transition: .18s ease; }
nav a:hover, nav a.active { color: #fff; background: var(--blue); box-shadow: 0 5px 13px rgba(37, 99, 235, .25); }

.card {
  margin-top: 15px;
  padding: clamp(20px, 4vw, 30px);
  background: rgba(17, 28, 46, .88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 38px rgba(0,0,0,.13);
}
label { display: block; margin: 15px 0 7px; color: #e2e8f0; font-size: .92rem; font-weight: 750; }
input, textarea, select {
  width: 100%;
  padding: 12px 13px;
  color: var(--text);
  background: rgba(4, 11, 23, .56);
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 11px;
  font: inherit;
  transition: border-color .18s ease, box-shadow .18s ease;
}
textarea { min-height: 112px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #60a5fa; outline: 0; box-shadow: 0 0 0 3px rgba(59,130,246,.16); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(96,165,250,.72); outline-offset: 3px; }
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 14px;
  padding: 10px 15px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 6px 14px rgba(37,99,235,.2);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
button:hover, .btn:hover { background: #2563eb; box-shadow: 0 9px 18px rgba(37,99,235,.27); transform: translateY(-1px); }
.green { background: var(--green); box-shadow: 0 6px 14px rgba(16,185,129,.18); }
.green:hover { background: #059669; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.out {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 9px;
  padding: 13px 14px;
  background: rgba(30, 41, 59, .82);
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 13px;
  overflow-wrap: anywhere;
}
.out b { color: #bfdbfe; font-size: .78rem; letter-spacing: .02em; text-transform: uppercase; }
.copy { min-height: 38px; margin: 0; padding: 7px 11px; color: #dbeafe; background: rgba(71,85,105,.9); box-shadow: none; font-size: .86rem; }
.copy:hover { background: var(--blue); }
.copied { background: var(--green) !important; }
.qr { display: grid; min-height: 240px; place-items: center; margin-top: 18px; padding: 20px; background: #fff; border-radius: 15px; }
.qr:empty::before { content: "Tu código QR aparecerá aquí"; color: #64748b; }
.qr img, .qr canvas { display: block; max-width: 100%; height: auto; }
.result { display: none; }.result.show { display: block; }
.related a { font-weight: 650; }
.ad { display: grid; min-height: 90px; place-items: center; color: #94a3b8; border: 1px dashed #64748b; border-radius: 14px; }
.faq details { padding: 13px 0; border-top: 1px solid var(--line); }.faq summary { cursor: pointer; color: #e2e8f0; font-weight: 700; }
.brand-logo { display:block; width:min(310px,80vw); height:auto; margin:0 auto 14px; filter:drop-shadow(0 8px 20px rgba(0,0,0,.22)); }
/* Elementos comunes: mismos títulos, textos, códigos, enlaces y pie en todo el sitio. */
header > a:first-child:not(.tool-card) { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 4px; color: #93c5fd; font-size: .78rem; font-weight: 800; letter-spacing: .11em; text-decoration: none; text-transform: uppercase; }
header > a:first-child:not(.tool-card)::before { width: 7px; height: 7px; content: ""; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 4px rgba(16,185,129,.13); }
header > p { margin: 8px auto 0; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card ul { padding-left: 1.2rem; }
.card li + li { margin-top: .35rem; }
code, kbd { padding: .13rem .38rem; color: #bfdbfe; background: rgba(59,130,246,.12); border: 1px solid rgba(96,165,250,.22); border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; }
pre { overflow: auto; padding: 15px; color: #dbeafe; background: #07111f; border: 1px solid var(--line); border-radius: 12px; }
pre code { padding: 0; color: inherit; background: transparent; border: 0; }
.status { min-height: 1.35em; margin: 11px 0 0; color: var(--muted); font-size: .91rem; }
.note { margin-top: 15px; }
.related { border-top-color: rgba(96,165,250,.35); }
footer { margin-top: 26px !important; padding: 4px 0; opacity: .9; }

/* Modo claro: se activa con el botón superior y se guarda en el navegador. */
body.light {
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #142033;
  --muted: #526176;
  --line: rgba(51, 65, 85, .16);
  --blue-soft: rgba(59, 130, 246, .1);
}
body.light::before { background: radial-gradient(700px 350px at 50% -80px, rgba(59,130,246,.14), transparent 70%); }
body.light input, body.light textarea, body.light select { color: #172033; background: #fff; border-color: #cbd5e1; }
body.light nav { background: rgba(255,255,255,.88); }
body.light .card { background: rgba(255,255,255,.92); box-shadow: 0 14px 35px rgba(15,23,42,.07); }
body.light .out { background: #f8fafc; border-color: #e2e8f0; }
body.light label, body.light .faq summary { color: #1e293b; }
body.light .note { background: #eff6ff; color: #334155; }

.theme-toggle { position: fixed; z-index: 20; right: 16px; bottom: 16px; min-width: 46px; min-height: 46px; margin: 0; padding: 9px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text); box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: 1.15rem; }
.theme-toggle:hover { background: var(--surface-2); color: var(--text); transform: translateY(-2px); }
@media (max-width: 620px) { .wrap { width: min(100% - 22px, 960px); padding-top: 22px; } .grid, .out { grid-template-columns: 1fr; } .copy { width: 100%; } nav { justify-content: flex-start; } nav a { font-size: .8rem; padding: 7px 9px; } .card { padding: 20px; } }

/* Contraste reforzado para modo claro. */
body.light { --text: #0f172a; --muted: #475569; }
body.light .out b { color: #1d4ed8; }
body.light .copy { color: #fff; background: #475569; }
body.light .copy:hover { background: #2563eb; }
body.light .tool-card { color: #0f172a; background: linear-gradient(145deg, #ffffff, #eef5ff); border-color: #d6e1f0; box-shadow: 0 12px 26px rgba(15,23,42,.08); }
body.light .tool-card p { color: #475569; }
body.light .tag { background: #e2e8f0; color: #1e3a5f; }
body.light .theme-toggle { background: #fff; color: #0f172a; border-color: #cbd5e1; }

/* Jerarquía de la home: Letras Lindas es la herramienta principal. */
.tools .tool-card:first-child { grid-column: span 2; min-height: 230px; }
.tools .tool-card:first-child .icon { width: 54px; height: 54px; font-size: 25px; }
.tools .tool-card:first-child h2 { font-size: 1.42rem; }
@media (max-width: 760px) { .tools .tool-card:first-child { grid-column: span 1; min-height: 190px; } }

/* Encabezado estándar de cada herramienta. */
header h1 + p.muted, header h1 + p.intro { max-width: 620px; }
header + nav { margin-top: 2px; }
