/* Página de enlaces de la bio (/links/) y sus formularios.
 * Hoja propia, sin matcha ni styles.css: la página se abre sobre todo en el
 * navegador interno de TikTok, y cada KB y cada hoja extra se notan ahí.
 * El ámbar es el sol del logo: marca lo que más importa, nada más. */

:root {
  --bg: #f6f1e7;
  --card: #fffdf8;
  --ink: #1d1a14;
  --muted: #6b6356;
  --line: #e2d9c6;
  --amber: #f0a52b;
  --amber-ink: #8a5000;
  --amber-soft: #fbecd0;
  --on-amber: #1d1405;
  --danger: #b42318;
  --focus: #1f6feb;
  --radius: 16px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e141b;
    --card: #151d27;
    --ink: #eef2f6;
    --muted: #9aa7b4;
    --line: #253244;
    --amber-ink: #ffc766;
    --amber-soft: #2b2313;
    --danger: #ff7b72;
    --focus: #58a6ff;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body.lh {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.lh a { color: var(--amber-ink); }
.lh :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.lh-wrap {
  max-width: 540px;
  margin: 0 auto;
  padding: 32px 16px 24px;
}

/* ── Cabecera ── */
.lh-head { text-align: center; margin-bottom: 24px; }
.lh-logo { width: 88px; height: 88px; border-radius: 50%; display: block; margin: 0 auto 12px; }
.lh-name { font-size: 1.5rem; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
.lh-tag { margin: 6px 0 0; color: var(--muted); }

/* ── Botones ── */
.lh-list { display: flex; flex-direction: column; gap: 12px; }

.lh-btn {
  display: grid;
  grid-template-columns: 40px 1fr 14px;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s, transform .08s;
}
.lh .lh-btn { color: var(--ink); }
.lh-btn:hover { border-color: var(--amber); }
.lh-btn:active { transform: translateY(1px); }

.lh-ico { font-size: 1.6rem; line-height: 1; text-align: center; }
.lh-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lh-t { font-weight: 700; font-size: 1.05rem; line-height: 1.3; }
.lh-s { color: var(--muted); font-size: .92rem; line-height: 1.35; }
.lh-arrow { font-size: 1.5rem; color: var(--muted); line-height: 1; }

.lh .lh-btn.is-hl { background: var(--amber); border-color: var(--amber); color: var(--on-amber); }
.lh-btn.is-hl .lh-s, .lh-btn.is-hl .lh-arrow { color: var(--on-amber); opacity: .85; }

.lh-badge {
  display: inline-block;
  align-self: flex-start;
  margin-top: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber-ink);
  font-size: .85rem;
  font-weight: 700;
}
.lh-btn.is-hl .lh-badge { background: var(--on-amber); color: var(--amber); }

.lh-btn-center { display: flex; justify-content: center; min-height: 52px; margin-top: 24px; font-weight: 700; }

/* ── Buscador de guías ── */
.lh-guides {
  margin: -4px 0 4px;
  padding: 14px 16px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.lh-search-label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 8px; }
.lh-search {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
}
.lh-empty { margin: 10px 0 0; color: var(--muted); font-size: .92rem; }
.lh-all { margin-top: 10px; }
.lh-all summary { cursor: pointer; color: var(--amber-ink); font-weight: 600; padding: 6px 0; }
.lh-group h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 4px; }
.lh-group ul { list-style: none; margin: 0; padding: 0; }
.lh-group li a { display: block; padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.lh-group li:last-child a { border-bottom: 0; }

/* ── Redes ── */
.lh-social { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.lh-social a {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
}

/* ── Pie ── */
.lh-foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 8px 16px 32px; }
.lh-foot p { margin: 4px 0; }
.lh-foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.lh-foot a { color: var(--muted); }

/* ── Formularios ── */
.lh-back { display: inline-block; margin-bottom: 16px; text-decoration: none; font-weight: 600; }
.lh-h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.01em; }
.lh-lead { color: var(--muted); margin: 0 0 16px; }
.lh-small { color: var(--muted); font-size: .9rem; margin: 8px 0 0; }

