/* Plomada · Galilea: el lago al amanecer. Los valores salen de la biblioteca de diseño. */
:root {
  --surface-0: #eef3f2; --surface-1: #fbfdfd; --surface-2: #dce8e8; --surface-inverse: #0f2a3d;
  --ink: #0f2a3d; --ink-muted: #4a6070; --ink-inverse: #eef3f2;
  --line: #d3dfe0; --line-strong: #738d94;
  --accent: #e2b04a; --accent-ink: #0f2a3d; --accent-edge: #9a7215;
  --focus: #1e6f7a; --good: #2d7a4b; --warn: #8f5f00; --danger: #b3261e;
  --sabbath: #5b5b9a; --sabbath-soft: #e8e7f3; --sabbath-ink: #33335c;
  --scrim: rgba(15,42,61,.45);
  --data-1: #0f2a3d; --data-2: #1e5f6a; --data-3: #2a7b84; --data-4: #3f8790; --data-5: #5e7280;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --ui: "Figtree", "Segoe UI", system-ui, sans-serif;
  --scripture: "Source Serif 4", Georgia, serif;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface-0: #0b1a24; --surface-1: #12263a; --surface-2: #1d3449; --surface-inverse: #e4eef1;
    --ink: #e4eef1; --ink-muted: #9fb3be; --ink-inverse: #0f2a3d;
    --line: #233c4f; --line-strong: #57788e;
    --accent-ink: #0b1a24; --accent-edge: #e2b04a;
    --focus: #6cc3c9; --good: #73c493; --warn: #f29b5b; --danger: #f08a80;
    --sabbath: #aeade3; --sabbath-soft: #26253d; --sabbath-ink: #dddcf6;
    --scrim: rgba(0,0,0,.6);
    --data-1: #cfeeea; --data-2: #9fd6d2; --data-3: #6cc3c9; --data-4: #4aa7ae; --data-5: #9fb3be;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface-0); color: var(--ink); font: 400 17px/26px var(--ui); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.boot { padding: 48px 16px; color: var(--ink-muted); }

.top { display: flex; align-items: center; gap: 8px; padding: 12px 16px 4px; }
.top .who { flex: 1; min-width: 0; font: 600 14px/20px var(--ui); letter-spacing: .02em; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chipbtn { border: 1px solid var(--line-strong); background: var(--surface-1); border-radius: 999px; padding: 6px 12px; font: 600 14px/20px var(--ui); min-height: 36px; cursor: pointer; }
main { flex: 1; padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 12px; }
h1 { font: 700 32px/38px var(--display); margin: 8px 0 4px; text-wrap: balance; }
h2 { font: 600 20px/26px var(--display); margin: 0 0 8px; }
h3 { font: 600 17px/24px var(--ui); margin: 0; }
p { margin: 0 0 8px; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--ink-muted); }
.small { font-size: 16px; line-height: 24px; }
.label { font: 600 14px/20px var(--ui); letter-spacing: .02em; color: var(--ink-muted); }
.scripture { font: italic 400 18px/26px var(--scripture); }

.card { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.card.next { background: var(--surface-inverse); color: var(--ink-inverse); border-color: var(--surface-inverse); }
.card.next .label, .card.next .muted { color: var(--ink-inverse); opacity: .8; }
.card.next h2 { font-size: 24px; line-height: 30px; }
.card.dashed { border: 1px dashed var(--line-strong); background: transparent; }
.band { background: var(--sabbath-soft); color: var(--sabbath-ink); border-radius: var(--r-lg); padding: 12px 16px; display: flex; gap: 10px; align-items: flex-start; }
.band svg { flex: none; margin-top: 3px; color: var(--sabbath); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 16px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-1); font: 600 17px/24px var(--ui); cursor: pointer; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-edge); }
.card.next .btn { background: transparent; color: var(--ink-inverse); border-color: var(--ink-inverse); }
.card.next .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.quiet { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 3px; padding-inline: 4px; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.spread { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 8px; }

.list { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.list > * { padding: 12px 16px; border-top: 1px solid var(--line); }
.list > *:first-child { border-top: 0; }
.item { display: flex; gap: 12px; align-items: center; width: 100%; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; cursor: pointer; min-height: 56px; }
.item .grow { flex: 1; min-width: 0; }
.item .sub { color: var(--ink-muted); font-size: 16px; line-height: 22px; }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 999px; background: var(--surface-2); display: grid; place-items: center; font: 600 16px/1 var(--ui); }

.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; background: var(--surface-2); font: 600 14px/20px var(--ui); letter-spacing: .02em; white-space: nowrap; }
.chip svg { flex: none; }
.chip.good svg { color: var(--good); } .chip.warn svg { color: var(--warn); } .chip.danger svg { color: var(--danger); } .chip.sab svg { color: var(--sabbath); }
.chip.pick { border: 1px solid var(--line-strong); background: var(--surface-1); min-height: 44px; padding: 8px 14px; cursor: pointer; font-size: 16px; }
.chip.pick[aria-pressed="true"] { background: var(--ink); color: var(--surface-1); border-color: var(--ink); }

.steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.steps i { height: 8px; border-radius: 4px; background: var(--surface-2); }
.steps i.on { background: var(--ink); }
.card.next .steps i { background: rgba(255,255,255,.25); } .card.next .steps i.on { background: var(--ink-inverse); }
.steplist { list-style: none; margin: 0; padding: 0; }
.steplist li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.steplist li:first-child { border-top: 0; padding-top: 0; }
.num { flex: none; width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--line-strong); display: grid; place-items: center; font: 600 15px/1 var(--ui); }
.num.on { background: var(--ink); color: var(--surface-1); border-color: var(--ink); }
.check { flex: none; width: 28px; height: 28px; margin-top: 1px; accent-color: var(--ink); }

.field { display: flex; flex-direction: column; gap: 4px; }
.field input, .field select, .field textarea { min-height: 48px; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface-1); width: 100%; }
.field textarea { min-height: 96px; resize: vertical; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 16px; }
.stat b { display: block; font: 700 28px/34px var(--display); font-variant-numeric: tabular-nums; }
.stat span { font-size: 16px; line-height: 22px; color: var(--ink-muted); }
.bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--data-2); border-radius: 5px; width: 0; }
.gen { display: grid; grid-template-columns: 36px 1fr 40px; gap: 8px; align-items: center; margin: 6px 0; font-variant-numeric: tabular-nums; }
.gen .bar > i.g1 { background: var(--data-1); } .gen .bar > i.g2 { background: var(--data-2); } .gen .bar > i.g3 { background: var(--data-3); } .gen .bar > i.g4 { background: var(--data-4); }

.whosees { color: var(--ink-muted); font-size: 16px; line-height: 22px; display: flex; gap: 8px; padding: 4px 2px; }
.whosees svg { flex: none; margin-top: 3px; }

.tabs { position: sticky; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-1); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { border: 0; background: none; padding: 8px 2px 10px; min-height: 60px; display: flex; flex-direction: column; align-items: center; gap: 2px; font: 600 13px/16px var(--ui); color: var(--ink-muted); cursor: pointer; }
.tabs button[aria-current="page"] { color: var(--ink); }
.tabs button[aria-current="page"] svg { background: var(--surface-2); border-radius: 999px; }
.tabs svg { width: 48px; height: 28px; padding: 3px 12px; }

dialog { border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 24px; background: var(--surface-1); color: var(--ink); max-width: min(520px, calc(100vw - 32px)); width: 100%; }
dialog::backdrop { background: var(--scrim); }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--surface-inverse); color: var(--ink-inverse); padding: 10px 16px; border-radius: var(--r-md); max-width: calc(100vw - 32px); z-index: 10; }
.link { word-break: break-all; font: 400 14px/20px ui-monospace, monospace; background: var(--surface-2); padding: 10px 12px; border-radius: var(--r-sm); user-select: all; }
.hide { display: none !important; }
@media (prefers-reduced-motion: no-preference) { .bar > i { transition: width .4s ease; } }

.stack > .chip, .card > .chip { align-self: flex-start; }

.qr { width: min(240px, 70vw); height: auto; align-self: center; border-radius: var(--r-sm); border: 1px solid var(--line); }
.quote { background: var(--surface-2); padding: 12px 14px; border-radius: var(--r-sm); user-select: all; }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.stats.three .stat { padding: 12px; }
.steplist li > div { flex: 1; min-width: 0; }
.ref { font-size: 16px; white-space: nowrap; }
.item.static { cursor: default; }
::placeholder { color: var(--ink-muted); opacity: 1; font-style: italic; }
details > summary { cursor: pointer; font: 600 17px/24px var(--ui); padding: 10px 0; min-height: 44px; }
main ul { margin: 0; padding-left: 22px; }
.list .label { display: block; }

dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
main > .btn.quiet { align-self: flex-start; }
.quote.pre { white-space: pre-wrap; user-select: text; }
.item .chip { margin-top: 6px; white-space: normal; text-align: left; }
.stats.three .stat span { font-size: 16px; overflow-wrap: anywhere; hyphens: auto; }

.mrow { padding: 8px 0; border-top: 1px solid var(--line); gap: 16px; }
.mrow:first-child { border-top: 0; }
.mrow b { font: 700 24px/1 var(--display); font-variant-numeric: tabular-nums; }

/* «Lo que Dios está haciendo»: cada historia es una tarjeta sencilla, sin contadores ni «me gusta» (13 nov). */
.post { border-top: 1px solid var(--line, rgba(127,127,127,.25)); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.post p { margin: 0; }

/* La red: las bolitas */
.net { gap: 4px; }
.netrow { display: flex; flex-direction: column; gap: 8px; }
.netrow.me .bubble .av { background: var(--surface-inverse); color: var(--ink-inverse); box-shadow: 0 0 0 3px var(--accent); }
.netline { width: 2px; height: 16px; background: var(--line-strong); margin-left: 34px; }
.bubbles { display: flex; flex-wrap: wrap; gap: 10px 8px; align-items: flex-start; }
.bubble { width: 84px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--ink); text-align: center; }
.bubble .av { width: 56px; height: 56px; border-radius: 999px; background: var(--surface-2); display: grid; place-items: center; font: 700 18px/1 var(--display); }
.bubble .n { font: 600 16px/20px var(--ui); max-width: 84px; overflow-wrap: anywhere; }
.bubble .label { font-size: 13px; line-height: 16px; text-align: center; }
.wpost { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.wpost .btn.quiet, .post .btn.quiet { padding: 0 4px; min-height: 40px; }
