:root {
  --bg: #fbfaf7; --bg-alt: #f2efe8; --surface: #ffffff; --text: #1d1f23; --muted: #5d636e;
  --border: #e3dfd6; --primary: #0f6e5c; --primary-ink: #ffffff; --primary-soft: #e3f2ee;
  --accent: #c2581b; --danger: #b42318; --ok: #12805c; --warn: #9a6700;
  --code-bg: #15181d; --code-text: #e6e8eb; --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .05), 0 6px 24px rgba(20, 20, 20, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317; --bg-alt: #171a1f; --surface: #1c2026; --text: #eceef1; --muted: #9aa1ad;
    --border: #2b3038; --primary: #3fb59a; --primary-ink: #08221c; --primary-soft: #16302a;
    --accent: #f08a4b; --danger: #f97066; --ok: #47cd89; --warn: #f5b83d; --code-bg: #0b0d10;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.01em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .9em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* Navegación */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.logo { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.nav-links { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a:not(.btn) { color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav-links a:not(.btn):hover { color: var(--text); }
@media (max-width: 760px) { .nav-links a:not(.btn) { display: none; } }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px;
  border-radius: 9px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .95rem;
  text-decoration: none; cursor: pointer; transition: transform .08s ease, background .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-alt); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-lg { padding: 13px 22px; font-size: 1.02rem; }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Hero */
.hero { padding: 64px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
@media (max-width: 920px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }
.hero-grid > * { min-width: 0; }
@media (max-width: 520px) {
  .nav-links { gap: 8px; }
  .nav-links .btn-ghost { display: none; }
  .brand { font-size: .95rem; }
  .code-card pre { font-size: .72rem; }
}
.eyebrow { color: var(--accent); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.lead { font-size: 1.15rem; color: var(--muted); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 18px; }
.badges { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.badges li { background: var(--primary-soft); color: var(--primary); padding: 4px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.code-card { background: var(--code-bg); color: var(--code-text); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.code-head { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.code-head span { width: 10px; height: 10px; border-radius: 50%; background: #3a3f47; }
.code-card pre { margin: 0; padding: 16px; overflow-x: auto; font-size: .82rem; line-height: 1.55; }
.c-mute { color: #7d8590; } .c-acc { color: #f0a46b; }

/* Secciones */
.section { padding: 64px 0; }
.section.alt { background: var(--bg-alt); }
.grid-2, .grid-3 { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card p:last-child { margin-bottom: 0; }
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.step-n { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-weight: 700; margin-bottom: 10px; }
.compat { margin-top: 24px; color: var(--muted); }

/* Precios */
.pricing { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 28px 0; }
@media (max-width: 860px) { .pricing { grid-template-columns: 1fr; } }
.price-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; }
.price-card.featured { border: 2px solid var(--primary); box-shadow: var(--shadow); }
.price-card ul { padding-left: 18px; margin: 0 0 20px; flex: 1; }
.price-card li { margin-bottom: 6px; }
.price { font-size: .95rem; color: var(--muted); }
.price span { font-size: 2.3rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.ribbon { position: absolute; top: -12px; right: 16px; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.addon { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pricing.compact .price-card { padding: 16px; }
.pricing.compact .price span { font-size: 1.7rem; }

details { border-bottom: 1px solid var(--border); padding: 14px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 10px 0 0; color: var(--muted); }
.cta-final { background: linear-gradient(135deg, var(--primary-soft), var(--bg-alt)); }

.footer { border-top: 1px solid var(--border); padding: 32px 0; font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }

/* Legal */
.legal { padding: 40px 16px 64px; }
.notice { background: #fff4e5; color: #7a4100; border: 1px solid #f5d9b0; padding: 10px 14px; border-radius: 8px; font-size: .9rem; }
@media (prefers-color-scheme: dark) { .notice { background: #2e2310; color: #f5c77e; border-color: #4d3a15; } }

/* Panel */
.app-main { padding: 32px 16px 64px; display: block; }
.app-main .card { margin-bottom: 16px; }
.auth { display: grid; place-items: center; min-height: 60vh; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab.active { color: var(--text); border-bottom-color: var(--primary); }
.form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
.form input, dialog input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
.form-ok { color: var(--ok); margin: 10px 0 0; font-size: .9rem; }
.form-ok:empty { display: none; }
.form-error { color: var(--danger); min-height: 1.2em; margin: 10px 0 0; font-size: .9rem; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.plan-badge { background: var(--primary-soft); color: var(--primary); padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: .9rem; }
.banner { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; background: var(--primary-soft); border: 1px solid var(--border); }
.banner.warn { background: #fff4e5; color: #7a4100; }
@media (prefers-color-scheme: dark) { .banner.warn { background: #2e2310; color: #f5c77e; } }
.stat .big { font-size: 1.6rem; font-weight: 800; margin: 0 0 6px; }
.bar { height: 8px; border-radius: 99px; background: var(--bg-alt); overflow: hidden; margin-bottom: 8px; }
.bar div { height: 100%; width: 0; background: var(--primary); transition: width .4s ease; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.dot.on { background: var(--ok); } .dot.off { background: var(--muted); }
.onboard { padding-left: 20px; margin: 0; }
.onboard li { margin-bottom: 12px; }
.onboard .btn { margin-left: 8px; }
.snippet-resource { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 10px; }
.snippet-resource select { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
.snippet { background: var(--code-bg); color: var(--code-text); border-radius: 10px; padding: 14px; overflow-x: auto; font-size: .82rem; white-space: pre; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.table th { color: var(--muted); font-weight: 600; }
.table th, .table .btn { white-space: nowrap; overflow-wrap: normal; }
.card:has(> .table) { overflow-x: auto; }
@media (max-width: 520px) { #keys-table th:nth-child(3), #keys-table td:nth-child(3) { display: none; } }
.revoked { opacity: .5; text-decoration: line-through; }
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); max-width: min(640px, calc(100vw - 32px)); width: 100%; padding: 24px; }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.secret { display: block; background: var(--code-bg); color: var(--code-text); padding: 12px; border-radius: 8px; overflow-wrap: anywhere; user-select: all; margin: 10px 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.docs h2 { margin-top: 40px; scroll-margin-top: 80px; }
.docs .lead { font-size: 1.05rem; }
.docs .toc ol { margin: 8px 0 0; padding-left: 20px; columns: 2; }
.docs .code-card, .docs .table, .docs > .card { margin: 16px 0; }
.docs .docs-dev { margin-top: 48px; }
@media (max-width: 520px) { .docs .toc ol { columns: 1; } }