.lh-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 16px 0;
}
.lh-card h2 { font-size: 1rem; margin: 14px 0 6px; }
.lh-card h2:first-child { margin-top: 0; }
.lh-card h3 { font-size: .95rem; margin: 16px 0 6px; }
.lh-card ul { margin: 0; padding-left: 0; list-style: none; }
.lh-card li { position: relative; padding-left: 26px; margin: 6px 0; }
.lh-yes li::before { content: "✓"; position: absolute; left: 4px; color: var(--amber-ink); font-weight: 700; }
.lh-no li::before { content: "–"; position: absolute; left: 6px; color: var(--muted); font-weight: 700; }
.lh-dots li::before { content: "•"; position: absolute; left: 7px; color: var(--muted); }

.lh-form { margin-top: 8px; }
.lh-field { margin: 0 0 16px; border: 0; padding: 0; }
.lh-field > label, .lh-multi legend { display: block; font-weight: 600; margin-bottom: 6px; }
.lh-opt { font-weight: 400; color: var(--muted); }
.lh-field input[type=text], .lh-field input[type=email], .lh-field textarea, .lh-field select {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
}
.lh-field textarea { resize: vertical; }
.has-error input, .has-error textarea { border-color: var(--danger); }
.lh-help { margin: 6px 0 0; font-size: .88rem; color: var(--muted); }
.lh-err { margin: 6px 0 0; font-size: .9rem; color: var(--danger); font-weight: 600; }
.lh-multi label, .lh-check label {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; font-weight: 400; cursor: pointer;
}
.lh-multi input, .lh-check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--amber); }

.lh-alert {
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-weight: 600;
}
.lh-alert p { margin: 0; }

.lh-submit {
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
  border: 0;
  border-radius: var(--radius);
  background: var(--amber);
  color: var(--on-amber);
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
}
.lh-submit:active { transform: translateY(1px); }

/* Campo trampa: fuera de la vista sin `display:none`, que algunos bots saltan. */
.lh-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.cf-turnstile { margin: 8px 0; }

.lh-done { text-align: center; padding-top: 24px; }
.lh-done-mark {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%;
  display: grid; place-items: center; font-size: 2rem; font-weight: 700;
  background: var(--amber); color: var(--on-amber);
}

/* ── Panel del dueño ── */
.lh-stats { max-width: 540px; }
.lh-range { display: flex; gap: 8px; margin: 8px 0 4px; }
.lh-range a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); }
.lh-range a[aria-current] { background: var(--amber); border-color: var(--amber); color: var(--on-amber); font-weight: 700; }

.lh-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
.lh-kpi {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-size: .85rem; color: var(--muted);
}
.lh-kpi-n { font-size: 1.5rem; font-weight: 700; color: var(--ink); }

.lh-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.lh-table th, .lh-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.lh-table th { color: var(--muted); font-weight: 600; font-size: .8rem; }

/* Bajo 640px la tabla se vuelve tarjetas: nunca scroll horizontal. */
@media (max-width: 640px) {
  .lh-table thead { display: none; }
  .lh-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .lh-table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 0; }
  .lh-table td::before { content: attr(data-label); color: var(--muted); }
}

.lh-bar-row { margin: 12px 0; }
.lh-bar-label { display: flex; justify-content: space-between; gap: 12px; }
.lh-bar { height: 8px; border-radius: 99px; background: var(--amber-soft); overflow: hidden; margin: 4px 0; }
.lh-bar span { display: block; height: 100%; background: var(--amber); }
.lh-flag { color: var(--danger); font-weight: 600; }

.lh-copy li { padding-left: 0; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; margin: 10px 0; }
.lh-copy-name { grid-column: 1 / -1; font-weight: 700; text-transform: capitalize; }
.lh-copy code { font-size: .85rem; overflow-wrap: anywhere; }
.lh-copy-btn {
  font: inherit; font-size: .85rem; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--amber); background: transparent; color: var(--amber-ink); cursor: pointer;
}
.lh code { font-size: .85em; overflow-wrap: anywhere; }
