/* ============ Fuente: Plus Jakarta Sans (SIL OFL, guardada en este servidor) ============ */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/PlusJakartaSans-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* ============ Base ============ */
:root {
  --bg: #f6f6fb;
  --surface: #ffffff;
  --text: #1d1d2b;
  --muted: #6b6b80;
  --border: #e4e4ee;
  --primary: #6c5ce7;
  --primary-ink: #ffffff;
  --danger: #d63c4a;
  --ok-bg: #e7f8ef;  --ok-fg: #17663d;
  --err-bg: #fdecee; --err-fg: #a2202d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 50, .05), 0 8px 24px rgba(20, 20, 50, .06);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  body.app {
    --bg: #12121a; --surface: #1c1c28; --text: #ececf3; --muted: #9a9ab0; --border: #2c2c3c;
    --ok-bg: #133524; --ok-fg: #8fe0b2; --err-bg: #3d1a1f; --err-fg: #ff9aa4;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.02em; }
input, textarea, select, button { font-family: inherit; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* ============ Controls ============ */
input, textarea, select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: .6rem .75rem; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
input[type=color] { width: 3rem; height: 2.4rem; padding: .2rem; cursor: pointer; }
input[type=file] { padding: .4rem; }
input[type=radio], input[type=checkbox] { width: auto; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .9rem; }
label > input, label > textarea, label > select, label > .prefix-input { margin-top: .35rem; font-weight: 400; }
label.check { font-weight: 400; display: flex; gap: .4rem; align-items: center; margin: .4rem 0 0; }
.inline-label { display: flex; align-items: center; gap: .75rem; }
.inline-label input { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  padding: .65rem 1.1rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
}
.btn:hover { filter: brightness(.97); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.small { padding: .4rem .7rem; font-size: .85rem; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }
.icon-btn { background: none; border: 1px solid var(--border); border-radius: 6px; width: 1.8rem; height: 1.4rem; line-height: 1; cursor: pointer; color: var(--text); font-size: .8rem; }
.icon-btn:disabled { opacity: .3; cursor: default; }
form.inline { display: inline; margin: 0; }

.flash { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; background: var(--ok-bg); color: var(--ok-fg); }
.flash.error { background: var(--err-bg); color: var(--err-fg); }
.flash.warn { background: #fff4d6; color: #7a5200; margin: .75rem 0 0; }
@media (prefers-color-scheme: dark) { body.app .flash.warn { background: #3b2f10; color: #ffd98a; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }

/* ============ App chrome ============ */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.25rem; max-width: 1180px; margin: 0 auto; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.25rem; text-decoration: none; color: var(--text); letter-spacing: -.04em; }
.topbar nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topbar nav a:not(.btn) { color: var(--muted); text-decoration: none; }
.lang-switch { font-size: .85rem; color: var(--muted); }
.lang-switch a { color: inherit; }
.container { max-width: 1180px; margin: 0 auto; padding: 1rem 1.25rem 3rem; }
.site-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; }

/* ============ Home ============ */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; padding: 3rem 0; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); letter-spacing: -.03em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34rem; }
.cta { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.5rem 0 .75rem; }
.phone {
  justify-self: center; width: 270px; padding: 2rem 1.25rem; border-radius: 34px; text-align: center;
  background: linear-gradient(160deg, #ffd6e7, #c7d2fe); border: 8px solid #1d1d2b; box-shadow: var(--shadow);
  color: #1d1d2b;
}
.phone-avatar { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto .6rem; background: #6c5ce7; color: #fff; display: grid; place-items: center; font-size: 1.8rem; font-weight: 700; }
.phone-name { font-weight: 700; }
.phone-bio { font-size: .85rem; opacity: .75; margin-bottom: 1rem; }
.phone-link { background: #fff; border-radius: 12px; padding: .65rem; margin-top: .6rem; font-weight: 600; font-size: .9rem; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.features .card + .card { margin-top: 0; }

/* ============ Auth ============ */
.auth-box { max-width: 420px; margin: 2rem auto; }
.prefix-input { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.prefix-input span { padding: .6rem .5rem .6rem .75rem; color: var(--muted); font-weight: 400; white-space: nowrap; background: var(--bg); }
.prefix-input span.suf { padding: .6rem .75rem .6rem .5rem; }
.prefix-input input { border: 0; border-radius: 0; margin: 0; min-width: 0; }

/* ============ Dashboard ============ */
.dash-grid { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }
.dash-preview { position: sticky; top: 1rem; }
.preview-frame { margin-top: .5rem; border: 8px solid #1d1d2b; border-radius: 34px; overflow: hidden; height: 640px; box-shadow: var(--shadow); }
.preview-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.share { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.share a#public-url { font-weight: 600; word-break: break-all; }
.share-actions { display: flex; gap: .5rem; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }

.clicks { font-size: .8rem; color: var(--muted); min-width: 2.5rem; text-align: right; }
.clicks::after { content: " ↗"; }
.empty { padding: 1rem 0 .25rem; }

/* ---- Bloques en el panel ---- */
.storage { margin: .25rem 0 1rem; }
.storage-bar { height: 8px; border-radius: 99px; background: var(--border); overflow: hidden; margin-bottom: .3rem; }
.storage-bar span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.storage-bar span.full { background: var(--danger); }

.add-block { margin-bottom: 1rem; }
.add-block > summary { list-style: none; cursor: pointer; display: inline-flex; }
.add-block > summary::-webkit-details-marker { display: none; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin: .5rem 0 1rem; }
.type-opt { display: flex; flex-direction: column; gap: .15rem; padding: .75rem; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); background: var(--surface); }
.type-opt:hover { border-color: var(--primary); }
.type-opt.active { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: -2px; }
.type-opt small { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.type-ico { font-size: 1.4rem; }
.block-form { border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-top: .5rem; }
.block-form h3 { margin-bottom: .75rem; }

.block-card { border: 1px solid var(--border); border-radius: 12px; padding: .6rem .75rem; margin: .6rem 0 0; background: var(--surface); }
.block-card.is-hidden { opacity: .6; }
.block-card.dragging { opacity: .4; border-style: dashed; }
.block-head { display: flex; align-items: center; gap: .6rem; }
.drag { cursor: grab; color: var(--muted); font-size: 1.2rem; padding: 0 .15rem; user-select: none; touch-action: none; }
.type-badge { font-size: 1.3rem; flex: none; }
.block-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.block-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block-info .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block-actions { display: flex; gap: .25rem; flex: none; }
.block-actions .icon-btn { width: 2rem; height: 2rem; font-size: .95rem; }
.block-edit { margin-top: .4rem; }
.block-edit > summary { cursor: pointer; color: var(--primary); font-size: .85rem; font-weight: 600; padding: .25rem 0; }
.block-fields { padding-top: .5rem; border-top: 1px solid var(--border); margin-top: .35rem; }
.row-actions { display: flex; gap: .5rem; margin-top: .75rem; }
.thumbs-edit { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.thumb-opt { margin: 0; width: 84px; font-weight: 400; font-size: .75rem; }
.thumb-opt img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; display: block; }
.thumb-opt .check { margin: .25rem 0 0; }
.cover-edit { display: flex; align-items: center; gap: .75rem; margin: .5rem 0; }
.cover-edit img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }

.progress { position: relative; height: 22px; border-radius: 99px; background: var(--border); overflow: hidden; margin: .75rem 0; }
.progress .bar { height: 100%; width: 0; background: var(--primary); transition: width .15s linear; }
.progress .pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: .75rem; font-weight: 600; color: var(--text); mix-blend-mode: normal; }

.avatar-row { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.avatar-row label { margin-bottom: .2rem; }
.avatar-thumb { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-thumb.placeholder { background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 1.8rem; font-weight: 700; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.two-col label { margin-bottom: .2rem; }
.themes { border: 0; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.themes legend { font-weight: 600; font-size: .9rem; margin-bottom: .4rem; padding: 0; }
.theme-opt { display: flex; flex-direction: column; align-items: center; gap: .3rem; font-weight: 400; font-size: .8rem; margin: 0; cursor: pointer; }
.theme-opt input { position: absolute; opacity: 0; }
.swatch { width: 54px; height: 54px; border-radius: 12px; border: 2px solid var(--border); }
.theme-opt input:checked + .swatch { outline: 3px solid var(--primary); outline-offset: 2px; }
.theme-opt input:focus-visible + .swatch { outline: 3px dashed var(--primary); outline-offset: 2px; }
.not-found { max-width: 420px; margin: 3rem auto; }
.not-found h1 { font-size: 4rem; }

/* ============ Public profile themes ============ */
.theme-light  { --p-bg: linear-gradient(180deg, #f7f7fb, #ececf6); --p-fg: #1d1d2b; --p-card: #ffffff; --p-card-fg: #1d1d2b; }
.theme-dark   { --p-bg: linear-gradient(180deg, #17171f, #0c0c12);  --p-fg: #f2f2f7; --p-card: #24242f; --p-card-fg: #f2f2f7; }
.theme-sunset { --p-bg: linear-gradient(160deg, #ff9a8b, #ff6a88 50%, #ff99ac); --p-fg: #ffffff; --p-card: rgba(255,255,255,.92); --p-card-fg: #3a1d2a; }
.theme-ocean  { --p-bg: linear-gradient(160deg, #2193b0, #6dd5ed); --p-fg: #ffffff; --p-card: rgba(255,255,255,.92); --p-card-fg: #0e3a4a; }
.theme-forest { --p-bg: linear-gradient(160deg, #134e5e, #71b280); --p-fg: #ffffff; --p-card: rgba(255,255,255,.92); --p-card-fg: #143326; }
.swatch.theme-light, .swatch.theme-dark, .swatch.theme-sunset, .swatch.theme-ocean, .swatch.theme-forest { background: var(--p-bg); }

body.profile { min-height: 100vh; background: var(--p-bg); color: var(--p-fg); }
.profile-wrap { max-width: 560px; margin: 0 auto; padding: 3rem 1.25rem 2rem; text-align: center; }
.profile-avatar { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem; display: block; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.profile-avatar.placeholder { background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 2.6rem; font-weight: 700; }
.profile-name { font-size: 1.5rem; margin: 0; }
.profile-handle { opacity: .7; font-size: .9rem; }
.profile-bio { margin: .9rem auto 0; max-width: 28rem; opacity: .9; }
.profile-links { display: flex; flex-direction: column; gap: .8rem; margin-top: 2rem; }
.profile-link {
  display: block; padding: 1rem 1.25rem; border-radius: 14px; text-decoration: none; font-weight: 600;
  background: var(--p-card); color: var(--p-card-fg); border-left: 5px solid var(--accent);
  box-shadow: 0 2px 10px rgba(0,0,0,.08); transition: transform .12s ease, box-shadow .12s ease;
}
.profile-link:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.14); }
.profile-empty { opacity: .7; }
.profile-footer { margin-top: 3rem; font-size: .8rem; opacity: .75; display: flex; flex-direction: column; gap: .4rem; align-items: center; }
.profile-footer a { color: inherit; }

.profile-card { display: flex; align-items: center; gap: .85rem; text-align: left; padding: .9rem 1rem; border-radius: 14px;
  background: var(--p-card); color: var(--p-card-fg); border-left: 5px solid var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.file-ico { flex: none; width: 46px; height: 56px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: .75rem; font-weight: 800; letter-spacing: .03em; }
.file-info { flex: 1; min-width: 0; }
.file-title { font-weight: 700; overflow-wrap: anywhere; }
.file-meta { font-size: .8rem; opacity: .65; }
.file-actions { display: flex; flex-direction: column; gap: .4rem; flex: none; }
.pbtn { display: block; text-align: center; padding: .4rem .9rem; border-radius: 99px; font-size: .85rem; font-weight: 700; text-decoration: none; background: var(--accent); color: #fff; border: 2px solid var(--accent); }
.pbtn.ghost { background: transparent; color: var(--p-card-fg); border-color: color-mix(in srgb, var(--p-card-fg) 25%, transparent); }
.pbtn:hover { filter: brightness(1.08); }
@media (max-width: 420px) { .profile-card.file-card { flex-wrap: wrap; } .file-actions { flex-direction: row; width: 100%; } .file-actions .pbtn { flex: 1; } }

.audio-card { align-items: stretch; }
.audio-cover { width: 76px; height: 76px; flex: none; border-radius: 10px; object-fit: cover; }
.audio-cover.placeholder { background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 2rem; }
.audio-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: .4rem; }
.audio-body audio { width: 100%; height: 36px; }

.blk-heading { margin: 1.4rem 0 -.2rem; font-size: 1.15rem; letter-spacing: -.01em; }
.blk-text { margin: .2rem auto; max-width: 30rem; opacity: .92; }
.blk-images { margin: 0; display: grid; gap: .5rem; }
.blk-images .blk-img { display: block; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.12); background: var(--p-card); }
.blk-images img { display: block; width: 100%; height: auto; }
.blk-images.gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.blk-images.gallery .blk-img { aspect-ratio: 1; }
.blk-images.gallery img { height: 100%; object-fit: cover; }
.blk-images figcaption { grid-column: 1 / -1; font-size: .85rem; opacity: .85; }

body.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.92); display: grid; place-items: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; border-radius: 6px; }
.lb-close, .lb-nav { position: absolute; background: rgba(255,255,255,.14); color: #fff; border: 0; cursor: pointer; border-radius: 50%; width: 44px; height: 44px; font-size: 1.7rem; line-height: 1; }
.lb-close { top: .75rem; right: .75rem; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: .5rem; }
.lb-next { right: .5rem; }
.lightbox.single .lb-nav { display: none; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 1.5rem 0; }
  .features { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-preview { position: static; }
  .preview-frame { max-width: 340px; margin: .5rem auto 0; }
}
@media (max-width: 640px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .block-head { flex-wrap: wrap; }
  .block-info { flex-basis: calc(100% - 6rem); }
  .block-actions { margin-left: auto; }
  .clicks { order: 3; }
}


/* ============ Plantillas: panel ============ */
.badge { display: inline-block; font-size: .68rem; font-weight: 700; padding: .05rem .45rem; border-radius: 99px; background: #fff4d6; color: #7a5200; vertical-align: middle; }
.cover-thumb { width: 96px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; }
.cover-thumb.placeholder { background: var(--border); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: .75rem; margin: .75rem 0 1rem; }
.tpl-opt { position: relative; display: flex; flex-direction: column; gap: .2rem; margin: 0; padding: .55rem; border: 1px solid var(--border); border-radius: 14px; cursor: pointer; font-weight: 400; background: var(--surface); }
.tpl-opt input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-opt strong { font-size: .88rem; margin-top: .25rem; }
.tpl-opt small { color: var(--muted); font-size: .74rem; line-height: 1.3; }
.tpl-opt:has(input:checked) { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: -2px; }
.tpl-opt:has(input:focus-visible) { outline-style: dashed; }

.tpl-mini { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 10px; aspect-ratio: 3 / 3.6; border-radius: 10px; overflow: hidden; background: #f1f1f7; position: relative; }
.tpl-mini i { display: block; flex: none; }
.tpl-mini .m-cover { display: none; }
.tpl-mini .m-avatar { width: 22px; height: 22px; border-radius: 50%; background: #6c5ce7; }
.tpl-mini .m-line { height: 5px; border-radius: 3px; background: #6b7280; }
.tpl-mini .m-line.w1 { width: 46%; }
.tpl-mini .m-line.w2 { width: 66%; opacity: .45; margin-bottom: 3px; }
.tpl-mini .m-btn { width: 100%; height: 12px; border-radius: 5px; background: #fff; border: 1px solid #d6d6e3; }
.tpl-mini.t-musica { background: #0f0f17; }
.tpl-mini.t-musica .m-cover { display: block; width: calc(100% + 20px); height: 40px; margin: -12px -10px 0; background: linear-gradient(160deg, #a78bfa, #1e1b4b); }
.tpl-mini.t-musica .m-avatar { margin-top: -14px; box-shadow: 0 0 0 2px #a78bfa; background: #c4b5fd; }
.tpl-mini.t-musica .m-line { background: #e5e7eb; }
.tpl-mini.t-musica .m-btn { background: #24242f; border-color: #33334a; }
.tpl-mini.t-negocio { align-items: flex-start; }
.tpl-mini.t-negocio .m-cover { display: block; width: calc(100% + 20px); height: 30px; margin: -12px -10px 0; background: #bbf7d0; border-radius: 0 0 12px 12px; }
.tpl-mini.t-negocio .m-avatar { border-radius: 7px; margin-top: -14px; background: #16a34a; box-shadow: 0 0 0 2px #f1f1f7; }
.tpl-mini.t-negocio .m-btn:first-of-type, .tpl-mini.t-negocio .m-cover + .m-avatar + .m-line + .m-line + .m-btn { background: #16a34a; border-color: #16a34a; }
.tpl-mini.t-portafolio { align-items: flex-start; background: #fafafa; }
.tpl-mini.t-portafolio .m-avatar { width: 16px; height: 16px; background: #111827; }
.tpl-mini.t-portafolio .m-line.w1 { height: 7px; width: 64%; background: #111827; }
.tpl-mini.t-portafolio .m-btn { background: none; border: 0; border-bottom: 1px solid #c9c9d3; border-radius: 0; height: 9px; }
.tpl-mini.t-creador { background: linear-gradient(160deg, #fecdd3, #fbcfe8); }
.tpl-mini.t-creador .m-cover { display: block; width: calc(100% + 20px); height: 28px; margin: -12px -10px 0; background: linear-gradient(160deg, #ec4899, #f97316); }
.tpl-mini.t-creador .m-avatar { width: 30px; height: 30px; margin-top: -16px; background: #fdf2f8; box-shadow: 0 0 0 3px #ec4899; }
.tpl-mini.t-creador .m-btn { border-radius: 99px; border: 1.5px solid #ec4899; background: #fff; }

/* ============ Página pública: piezas comunes ============ */
.p-head { display: flex; flex-direction: column; align-items: center; position: relative; }
.p-cover { display: none; width: 100%; height: 200px; background-size: cover; background-position: center; background-color: var(--accent); }
.p-cover.empty { background-image: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 35%, #0b0b14)); }
.profile-name { font-weight: 800; letter-spacing: -.03em; }
.profile-link.contact { display: flex; align-items: center; justify-content: center; gap: .6rem; }
.profile-link .c-ico { font-size: 1.1em; }
.blk-heading { font-weight: 800; }
.blk-embed { margin: 0; }
.embed-box { border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 2px 10px rgba(0,0,0,.14); }
.embed-box.ratio { aspect-ratio: 16 / 9; }
.embed-box iframe { display: block; width: 100%; height: 100%; border: 0; }
.blk-embed.e-spotify .embed-box, .blk-embed.e-soundcloud .embed-box { background: transparent; box-shadow: none; }
.blk-embed figcaption { font-size: .85rem; opacity: .85; margin-top: .4rem; }
.profile-wrap, .p-head { --fade: linear-gradient(#000 55%, transparent); }

/* ---- Música: portada a todo el ancho, nombre grande ---- */
body.tpl-musica .profile-wrap { max-width: 600px; padding-top: 0; }
body.tpl-musica .p-head { margin: 0 -1.25rem; padding: 0 1.25rem; }
body.tpl-musica .p-cover { display: block; height: 270px; margin: 0 -1.25rem; width: calc(100% + 2.5rem); -webkit-mask-image: var(--fade); mask-image: var(--fade); }
body.tpl-musica .profile-avatar { width: 124px; height: 124px; margin: -78px auto .9rem; position: relative; box-shadow: 0 0 0 4px var(--accent), 0 14px 34px rgba(0,0,0,.4); }
body.tpl-musica .profile-name { font-size: 2.1rem; }
body.tpl-musica .profile-links { margin-top: 1.6rem; }
body.tpl-musica .profile-link { background: color-mix(in srgb, var(--p-card) 88%, transparent); border-left: 0; border-radius: 16px; padding: 1.1rem 1.25rem; }
body.tpl-musica .profile-card { border-left: 0; border-radius: 18px; }
body.tpl-musica .audio-cover { width: 92px; height: 92px; }
body.tpl-musica .blk-heading { font-size: 1.35rem; margin-top: 1.8rem; }

/* ---- Negocio local: portada, logo cuadrado, WhatsApp protagonista ---- */
body.tpl-negocio .profile-wrap { max-width: 520px; padding-top: 0; text-align: left; }
body.tpl-negocio .p-head { align-items: flex-start; margin: 0 -1.25rem; padding: 0 1.25rem; }
body.tpl-negocio .p-cover { display: block; height: 180px; margin: 0 -1.25rem; width: calc(100% + 2.5rem); border-radius: 0 0 28px 28px; }
body.tpl-negocio .profile-avatar { width: 96px; height: 96px; border-radius: 26px; margin: -48px 0 .8rem; position: relative; border: 4px solid var(--p-card); }
body.tpl-negocio .profile-name { font-size: 1.7rem; }
body.tpl-negocio .profile-bio { margin: .45rem 0 0; max-width: none; }
body.tpl-negocio .profile-links { margin-top: 1.5rem; }
body.tpl-negocio .profile-link { border-left: 0; border-radius: 16px; }
body.tpl-negocio .profile-link.contact { background: var(--accent); color: #fff; padding: 1.15rem; font-size: 1.05rem; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent); }
body.tpl-negocio .profile-card { border-left: 0; border-radius: 16px; }
body.tpl-negocio .blk-heading, body.tpl-negocio .blk-text { text-align: left; margin-left: 0; }
body.tpl-negocio .blk-text { background: var(--p-card); color: var(--p-card-fg); padding: .95rem 1.1rem; border-radius: 16px; margin-top: 0; margin-bottom: 0; max-width: none; }
body.tpl-negocio .profile-footer { align-items: flex-start; }

/* ---- Portafolio: editorial, a la izquierda, listas con línea ---- */
body.tpl-portafolio .profile-wrap { max-width: 760px; padding-top: 4rem; text-align: left; }
body.tpl-portafolio .p-head { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 1.2rem; }
body.tpl-portafolio .profile-avatar { width: 84px; height: 84px; margin: 0; box-shadow: none; }
body.tpl-portafolio .p-id { flex: 1; min-width: 14rem; }
body.tpl-portafolio .profile-name { font-size: 2.3rem; line-height: 1.05; letter-spacing: -.04em; }
body.tpl-portafolio .profile-bio { margin: .55rem 0 0; max-width: 34rem; opacity: .72; font-size: 1.04rem; }
body.tpl-portafolio .profile-links { gap: 0; margin-top: 2.6rem; }
body.tpl-portafolio .profile-link { display: flex; justify-content: space-between; align-items: center; background: transparent; color: var(--p-fg); box-shadow: none; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--p-fg) 16%, transparent); border-radius: 0; padding: 1.05rem 0; font-size: 1.05rem; }
body.tpl-portafolio .profile-link::after { content: "↗"; opacity: .45; transition: transform .15s ease; }
body.tpl-portafolio .profile-link:hover { transform: none; box-shadow: none; }
body.tpl-portafolio .profile-link:hover::after { transform: translate(2px, -2px); opacity: 1; }
body.tpl-portafolio .profile-link.contact { justify-content: flex-start; }
body.tpl-portafolio .profile-link.contact::after { margin-left: auto; }
body.tpl-portafolio .blk-heading { font-size: .78rem; text-transform: uppercase; letter-spacing: .16em; opacity: .55; margin: 2.4rem 0 .5rem; }
body.tpl-portafolio .blk-text { text-align: left; margin: .25rem 0; max-width: 38rem; }
body.tpl-portafolio .blk-images { margin: .6rem 0; }
body.tpl-portafolio .blk-images.gallery { grid-template-columns: repeat(3, 1fr); gap: .4rem; }
body.tpl-portafolio .blk-images .blk-img { border-radius: 6px; box-shadow: none; }
body.tpl-portafolio .profile-card { background: transparent; box-shadow: none; border: 1px solid color-mix(in srgb, var(--p-fg) 18%, transparent); border-left: 1px solid color-mix(in srgb, var(--p-fg) 18%, transparent); border-radius: 12px; color: var(--p-fg); }
body.tpl-portafolio .profile-footer { align-items: flex-start; }

/* ---- Creador: foto grande con aro, botones tipo píldora ---- */
body.tpl-creador .profile-wrap { max-width: 540px; padding-top: 0; }
body.tpl-creador .p-head { margin: 0 -1.25rem; padding: 0 1.25rem; }
body.tpl-creador .p-cover { display: block; height: 170px; margin: 0 -1.25rem; width: calc(100% + 2.5rem); -webkit-mask-image: var(--fade); mask-image: var(--fade); }
body.tpl-creador .profile-avatar { width: 136px; height: 136px; margin: -70px auto .8rem; position: relative; box-shadow: 0 0 0 5px var(--accent), 0 14px 34px rgba(0,0,0,.25); }
body.tpl-creador .profile-name { font-size: 2rem; }
body.tpl-creador .profile-links { gap: .85rem; margin-top: 1.7rem; }
body.tpl-creador .profile-link { border-radius: 999px; border: 2px solid var(--accent); border-left-width: 2px; padding: 1.05rem 1.5rem; font-weight: 700; }
body.tpl-creador .profile-link:first-of-type { background: var(--accent); color: #fff; box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 38%, transparent); }
body.tpl-creador .profile-card { border-left: 0; border-radius: 22px; border: 2px solid var(--accent); }
body.tpl-creador .blk-heading { margin-top: 1.5rem; }

/* ---------- Vista previa de plantillas ---------- */
.tpl-layout { display: grid; grid-template-columns: 1fr 305px; gap: 1.5rem; align-items: start; }
.tpl-preview { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; position: sticky; top: 1rem; }
.phone-frame { width: 289px; height: 562px; border: 8px solid #15151f; border-radius: 34px; overflow: hidden; background: #fff; position: relative; box-shadow: 0 18px 40px rgba(20, 20, 40, .22); flex: none; }
.phone-frame iframe { width: 390px; height: 780px; border: 0; transform: scale(.7); transform-origin: 0 0; display: block; background: #fff; }
@media (max-width: 860px) {
  .tpl-layout { grid-template-columns: 1fr; }
  .tpl-preview { position: static; }
}

/* ---------- Página de inicio ---------- */
body.landing { margin: 0; color: #f3f0ff; background: #140f2e; overflow-x: hidden; }
body.landing a { color: inherit; }
.landing::before { content: ""; position: fixed; inset: 0; z-index: -1; background:
  radial-gradient(60rem 40rem at 15% -10%, rgba(139, 92, 246, .55), transparent 60%),
  radial-gradient(50rem 40rem at 95% 30%, rgba(236, 72, 153, .30), transparent 60%),
  radial-gradient(60rem 50rem at 40% 110%, rgba(59, 130, 246, .28), transparent 60%),
  linear-gradient(180deg, #1a1240, #140f2e 60%, #0f0b24); }
.l-top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; padding: 1rem 1.25rem; }
.l-top nav { max-width: 1100px; margin: 0 auto; display: flex; justify-content: flex-end; gap: 1.25rem; align-items: center; font-size: .95rem; }
.l-top nav a { text-decoration: none; opacity: .85; }
.l-top nav a:hover { opacity: 1; }
.l-top .lang-switch, .l-foot .lang-switch { color: rgba(243, 240, 255, .7); }
.l-top .lang-switch a, .l-foot .lang-switch a { color: inherit; }

.l-hero { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 5rem 1.5rem 4rem; position: relative; }
.l-hero-in { max-width: 40rem; }
.l-logo { font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 800; letter-spacing: -.045em; margin-bottom: 1.25rem; }
.l-hero h1 { font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.05; letter-spacing: -.035em; margin: 0 0 1rem; }
.l-sub { font-size: 1.08rem; color: rgba(243, 240, 255, .78); margin: 0 auto 1.8rem; max-width: 34rem; }
.l-cta { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.l-btn { background: #fff; color: #231a52 !important; border-color: transparent; font-weight: 700; padding: .8rem 1.6rem; border-radius: 99px; text-decoration: none; display: inline-block; }
.l-btn:hover { filter: none; transform: translateY(-1px); box-shadow: 0 10px 28px rgba(0, 0, 0, .35); }
.l-btn-ghost { background: transparent; color: #fff !important; border: 1.5px solid rgba(255, 255, 255, .45); padding: .8rem 1.6rem; border-radius: 99px; text-decoration: none; font-weight: 600; display: inline-block; }
.l-btn-ghost:hover { border-color: #fff; }
.l-note { margin: 1.2rem 0 0; font-size: .85rem; color: rgba(243, 240, 255, .6); }
.l-scroll { position: absolute; bottom: 1.6rem; left: 50%; transform: translateX(-50%); font-size: .85rem; text-decoration: none; opacity: .65; display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.l-scroll:hover { opacity: 1; }

.l-flow { max-width: 1040px; margin: 0 auto; padding: 0 1.25rem 3rem; position: relative; display: flex; flex-direction: column; align-items: center; }
.l-flow::before { content: ""; position: absolute; top: 0; bottom: 5rem; left: 50%; width: 2px; background: linear-gradient(180deg, rgba(255,255,255,.0), rgba(255,255,255,.28) 6%, rgba(255,255,255,.28) 94%, rgba(255,255,255,0)); transform: translateX(-1px); z-index: -1; }
.l-pill { background: #261c5c; border: 1px solid rgba(255, 255, 255, .28); border-radius: 99px; padding: .4rem 1rem; font-size: .8rem; font-weight: 700; letter-spacing: .02em; margin: 2.2rem 0 0; }
.l-panel { width: 100%; margin-top: 2.2rem; padding: 2.2rem 2rem; border-radius: 22px; background: rgba(32, 24, 76, .78); border: 1px solid rgba(255, 255, 255, .13); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.l-panel h2 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); letter-spacing: -.03em; margin: 0 0 .7rem; }
.l-panel p { color: rgba(243, 240, 255, .78); }
.l-lead { max-width: 36rem; margin: 0 auto 1.6rem; }
.l-center { text-align: center; }
.l-what { display: grid; grid-template-columns: 1fr auto; gap: 2.5rem; align-items: center; }
.l-url { font-size: .9rem; opacity: .75; }
.l-url { font-weight: 600; color: #c4b5fd !important; }

.l-tpls { text-align: center; }
.l-tpl-row { display: flex; gap: 1.6rem; overflow-x: auto; padding: .5rem .25rem 1.4rem; margin: 0 -.5rem 1rem; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.l-tpl { margin: 0; flex: none; scroll-snap-align: center; width: 258px; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.l-tpl figcaption { display: flex; flex-direction: column; gap: .15rem; font-size: .88rem; }
.l-tpl figcaption span { color: rgba(243, 240, 255, .65); font-size: .8rem; }
.phone-frame.sm { width: 258px; height: 500px; }
.phone-frame.sm iframe { transform: scale(.62); }

.l-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.4rem; text-align: left; }
.l-tile { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px; padding: 1.2rem; }
.l-tile h3 { margin: .6rem 0 .3rem; font-size: 1.05rem; }
.l-tile p { margin: 0; font-size: .9rem; }
.l-tile-n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(167, 139, 250, .25); color: #ddd6fe; font-weight: 800; font-size: .85rem; }
.l-final { background: linear-gradient(135deg, rgba(124, 58, 237, .55), rgba(236, 72, 153, .38)); }
.l-foot { text-align: center; font-size: .82rem; color: rgba(243, 240, 255, .55); padding: 1rem 1rem 2.5rem; }

@media (max-width: 760px) {
  .l-what { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .l-tiles { grid-template-columns: 1fr 1fr; }
  .l-panel { padding: 1.6rem 1.15rem; }
}
@media (max-width: 480px) { .l-tiles { grid-template-columns: 1fr; } }

/* Iconos automáticos en enlaces */
body .profile-link.has-ico { position: relative; padding-left: 3.1rem; padding-right: 3.1rem; text-align: center; }
.profile-link .l-ico { position: absolute; left: 1.05rem; top: 50%; transform: translateY(-50%); opacity: .8; }
body.tpl-portafolio .profile-link.has-ico { padding-left: 2.2rem; padding-right: 1.6rem; text-align: left; }
body.tpl-portafolio .profile-link .l-ico { left: 0; }
body.tpl-creador .profile-link:first-of-type .l-ico { opacity: 1; }

/* QR y zona de peligro */
.qr-card { display: flex; gap: 1.25rem; align-items: center; }
.qr-box { flex: 0 0 132px; line-height: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.qr-box svg { width: 132px; height: 132px; display: block; }
.qr-info h2 { margin: 0 0 .25rem; }
.qr-info p { margin: 0 0 .75rem; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.danger-zone summary { display: inline-block; cursor: pointer; list-style: none; }
.danger-zone summary::-webkit-details-marker { display: none; }
.delete-form { margin-top: 1rem; display: grid; gap: .8rem; max-width: 24rem; }
@media (max-width: 520px) { .qr-card { flex-direction: column; align-items: flex-start; } }
.l-flash { max-width: 34rem; margin: 1rem auto 0; position: relative; z-index: 5; }
