:root {
    --bg: #faf7f2; --surface: #ffffff; --text: #1f1c18; --muted: #6b645a; --line: #e6dfd4;
    --accent: #0f6e66; --accent-text: #ffffff; --accent-soft: #e2f1ef;
    --ok: #2f6b1f; --ok-soft: #e8f2df; --warn: #8a5a00; --warn-soft: #fbefd5; --bad: #a3322a; --bad-soft: #fbe6e3;
    --radius: 10px; --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #171512; --surface: #211e1a; --text: #f1ece4; --muted: #a59d91; --line: #38332c;
        --accent: #4fb3a8; --accent-text: #0d1f1d; --accent-soft: #1d3330;
        --ok: #9ccf83; --ok-soft: #22301c; --warn: #f0c46b; --warn-soft: #382b12; --bad: #f19a90; --bad-soft: #3a1f1c;
    }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 .75rem; font-weight: 600; }
h2 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; font-weight: 600; }
code { font-size: .88em; overflow-wrap: anywhere; }
.muted { color: var(--muted); font-size: .92rem; }
.wrap { overflow-wrap: anywhere; }

.top { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between;
    padding: .75rem 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.brand span { color: var(--accent); font-weight: 600; }
.top nav { display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.top nav a { text-decoration: none; color: var(--muted); padding: .2rem 0; }
.top nav a[aria-current="page"] { color: var(--text); border-bottom: 2px solid var(--accent); }
main { max-width: 1080px; margin: 0 auto; padding: 1.25rem 16px 3rem; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 1rem 16px 2rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.narrow { max-width: 440px; margin: 2rem auto; }
label { display: block; margin: .75rem 0; font-weight: 500; }
input, textarea, select { display: block; width: 100%; margin-top: .3rem; padding: .6rem .7rem; font: inherit; color: var(--text);
    background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, .button { display: inline-block; padding: .55rem 1rem; font: inherit; font-weight: 600; border-radius: 8px; cursor: pointer;
    border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { color: var(--bad); border-color: var(--bad); }
button.small { padding: .3rem .6rem; font-size: .88rem; }
form.inline { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; }
form.inline label { margin: 0; }

.flash { padding: .7rem .9rem; border-radius: 8px; margin: 0 0 1rem; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--bad-soft); color: var(--bad); }

.count { display: inline-block; min-width: 1.6rem; padding: 0 .45rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
    font-size: .9rem; text-align: center; vertical-align: middle; }
.list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.list li + li { border-top: 1px solid var(--line); }
.list a, .list .row { display: flex; flex-wrap: wrap; gap: .4rem .75rem; align-items: center; padding: .75rem 1rem; text-decoration: none; color: var(--text); }
.list a:hover { background: var(--accent-soft); }
.when { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 7.5rem; }
.excerpt { flex: 1 1 18rem; }

.badge { display: inline-block; padding: .05rem .5rem; border-radius: 6px; font-size: .8rem; font-weight: 600; border: 1px solid var(--line); }
.badge.instagram { color: #b1306e; } .badge.facebook { color: #2d5bb8; } .badge.pinterest { color: #c1272d; }
@media (prefers-color-scheme: dark) { .badge.instagram { color: #f08fbf; } .badge.facebook { color: #8fb1f3; } .badge.pinterest { color: #f2898c; } }
.badge.pillar { color: var(--muted); }
.state { font-weight: 600; font-size: .88rem; }
.state.approved, .state.active, .state.ran, .state.ok { color: var(--ok); }
.state.draft, .state.needs_review, .state.open, .state.drafted, .state.skipped { color: var(--warn); }
.state.rejected, .state.expired, .state.missed, .state.gone, .state.failed, .state.excluded { color: var(--bad); }
.tag { color: var(--accent); }

.crumbs { margin: 0 0 .5rem; }
.draft-title { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.grid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 820px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.actions form { margin: 0; }
.actions .reject { display: flex; gap: .5rem; align-items: end; flex: 1 1 100%; }
.actions .reject label { flex: 1; margin: 0; }

.preview { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.pv-head { display: flex; gap: .6rem; align-items: center; padding: .7rem .9rem; font-weight: 600; font-size: .92rem; }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-text); font-size: .75rem; }
.pv-image { aspect-ratio: 1 / 1; display: grid; place-items: center; color: var(--muted); font-size: .9rem;
    background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 12px, var(--line) 12px, var(--line) 13px); }
.preview.pinterest .pv-image { aspect-ratio: 2 / 3; }
.preview.facebook .pv-image { aspect-ratio: 1.91 / 1; }
.preview.facebook .pv-text { order: -1; }
.pv-title { font-weight: 700; margin: .8rem .9rem 0; }
.pv-text { margin: .7rem .9rem; font-size: .95rem; overflow-wrap: anywhere; }
.pv-link { margin: 0; padding: .6rem .9rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }

.factlist { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; font-size: .92rem; }
.factlist dt { color: var(--muted); text-transform: capitalize; }
.factlist dd { margin: 0; overflow-wrap: anywhere; }
.versions { font-size: .9rem; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; vertical-align: top; padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
table.settings form.set { display: flex; gap: .35rem; min-width: 16rem; }
table.settings form.set input { margin: 0; padding: .35rem .5rem; font-family: ui-monospace, monospace; font-size: .85rem; }
.day h2 { margin-top: 1.25rem; }

.qr { display: grid; place-items: center; margin: 1rem 0; }
.qr svg { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 8px; }
.key { text-align: center; }
.codes { columns: 2; list-style: none; padding: 0; font-size: 1.05rem; }
.codes li { margin: .3rem 0; }
