/* The haven pages: safety, report, transparency, the fire, the vault. Same ink and accent as the
   front page, with a serif for headings and room to breathe. No inline styles (HAVEN_CSP). */
:root {
  --bg: #0e1116; --panel: #141922; --panel-2: #10141b; --ink: #e8ebf1; --soft: #b9c1cf; --muted: #8b95a7;
  --line: #242b37; --accent: #7cc4ff; --good: #7bd88f; --warn: #f2c14e; --bad: #f08080;
  --ember: #ff9a5a; --ember-deep: #c2551f; --glow: rgba(255, 154, 90, .14);
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--sans); }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #a9d8ff; }
::selection { background: rgba(124, 196, 255, .28); }

.top { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.top .brand { font: 700 19px/1 var(--sans); letter-spacing: .02em; color: var(--ink); text-decoration: none; }
.top nav { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.top nav a { color: var(--muted); text-decoration: none; padding-bottom: 2px; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--ink); }
.top nav a.on { color: var(--ink); border-bottom-color: var(--accent); }

main { max-width: 760px; margin: 0 auto; padding: 40px 24px 72px; }
main.wide { max-width: 980px; }
.eyebrow { font: 600 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
h1 { font: 600 40px/1.15 var(--serif); letter-spacing: -.01em; margin: 0 0 14px; }
h2 { font: 600 24px/1.25 var(--serif); margin: 48px 0 10px; }
h3 { font: 600 17px/1.3 var(--sans); margin: 24px 0 6px; }
p { margin: 0 0 14px; color: var(--soft); }
.lead { font-size: 19px; line-height: 1.6; color: var(--ink); max-width: 38em; }
.dated { font-size: 13px; color: var(--muted); }
ul, ol { color: var(--soft); padding-left: 22px; }
li { margin: 6px 0; }
strong { color: var(--ink); }
code { font: 13px var(--mono); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

.promises { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 28px 0 8px; }
.promise { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.promise b { display: block; font: 600 15px/1.3 var(--sans); color: var(--ink); margin-bottom: 4px; }
.promise span { font-size: 14px; color: var(--muted); line-height: 1.5; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 18px 0; }
.steps li { counter-increment: step; position: relative; padding: 2px 0 14px 46px; margin: 0; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--accent); font: 600 14px/28px var(--sans); text-align: center; }
.steps li::after { content: ""; position: absolute; left: 15px; top: 32px; bottom: 2px; width: 1px; background: var(--line); }
.steps li:last-child::after { display: none; }

.note { border-left: 3px solid var(--accent); background: var(--panel); border-radius: 0 10px 10px 0; padding: 14px 18px; margin: 18px 0; }
.note.urgent { border-left-color: var(--bad); }
.note.warm { border-left-color: var(--ember); }
.note p:last-child { margin-bottom: 0; }

.btn { display: inline-block; background: var(--accent); color: #06111c; border: 0; border-radius: 10px; padding: 11px 18px; font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: #a9d8ff; color: #06111c; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); }
.btn[disabled] { opacity: .5; cursor: default; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 6px; }

/* forms */
label { display: block; margin: 22px 0 8px; font: 600 14px/1.3 var(--sans); color: var(--ink); }
label small { display: block; font-weight: 400; color: var(--muted); margin-top: 3px; }
input[type=text], input[type=email], textarea { width: 100%; background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font: 15px/1.5 var(--sans); }
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, .choice:focus-within { outline: 2px solid rgba(124, 196, 255, .5); outline-offset: 1px; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.choice { position: relative; display: flex; gap: 10px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; cursor: pointer; margin: 0; font: 400 14px/1.4 var(--sans); color: var(--soft); }
.choice input { margin: 3px 0 0; accent-color: var(--accent); }
.choice:has(input:checked) { border-color: var(--accent); color: var(--ink); background: #132033; }
.check { display: flex; gap: 10px; align-items: flex-start; font: 400 14px/1.5 var(--sans); color: var(--soft); margin: 12px 0 0; }
.check input { margin-top: 4px; accent-color: var(--accent); }
.hidden { display: none !important; }
.err { color: var(--bad); font-size: 14px; margin-top: 12px; min-height: 1.4em; }

.receipt { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin-top: 8px; }
.receipt .big { font: 600 22px/1.3 var(--serif); color: var(--ink); margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 9em 1fr; gap: 6px 14px; font-size: 14px; margin: 12px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); word-break: break-all; }

/* transparency */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 12px; margin: 26px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.stat .n { font: 600 34px/1.1 var(--serif); color: var(--ink); }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 6px; }
.stat.good .n { color: var(--good); }
.bars { margin: 10px 0 0; }
.bar { display: grid; grid-template-columns: 15em 1fr 3em; gap: 12px; align-items: center; font-size: 14px; margin: 8px 0; color: var(--soft); }
.bar .track { height: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--accent); border-radius: 99px; }
.bar .c { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--line); padding: 8px 10px; }
td { border-bottom: 1px solid var(--line); padding: 10px; color: var(--soft); font-variant-numeric: tabular-nums; }
td.mono { font-family: var(--mono); font-size: 13px; }
.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.pill.ok { color: var(--good); border-color: rgba(123, 216, 143, .35); }
.pill.late { color: var(--bad); border-color: rgba(240, 128, 128, .35); }
.pill.open { color: var(--warn); border-color: rgba(242, 193, 78, .35); }
.empty { text-align: center; padding: 34px 18px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); }
.empty b { display: block; font: 600 19px/1.3 var(--serif); color: var(--ink); margin-bottom: 6px; }

footer.foot { border-top: 1px solid var(--line); padding: 22px 24px 40px; text-align: center; font-size: 13px; color: var(--muted); }
footer.foot a { color: var(--muted); margin: 0 8px; text-decoration: none; white-space: nowrap; display: inline-block; line-height: 2; }
footer.foot a:hover { color: var(--ink); }

@media (max-width: 640px) {
  h1 { font-size: 31px; }
  main { padding: 28px 16px 56px; }
  .top { padding: 14px 16px; }
  .top nav { margin-left: 0; width: 100%; }
  .bar { grid-template-columns: 9em 1fr 2.5em; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
  table .wide-only { display: none; }
}
.check label { display: inline; margin: 0; font: 400 14px/1.5 var(--sans); color: var(--soft); }
.pill { white-space: nowrap; }
@media (max-width: 640px) { td, th { padding: 9px 6px; } td.mono { font-size: 12px; } }

/* ---------------------------------------------------------------- the fire */
body.fireside { background: radial-gradient(ellipse 70% 420px at 50% 0, rgba(255, 140, 60, .11), transparent 70%), var(--bg); }
.eyebrow.ember { color: var(--ember); }
main.fire { max-width: 760px; }
.hearth { position: relative; width: 140px; height: 118px; margin: -8px auto 18px; }
.flame { position: absolute; left: 50%; bottom: 26px; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%; transform-origin: 50% 100%; animation: flicker 1.9s ease-in-out infinite alternate; }
.flame.f1 { width: 64px; height: 84px; margin-left: -32px; background: radial-gradient(ellipse at 50% 78%, #ffb067 0%, #ff8a3d 38%, #c2551f 68%, rgba(194, 85, 31, 0) 72%); filter: blur(1.5px); opacity: .92; }
.flame.f2 { width: 40px; height: 58px; margin-left: -20px; background: radial-gradient(ellipse at 50% 80%, #ffe3a3 0%, #ffb067 45%, rgba(255, 138, 61, 0) 72%); animation-duration: 1.4s; animation-delay: -.4s; }
.flame.f4 { width: 34px; height: 52px; margin-left: -36px; bottom: 24px; rotate: -14deg; background: radial-gradient(ellipse at 50% 80%, #ff9a5a 0%, #c2551f 55%, rgba(194, 85, 31, 0) 72%); filter: blur(1.5px); opacity: .8; animation-duration: 1.6s; animation-delay: -1.1s; }
.flame.f5 { width: 30px; height: 46px; margin-left: 5px; bottom: 24px; rotate: 16deg; background: radial-gradient(ellipse at 50% 80%, #ff9a5a 0%, #c2551f 55%, rgba(194, 85, 31, 0) 72%); filter: blur(1.5px); opacity: .75; animation-duration: 2.1s; animation-delay: -.6s; }
.flame.f3 { width: 20px; height: 30px; margin-left: -10px; bottom: 28px; background: radial-gradient(ellipse at 50% 85%, #fffbe8 0%, #ffe3a3 50%, rgba(255, 227, 163, 0) 75%); animation-duration: 1.1s; animation-delay: -.8s; }
.logs { position: absolute; left: 50%; bottom: 14px; width: 96px; height: 16px; margin-left: -48px; }
.logs::before, .logs::after { content: ""; position: absolute; left: 6px; right: 6px; top: 4px; height: 9px; border-radius: 6px; background: linear-gradient(#5a3a26, #3a2418); }
.logs::before { transform: rotate(9deg); }
.logs::after { transform: rotate(-9deg); }
.hearth::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 150px; height: 26px; margin-left: -75px; border-radius: 50%; background: radial-gradient(ellipse, rgba(255, 140, 60, .28), transparent 70%); animation: glow 2.6s ease-in-out infinite alternate; }
.spark { position: absolute; left: 50%; bottom: 70px; width: 3px; height: 3px; border-radius: 50%; background: #ffd27a; opacity: 0; animation: rise 3.2s linear infinite; }
.spark.s1 { margin-left: -14px; animation-delay: 0s; }
.spark.s2 { margin-left: 9px; animation-delay: .9s; }
.spark.s3 { margin-left: -3px; animation-delay: 1.7s; }
.spark.s4 { margin-left: 16px; animation-delay: 2.4s; }
@keyframes flicker { 0% { transform: scale(1, 1) skewX(0deg); } 35% { transform: scale(.96, 1.06) skewX(2deg); } 70% { transform: scale(1.03, .95) skewX(-2deg); } 100% { transform: scale(.98, 1.04) skewX(1deg); } }
@keyframes glow { from { opacity: .7; } to { opacity: 1; } }
@keyframes rise { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: .9; } 100% { transform: translate(6px, -70px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .flame, .spark, .hearth::after { animation: none; } .spark { display: none; } }

.lanes { display: flex; gap: 8px; margin: 30px 0 6px; }
.lane { background: var(--panel); color: var(--soft); border: 1px solid var(--line); border-radius: 99px; padding: 8px 16px; font: 600 14px/1 var(--sans); cursor: pointer; }
.lane:hover { color: var(--ink); }
.lane.on { color: #1b0e05; background: var(--ember); border-color: var(--ember); }
.lane .count { font-weight: 400; opacity: .75; margin-left: 4px; }
.lane-note { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.data-notice { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; padding: 9px 13px; margin: 16px 0 18px; }
.data-notice .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 10px var(--ember); flex: none; }

.composer { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; }
.composer textarea { min-height: 76px; background: var(--panel-2); }
.composer .who { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.composer .who b { color: var(--ink); font-weight: 600; }
.composer .row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.composer .row .err { flex: 1; margin: 0; }
.composer .chars { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.btn.ember-btn { background: var(--ember); color: #1b0e05; }
.btn.ember-btn:hover { background: #ffb380; color: #1b0e05; }
.join { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; font-size: 14px; color: var(--soft); background: var(--panel-2); }
.join p { margin: 0 0 6px; }
.join p:last-child { margin: 0; }

.posts { display: flex; flex-direction: column; gap: 12px; }
.post { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px 13px; }
.post.standing { border-left: 3px solid var(--ember); }
.post.reply { margin-left: 26px; background: var(--panel-2); }
.post .meta { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.post .meta .name { font: 600 15px/1.2 var(--sans); color: var(--ink); text-decoration: none; }
.post .meta .name:hover { color: var(--ember); }
.post .meta .when { margin-left: auto; }
.badge { font-size: 11px; letter-spacing: .04em; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.badge.ember { color: var(--ember); border-color: rgba(255, 154, 90, .35); }
.post .text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); margin: 8px 0 6px; font-size: 15.5px; line-height: 1.6; }
.post .foot { display: flex; gap: 14px; align-items: center; font-size: 13px; color: var(--muted); }
.post .foot button { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; }
.post .foot button:hover { color: var(--ember); }
.post .flagged { color: var(--warn); }
.scanwarn { font-size: 13px; color: var(--warn); background: rgba(242, 193, 78, .07); border: 1px solid rgba(242, 193, 78, .25); border-radius: 10px; padding: 8px 12px; margin: 8px 0 4px; }
.scanwarn button { background: none; border: 0; color: var(--ember); font: inherit; cursor: pointer; padding: 0; margin-left: 6px; text-decoration: underline; }
.post .text.veiled { display: none; }
.flagmenu { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.flagmenu button { border: 1px solid var(--line) !important; border-radius: 99px; padding: 2px 9px !important; }
.back { background: none; border: 0; color: var(--ember); font: 600 14px var(--sans); cursor: pointer; padding: 0; margin: 0 0 12px; }
.more { text-align: center; margin: 18px 0 0; }
.empty.fire-empty { border-color: rgba(255, 154, 90, .3); }

.post .foot a { color: var(--muted); text-decoration: none; }
.post .foot a:hover { color: var(--ember); }
main.fire .promises { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { main.fire .promises { grid-template-columns: 1fr; } .post.reply { margin-left: 12px; } }

/* ---------------------------------------------------------------- the vault */
body.vaultside { --moon: #a9b8ff; --moon-deep: #5b6bc7; background: radial-gradient(ellipse 70% 420px at 50% 0, rgba(120, 140, 255, .10), transparent 70%), var(--bg); }
.eyebrow.moon { color: var(--moon); }
main.vault { max-width: 760px; }
.door { position: relative; width: 132px; height: 132px; margin: 0 auto 26px; }
.door .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(169, 184, 255, .35); box-shadow: 0 0 40px rgba(120, 140, 255, .15), inset 0 0 22px rgba(120, 140, 255, .10); }
.door .ring.r2 { inset: 14px; border: 1px dashed rgba(169, 184, 255, .30); box-shadow: none; }
.door .dial { position: absolute; inset: 30px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #1d2540, #10141f 70%); border: 1px solid rgba(169, 184, 255, .4); animation: turn 14s cubic-bezier(.6, 0, .4, 1) infinite; }
.door .dial span { position: absolute; left: 50%; top: 4px; width: 2px; height: 8px; margin-left: -1px; background: var(--moon); border-radius: 2px; transform-origin: 1px 32px; }
.door .dial span:nth-child(2) { transform: rotate(60deg); opacity: .6; }
.door .dial span:nth-child(3) { transform: rotate(120deg); opacity: .6; }
.door .dial span:nth-child(4) { transform: rotate(180deg); opacity: .6; }
.door .dial span:nth-child(5) { transform: rotate(240deg); opacity: .6; }
.door .dial span:nth-child(6) { transform: rotate(300deg); opacity: .6; }
.door .hub { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--moon); box-shadow: 0 0 16px var(--moon); }
@keyframes turn { 0% { transform: rotate(0); } 30% { transform: rotate(140deg); } 55% { transform: rotate(60deg); } 80% { transform: rotate(250deg); } 100% { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .door .dial { animation: none; } }

.trio { list-style: none; padding: 0; margin: 30px 0 6px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; counter-reset: trio; }
.trio li { counter-increment: trio; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 0; }
.trio li b { display: block; font: 600 20px/1.2 var(--serif); color: var(--ink); margin-bottom: 6px; }
.trio li b::before { content: counter(trio) "  "; color: var(--moon); font: 600 13px var(--sans); vertical-align: 3px; margin-right: 4px; }
.trio li span { font-size: 14px; color: var(--muted); line-height: 1.55; }
.keys { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 10px; }
.keyrow { display: flex; gap: 14px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.keyrow b { display: block; color: var(--ink); font-size: 15px; }
.keyrow span { font-size: 14px; color: var(--muted); }
.keyrow .mark { flex: none; width: 22px; height: 22px; border-radius: 50%; margin-top: 1px; border: 1px solid var(--line); position: relative; }
.keyrow.yes .mark { border-color: rgba(123, 216, 143, .5); background: rgba(123, 216, 143, .12); }
.keyrow.yes .mark::after { content: ""; position: absolute; left: 7px; top: 4px; width: 5px; height: 9px; border: solid var(--good); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.keyrow.opt .mark { border-color: rgba(169, 184, 255, .5); background: rgba(169, 184, 255, .12); }
.keyrow.opt .mark::after { content: ""; position: absolute; left: 6px; top: 10px; width: 9px; height: 2px; background: var(--moon); }
.keyrow.no .mark { border-color: rgba(240, 128, 128, .45); background: rgba(240, 128, 128, .10); }
.keyrow.no .mark::before, .keyrow.no .mark::after { content: ""; position: absolute; left: 10px; top: 5px; width: 2px; height: 11px; background: var(--bad); transform: rotate(45deg); }
.keyrow.no .mark::after { transform: rotate(-45deg); }
pre.cmd { background: #0a0d12; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; font: 13.5px/1.7 var(--mono); color: var(--ink); }
pre.cmd .c { color: var(--muted); }
.mine { border: 1px solid rgba(169, 184, 255, .35); background: rgba(120, 140, 255, .06); border-radius: 12px; padding: 12px 16px; font-size: 14px; color: var(--soft); margin: 18px 0 0; }
.mine b { color: var(--ink); }
main.vault .promises { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .trio, main.vault .promises { grid-template-columns: 1fr; } }
