:root {
  --ink: #17202a; --muted: #5d6875; --line: #dfe3e8; --page: #f4f6f8; --card: #fff;
  --primary: #2357d6; --ok: #1f8a4c; --warn: #b26a00; --bad: #c0362c;
  --radius: 10px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font-size: 15px; line-height: 1.45; }
a { color: var(--primary); }
h1 { font-size: 1.45rem; margin: 0 0 .4rem; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
code { font-size: .88em; background: #eef1f4; padding: 0 .3em; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none; }

.top { display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.2rem; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.top .brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.top nav { display: flex; gap: 1rem; flex: 1; }
.top nav a { text-decoration: none; color: var(--ink); }
.top .who { display: flex; align-items: center; gap: .7rem; }
.page { max-width: 1280px; margin: 0 auto; padding: 1.2rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.narrow { max-width: 460px; }
.stack { display: flex; flex-direction: column; gap: .7rem; }
.row { display: flex; gap: .5rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; font-size: .9rem; }
input, select, textarea { font: inherit; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 7px; background: #fff; width: 100%; }
.row input, .row select { width: auto; }
textarea { resize: vertical; line-height: 1.5; }
button, .button { font: inherit; padding: .45rem .9rem; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap; }
button:hover, .button:hover { border-color: #b9c1cb; }
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.danger { color: var(--bad); border-color: #efc3bf; }
button[disabled] { opacity: .45; cursor: not-allowed; }
button.link { border: none; background: none; color: var(--primary); padding: 0; }
form { margin: 0; }

.flash { padding: .6rem .8rem; border-radius: 8px; margin-bottom: .7rem; background: #e8f4ec; border: 1px solid #bfe0cb; }
.flash.error { background: #fbeceb; border-color: #f1c6c2; color: #7c241d; }
.flash.warn { background: #fff4e0; border-color: #f2d6a2; color: #6b4300; }
.pill, .chip { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eef1f4; color: var(--muted); }
.pill.ok { background: #e3f3e9; color: var(--ok); }
.pill.warn { background: #fff0d6; color: var(--warn); }
.pill.bad { background: #fbe6e4; color: var(--bad); }
.chip.s-approved, .chip.s-ready { background: #e3f3e9; color: var(--ok); }
.chip.s-posted { background: #e3ebfb; color: var(--primary); }
.chip.s-rejected, .chip.s-failed { background: #fbe6e4; color: var(--bad); }
.chip.s-generating { background: #fff0d6; color: var(--warn); }
.dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-right: .4em; vertical-align: baseline; }

.toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.toolbar .actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.legend { margin-top: 0; }
.fact { margin: .3rem 0 0; font-style: italic; color: var(--muted); max-width: 70ch; }

.week h2 { margin: 1rem 0 .5rem; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.day { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); min-height: 120px; padding: .45rem; display: flex; flex-direction: column; gap: .4rem; }
.day.today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.day.past { opacity: .7; }
.day-head { font-size: .8rem; font-weight: 700; color: var(--muted); }
.post-card { display: flex; flex-direction: column; gap: .3rem; text-decoration: none; color: var(--ink); border-left: 4px solid var(--app); padding: .35rem .45rem; border-radius: 6px; background: #fafbfc; }
.post-card:hover { background: #f1f4f7; }
.post-card img { width: 100%; border-radius: 4px; aspect-ratio: 4 / 5; object-fit: cover; }
.post-card .meta { display: flex; justify-content: space-between; gap: .3rem; font-size: .8rem; }
.post-card .headline { font-size: .82rem; line-height: 1.3; }
.chips { display: flex; gap: .2rem; flex-wrap: wrap; }

.post-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1rem; align-items: start; }
.posters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.posters figure { margin: 0; }
.posters img { width: 100%; border: 1px solid var(--line); border-radius: 6px; display: block; }
.posters figcaption { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.placeholder { aspect-ratio: 1; display: grid; place-items: center; background: #eef1f4; border-radius: 6px; color: var(--muted); }
.variant .row.wrap { margin-top: .6rem; }
.events { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.events li { padding: .25rem 0; border-bottom: 1px solid #f0f2f4; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
details { margin: .4rem 0; }
.commit summary { cursor: pointer; }
.commit summary .pill { margin-left: .4rem; }
.commit form { margin-top: .8rem; }
details ul { font-size: .9rem; }

@media (max-width: 900px) {
  .days { grid-template-columns: 1fr; }
  .day { min-height: 0; }
  .post-grid { grid-template-columns: 1fr; }
}

.publish-state { font-size: .88rem; color: var(--muted); margin: .4rem 0; }
.publish-state.bad { color: var(--bad); }
form.inline { display: inline; }
