:root {
  --bg: #07131d;
  --bg2: #0c2030;
  --card: #0f2638;
  --line: #1f4258;
  --text: #e6eef3;
  --muted: #9db3c2;
  --gold: #ffd24a;
  --gold2: #e2a93a;
  --ok: #5ee07a;
  --err: #ff8a6a;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 500px at 20% -10%, #133a55 0%, transparent 60%), var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--gold); }
a:hover { color: #fff1b8; }
code { background: #0a1b28; border: 1px solid var(--line); padding: 1px 6px; border-radius: 4px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

.top { border-bottom: 1px solid var(--line); background: rgba(5, 14, 22, .8); position: sticky; top: 0; backdrop-filter: blur(6px); z-index: 2; }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-top: 12px; padding-bottom: 12px; }
.brand { color: var(--gold); text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: .01em; }
.brand small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.hook { display: inline-block; transform: translateY(1px); }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.top nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.top nav a:hover, .top nav a[aria-current] { color: var(--gold); }

main { padding-top: 28px; padding-bottom: 40px; }
h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 1.25rem; margin: 0 0 12px; color: var(--gold); }
h3 { font-size: 1.05rem; margin: 0 0 8px; color: var(--gold); }
.lead { color: var(--text); font-size: 1.05rem; max-width: 760px; }
.muted { color: var(--muted); font-size: .92rem; }

.hero { padding: 8px 0 18px; }
.stats { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 18px 0 0; }
.stats li { background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; color: var(--muted); }
.stats b { color: var(--gold); font-variant-numeric: tabular-nums; }

.card { background: linear-gradient(180deg, var(--card), #0c2132); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 18px; }
.card.narrow { max-width: 720px; }
.card.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card ul { margin: 0; padding-left: 20px; }
.card li { margin: 4px 0; }
.steps { margin: 0; padding-left: 22px; }
.steps li { margin: 6px 0; }
.prose p { max-width: 70ch; }

textarea, input[type=text], input[type=password] {
  width: 100%; background: #06121b; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font: 13px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
}
textarea { resize: vertical; min-height: 140px; word-break: break-all; }
input[type=text], input[type=password] { font: inherit; max-width: 360px; }
textarea:focus, input:focus { outline: 2px solid var(--gold2); outline-offset: 1px; }
label { display: block; margin: 0 0 6px; }
.consent label { display: flex; gap: 8px; align-items: flex-start; }
.consent input { margin-top: 5px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

button, .button {
  display: inline-block; background: linear-gradient(180deg, var(--gold), var(--gold2)); color: #1b1203; border: 0; border-radius: 8px;
  padding: 10px 20px; font: 600 1rem/1.2 inherit; font-family: inherit; cursor: pointer; text-decoration: none; margin-top: 10px;
}
button:hover, .button:hover { filter: brightness(1.08); color: #1b1203; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.danger { background: linear-gradient(180deg, #ff9b7d, #d9573a); }
button.small { padding: 5px 10px; font-size: .85rem; margin: 0; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }

.preview { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: #08182333; }
.ok { color: var(--ok); }
.err { color: var(--err); }
.preview.ok { border-color: #2d6b3c; }
.preview.err { border-color: #7a3a2b; }
.result { margin-top: 12px; min-height: 1.5em; }
.cf-turnstile { margin-top: 12px; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .8rem; border: 1px solid var(--line); }
.tag.new { color: var(--gold); }
.tag.approved { color: var(--ok); }
.tag.rejected { color: var(--err); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.tile b { display: block; font-size: 1.4rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }
.inline { display: inline; }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 18px 0 30px; }

@media (max-width: 720px) {
  .card.two { grid-template-columns: 1fr; }
  .card { padding: 16px; }
}

/* --- Installer and admin area ------------------------------------------- */
input[type=email], input:not([type]), input[type=number], input[type=file], select {
  width: 100%; max-width: 360px; background: #06121b; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit;
}
form label { margin-top: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 360px; }
.warn { color: var(--gold); }
.progress { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 18px; counter-reset: st; }
.progress li { counter-increment: st; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .88rem; }
.progress li::before { content: counter(st) ". "; }
.progress li.done { color: var(--ok); border-color: #2d6b3c; }
.progress li.now { color: #1b1203; background: var(--gold); border-color: var(--gold); font-weight: 600; }

body.admin .wrap { max-width: 1240px; }
.admin .top nav { gap: 4px 14px; }
.flash { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); margin: 0 0 16px; background: var(--bg2); }
.flash.ok { border-color: #2d6b3c; }
.flash.err { border-color: #7a3a2b; }
.tag.safe, .tag.ok, .tag.applied, .tag.release { color: var(--ok); }
.tag.review, .tag.community, .tag.open { color: var(--gold); }
.tag.stale, .tag.admin { color: var(--muted); }
.tag.bad, .tag.unchecked { color: var(--err); }
.flow { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.flow li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.flow .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--muted); font-weight: 700; }
.flow li.done .n { background: #1d4d2a; color: var(--ok); border-color: #2d6b3c; }
.flow li.todo .n { background: var(--gold); color: #1b1203; border-color: var(--gold); }
td.code, .code { font: 12.5px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; word-break: break-word; }
.fields { display: grid; grid-template-columns: minmax(110px, 180px) 1fr; gap: 8px 10px; align-items: start; }
.fields input, .fields textarea { max-width: none; font: 13px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.fields textarea { min-height: 44px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; justify-content: space-between; margin-bottom: 12px; }
.toolbar form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 0; }
.toolbar input, .toolbar select { width: auto; }
.toolbar button { margin: 0; }
.diff del { color: var(--err); text-decoration: none; }
.diff ins { color: var(--ok); text-decoration: none; }
@media (max-width: 720px) {
  .fields { grid-template-columns: 1fr; }
  .flow li { grid-template-columns: 30px 1fr; }
  .flow li > :last-child { grid-column: 2; }
}

/* --- Thank-you ticker -------------------------------------------------- */
.ticker { overflow: hidden; border: 1px solid var(--line); border-radius: 999px; background: var(--bg2); margin: 0 0 18px; }
.ticker-track { display: flex; width: max-content; animation: ticker 60s linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker-list { display: flex; list-style: none; margin: 0; padding: 0; }
.ticker-list li { white-space: nowrap; padding: 8px 28px 8px 0; color: var(--muted); font-size: .92rem; }
.ticker-list li:first-child { padding-left: 18px; }
.ticker-list b { color: var(--gold); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker { border-radius: var(--radius); }
  .ticker-track { animation: none; width: auto; }
  .ticker-list[aria-hidden] { display: none; }
  .ticker-list { flex-wrap: wrap; }
}
button.big { font-size: 1.1rem; padding: 14px 26px; margin: 4px 0 12px; }
.foot a { color: var(--muted); }

/* --- Big drag & drop upload field (admin) -------------------------------- */
.dropzone { position: relative; display: block; border: 2px dashed var(--gold2); border-radius: var(--radius); background: #06121b;
  padding: 38px 20px; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; margin: 8px 0 4px; }
.dropzone:hover, .dropzone.over { background: #0b2233; border-color: var(--gold); }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; opacity: 0; cursor: pointer; }
.dropzone .dz-icon { font-size: 2.4rem; display: block; }
.dropzone .dz-title { display: block; font-size: 1.15rem; font-weight: 600; color: var(--gold); margin: 6px 0; }
.dropzone .dz-files { display: block; margin-top: 10px; color: var(--ok); font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
.upload-row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.mt { margin-top: 14px; }

/* --- Download box ---------------------------------------------------------- */
.card.download { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; border-color: var(--gold2); }
.card.download h2 { margin-bottom: 6px; }
.release-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 6px; color: var(--muted); }
.release-meta b { color: var(--text); }
a.button.big { font-size: 1.1rem; padding: 14px 26px; margin: 0; }

/* overview: the one main action */
.card.publish { border-color: rgba(233, 185, 73, .55); background: linear-gradient(135deg, rgba(233, 185, 73, .10), transparent 55%), var(--card, #0f1d2e); }
.card.publish h2 { margin-top: 0; }
details > summary { cursor: pointer; padding: 4px 0; }
