/* Web de Pulso. Los colores y las tipografías vienen de /app/theme.css (los mismos del panel). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1; }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--cobalt); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
code, kbd { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .88em; background: var(--raised); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; overflow-wrap: anywhere; }

.wrap { width: min(1160px, 100% - 48px); margin-inline: auto; }
.narrow { width: min(720px, 100% - 48px); margin-inline: auto; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 12px; }
.muted { color: var(--muted); }
.small { font-size: 14.5px; }
.center { text-align: center; }

/* ---------- Titulares ---------- */
h1, h2, h3 { font-family: var(--font-display); font-stretch: 82%; font-weight: 740; letter-spacing: -0.015em; line-height: 1.04; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(38px, 5.4vw, 64px); font-stretch: 78%; font-weight: 780; }
h2 { font-size: clamp(29px, 3.4vw, 44px); }
h3 { font-size: 21px; font-stretch: 88%; font-weight: 680; line-height: 1.2; letter-spacing: -0.005em; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; color: var(--muted); max-width: 56ch; text-wrap: pretty; }
.num { font-family: var(--font-display); font-stretch: 84%; font-variant-numeric: tabular-nums lining-nums; }

/* ---------- Botones ---------- */
.b {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  border: 1.5px solid var(--ink); border-radius: 8px;
  background: var(--ink); color: var(--paper);
  font-weight: 650; font-size: 16px; line-height: 1.1; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .12s ease, background-color .12s ease, border-color .12s ease;
}
.b:hover { background: color-mix(in srgb, var(--ink) 88%, var(--cobalt)); border-color: color-mix(in srgb, var(--ink) 88%, var(--cobalt)); }
.b:active { transform: translateY(1px); }
.b.alt { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.b.alt:hover { border-color: var(--ink); background: transparent; }
.b.quiet { background: transparent; border-color: transparent; color: var(--muted); padding: 0 10px; min-height: 38px; font-weight: 550; }
.b.quiet:hover { color: var(--ink); background: transparent; border-color: transparent; }
.b.danger { background: transparent; color: var(--red); border-color: color-mix(in srgb, var(--red) 55%, transparent); }
.b.danger:hover { border-color: var(--red); background: transparent; }
.b.sm { min-height: 38px; padding: 0 14px; font-size: 14.5px; }
.b.wide { width: 100%; }
.b[disabled], .b[aria-busy='true'] { opacity: .55; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Cabecera ---------- */
.top { display: flex; align-items: center; gap: 30px; min-height: 76px; position: relative; z-index: 5; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 780 25px/1 var(--font-display); font-stretch: 80%; letter-spacing: -0.01em; }
.logo svg { width: 30px; height: 30px; flex: none; }
.nav { display: flex; gap: 24px; margin-right: auto; }
.nav a, .top .link { color: var(--muted); text-decoration: none; font-size: 15.5px; font-weight: 550; padding: 6px 0; }
.nav a:hover, .top .link:hover, .nav a[aria-current='page'] { color: var(--ink); }
.nav a[aria-current='page'] { box-shadow: 0 2px 0 var(--cobalt); }
.top-actions { display: flex; align-items: center; gap: 18px; }
.menu-btn { display: none; margin-left: auto; min-height: 42px; padding: 0 14px; background: transparent; border: 1.5px solid var(--line-strong); border-radius: 8px; font-weight: 600; cursor: pointer; }
@media (max-width: 820px) {
  .top { flex-wrap: wrap; gap: 0 16px; }
  .menu-btn { display: inline-flex; align-items: center; }
  .nav, .top-actions { display: none; width: 100%; }
  .top.open .nav { display: grid; gap: 2px; padding: 8px 0 4px; margin: 0; }
  .top.open .nav a { padding: 10px 0; font-size: 17px; border-bottom: 1px solid var(--line); }
  .top.open .top-actions { display: flex; flex-wrap: wrap; padding: 14px 0 18px; }
}

/* ---------- Pie ---------- */
.foot { margin-top: 120px; border-top: 1px solid var(--line); padding: 44px 0 40px; color: var(--muted); font-size: 15px; }
.foot-grid { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 32px; }
.foot h4 { margin: 0 0 10px; font: 650 14px/1.3 var(--font-ui); color: var(--ink); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }
.foot-note { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; font-size: 14px; }
.theme-pick { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.theme-pick button { background: transparent; border: 0; padding: 7px 12px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.theme-pick button + button { border-left: 1px solid var(--line-strong); }
.theme-pick button[aria-pressed='true'] { background: var(--raised); color: var(--ink); font-weight: 600; }
@media (max-width: 760px) { .foot { margin-top: 80px; } .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Secciones ---------- */
.section { padding-top: clamp(72px, 10vw, 128px); }
.section-head { display: grid; gap: 16px; margin-bottom: clamp(28px, 4vw, 52px); max-width: 760px; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* ---------- Portada: el pulso del día ---------- */
.hero { padding-top: clamp(28px, 4.4vw, 60px); }
.hero h1 { font-size: clamp(46px, 7.6vw, 108px); line-height: .92; font-stretch: 74%; font-weight: 800; letter-spacing: -0.022em; max-width: 12ch; }
.hero .lead { margin-top: 24px; max-width: 62ch; }
.hero .btn-row { margin-top: 28px; }
.hero-note { margin: 14px 0 0; font-size: 14.5px; color: var(--faint); }

.pulse { position: relative; margin-top: clamp(8px, 2vw, 28px); height: 250px; user-select: none; }
.pulse svg.trace { position: absolute; left: 0; right: 0; bottom: 34px; width: 100%; height: 90px; overflow: visible; }
.pulse .base { stroke: var(--line-strong); stroke-width: 1.5; fill: none; }
.pulse .beat { stroke: var(--cobalt); stroke-width: 2.5; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.pulse .tick { stroke: var(--line-strong); stroke-width: 1; }
.pulse .tick.big { stroke: var(--faint); }
.pulse-hours { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; margin: 0; padding: 0; list-style: none; }
.pulse-hours li { position: absolute; transform: translateX(-50%); font: 600 13px/1 var(--font-display); font-stretch: 86%; color: var(--faint); font-variant-numeric: tabular-nums; }
.pulse-hours li.now { color: var(--ink); }
.pulse-pet { position: absolute; bottom: 62px; width: 84px; height: 100px; margin-left: -42px; will-change: transform, left; }
.pulse-bubble {
  position: absolute; bottom: 176px; width: min(300px, 78vw); transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px 14px 14px 4px;
  padding: 12px 14px 12px; box-shadow: var(--shadow-soft);
  font-size: 15px; line-height: 1.4; opacity: 0; translate: 0 6px; transition: opacity .25s ease, translate .25s ease; pointer-events: none;
}
.pulse-bubble.on { opacity: 1; translate: 0 0; }
.pulse-bubble b { display: block; font: 700 12.5px/1.2 var(--font-display); font-stretch: 88%; color: var(--cobalt); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .pulse { height: 230px; } .pulse-pet { width: 68px; height: 82px; margin-left: -34px; } .pulse-bubble { bottom: 156px; } }

/* La mascota dibujada (mismas piezas que en la app de escritorio) */
.pet .body { width: 100%; height: 100%; overflow: visible; }
.pet .shadow { fill: rgba(0, 0, 0, .32); }
.pet .antenna { stroke: #8fa0bb; stroke-width: 3; stroke-linecap: round; }
.pet .led { fill: #7aa0ff; }
.pet .arm { fill: var(--limb); transform-box: fill-box; transform-origin: 50% 10%; }
.pet .leg { fill: #8fa0bb; transform-box: fill-box; transform-origin: 50% 0%; }
.pet .torso { fill: var(--body); }
.pet .screen { fill: var(--screen); }
.pet .eye { fill: #e8f1ff; transform-box: fill-box; transform-origin: 50% 50%; animation: pet-blink 5.2s infinite; }
.pet .eye-line { fill: none; stroke: #e8f1ff; stroke-width: 2.6; stroke-linecap: round; }
.pet .eyes { transition: transform .25s; }
.pet .eyes-closed, .pet .brows, .pet .steam { display: none; }
.pet .ecg { fill: none; stroke: #bfd0ff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; animation: pet-ecg 2.2s linear infinite; }
.pet .figure { transform-box: view-box; transform-origin: 50% 100%; animation: pet-breathe 3.4s ease-in-out infinite; }
.pet.walk .figure { animation: pet-bob .5s ease-in-out infinite; }
.pet.walk .leg-r, .pet.walk .arm-r { animation: pet-step .5s ease-in-out infinite; }
.pet.walk .leg-l, .pet.walk .arm-l { animation: pet-step .5s ease-in-out infinite reverse; }
.pet.walk .eyes { transform: translateX(4px); }
.pet.talk .figure { animation: pet-hop 1.2s ease-in-out infinite; }
.pet.talk .arm-r { animation: pet-wave .6s ease-in-out infinite; }
:root[data-theme='claro'] .pet .antenna, :root[data-theme='claro'] .pet .leg { stroke: #1b2733; }
:root[data-theme='claro'] .pet .leg { fill: #1b2733; }
@keyframes pet-blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes pet-ecg { from { stroke-dashoffset: 120; } to { stroke-dashoffset: 0; } }
@keyframes pet-breathe { 50% { transform: scaleY(.975) translateY(1px); } }
@keyframes pet-bob { 50% { transform: translateY(-2.5px); } }
@keyframes pet-step { 0%, 100% { transform: rotate(14deg); } 50% { transform: rotate(-14deg); } }
@keyframes pet-hop { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }
@keyframes pet-wave { 0%, 100% { transform: rotate(-150deg); } 50% { transform: rotate(-110deg); } }

/* ---------- Un día con Pulso ---------- */
.dayline { list-style: none; margin: 0; padding: 0; position: relative; }
.dayline::before { content: ''; position: absolute; left: 94px; top: 10px; bottom: 10px; width: 1.5px; background: var(--line-strong); }
.dayline li { display: grid; grid-template-columns: 72px 1fr; gap: 46px; padding: 0 0 34px; position: relative; }
.dayline li:last-child { padding-bottom: 0; }
.dayline li::before { content: ''; position: absolute; left: 88px; top: 9px; width: 13px; height: 13px; border-radius: 50%; background: var(--paper); border: 2px solid var(--cobalt); }
.dayline time { font: 720 22px/1.2 var(--font-display); font-stretch: 82%; font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; }
.dayline h3 { margin-bottom: 6px; }
.dayline p { margin: 0; color: var(--muted); max-width: 54ch; }
.dayline .said { display: inline-block; margin-top: 10px; padding: 8px 12px; border-radius: 12px 12px 12px 3px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 15px; }
@media (max-width: 560px) {
  .dayline::before { left: 5px; }
  .dayline li { grid-template-columns: 1fr; gap: 4px; padding-left: 28px; }
  .dayline li::before { left: -1px; top: 6px; }
  .dayline time { text-align: left; font-size: 19px; }
}

/* ---------- Filas de explicación (conexiones, dispositivos) ---------- */
.rows { margin: 0; display: grid; }
.rows > div { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 12px 40px; padding: 24px 0; border-top: 1px solid var(--line); }
.rows > div:last-child { border-bottom: 1px solid var(--line); }
.rows dt { font: 680 21px/1.2 var(--font-display); font-stretch: 86%; }
.rows dd { margin: 0; color: var(--muted); max-width: 60ch; }
.rows dd strong { color: var(--ink); font-weight: 600; }
@media (max-width: 700px) { .rows > div { grid-template-columns: 1fr; } }

.devices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.device figure { margin: 0 0 18px; aspect-ratio: 4 / 3; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: grid; place-items: center; }
.device figure { position: relative; }
.device figure img { position: absolute; top: 0; left: 0; width: 100%; height: auto; max-width: none; display: block; }
/* Cada captura se acerca a lo que importa: el panel por arriba a la izquierda, el escritorio hacia la mascota. */
.device figure.zoom-tl img { width: 140%; }
.device figure.zoom-br img { width: 150%; top: auto; left: auto; right: 0; bottom: 0; }
.device h3 { margin-bottom: 6px; }
.device p { color: var(--muted); margin: 0 0 12px; }
@media (max-width: 900px) { .devices { grid-template-columns: 1fr; max-width: 520px; } }

/* ---------- Planes ---------- */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px 30px 32px; display: flex; flex-direction: column; }
.plan.pro { border-color: var(--cobalt); box-shadow: 0 0 0 1px var(--cobalt) inset; }
.plan h3 { font-size: 26px; font-stretch: 82%; }
.plan .price { margin: 16px 0 4px; font: 780 54px/1 var(--font-display); font-stretch: 78%; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.plan .price small { font: 500 16px/1 var(--font-ui); color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.plan .per { color: var(--muted); font-size: 15px; min-height: 24px; margin: 0 0 20px; }
.plan ul { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 10px; }
.plan li { padding-left: 26px; position: relative; }
.plan li::before { content: ''; position: absolute; left: 2px; top: .52em; width: 12px; height: 6px; border: 2px solid var(--green); border-top: 0; border-right: 0; transform: rotate(-45deg); }
.plan li.no { color: var(--faint); }
.plan li.no::before { border: 0; height: 2px; width: 11px; top: .75em; background: var(--faint); transform: none; }
.plan .b { margin-top: auto; }
.bill-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; padding: 3px; gap: 3px; margin-bottom: 26px; }
.bill-toggle button { border: 0; background: transparent; padding: 8px 14px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--muted); }
.bill-toggle button[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }

/* ---------- Preguntas ---------- */
.faq { display: grid; }
.faq details { border-top: 1px solid var(--line); padding: 4px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 16px 34px 16px 0; font-weight: 600; font-size: 18px; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: 12px; font: 500 26px/1 var(--font-display); color: var(--muted); }
.faq details[open] summary::after { content: '–'; }
.faq details > *:not(summary) { color: var(--muted); max-width: 68ch; }
.faq details > :last-child { margin-bottom: 20px; }

/* ---------- Llamada final ---------- */
.closing { display: grid; gap: 22px; justify-items: start; padding: clamp(36px, 5vw, 64px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.closing h2 { max-width: 16ch; }

/* ---------- Formularios y páginas de acceso ---------- */
.auth { width: min(440px, 100% - 40px); margin: clamp(28px, 7vh, 90px) auto 0; }
.auth h1 { font-size: clamp(34px, 4.6vw, 46px); margin-bottom: 10px; }
.auth .lead { font-size: 17px; margin-bottom: 26px; }
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span, .field > label { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.field small { color: var(--muted); font-size: 13.5px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 10px 14px;
  background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--line-strong); border-radius: 8px;
  transition: border-color .12s ease;
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: var(--faint); }
.input:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 1px; border-color: var(--cobalt); }
.input[aria-invalid='true'] { border-color: var(--red); }
.pw { position: relative; }
.pw .input { padding-right: 92px; }
.pw button { position: absolute; right: 6px; top: 6px; bottom: 6px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 6px; }
.pw button:hover { color: var(--ink); }
.form-msg { margin: 0; padding: 11px 14px; border-radius: 8px; font-size: 15px; background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); }
.form-msg.ok { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.form-msg.info { background: var(--cobalt-soft); color: var(--ink); border-color: color-mix(in srgb, var(--cobalt) 40%, transparent); }
.or { display: flex; align-items: center; gap: 14px; color: var(--faint); font-size: 14px; margin: 4px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-alt { margin-top: 22px; color: var(--muted); font-size: 15.5px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--muted); }
.check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--cobalt); flex: none; }
.code-big { font: 780 40px/1 var(--font-display); font-stretch: 84%; letter-spacing: .06em; font-variant-numeric: tabular-nums; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; text-align: center; }

/* ---------- Cuenta ---------- */
.page-head { padding: clamp(28px, 5vw, 56px) 0 clamp(22px, 3vw, 36px); display: grid; gap: 10px; }
.page-head h1 { font-size: clamp(36px, 4.8vw, 56px); }
.acc { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.acc-nav { position: sticky; top: 20px; display: grid; gap: 2px; }
.acc-nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 550; font-size: 15.5px; border-left: 2px solid transparent; }
.acc-nav a:hover { color: var(--ink); }
.acc-nav a.on { color: var(--ink); background: var(--surface); border-left-color: var(--cobalt); }
.acc-body { display: grid; gap: 22px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px 28px; scroll-margin-top: 20px; }
.panel > h2 { font-size: 25px; font-stretch: 84%; margin-bottom: 6px; }
.panel > .muted { margin-bottom: 18px; max-width: 64ch; }
.panel .form { max-width: 520px; }
.kv { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); gap: 10px 20px; margin: 0; }
.kv dt { color: var(--muted); font-size: 15px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 4px; }
.list .who { min-width: 0; }
.list .who b { display: block; font-weight: 600; }
.list .who span { color: var(--muted); font-size: 14.5px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--raised); color: var(--muted); white-space: nowrap; }
.tag.ok { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.tag.warn { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.tag.err { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.tag.blue { color: var(--cobalt); background: var(--cobalt-soft); }
.meter { height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--cobalt); border-radius: 4px; }
.meter i.warn { background: var(--amber); }
.meter i.full { background: var(--red); }
.notice { padding: 14px 16px; border-radius: 10px; background: var(--cobalt-soft); border: 1px solid color-mix(in srgb, var(--cobalt) 35%, transparent); }
.notice.warn { background: color-mix(in srgb, var(--amber) 12%, transparent); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.notice p:last-child { margin-bottom: 0; }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
@media (max-width: 860px) {
  .acc { grid-template-columns: 1fr; }
  .acc-nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .acc-nav a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .acc-nav a.on { border-bottom-color: var(--cobalt); }
  .panel { padding: 22px 20px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
}

/* ---------- Guía ---------- */
.doc { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.doc-nav { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; display: grid; gap: 1px; padding-right: 6px; }
.doc-nav a { padding: 6px 12px; color: var(--muted); text-decoration: none; font-size: 15px; border-left: 2px solid var(--line); }
.doc-nav a:hover { color: var(--ink); }
.doc-nav a.on { color: var(--ink); border-left-color: var(--cobalt); font-weight: 600; }
.prose { max-width: 70ch; min-width: 0; }
.prose section { padding-bottom: 56px; scroll-margin-top: 20px; }
.prose h2 { font-size: clamp(27px, 3vw, 36px); margin-bottom: 16px; }
.prose h3 { margin: 30px 0 8px; }
.prose p, .prose li { color: color-mix(in srgb, var(--ink) 84%, var(--muted)); }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 1em; display: grid; gap: 6px; }
.prose .tip { margin: 18px 0; padding: 14px 16px; border-left: 3px solid var(--cobalt); background: var(--surface); border-radius: 0 10px 10px 0; }
.prose .tip p:last-child { margin: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 14px 0 20px; font-size: 15.5px; }
.prose th, .prose td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--muted); font-weight: 600; font-size: 14px; }
.steps { counter-reset: paso; list-style: none; padding: 0 !important; display: grid; gap: 14px !important; }
.steps > li { counter-increment: paso; padding-left: 46px; position: relative; }
.steps > li::before { content: counter(paso); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 720 15px/1 var(--font-display); background: var(--raised); border: 1px solid var(--line-strong); color: var(--ink); }
@media (max-width: 860px) { .doc { grid-template-columns: 1fr; } .doc-nav { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 6px; } .doc-nav a { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 14px; } .doc-nav a.on { border-color: var(--cobalt); } }

/* ---------- Descargas ---------- */
.dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1180px) { .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dl article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.dl article p { color: var(--muted); margin: 0; }
.dl article .b { margin-top: auto; align-self: flex-start; }
.dl .meta { font-size: 14px; color: var(--faint); }
.qr { background: #fff; padding: 10px; border-radius: 10px; width: 148px; height: 148px; }
@media (max-width: 900px) { .dl { grid-template-columns: 1fr; } }

/* ---------- Tablas (administración) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { font-size: 13.5px; color: var(--muted); font-weight: 600; background: var(--raised); }
table.data tr:last-child td { border-bottom: 0; }
table.data td.wrap-cell { white-space: normal; min-width: 220px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; }
.stat .v { font: 780 36px/1 var(--font-display); font-stretch: 80%; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 14.5px; margin-top: 6px; }

/* ---------- Avisos flotantes ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); max-width: min(520px, 100% - 32px); background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 10px; font-weight: 550; font-size: 15.5px; box-shadow: var(--shadow); z-index: 40; }
.toast.err { background: var(--red); color: #fff; }

/* ---------- Legal ---------- */
.legal { max-width: 72ch; }
.legal h2 { font-size: 26px; margin: 40px 0 12px; }
.legal p, .legal li { color: color-mix(in srgb, var(--ink) 84%, var(--muted)); }
.legal .draft { margin: 0 0 30px; }
.draft:empty { display: none; }

/* Invitación a un proyecto compartido (/unirse) */
.eyebrow-inv { margin: 0 0 8px; color: var(--cobalt); font-weight: 650; font-size: 14px; }
.invite-box { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 16px 18px; margin: 4px 0 20px; }
.invite-desc { margin: 0 0 8px; font-size: 16px; }
.invite-box .small { margin: 0; }
