/* Tema: claro por defecto, oscuro si el sistema lo pide, y siempre el que elija el usuario (data-theme). */
:root {
  --bg: #f5f5fa; --card: #ffffff; --raise: #ffffff; --fg: #12131a; --muted: #686d82; --line: #e5e6ef;
  --accent: #5b4ef0; --accent-2: #a45cf6; --accent-fg: #ffffff; --soft: #efeeff;
  --ok: #0b8457; --ok-soft: #e2f6ec; --bad: #c2311f; --bad-soft: #fdecea; --warn-soft: #fff4dd;
  --shadow: 0 1px 2px rgba(20, 20, 45, .04), 0 10px 30px rgba(20, 20, 45, .06);
  --glow: .5;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #0a0b10; --card: #13151c; --raise: #191c25; --fg: #eceef5; --muted: #8b92a8; --line: #222634;
    --accent: #918aff; --accent-2: #c58dff; --accent-fg: #0a0b10; --soft: #1b1c33;
    --ok: #4ade80; --ok-soft: #11261b; --bad: #ff8070; --bad-soft: #2c1614; --warn-soft: #2a2110;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 34px rgba(0, 0, 0, .38);
    --glow: .28;
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
  --bg: #0a0b10; --card: #13151c; --raise: #191c25; --fg: #eceef5; --muted: #8b92a8; --line: #222634;
  --accent: #918aff; --accent-2: #c58dff; --accent-fg: #0a0b10; --soft: #1b1c33;
  --ok: #4ade80; --ok-soft: #11261b; --bad: #ff8070; --bad-soft: #2c1614; --warn-soft: #2a2110;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 34px rgba(0, 0, 0, .38);
  --glow: .28;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; transition: background .3s, color .3s; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
code { background: var(--soft); padding: 1px 6px; border-radius: 6px; }
pre { margin: 6px 0 0; white-space: pre-wrap; word-break: break-all; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.addr code, .addrline code, code.tiny { background: none; padding: 0; }
small { font-size: 12.5px; color: var(--muted); }
.tiny { font-size: 12px; word-break: break-all; }
.i { width: 18px; height: 18px; flex: none; }
.neg { color: var(--bad); } .pos { color: var(--ok); }
.grow { flex: 1; }
.amt { white-space: nowrap; }
[hidden] { display: none !important; }

/* Fondo: dos manchas de color muy suaves que dan profundidad sin distraer. */
.aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--glow);
  background: radial-gradient(60vw 44vh at 12% -8%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%),
              radial-gradient(52vw 40vh at 96% 4%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 70%); }

