:root {
  --bg: #f4f1ea; --panel: #fffdf8; --ink: #2b2620; --muted: #7a7166; --line: #e2dccf;
  --accent: #1f8a8a; --accent-ink: #ffffff; --warn: #b8541c; --ok: #3a7d3a; --shade: #efe9dc;
  --check: repeating-conic-gradient(#e6e0d3 0% 25%, #f7f3ea 0% 50%) 50% / 20px 20px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1d1a16; --panel: #26221d; --ink: #efe9dd; --muted: #a79d8f; --line: #3a342c; --accent: #4fc1bf; --accent-ink: #10211f; --shade: #2f2a24;
    --check: repeating-conic-gradient(#2c2721 0% 25%, #3a342c 0% 50%) 50% / 20px 20px; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.top { display: flex; align-items: center; gap: 18px; padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: .2px; display: flex; align-items: center; gap: 8px; }
.mark { width: 14px; height: 14px; border-radius: 3px; background: var(--accent); display: inline-block; box-shadow: 4px 4px 0 var(--warn); }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav button { background: none; border: 1px solid transparent; color: var(--ink); padding: 6px 10px; border-radius: 6px; cursor: pointer; font: inherit; }
nav button:hover { background: var(--shade); }
nav button.active { background: var(--accent); color: var(--accent-ink); }
.who { margin-left: auto; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.pill { background: var(--shade); border-radius: 999px; padding: 2px 9px; font-size: 12px; color: var(--ink); }
.view { padding: 18px; max-width: 1400px; margin: 0 auto; }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
h2 { margin: 0 0 10px; font-size: 18px; }
h3 { margin: 14px 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label > span.req::after { content: " *"; color: var(--warn); }
input, select, textarea, button { font: inherit; color: var(--ink); }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; min-width: 0; }
textarea { min-height: 70px; resize: vertical; }
input[type=checkbox] { width: auto; }
button.primary { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: 8px 14px; cursor: pointer; font-weight: 600; }
button.ghost { background: var(--shade); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; cursor: pointer; }
button.danger { background: none; color: var(--warn); border: 1px solid var(--warn); border-radius: 6px; padding: 6px 10px; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
.prompt { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--shade); padding: 10px; border-radius: 6px; white-space: pre-wrap; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
tr.status-failed td { color: var(--warn); }
.grid { columns: 5 200px; column-gap: 12px; }
.tile { break-inside: avoid; margin-bottom: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; }
.tile:hover { border-color: var(--accent); }
.tile img { display: block; width: 100%; background: var(--check); }
.tile .cap { padding: 6px 8px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.tile .cap b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-block; background: var(--shade); border-radius: 4px; padding: 1px 6px; font-size: 12px; margin: 2px 2px 0 0; }
.status-approved .cap { border-top: 3px solid var(--ok); }
.status-rejected { opacity: .55; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(560px, 100%); background: var(--panel); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(0,0,0,.15); overflow: auto; padding: 18px; z-index: 6; }
.drawer .big { width: 100%; background: var(--check); border-radius: 8px; cursor: crosshair; display: block; }
.drawer .close { float: right; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 9; max-width: 80%; }
.toast.err { background: var(--warn); color: #fff; }
.issues { margin: 8px 0; padding: 8px 10px; border-radius: 6px; background: var(--shade); font-size: 13px; }
.issues.err { border-left: 4px solid var(--warn); }
.issues.ok { border-left: 4px solid var(--ok); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.form-grid label.wide { grid-column: 1 / -1; }
.obj { border: 1px dashed var(--line); border-radius: 6px; padding: 8px; }
.obj-list > .obj { margin-bottom: 6px; }
.help { font-size: 12px; color: var(--muted); }
.step { padding: 6px 0; border-bottom: 1px solid var(--line); }
.step pre { white-space: pre-wrap; font-size: 12px; background: var(--shade); padding: 8px; border-radius: 6px; max-height: 260px; overflow: auto; }
.ok { color: var(--ok); } .fail { color: var(--warn); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); vertical-align: middle; margin-right: 4px; }
.list { max-height: 60vh; overflow: auto; }
.list button { text-align: left; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 7px 6px; cursor: pointer; color: var(--ink); }
.list button:hover, .list button.active { background: var(--shade); }
.two { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
@media (max-width: 800px) { .two { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; } }
.anchor-dot { position: absolute; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #ff2d55; background: rgba(255,45,85,.35); transform: translate(-50%, -50%); pointer-events: none; }
.imgwrap { position: relative; }
label.inline { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; margin: 2px 12px 2px 0; color: var(--ink); font-size: 13px; }

/* signing in */
.login { max-width: 460px; margin: 40px auto; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login .enroll { background: var(--shade); border-radius: 8px; padding: 12px; }
.login .qr { width: 180px; height: 180px; background: #fff; padding: 6px; border-radius: 6px; }
.login .qr svg { width: 100%; height: 100%; }
.help.err { color: var(--warn); }

/* rendered Markdown: the help, the roadmap, a note */
.doc h1 { font-size: 22px; margin: 0 0 12px; }
.doc h2 { font-size: 18px; margin: 22px 0 8px; }
.doc h3 { font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 16px 0 6px; }
.doc p, .doc li { max-width: 78ch; }
.doc li.item { list-style: none; margin-left: -18px; }
.doc li.item.done { color: var(--muted); }
.doc code { background: var(--shade); padding: 1px 4px; border-radius: 4px; font-size: 13px; }
.doc .table-wrap { overflow-x: auto; margin: 8px 0; }
.note-form { display: flex; flex-direction: column; gap: 8px; }

/* a wish as the settler pinned it */
.letter { background: #fbf6e9; color: #2b2620; border: 1px solid #e3d9bf; border-radius: 4px; padding: 16px 20px; margin: 8px 0; font-family: Georgia, "Times New Roman", serif; max-width: 70ch; box-shadow: 2px 3px 0 #e3d9bf; }
.letter p { margin: 0 0 10px; }
.letter .to { font-variant: small-caps; letter-spacing: .3px; }
.letter .from, .letter .credit { color: #6b6152; font-size: 14px; }
@media (prefers-color-scheme: dark) { .letter { background: #3a3324; color: #f0e8d6; border-color: #5a4f3a; box-shadow: 2px 3px 0 #5a4f3a; } .letter .from, .letter .credit { color: #bfb39c; } }
