:root {
  --bg: #0b0e14;
  --bg-2: #0f131c;
  --panel: #121722;
  --border: #1e2634;
  --text: #dbe2ef;
  --muted: #7d8aa0;
  --accent: #4ade80;
  --accent-dim: rgba(74, 222, 128, 0.12);
  --error: #f87171;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(900px 400px at 80% -10%, rgba(74, 222, 128, 0.06), transparent),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 8px;
  color: var(--text); text-decoration: none;
  font-weight: 700; letter-spacing: -0.02em; font-size: 1.05rem;
}
.brand__icon { color: var(--accent); }
.brand__accent { color: var(--accent); }
.topbar nav { display: flex; gap: 22px; }
.topbar nav a {
  color: var(--muted); text-decoration: none; font-size: 0.85rem;
  letter-spacing: 0.04em; transition: color 200ms;
}
.topbar nav a:hover { color: var(--accent); }
.topbar nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: clamp(28px, 5vw, 56px) 16px 26px; }
.hero__kicker {
  color: var(--accent); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.28em; margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.12;
}
.hero__sub {
  color: var(--muted); max-width: 560px; margin: 14px auto 0;
  font-size: 1rem;
}

/* ---------- tool ---------- */
.tool {
  max-width: 1180px; margin: 0 auto; padding: 0 clamp(12px, 3vw, 32px);
}
.toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 10px 12px;
}
.toolbar__group {
  display: inline-flex; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 3px; gap: 2px;
}
.seg {
  background: transparent; border: 0; color: var(--muted);
  font: inherit; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.05em;
  min-height: 34px; padding: 6px 14px; border-radius: 6px; cursor: pointer;
  transition: all 180ms;
}
.seg--sm { padding: 6px 10px; font-size: 0.75rem; }
.seg:hover { color: var(--text); }
.seg.is-active { background: var(--accent-dim); color: var(--accent); }
.seg:focus-visible { outline: 2px solid var(--accent); }
.toolbar__actions { display: flex; gap: 8px; margin-left: auto; }
.btn {
  font: inherit; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.03em;
  min-height: 44px; padding: 8px 18px; border-radius: 8px; cursor: pointer;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border);
  transition: all 180ms;
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #08120b; border-color: var(--accent); }
.btn--primary:hover { filter: brightness(1.1); color: #08120b; }
.btn--ghost { min-width: 44px; padding: 8px 0; color: var(--muted); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.panes {
  display: grid; grid-template-columns: 1fr 1fr;
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  background: var(--panel);
}
.pane { display: flex; flex-direction: column; min-width: 0; }
.pane:first-child { border-right: 1px solid var(--border); }
.pane__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.pane__meta { letter-spacing: 0.02em; text-transform: none; font-weight: 500; }
.pane__actions { display: flex; gap: 4px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px;
  background: transparent; border: 1px solid transparent;
  color: var(--muted); cursor: pointer; transition: all 180ms;
}
.icon-btn:hover { color: var(--accent); border-color: var(--border); background: var(--bg-2); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); }
textarea {
  width: 100%; height: 300px; resize: vertical;
  background: var(--bg-2); color: var(--text);
  border: 0; padding: 14px; font-family: var(--mono);
  font-size: 0.85rem; line-height: 1.55; tab-size: 4;
}
textarea::placeholder { color: #4a5568; }
textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent-dim); }

.statusbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 9px 14px; font-size: 0.8rem;
  border-top: 0;
}
.statusbar__msg { color: var(--muted); min-height: 1.2em; }
.statusbar__msg--ok { color: var(--accent); }
.statusbar__msg--error { color: var(--error); }
.statusbar__stats { color: var(--muted); font-family: var(--mono); font-size: 0.75rem; }

/* ---------- contenido ---------- */
.content {
  max-width: 760px; margin: 0 auto; padding: clamp(30px, 5vw, 54px) 20px 0;
}
.content h2 {
  font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 750;
  letter-spacing: -0.02em; margin-bottom: 14px;
}
.content h2::before {
  content: ""; display: block; width: 34px; height: 3px;
  background: var(--accent); border-radius: 2px; margin-bottom: 12px;
}
.content h3 { font-size: 1.05rem; margin: 20px 0 6px; }
.content p { color: var(--muted); margin-bottom: 10px; }
.content strong { color: var(--text); }
.steps { margin: 0 0 14px 20px; color: var(--muted); }
.steps li { margin-bottom: 8px; }
kbd {
  background: var(--bg-2); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 7px; font-family: var(--mono); font-size: 0.78rem;
  color: var(--text);
}
details {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px;
  transition: border-color 200ms;
}
details[open] { border-color: #2c3a50; }
details summary {
  cursor: pointer; font-weight: 600; color: var(--text); list-style: none;
  position: relative; padding-right: 24px;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "+"; position: absolute; right: 4px; top: 0;
  color: var(--accent); font-weight: 700; transition: transform 200ms;
}
details[open] summary::after { content: "−"; }

.cta {
  max-width: 760px; margin: 34px auto 0; padding: 0 20px 40px;
  color: var(--muted); text-align: center;
}
.cta a { color: var(--accent); }

.footer {
  border-top: 1px solid var(--border); padding: 26px 20px 34px;
  text-align: center; color: var(--muted); font-size: 0.82rem;
}
.footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; margin-bottom: 12px; }
.footer a { color: var(--muted); text-decoration: none; transition: color 180ms; }
.footer a:hover { color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: var(--accent); color: #08120b; font-weight: 600; font-size: 0.85rem;
  padding: 10px 22px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: all 250ms; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); z-index: 50;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .panes { grid-template-columns: 1fr; }
  .pane:first-child { border-right: 0; border-bottom: 1px solid var(--border); }
  textarea { height: 220px; }
  .toolbar__actions { margin-left: 0; width: 100%; }
  .toolbar__actions .btn { flex: 1; }
}
@media (max-width: 480px) {
  .topbar nav { display: none; }
}
