/* Kingdom Colors: a coloring page on a desk. White sheets, pencil-black ink,
   one crayon blue for actions; crayon colours are kept for the ark and rainbow. */
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/static/fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/static/fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --desk: #e9edf1;
  --sheet: #ffffff;
  --ink: #222222;
  --muted: #5b5f66;
  --rule: #c9ced6;
  --action: #2b62c4;
  --action-ink: #ffffff;
  --warn: #9a5a00;
  --bad: #b3261e;
  --good: #2f7d32;
  --crayon-red: #e2483d; --crayon-orange: #f08c2e; --crayon-yellow: #f5c936;
  --crayon-green: #4fa34a; --crayon-blue: #2b62c4; --crayon-purple: #7a4bb5; --crayon-wood: #b5713c;
  font-family: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--desk); color: var(--ink); line-height: 1.55; }
a { color: var(--action); text-underline-offset: 2px; }
code { font-size: .92em; background: #f1f3f5; padding: 0 .3em; border-radius: 3px; }

html { scroll-padding-top: 5rem; }  /* in-page links (#page-3) land below the fixed top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem;
  padding: .7rem 1rem; background: var(--sheet); border-bottom: 2px solid var(--ink); }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand svg { width: 40px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
/* Content uses 85% of the window; small screens keep a 16px gutter instead. */
main { width: 85%; margin: 1.5rem auto; padding: 0 16px; }
@media (max-width: 700px) { main { width: 100%; } }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; }

.card { background: var(--sheet); border: 2px solid var(--ink); border-radius: 4px; padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; }
.card.narrow { max-width: 420px; margin: 3rem auto; }
h1 { margin: 0 0 .75rem; font-size: 1.75rem; line-height: 1.2; }
h2 { margin: 0 0 .75rem; font-size: 1.25rem; }
label { display: block; margin: .75rem 0; font-weight: 700; }
input, select { display: block; width: 100%; margin-top: .25rem; padding: .55rem .65rem; font: inherit;
  border: 1.5px solid var(--rule); border-radius: 4px; background: #fff; color: var(--ink); }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid #8fb3ee; outline-offset: 2px; }
button { font: inherit; cursor: pointer; padding: .5rem 1rem; border-radius: 4px; border: 2px solid var(--ink); background: #fff; color: var(--ink); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--action); border-color: var(--action); color: var(--action-ink); font-weight: 700; }
button.danger { color: var(--bad); border-color: var(--bad); }
button.link { border: 0; background: none; color: var(--action); padding: 0; text-decoration: underline; text-underline-offset: 2px; }
form.inline { display: inline; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.row input { flex: 1 1 220px; width: auto; margin: 0; }
.inline-label { display: inline; margin: 0; }
select.fit { display: inline-block; width: auto; max-width: 100%; margin: 0; }
.inline-check { display: flex; align-items: center; gap: .4rem; margin: 0; }
.inline-check input { width: auto; margin: 0; }
details.inline { display: inline-block; margin-left: .5rem; }
.error { color: var(--bad); font-weight: 700; }
.muted { color: var(--muted); }
.list { padding-left: 1.2rem; }
.tag { display: inline-block; font-size: .8rem; padding: 0 .45rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--muted); margin-left: .4rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
th { font-weight: 700; }
@media (max-width: 600px) { th, td { font-size: .9rem; } .card { padding: 1rem; } h1 { font-size: 1.45rem; } }

.warn { color: var(--warn); }
.notice { display: flex; justify-content: space-between; align-items: center; gap: .75rem 1rem; flex-wrap: wrap; }
.notice p { margin: 0; }
.page-list { list-style: none; padding: 0; margin: 0; }
.page-list li { padding: 0.75rem 0; border-top: 1px solid var(--rule); }
.page-list h3 { margin: 0 0 0.25rem; font-size: 1rem; }
blockquote { margin: 0.25rem 0; padding-left: 0.75rem; border-left: 3px solid var(--crayon-blue); }
blockquote cite { display: block; font-size: 0.85rem; font-style: normal; opacity: 0.75; }

.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 1.25rem; }
.page-card { margin-bottom: 0; min-width: 0; }
.page-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.page-card-head h2 { font-size: 1.05rem; margin: 0; }
.page-image img { width: 100%; height: auto; border: 1px solid var(--rule); background: #fff; }
.badge { font-size: .8rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--rule); white-space: nowrap; }
.badge-approved { color: var(--good); border-color: var(--good); }
.badge-denied { color: var(--bad); border-color: var(--bad); }
.check { font-size: .9rem; font-weight: 400; display: inline-flex; gap: .3rem; align-items: center; white-space: nowrap; margin: 0; }
.check input { width: auto; margin: 0; }
.prompt-form textarea { width: 100%; box-sizing: border-box; font: inherit; }
.locked { font-size: .85rem; overflow-wrap: anywhere; }
pre.prompt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .85rem; }
.history { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .5rem; }
.history img { width: 100%; border: 1px solid var(--rule); }
.denied-list { list-style: none; padding: 0; }
.denied-list li { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; border-top: 1px solid var(--rule); }

.stack { display: flex; flex-direction: column; gap: .4rem; }
.stack textarea { width: 100%; box-sizing: border-box; font: inherit; }
.msg { padding: .75rem 0; border-top: 1px solid var(--rule); }
.msg:first-child { border-top: 0; }
.msg-user p:first-child { font-weight: 600; }
.plan-pages { padding-left: 1.25rem; }
.plan-pages li { margin: .5rem 0; }
