:root {
  --bg: #f6f5f2; --panel: #ffffff; --ink: #1c1c1c; --muted: #777;
  --accent: #7c2d12; --chip: #e7e2da; --border: #ddd6cc;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, sans-serif; background: var(--bg); color: var(--ink); }
.topbar { display: flex; justify-content: space-between; align-items: center;
  padding: .6rem 1.2rem; background: var(--accent); color: #fff; }
.topbar a, .topbar .link { color: #fff; text-decoration: none; margin-left: 1rem;
  background: none; border: none; font: inherit; cursor: pointer; }
.brand { font-weight: 700; margin-left: 0 !important; }
.inline { display: inline; }
main { max-width: 1100px; margin: 1.5rem auto; padding: 0 1rem; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 1.2rem; }
.narrow { max-width: 380px; margin: 4rem auto; }
label { display: block; margin: .7rem 0; }
input, select, textarea { width: 100%; padding: .45rem; border: 1px solid var(--border); border-radius: 5px; font: inherit; }
button { padding: .45rem .9rem; border: none; border-radius: 5px; background: var(--accent);
  color: #fff; font: inherit; cursor: pointer; }
button:hover { filter: brightness(1.12); }
.row { display: flex; gap: 1rem; align-items: center; }
.spread { justify-content: space-between; }
.list { width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.list th, .list td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--border); }
.list tbody tr:hover { background: #faf8f4; }
.chip { display: inline-block; padding: .05rem .55rem; border-radius: 99px;
  background: var(--chip); font-size: .82rem; white-space: nowrap; }
.chip-ready_for_review { background: #fde68a; }
.chip-approved, .chip-submitted { background: #bbf7d0; }
.chip-failed { background: #fecaca; }
.chip-researching, .chip-generating, .chip-pushing, .chip-revising { background: #bfdbfe; }
.error { color: #b91c1c; }
.muted { color: var(--muted); }
.preview { line-height: 1.65; }
.preview h2 { margin-top: 1.6rem; border-bottom: 2px solid var(--border); padding-bottom: .25rem; }
.preview img { max-width: 100%; border: 1px solid var(--border); border-radius: 6px; }
.preview ul { background: #faf8f4; padding: .7rem 1rem .7rem 2rem; border-radius: 6px; }
/* Edit section: disclosure rows must read as buttons, not bare text. */
.btn-link { display: inline-block; padding: .45rem .9rem; border-radius: 5px;
  background: var(--accent); color: #fff; text-decoration: none; }
.btn-link:hover { filter: brightness(1.12); }
.edit-item { padding: 0; margin: .6rem 0; overflow: hidden; }
.edit-item > summary { cursor: pointer; padding: .75rem 1.1rem; background: #faf8f4;
  border-radius: 8px; display: flex; justify-content: space-between; gap: 1rem;
  align-items: center; user-select: none; }
.edit-item > summary:hover { background: #f1ece4; }
.edit-item[open] > summary { border-bottom: 1px solid var(--border); border-radius: 8px 8px 0 0; }
.edit-item > *:not(summary) { margin-left: 1.1rem; margin-right: 1.1rem; }
.edit-item > form:last-of-type, .edit-item > div:last-child { margin-bottom: 1.1rem; }
.edit-hint { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.warn-flag { color: #b45309; font-size: .85rem; white-space: nowrap; }
