:root {
  --bg: #f6f5f2; --card: #fff; --text: #1f1d1a; --muted: #6b665e; --line: #e2ded6;
  --accent: #7a4b1e; --accent-text: #fff; --ok: #2f6b3a; --warn: #8a5a00; --err: #a12a2a;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: .4em 0; }
h2 { font-size: 1.15rem; margin: 0 0 .6em; }
.top { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.sites { display: flex; gap: 6px; flex-wrap: wrap; }
.sites a { padding: 4px 10px; border-radius: 6px; text-decoration: none; border: 1px solid var(--line); }
.sites a.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.me { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 16px 0; }
.card.narrow { max-width: 380px; margin: 60px auto; }
.scroll { overflow-x: auto; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; justify-content: space-between; }
label { display: block; margin-bottom: 10px; font-weight: 500; }
label.check { font-weight: 400; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 8px; font: inherit; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
label.check input { display: inline; width: auto; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid .wide, .grid button, .grid .check { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
button { padding: 8px 16px; font: inherit; border: 0; border-radius: 6px; background: var(--accent); color: var(--accent-text); cursor: pointer; justify-self: start; }
button.secondary { background: #ece7de; color: var(--text); }
button.small { padding: 4px 10px; font-size: .9em; }
button.link { background: none; color: var(--accent); padding: 0; text-decoration: underline; }
form.inline { display: inline-flex; gap: 6px; align-items: center; }
form.inline input, form.inline select { margin: 0; width: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.muted { color: var(--muted); }
.error { color: var(--err); background: #fbeaea; padding: 8px 12px; border-radius: 6px; }
.info { background: #eef4ec; color: var(--ok); padding: 8px 12px; border-radius: 6px; }
.notes { white-space: pre-wrap; background: #faf8f3; padding: 8px 12px; border-left: 3px solid var(--line); }
.status { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .85em; background: #ece7de; }
.s-outline_ready { background: #e3efe2; color: var(--ok); }
.s-outline_running { background: #fbf1dc; color: var(--warn); }
.s-failed { background: #fbeaea; color: var(--err); }
.badge { font-size: .8em; background: #ece7de; padding: 1px 6px; border-radius: 4px; }
.outline .h1 { font-size: 1.1rem; font-weight: 600; }
.outline ol > li { margin-bottom: 10px; }
.questions li { color: var(--warn); }
tr.inactive { opacity: .5; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.small { font-size: .9em; }
.card.warn { border-color: #e9cf96; background: #fffaf0; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary h2 { display: inline; }
.issues ul { padding-left: 0; list-style: none; }
.issues li { padding: 8px 10px; margin-bottom: 6px; border-radius: 6px; }
.issue-error { background: #fbeaea; }
.issue-warning { background: #fbf4e4; }
.preview { border: 1px solid var(--line); border-radius: 8px; padding: 8px 20px 16px; margin: 16px 0; background: #fff; }
.preview h1 { font-size: 1.6rem; }
.preview .lead { font-size: 1.05rem; color: var(--muted); }
.rich h2 { font-size: 1.3rem; margin-top: 1.4em; }
.rich h3 { font-size: 1.1rem; }
.rich table td, .rich table th { border: 1px solid var(--line); }
textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.edit h3 { margin: 8px 0; }
.send { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
button[disabled] { opacity: .45; cursor: not-allowed; }
.s-draft_ready, .s-shop-approved { background: #e3efe2; color: var(--ok); }
.s-writing, .s-meta_running, .s-shop-pending_approval { background: #fbf1dc; color: var(--warn); }
.s-shop-rejected, .s-shop-shop_failed { background: #fbeaea; color: var(--err); }
.tick { display: inline; font-weight: 400; margin: 0; } .tick input { display: inline; width: auto; margin: 0 6px 0 0; }
.s-fixing { background: #fbf1dc; color: var(--warn); }
.facts li { margin-bottom: 4px; }
.facts span[class^="fact-"] { font-size: .78em; padding: 1px 6px; border-radius: 4px; margin-right: 4px; }
.fact-potwierdzone { background: #e3efe2; color: var(--ok); }
.fact-baza-wiedzy { background: #e6ecf7; color: #2b4a7a; }
.fact-hipoteza { background: #fbf1dc; color: var(--warn); }
table.sources td { font-size: .95em; }
.err { color: var(--err); }
.paste { margin-top: 12px; }
.s-research_running { background: #fbf1dc; color: var(--warn); }
.s-research_ready { background: #e3efe2; color: var(--ok); }