/* ── Cabecera ── */
.top { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; color: var(--fg); letter-spacing: -.02em; margin-right: 6px; }
.brand:hover { text-decoration: none; }
.logo { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: inset 0 0 0 5px color-mix(in srgb, #fff 22%, transparent); }
nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
nav a { padding: 7px 13px; border-radius: 999px; color: var(--muted); white-space: nowrap; font-weight: 500; transition: background .2s, color .2s; }
nav a:hover { text-decoration: none; color: var(--fg); background: color-mix(in srgb, var(--fg) 6%, transparent); }
nav a.on { background: var(--soft); color: var(--accent); }
.pulse { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.pulse:hover { text-decoration: none; color: var(--fg); }
.pulse i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: beat 2.4s infinite; }
.tool { width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 12px; font-weight: 700; color: var(--muted); background: transparent; }
.tool:hover { color: var(--fg); }
.who { display: flex; align-items: center; gap: 9px; padding: 5px 13px 5px 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--fg); background: var(--card); font-size: 13.5px; white-space: nowrap; transition: border-color .2s, transform .2s var(--ease); min-height: 38px; max-width: 230px; }
.who:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.who.on { border-color: var(--accent); }
.who span:not(.av) { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.who b, .who small { overflow: hidden; text-overflow: ellipsis; }
.who .i { margin-left: 6px; }

/* ── Estructura ── */
main { max-width: 1060px; margin: 0 auto; padding: 28px 18px 96px; }
main.enter > * { animation: rise .5s var(--ease) both; }
main.enter > *:nth-child(2) { animation-delay: .04s; } main.enter > *:nth-child(3) { animation-delay: .08s; }
main.enter > *:nth-child(4) { animation-delay: .12s; } main.enter > *:nth-child(5) { animation-delay: .16s; }
main.enter > *:nth-child(n+6) { animation-delay: .2s; }
h1 { font-size: 27px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.028em; overflow-wrap: anywhere; }
h2 { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 34px 0 12px; }
.lead { color: var(--muted); margin: 0 0 18px; max-width: 700px; font-size: 15.5px; }
.hint { font-size: 13.5px; color: var(--muted); margin: 10px 0 0; }
a.hint { display: inline-flex; align-items: center; gap: 6px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.head > div:first-child { min-width: 0; flex: 1 1 320px; }
.title { display: flex; align-items: center; gap: 16px; min-width: 0; }
.title > div { min-width: 0; }
.title .lead { margin: 0; word-break: break-all; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
.split > * { min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card + .card, .card + details.card { margin-top: 12px; }
.card.flush { padding: 0; overflow-x: auto; }
.card.empty, .empty { color: var(--muted); text-align: center; padding: 26px 18px; }
.card.hero { text-align: center; padding: 56px 20px; }
.card.tip { display: flex; align-items: center; gap: 12px; background: var(--soft); border-color: transparent; box-shadow: none; margin: 14px 0; flex-wrap: wrap; }
.card.tip > span { flex: 1 1 260px; }
.card.tip.warn { background: var(--warn-soft); }
.card.sentence { display: flex; align-items: center; gap: 14px; font-size: 16.5px; }
.card.sentence > span:last-child { min-width: 0; }
details.card summary { cursor: pointer; color: var(--muted); font-weight: 500; }
details.card pre { margin-top: 12px; }

/* ── Avatares y personas ── */
.av { display: inline-block; width: 22px; height: 22px; border-radius: 50%; flex: none; vertical-align: middle; }
.av.sq { border-radius: 30%; }
.av.lg { width: 40px; height: 40px; } .av.xl { width: 56px; height: 56px; }
.person { display: inline-flex; align-items: center; gap: 7px; color: var(--fg); font-weight: 500; min-width: 0; vertical-align: middle; max-width: 100%; }
.person > span:not(.av):not(.tag) { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.people { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.people > span { display: inline-flex; align-items: center; gap: 6px; }
a.person:hover { text-decoration: none; color: var(--accent); }

/* ── Bienvenida ── */
.welcome { text-align: center; padding: 44px 0 20px; }
.eyebrow { display: inline-block; padding: 5px 14px; border-radius: 999px; background: var(--soft); color: var(--accent); font-weight: 600; font-size: 13px; margin-bottom: 18px; }
.welcome h1 { font-size: clamp(34px, 6.4vw, 60px); letter-spacing: -.045em; line-height: 1.04; margin-bottom: 18px; background: linear-gradient(120deg, var(--fg) 30%, var(--accent) 70%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.welcome .lead { margin: 0 auto 26px; font-size: 17.5px; max-width: 610px; }
.welcome small { display: block; margin-top: 14px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.welcome .cta { justify-content: center; margin-top: 0; }
.cta.sticky { position: sticky; bottom: 16px; background: var(--card); border: 1px solid var(--line); padding: 12px; border-radius: 18px; box-shadow: var(--shadow); margin-top: 18px; }
.steps3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.steps3 .card { margin: 0; transition: transform .3s var(--ease), border-color .3s; }
.steps3 .card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.steps3 .n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; margin-bottom: 12px; }
.steps3 p { color: var(--muted); margin: 6px 0 0; font-size: 14.5px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 28px; padding: 6px 2px; }
.facts b { display: block; font-size: 18px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.facts span { color: var(--muted); font-size: 14px; }

/* ── Ir a una app ── */
.go { padding: 22px 0 6px; }
.go h1 { font-size: clamp(26px, 4.4vw, 40px); letter-spacing: -.035em; margin-bottom: 16px; }
.search { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 7px 7px 7px 18px; box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s; margin-bottom: 16px; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent), var(--shadow); }
.search > .i { color: var(--muted); }
.search input { flex: 1; border: 0; background: none; padding: 10px 0; font-size: 16.5px; min-width: 0; }
.search input:focus { outline: none; box-shadow: none; }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.apps.one { grid-template-columns: 1fr; }
.app { display: flex; align-items: center; gap: 13px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; color: var(--fg); box-shadow: var(--shadow); transition: transform .28s var(--ease), border-color .2s; min-width: 0; }
.app:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--accent); }
.app > .i { color: var(--muted); transition: transform .28s var(--ease), color .2s; }
.app:hover > .i { transform: translateX(3px); color: var(--accent); }
.what { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.what b, .what small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Importes grandes: se adaptan al hueco y nunca se salen ── */
.big { font-size: clamp(22px, 3.4vw, 32px); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-width: 0; }
.big small { font-size: 14px; font-weight: 500; letter-spacing: 0; white-space: nowrap; }
.balance { background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 13%, var(--card)), var(--card) 62%); display: flex; flex-direction: column; gap: 10px; }
.balance.locked { align-items: flex-start; }
.balance .hint { margin: 0; }
.ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--soft); color: var(--accent); flex: none; }
.ic.bad { background: var(--bad-soft); color: var(--bad); }
.wallets { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.wallet { display: flex; flex-direction: column; gap: 10px; margin: 0 !important; transition: border-color .2s; }
.wallet.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent), var(--shadow); }
.wallet .person { width: 100%; }
.wallet .person > span:not(.av):not(.tag) { flex: 1; }

.addrline { display: inline-flex; align-items: center; justify-content: flex-start; align-self: flex-start; gap: 8px; background: none; border: 0; padding: 2px 0; color: var(--muted); font-weight: 400; cursor: pointer; max-width: 100%; text-align: left; white-space: normal; }
.addrline code { word-break: break-all; }
.addrline:hover { color: var(--accent); transform: none; }
.addr { display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0 0 12px; }
.addr code { flex: 1; word-break: break-all; }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.option { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 3px; text-align: left; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; color: var(--fg); font-weight: 400; box-shadow: var(--shadow); white-space: normal; }
.option .i { color: var(--accent); margin-bottom: 6px; }
.option:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }

/* ── Actividad ── */
.feed { padding: 6px; }
.feed .row { display: flex; align-items: center; gap: 13px; padding: 11px 12px; border-radius: 12px; cursor: pointer; transition: background .15s; flex-wrap: nowrap; }
.feed .row:hover { background: color-mix(in srgb, var(--fg) 4%, transparent); }
.feed .what > .line { white-space: normal; overflow-wrap: anywhere; }
.feed .what small { white-space: normal; }
.delta { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Tablas, fichas ── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 15px 16px; box-shadow: var(--shadow); min-width: 0; color: var(--fg); display: block; transition: border-color .2s, transform .28s var(--ease); }
a.tile:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.tile b { display: block; font-size: clamp(16px, 2vw, 20px); font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.3; }
.tile b .amt { white-space: normal; }
.tile b small { font-weight: 500; }
.tile > span { color: var(--muted); font-size: 13px; display: block; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: color-mix(in srgb, var(--fg) 2.5%, transparent); }
th { font-size: 12px; font-weight: 500; color: var(--muted); }
td.wrap { white-space: normal; word-break: break-word; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
td.arrow { color: var(--muted); padding-left: 0; padding-right: 0; width: 18px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 14px 24px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv dd > small { display: block; margin-top: 2px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--soft); color: var(--accent); white-space: nowrap; }
a.tag:hover { text-decoration: none; filter: brightness(.96); }
.tag.ok, .tag.mint { background: var(--ok-soft); color: var(--ok); }
.tag.burn { background: var(--bad-soft); color: var(--bad); }
.tabs { display: inline-flex; gap: 2px; padding: 4px; background: color-mix(in srgb, var(--fg) 6%, transparent); border-radius: 14px; margin: 4px 0 14px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 7px 14px; border-radius: 10px; color: var(--muted); font-weight: 500; white-space: nowrap; transition: background .2s, color .2s; }
.tabs a:hover { text-decoration: none; color: var(--fg); }
.tabs a.on { background: var(--card); color: var(--fg); box-shadow: var(--shadow); }
.name { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; }
.name .what { min-width: 200px; }
.params { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.unit { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); transition: border-color .2s, box-shadow .2s; }
.unit:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.unit input { border: 0; background: none; box-shadow: none !important; min-width: 0; }
.unit span { padding: 0 12px; color: var(--muted); font-size: 13px; white-space: nowrap; }

/* Suministro: una suma que se lee de arriba abajo. */
.eqs { padding: 6px 18px; }
.eq { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.eq:last-child { border-bottom: 0; }
.eq .sign { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--soft); color: var(--accent); font-weight: 700; font-size: 17px; flex: none; }
.eq .what b, .eq .what small { white-space: normal; }
.eq .num { font-size: clamp(15px, 2.2vw, 19px); font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.eq.total .sign { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.eq.total .num { font-size: clamp(17px, 2.8vw, 24px); }

/* Propuestas */
.prop { display: flex; flex-direction: column; gap: 10px; }
.prop.open { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.changes { margin: 0; padding-left: 18px; }
.changes li { overflow-wrap: anywhere; }
.bar { position: relative; display: flex; height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--fg) 8%, transparent); overflow: hidden; }
.bar i { display: block; height: 100%; transition: width .6s var(--ease); }
.bar .yes { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar .no { background: var(--bad); margin-left: auto; order: 3; }
.bar u { position: absolute; left: 66.67%; top: 0; bottom: 0; width: 2px; background: var(--fg); opacity: .55; }
.voters { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.voters > span { display: inline-flex; align-items: center; gap: 6px; }

/* ── Formularios ── */
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.row { align-items: flex-end; }
.rent .search { box-shadow: none; background: var(--bg); margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 150px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--muted); }
.field.narrow { flex: 0 0 140px; min-width: 96px; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
input, select, textarea { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; width: 100%; transition: border-color .2s, box-shadow .2s; }
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
input:disabled { opacity: .65; }
input[type=file] { padding: 8px; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--fg); border-radius: 12px; padding: 9px 16px; white-space: nowrap; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s, opacity .2s; }
.btn:hover { text-decoration: none; }
button:hover, .btn:hover { transform: translateY(-1px); border-color: var(--accent); }
button:active, .btn:active { transform: scale(.97); }
.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-fg); border-color: transparent; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 32%, transparent); }
.primary:hover { border-color: transparent; box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 42%, transparent); }
.ghost { background: transparent; color: var(--accent); }
.danger { background: transparent; color: var(--bad); }
.danger:hover { border-color: var(--bad); }
button.big { font-size: 16.5px; padding: 14px 24px; border-radius: 15px; letter-spacing: 0; line-height: 1.3; font-weight: 600; }
.small { padding: 6px 12px; font-size: 13.5px; border-radius: 10px; }
.icon { padding: 6px 8px; color: var(--muted); }
.wide { width: 100%; }
button:disabled { opacity: .55; cursor: default; transform: none; }
button.busy { color: transparent !important; position: relative; }
button.busy::after { content: ''; position: absolute; width: 16px; height: 16px; border: 2px solid var(--accent-fg); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.chip { padding: 5px 12px 5px 6px; border-radius: 999px; font-weight: 500; font-size: 13.5px; }

/* ── Diálogo ── */
dialog { border: 1px solid var(--line); border-radius: 24px; background: var(--raise); color: var(--fg); padding: 26px; width: min(460px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow-y: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .28); }
dialog[open] { animation: pop .32s var(--ease); }
dialog::backdrop { background: rgba(10, 10, 20, .5); backdrop-filter: blur(6px); animation: fade .25s; }
dialog h3 { margin: 0 0 6px; font-size: 20px; letter-spacing: -.02em; }
dialog .lead { font-size: 14.5px; margin-bottom: 16px; }
dialog .field, dialog .check { margin-bottom: 14px; }
dialog form.shake { animation: shake .35s; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.err { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: 11px; font-size: 14px; margin: 0 0 12px; animation: rise .25s var(--ease); }
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps i { height: 4px; flex: 1; border-radius: 4px; background: var(--line); transition: background .3s; }
.steps i.on { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.words { list-style: none; counter-reset: w; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 0; margin: 0 0 16px; }
.words li { counter-increment: w; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 7px 8px; font: 13.5px ui-monospace, SFMono-Regular, Menlo, monospace; animation: rise .4s var(--ease) both; }
.words li::before { content: counter(w); color: var(--muted); font-size: 11px; margin-right: 7px; }
.words li:nth-child(n+7) { animation-delay: .05s; } .words li:nth-child(n+13) { animation-delay: .1s; } .words li:nth-child(n+19) { animation-delay: .15s; }
.review { text-align: center; }
.review .kv { text-align: left; margin: 18px 0 4px; }
.done { display: grid; place-items: center; margin: 6px 0 14px; }
.done svg { width: 72px; height: 72px; fill: none; stroke: var(--ok); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.done circle { stroke-dasharray: 145; stroke-dashoffset: 145; animation: draw .6s var(--ease) forwards; }
.done path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .4s .45s var(--ease) forwards; }

/* ── Aviso inferior ── */
#note { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 24px); display: flex; align-items: center; gap: 11px; background: var(--fg); color: var(--bg); padding: 12px 18px 12px 14px; border-radius: 999px; max-width: calc(100vw - 28px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s var(--ease); z-index: 9999; box-shadow: 0 14px 40px rgba(0, 0, 0, .28); font-weight: 500; }
#note.show { opacity: 1; transform: translate(-50%, 0); }
#note.bad { background: var(--bad); color: #fff; border-radius: 16px; }
.spin { width: 17px; height: 17px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; flex: none; }
.tick { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tick path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .35s var(--ease) forwards; }
.bang { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, .25); font-weight: 700; flex: none; }

/* ── Carga ── */
.skeleton { height: 76px; border-radius: 18px; margin-bottom: 14px; background: linear-gradient(100deg, var(--card) 30%, color-mix(in srgb, var(--fg) 6%, var(--card)) 50%, var(--card) 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skeleton.tall { height: 180px; }

body.popup .top, body.popup .aurora { display: none; }
body.popup main { max-width: 460px; padding-top: 24px; }
body.popup .field { margin-bottom: 14px; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes fade { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes beat { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split aside { order: -1; }
}
@media (max-width: 680px) {
  .top { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  nav { order: 5; flex-basis: 100%; }
  .brand { flex: 1; }
  .pulse { display: none; }
  .who { max-width: 170px; }
  main { padding: 20px 14px 96px; }
  th, td { padding: 10px 12px; }
  .words { grid-template-columns: repeat(2, 1fr); }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 12px; }
  dialog { padding: 20px; }
  .wallets { grid-template-columns: 1fr; }
  .wallet .row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ══ Segunda pasada: navegación, publicar, datos, documentación, firma ══ */
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
s { color: var(--muted); }

/* Barra de carga al cambiar de página */
#bar { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 30; background: linear-gradient(90deg, var(--accent), var(--accent-2)); opacity: 0; transition: opacity .3s; }
body.loading #bar { opacity: 1; animation: load 1.4s var(--ease) forwards; }
@keyframes load { from { width: 0; } to { width: 88%; } }

/* Camino de vuelta */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; margin: 0 0 14px; overflow: visible; flex: none; }
.crumbs a { color: var(--muted); padding: 0; border-radius: 0; font-weight: 400; }
.crumbs a:hover { color: var(--accent); background: none; }
.crumbs span { color: var(--muted); opacity: .6; }
.crumbs b { font-weight: 600; }

/* Secciones numeradas: cada página se lee de arriba abajo */
h2.numbered, .doc > h2 { display: flex; align-items: center; gap: 10px; text-transform: none; letter-spacing: -.01em; font-size: 17px; color: var(--fg); margin: 38px 0 12px; }
h2 .n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 9px; background: var(--soft); color: var(--accent); font-size: 13px; font-weight: 700; flex: none; }
h2.numbered + .hint { margin: -4px 0 12px; }
h3 { font-size: 14px; margin: 22px 0 10px; }

/* Ayuda desplegable */
.help { margin: 12px 0; border: 1px dashed var(--line); border-radius: 14px; padding: 0 14px; background: color-mix(in srgb, var(--card) 60%, transparent); }
.help summary { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 11px 0; color: var(--accent); font-weight: 500; font-size: 14px; list-style: none; }
.help summary::-webkit-details-marker { display: none; }
.help[open] summary { border-bottom: 1px dashed var(--line); }
.help p { color: var(--muted); font-size: 14px; margin: 12px 0; max-width: 720px; }

/* Publicar soltando */
.drop { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 38px 20px; border: 2px dashed color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 22px; background: color-mix(in srgb, var(--accent) 4%, var(--card)); transition: border-color .2s, background .2s, transform .25s var(--ease); }
.drop b { font-size: 18px; letter-spacing: -.01em; }
.drop small { max-width: 440px; }
.drop .ic { width: 48px; height: 48px; border-radius: 16px; transition: transform .3s var(--ease); }
.drop .cta { justify-content: center; }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); transform: scale(1.01); }
.drop.over .ic { transform: translateY(-6px) scale(1.08); }
.checks { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.checks li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; }
.checks li.yes .i { color: var(--ok); } .checks li.no .i { color: var(--muted); }
.filelist { list-style: none; padding: 0; margin: 10px 0; max-height: 180px; overflow-y: auto; }
.filelist li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13px; }
.filelist code { background: none; padding: 0; word-break: break-all; }

/* Filtros y buscador compacto */
.chips.filter { margin: 4px 0 14px; }
a.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--fg); font-weight: 500; font-size: 13.5px; transition: border-color .2s, background .2s; }
a.chip:hover { text-decoration: none; border-color: var(--accent); }
a.chip.on { background: var(--soft); border-color: transparent; color: var(--accent); }
.search.slim { padding: 4px 4px 4px 14px; border-radius: 14px; box-shadow: none; }
.search.slim input { font-size: 15px; padding: 8px 0; }

/* Datos de una app */
.records { display: grid; gap: 10px; }
.record { display: grid; grid-template-columns: minmax(140px, 240px) minmax(0, 1fr); gap: 6px 20px; padding: 14px 16px; margin: 0 !important; align-items: start; }
.record .rkey { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.record .rkey code { background: var(--soft); color: var(--accent); padding: 3px 8px; border-radius: 8px; word-break: break-all; display: inline-block; }
.record details { grid-column: 1 / -1; }
.record details summary { cursor: pointer; color: var(--muted); font-size: 12.5px; width: max-content; }
.fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 14px; margin: 0; }
.fields dt { color: var(--muted); font-size: 13px; }
.fields dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.val { overflow-wrap: anywhere; } .val.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.vlist { margin: 0; padding-left: 20px; }

/* Documentación */
.doc { scroll-margin-top: 80px; }
.doc p { max-width: 760px; }
.doc .facts { margin: 14px 0; }
pre.code { background: #11131a; color: #e6e8f0; border: 0; border-radius: 14px; padding: 16px 18px; overflow-x: auto; white-space: pre; word-break: normal; margin: 12px 0; box-shadow: var(--shadow); }
pre.code code { background: none; padding: 0; color: inherit; font-size: 13px; }
.list { padding-left: 20px; max-width: 760px; }
.list li { margin: 6px 0; }
table.ref td:first-child { white-space: normal; width: 44%; }
table.ref code { background: none; padding: 0; color: var(--accent); }

/* Tarjeta de wallet: acciones en su sitio, sin salirse */
.wactions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 4px; }
.wactions .main, .wactions .tools { display: flex; flex-wrap: wrap; gap: 6px; }
.wactions .tools { margin-left: auto; }
.wallets { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.name.todo { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }

/* Ventana de la wallet */
.signhead { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.signhead div { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.signhead b { font-size: 18px; overflow-wrap: anywhere; }
.signhead code { color: var(--muted); }
.card.pay { text-align: center; background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 14%, var(--card)), var(--card) 70%); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.card.pay .big { font-size: 36px; margin: 2px 0; }
.choices { display: grid; gap: 8px; margin: 0 0 16px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.choice.off { opacity: .55; cursor: not-allowed; }
.choice .bal { display: flex; flex-direction: column; align-items: flex-end; text-align: right; line-height: 1.3; white-space: nowrap; }
body.popup h2 { margin-top: 22px; }
body.popup .actions { margin-top: 14px; }
body.popup footer { display: none; }

/* Pie */
footer { max-width: 1060px; margin: 0 auto; padding: 22px 18px 40px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }
footer span { margin-right: auto; }
main { padding-bottom: 56px; min-height: calc(100dvh - 180px); }

/* Entradas escalonadas en las listas */
main.enter .feed .row, main.enter .apps .app, main.enter .records .record { animation: rise .45s var(--ease) both; }
main.enter .feed .row:nth-child(2), main.enter .apps .app:nth-child(2), main.enter .records .record:nth-child(2) { animation-delay: .04s; }
main.enter .feed .row:nth-child(3), main.enter .apps .app:nth-child(3), main.enter .records .record:nth-child(3) { animation-delay: .08s; }
main.enter .feed .row:nth-child(4), main.enter .apps .app:nth-child(4), main.enter .records .record:nth-child(4) { animation-delay: .12s; }
main.enter .feed .row:nth-child(n+5), main.enter .apps .app:nth-child(n+5), main.enter .records .record:nth-child(n+5) { animation-delay: .16s; }
a.card { color: var(--fg); display: block; }
a.card:hover { text-decoration: none; }

@media (max-width: 680px) {
  .record { grid-template-columns: 1fr; }
  .drop { padding: 28px 14px; }
  .choice .bal small { display: none; }
}

/* Sello personal, dominios, ayuda */
.seal { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 0 0 14px; border-radius: 14px; background: var(--soft); }
.seal span { font-size: 22px; letter-spacing: 4px; white-space: nowrap; }
.seal small { color: var(--muted); }
.seal.big { flex-direction: column; align-items: flex-start; gap: 6px; }
.seal.big span { font-size: 30px; }
.card.row > .seal.big { margin: 0; background: none; padding: 0; }
.domain { display: flex; flex-direction: column; gap: 12px; }
.domain.todo { border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.dns { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.dns .kv { margin-top: 10px; gap: 8px 16px; }
.dns code { word-break: break-all; }
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.term { margin: 0 !important; transition: transform .28s var(--ease), border-color .2s; }
.term:hover { transform: translateY(-3px); border-color: var(--accent); }
.term p { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
ol.list { padding-left: 22px; }
img.av { object-fit: cover; background: var(--soft); display: inline-block; }
.card.sentence a { white-space: nowrap; }
.reason { margin: 0; color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.legal p, .legal li { max-width: 780px; }
.legal .cite { font-size: 13px; color: var(--muted); border-left: 3px solid var(--line); padding: 2px 0 2px 12px; margin: 10px 0; }
.legal h3 { font-size: 15px; margin: 20px 0 8px; }
/* Lista de idiomas */
.menu { position: absolute; top: calc(100% + 6px); right: 16px; z-index: 30; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 6px; min-width: 280px; max-width: calc(100vw - 32px); background: var(--raise); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); animation: rise .16s ease; }
.menu[hidden] { display: none; }
.menu button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: transparent; color: var(--fg); font-weight: 500; font-size: 14px; text-align: start; white-space: nowrap; }
.menu button b { width: 24px; font-size: 11px; color: var(--muted); }
.menu button:hover, .menu button.on { background: color-mix(in srgb, var(--accent, #4f46e5) 12%, transparent); }
:lang(zh) body, :lang(ja) body { line-height: 1.7; }

/* ── Buscador de la red ── */
.results { padding: 6px; display: flex; flex-direction: column; }
.results[hidden] { display: none; }
.res { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; flex-wrap: wrap; }
.res[hidden] { display: none; }
.res + .res { border-top: 1px solid var(--line); border-radius: 0; }
.res .main { display: flex; align-items: center; gap: 12px; flex: 1 1 260px; min-width: 0; color: var(--fg); }
.res .main:hover { text-decoration: none; }
.res .main:hover b { color: var(--accent); }
.res .what small { white-space: normal; overflow-wrap: anywhere; }
.res .tags, .res .acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.res .acts .btn, .res .acts button { white-space: nowrap; }
.search .primary.small { margin-inline-start: auto; }
a.tool { display: inline-flex; align-items: center; justify-content: center; }
/* Tarjeta de app: abrir, o ir a su ficha */
.app { padding: 0; gap: 0; align-items: stretch; }
.app .go { display: flex; align-items: center; gap: 13px; padding: 14px; flex: 1; min-width: 0; color: var(--fg); }
.app .go:hover { text-decoration: none; }
.app .info { display: flex; align-items: center; padding: 0 14px; color: var(--muted); border-inline-start: 1px solid var(--line); }
.app .info:hover { color: var(--accent); }
/* ── Stake ── */
.facts3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 12px 0; }
.facts3 > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--soft); min-width: 0; }
.facts3 small { color: var(--muted); font-size: 12px; }
.facts3 b { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.vnode { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.vnode .row { flex-wrap: wrap; }
.vnode details { margin: 4px 0; }
.vnode summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.vnode .people { margin-top: 8px; }
.meter { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.mystake { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; align-items: start; }
.mystake .waiting { display: flex; flex-direction: column; gap: 8px; }

/* ── Guía de desarrollo ── */
.codebox { margin: 12px 0; border-radius: 14px; overflow: hidden; background: #11131a; box-shadow: var(--shadow); max-width: 100%; }
.codebox .cbhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 6px 16px; background: #191c26; color: #9aa1b5; font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.codebox .cbhead span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codebox .cbhead button { color: #c9cee0; background: transparent; white-space: nowrap; }
.codebox .cbhead button:hover { color: #fff; }
.codebox pre.code { margin: 0; border-radius: 0; box-shadow: none; }
.howto { display: flex; flex-direction: column; gap: 18px; margin: 16px 0; }
.howto .step { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; }
.howto .step > .n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; }
.howto .step p { margin: 4px 0 0; color: var(--muted); }
a.nextpage { display: flex; flex-direction: column; gap: 6px; margin: 0; color: var(--fg); transition: transform .28s var(--ease), border-color .2s; }
a.nextpage:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--accent); }
a.nextpage small { color: var(--muted); line-height: 1.45; }

/* ══ Pulido: un mismo ritmo vertical y columnas que casan ══════════════════════
   Hasta aquí cada componente traía su propio margen, y dos bloques seguidos quedaban pegados o desiguales.
   Regla única: entre dos bloques de una página hay siempre la misma separación. */
:root { --gap: 16px; }
main :is(.card, .tiles, .apps, .nodes, .codebox, .help, .howto, .steps3, .results, .feed, .records, .search, .mystake, .tabs, .chips, .facts, table, .cta, pre)
  + :is(.card, .tiles, .apps, .nodes, .codebox, .help, .howto, .steps3, .results, .feed, .records, .search, .mystake, .facts, pre) { margin-top: var(--gap); }
main :is(p, .hint, .lead, ul, ol, h1) + :is(.card, .tiles, .apps, .nodes, .codebox, .help, .howto, .steps3, .results, .feed, .records, .mystake, .facts, pre) { margin-top: var(--gap); }
main :is(.card, .tiles, .apps, .nodes, .codebox, .results, .feed, .records, .howto, .steps3, pre) + :is(p, .hint, ul, ol) { margin-top: 12px; }
main .card.tip, main .help, main .codebox, main .search { margin-bottom: 0; }
main .card.tip { margin-top: var(--gap); }
/* Dentro de una rejilla, las tarjetas no llevan margen propio: la separación la pone la rejilla. */
main :is(.nodes, .apps, .steps3, .tiles, .howto) > * { margin: 0; }
.nodes { gap: var(--gap); align-items: stretch; }
.apps, .tiles, .steps3 { gap: 14px; }
.vnode { padding: 18px; gap: 10px; }
.vnode > .row:first-child { min-height: 28px; }
.vnode .cta { margin-top: auto; padding-top: 4px; }
.vnode details, .vnode .facts3 { margin: 0; }
.facts3.fixed { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.facts3.fixed > div { padding: 9px 10px; }
.facts3.fixed b { font-size: 14.5px; line-height: 1.3; }
.facts3.fixed b small { font-size: 11px; font-weight: 500; color: var(--muted); }
.mystake { align-items: center; }
h2 + .hint { margin-top: -4px; }

/* Páginas de lectura (guía, legal, ayuda, técnica, acerca de): texto, tablas, avisos y código comparten una
   misma columna; el índice de apartados se queda a la derecha mientras se lee. */
main.reading { display: grid; grid-template-columns: minmax(0, 760px); justify-content: start; }
main.reading > *, main.reading > .legal > * { grid-column: 1; min-width: 0; }
main.reading .legal { display: contents; }
main.reading :is(p, li, .lead, .list, .doc p, .help p) { max-width: none; }
main.reading .doc > :is(p, ul, ol) { line-height: 1.7; }
main.reading .doc > p { margin: 12px 0; }
main.reading table.ref td:first-child { width: 38%; }
@media (min-width: 1040px) {
  main.reading { grid-template-columns: minmax(0, 760px) 220px; column-gap: 44px; }
  main.reading .chips.filter { grid-column: 2; grid-row: 1 / span 400; align-self: start; position: sticky; top: 84px; flex-direction: column; align-items: stretch; gap: 2px; margin: 0; padding-inline-start: 14px; border-inline-start: 1px solid var(--line); max-height: calc(100dvh - 110px); overflow-y: auto; }
  main.reading .chips.filter a.chip { border: 0; background: none; box-shadow: none; border-radius: 8px; padding: 6px 10px; color: var(--muted); font-weight: 500; font-size: 13.5px; white-space: normal; line-height: 1.35; }
  main.reading .chips.filter a.chip:hover { color: var(--accent); background: var(--soft); }
}

/* Dominios: comprobaciones y nodos a los que apuntar */
.checks { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.checks li > .i { margin-top: 2px; color: var(--muted); }
.checks li.ok > .i { color: var(--ok); }
.checks li small { display: block; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.checks li.todo b { font-weight: 600; }
.nodelist { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.nodelist .row { gap: 8px; }
.dnsrec { margin: 12px 0; }

.nodeopt { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.nodeopt .row { gap: 8px; margin-bottom: 6px; }
table.dnsrows { width: 100%; font-size: 13.5px; }
table.dnsrows th { text-align: start; font-weight: 500; color: var(--muted); font-size: 12px; padding: 2px 8px 2px 0; }
table.dnsrows td { padding: 3px 8px 3px 0; overflow-wrap: anywhere; vertical-align: middle; }
.token-row { align-items: center; gap: 12px; } .token-row .what { flex: 1; }

/* ── Propuestas y peticiones: una fila que se despliega ── */
details.prop { padding: 0; }
details.prop[hidden] { display: none; }
details.prop > summary { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; flex-wrap: wrap; }
details.prop > summary::-webkit-details-marker { display: none; }
details.prop > summary:hover .ptitle b { color: var(--accent); }
details.prop > :not(summary) { margin-inline: 18px; }
details.prop > :last-child { margin-bottom: 16px; }
details.prop.waiting { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.prop .pid { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; min-width: 30px; }
.prop .ptitle { display: flex; flex-direction: column; flex: 1 1 240px; min-width: 0; line-height: 1.35; }
.prop .ptitle small { color: var(--muted); }
.prop .tally { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.prop .tally b { color: var(--fg); font-variant-numeric: tabular-nums; }
.prop .cta.votes button { min-width: 130px; justify-content: center; }
.prop .who-voted { margin-top: 12px; }
.prop .who-voted summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.prop .who-voted .voters { margin-top: 8px; }
.prop .plink { display: inline-block; margin-top: 10px; }
#props { display: flex; flex-direction: column; gap: 10px; }
#props > .card { margin: 0; }
.tag.warn { background: var(--warn-soft); color: var(--fg); }
.chip small { color: var(--muted); font-variant-numeric: tabular-nums; }
.options.off .option:not(a) { opacity: .5; pointer-events: none; }
/* Datos de una app: acciones de cada entrada */
.ractions { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.ractions details { flex: 1 1 200px; min-width: 0; }
.prop .ptitle b { color: var(--fg); font-size: 15.5px; }
.prop .changes { margin: 4px 18px 14px; }
.prop .bar { margin-top: 6px; }
.prop .reason { margin-bottom: 12px; }

/* La última noticia del blog de la red, en la portada */
a.newsline { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--fg); flex-wrap: wrap; }
a.newsline:hover { text-decoration: none; border-color: var(--accent); }
a.newsline b { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
a.newsline small { color: var(--muted); }
a.newsline > .i { color: var(--muted); }
section.go + a.newsline, a.newsline + section.welcome { margin-top: 16px; }

/* Tarjeta de app que es un único enlace (tus apps → su ficha) */
a.app.solo { padding: 14px; gap: 13px; align-items: center; }

/* ── Explorador de la API ── */
#endpoints { display: flex; flex-direction: column; gap: 10px; }
#endpoints > .card { margin: 0; }
details.ep { padding: 0; }
details.ep > summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; flex-wrap: wrap; }
details.ep > summary::-webkit-details-marker { display: none; }
details.ep > summary small { color: var(--muted); flex: 1 1 260px; min-width: 0; }
details.ep > :not(summary) { margin-inline: 16px; }
details.ep > :last-child { margin-bottom: 16px; }
.eppath { background: none; padding: 0; font-weight: 600; overflow-wrap: anywhere; }
.epparams { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 4px; }
.epurl { overflow-wrap: anywhere; color: var(--muted); }
pre.epout { max-height: 420px; overflow: auto; margin-top: 12px; font-size: 12.5px; }
.tool.on { color: var(--accent); }
/* Declaración del operador del nodo, al principio de la página legal */
.opstmt { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.opstmt .stmt p { margin: 10px 0; line-height: 1.65; overflow-wrap: anywhere; }
.opstmt .row { flex-wrap: wrap; gap: 8px 12px; margin-bottom: 6px; }

.opstmt .stmt h3 { font-size: 14px; margin: 22px 0 6px; letter-spacing: .02em; }
.opstmt .stmt { max-height: 520px; overflow-y: auto; padding-right: 8px; }

/* ── Marca ──
   El símbolo es una W trazada como una cadena de nodos enlazados (logo.svg). El nombre se compone en dos pesos:
   "web", ligero; "chain", firme. */
.logo { width: 26px; height: 26px; border-radius: 0; background: url('/logo.svg') center / contain no-repeat; box-shadow: none; flex: none; }
.brand { gap: 10px; font-size: 18px; letter-spacing: -.035em; }
.wordmark { font-weight: 450; color: var(--fg); }
.wordmark b { font-weight: 750; }
.welcome .biglogo { display: block; width: 76px; height: 76px; margin: 0 auto 22px; background: url('/logo.svg') center / contain no-repeat; filter: drop-shadow(0 14px 30px color-mix(in srgb, var(--accent) 40%, transparent)); animation: rise .6s var(--ease) both; }

main :is(.steps3, .nodes, .apps, .tiles, .howto, #posts, #props, #endpoints) > .card + .card { margin-top: 0; }

/* ── Parada de emergencia ── */
#haltbar { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 10px 16px; background: color-mix(in srgb, var(--danger, #d9304f) 14%, var(--bg)); border-bottom: 1px solid color-mix(in srgb, var(--danger, #d9304f) 40%, transparent); font-size: 14px; }
#haltbar[hidden] { display: none; }
#haltbar svg { flex: none; color: var(--danger, #d9304f); }
.card.halt .row { align-items: center; gap: 12px; }
.card.halt .row > svg { flex: none; color: var(--muted); }
.card.halt.on { border-color: color-mix(in srgb, var(--danger, #d9304f) 55%, transparent); }
.card.halt.on .row > svg { color: var(--danger, #d9304f); }
.card.halt ul.rules { margin: 14px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.65; }

/* ── Elegir una app (a dónde lleva un nombre o un dominio) ── */
.row.target { align-items: center; gap: 12px; margin-top: 12px; }
.picks { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; max-height: 46vh; overflow-y: auto; }
.pick { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.pick:hover { border-color: var(--accent); }
.pick:has(input:checked) { border-color: var(--accent); background: var(--soft); }
.pick input { accent-color: var(--accent); flex: none; }
.pick .what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pick .what small { color: var(--muted); overflow-wrap: anywhere; }
dialog .picks { overflow-x: hidden; }
dialog .picks label.pick { display: flex; width: auto; margin: 0; font-weight: 400; }
dialog .picks label.pick input[type=radio] { width: 18px; height: 18px; min-width: 18px; padding: 0; margin: 0; box-shadow: none; }
dialog .picks label.pick .what { flex: 1; text-align: left; }

/* ── Desglose de la cartera: condiciones, ofertas, stake, rendimiento y esperas ── */
.holdings { display: flex; flex-direction: column; gap: 0; padding-top: 6px; padding-bottom: 6px; margin-top: 14px; }
.hold { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; min-width: 0; }
.hold + .hold { border-top: 1px solid var(--line); }
.hold .row { flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.hold .num { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hold .htitle b:first-child { font-size: 15px; }
.hold .hint { margin: 0; }
.hold .line { font-size: 14.5px; }
.hold .line small, .hold .sub { color: var(--muted); font-size: 12.5px; }
.hold .sub { margin-top: -4px; }
.hold .sub svg { width: 14px; height: 14px; flex: none; }
.hold .grant, .hold .offer { font-size: 14px; line-height: 1.5; padding: 10px 12px; border-radius: 12px; background: var(--soft); overflow-wrap: anywhere; }
.hold .offer.in { background: var(--warn-soft); }
.hold .person { vertical-align: middle; max-width: 100%; }
.hold .cta { margin-top: 4px; }
.hold .offer .cta { margin-top: 8px; }
.hold .help { margin: 2px 0 0; }
.vnode.focus { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.signhead small.by { color: var(--muted); font-size: 12px; margin-top: 3px; }
