:root {
  --bg: #121826; --panel: #1b2233; --panel2: #243049; --edge: #34405e; --text: #eef2f8; --dim: #9aa6b8;
  --accent: #f2b33d; --good: #57c26b; --bad: #e2574c; --blue: #6fa8e8;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--blue); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }
main { max-width: 980px; margin: 0 auto; padding: 16px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--edge); background: var(--panel); position: sticky; top: 0; z-index: 2; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 600; }
.brand img { image-rendering: pixelated; border-radius: 6px; }
nav { display: flex; gap: 14px; align-items: center; }
nav a { color: var(--dim); text-decoration: none; }
nav a:hover { color: var(--text); }
h1 { font-size: 1.6rem; margin: .2em 0; }
h2 { font-size: 1.1rem; margin: .4em 0; }
.hero { padding: 8px 0 4px; }
.hero p { color: var(--dim); max-width: 60ch; }
.muted { color: var(--dim); }
.small { font-size: .875rem; }
.warn { color: var(--accent); }
.card { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); padding: 14px; margin: 12px 0; }
.card.narrow { max-width: 420px; }
.card.narrow form > button { margin-top: 14px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.gallery .card { margin: 0; }
.stage { width: 100%; height: auto; image-rendering: pixelated; border-radius: 8px; display: block; background: #4f8fd8; }
.stage-label { margin: 4px 0 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.split .card { margin: 0; }
@media (max-width: 720px) { .split { grid-template-columns: 1fr; } }
label { display: block; margin: 10px 0 4px; color: var(--dim); font-size: .9rem; }
label.check { display: flex; gap: 6px; align-items: center; }
input, textarea, select { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--edge);
  border-radius: 8px; padding: 9px 10px; font: inherit; }
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; resize: vertical; }
input[type=checkbox] { width: auto; }
button, .file { background: var(--accent); color: #241a05; border: 0; border-radius: 8px; padding: 9px 14px;
  font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
button.ghost, .file { background: var(--panel2); color: var(--text); border: 1px solid var(--edge); font-weight: 500; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.file { margin: 0; }
.file input { display: none; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.row input { flex: 1; min-width: 90px; }
.row form { margin: 0; }
.problems { color: var(--accent); font-size: .875rem; padding-left: 18px; }
.badge { display: inline-block; background: var(--panel2); border: 1px solid var(--edge); border-radius: 999px;
  padding: 1px 10px; font-size: .8rem; color: var(--dim); font-weight: 500; }
.status-pending { border-color: var(--accent); }
.status-rejected, .status-superseded { opacity: .55; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.stats .card { margin: 0; display: flex; flex-direction: column; }
.stats strong { font-size: 1.6rem; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; color: var(--dim); font-weight: 500; white-space: nowrap; }
th, td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--edge); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.good { color: var(--good); }
td.never { color: var(--dim); }
meter { width: 56px; vertical-align: middle; }
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { padding: 7px 0; border-bottom: 1px solid var(--edge); }
.feed li:last-child { border-bottom: 0; }
.ranks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ranks li { display: grid; grid-template-columns: 7rem 1fr 2rem; align-items: center; gap: 10px; }
.ranks progress { width: 100%; accent-color: var(--accent); }
.petcard .petinfo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-top: 8px; }
.petcard .petinfo p { margin: 0; }
.bars { display: grid; gap: 6px; margin: 12px 0; }
.bar { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; font-size: .9rem; }
.track { height: 10px; background: var(--panel2); border-radius: 6px; overflow: hidden; }
.fill { height: 100%; border-radius: 6px; transition: width .4s; }
.fill.food { background: var(--bad); } .fill.fun { background: var(--accent); }
.fill.energy { background: var(--good); } .fill.clean { background: var(--blue); }
.care { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.list { list-style: none; padding: 0; margin: 8px 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0;
  border-top: 1px solid var(--edge); }
.list li:first-child { border-top: 0; }
.list .actions { display: flex; gap: 6px; align-items: center; }
.list select { width: auto; padding: 6px; }
.list button { padding: 6px 10px; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; color: var(--accent); font-size: 1.1rem; }
details { margin-top: 12px; }
.checklist { margin: 8px 0 0; padding-left: 0; list-style: none; display: grid; gap: 5px; }
.checklist .done { color: var(--good); }
.achievement-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 8px; }
.achievement { border: 1px solid var(--edge); border-radius: 10px; padding: 9px; font-size: .86rem; }
.achievement.earned { border-color: var(--good); color: var(--good); }
.achievement.locked { color: var(--dim); }
.timeline { list-style: none; margin: 8px 0; padding: 0; }
.timeline li { border-left: 2px solid var(--edge); padding: 5px 0 5px 12px; font-size: .88rem; }
.diagnostics { display: grid; grid-template-columns: minmax(100px, 1fr) 2fr; margin: 10px 0; }
.diagnostics dt, .diagnostics dd { margin: 0; padding: 4px 0; border-bottom: 1px solid var(--edge); }
.diagnostics dt { font-weight: 600; }
.button-link { display: inline-block; background: var(--panel2); border: 1px solid var(--edge); border-radius: 8px;
  padding: 8px 12px; color: var(--text); text-decoration: none; }
