:root { --bg: #f6f5fb; --card: #fff; --fg: #1d1b2e; --muted: #6b6880; --line: #e4e1ef; --accent: #6d28d9; --accent-fg: #fff;
  --ok: #15803d; --warn: #b45309; --err: #b91c1c; --info: #1d4ed8; color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #13111c; --card: #1d1a2b; --fg: #ebe8f6; --muted: #9a96b0; --line: #2f2b44; --accent: #a78bfa; --accent-fg: #13111c;
    --ok: #4ade80; --warn: #fbbf24; --err: #f87171; --info: #93c5fd; }
}
* { box-sizing: border-box; }
body { font: 15px/1.5 system-ui, -apple-system, Segoe UI, sans-serif; margin: 0; color: var(--fg); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); }
h1 { font-size: 1.25rem; margin: 0; }
h2 { font-size: 1.2rem; margin: 0; }
h3 { font-size: 1rem; margin: .4rem 0; }
.top { display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: .5rem; }
nav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
nav button { background: none; border: 0; padding: .45rem .75rem; border-radius: 8px; color: var(--muted); font-weight: 500; }
nav button.on { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
main { max-width: 1100px; width: 100%; margin: 0 auto; padding: 1.2rem 1rem 2rem; flex: 1; }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 70ch; }
button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--fg); padding: .4rem .8rem; border-radius: 8px; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: var(--accent); }
button:disabled { opacity: .5; cursor: wait; }
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button.danger { color: var(--err); }
button.ghost { border: 0; background: none; color: var(--muted); }
button.small { font-size: .8rem; padding: .15rem .5rem; }
.bar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .8rem; }
.bar h2 { margin-right: auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.narrow { max-width: 480px; }
.list { display: flex; flex-direction: column; gap: .8rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; }
.meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.err { color: var(--err); font-size: .85rem; margin: .3rem 0; overflow-wrap: anywhere; }
.ok { color: var(--ok); }
.empty { color: var(--muted); text-align: center; padding: 2rem; }
.badge { font-size: .75rem; padding: .1rem .5rem; border-radius: 99px; background: color-mix(in srgb, var(--muted) 15%, transparent); white-space: nowrap; }
.st-generating, .st-publishing { color: var(--info); background: color-mix(in srgb, var(--info) 14%, transparent); }
.st-pending, .st-partial { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.st-scheduled, .st-posted { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.st-failed { color: var(--err); background: color-mix(in srgb, var(--err) 14%, transparent); }
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .3rem; background: currentColor; }
.dot.st-skipped { color: var(--muted); }
.post .text { white-space: pre-wrap; margin: .3rem 0; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.media { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
.media img, .media video { max-height: 220px; max-width: 100%; height: auto; width: auto; border-radius: 8px; background: #0002; }
.thumb { display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: .4rem 0; }
.chip { font-size: .8rem; border: 1px solid var(--line); border-radius: 99px; padding: .1rem .6rem; text-decoration: none; color: var(--fg); display: inline-flex; align-items: center; }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }
.actions.end { justify-content: flex-end; margin-top: 1rem; }
.progress { color: var(--info); font-size: .9rem; margin: .3rem 0; display: flex; align-items: center; gap: .5rem; }
.spin { width: .9rem; height: .9rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.project { padding: 0; overflow: hidden; }
.project.off { opacity: .6; }
.project .cover { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; display: block; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 30%, transparent), transparent); }
.project .pad { padding: .8rem 1rem 1rem; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--fg); padding: 1.2rem; width: min(720px, 96vw); max-height: 92vh; }
dialog::backdrop { background: #0008; }
form label { display: flex; flex-direction: column; gap: .2rem; margin: .5rem 0; font-size: .9rem; }
form label > span { color: var(--muted); }
input, textarea, select { font: inherit; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); width: 100%; }
textarea { resize: vertical; }
label.chk { flex-direction: row; align-items: center; gap: .45rem; margin: .3rem .8rem .3rem 0; display: inline-flex; }
label.chk input { width: auto; }
label.chk > span { color: var(--fg); }
label.file input { padding: .3rem; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: .6rem 0; padding: .4rem .8rem .6rem; }
legend { color: var(--muted); font-size: .9rem; padding: 0 .3rem; }
.checks { max-height: 180px; overflow: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; }
.row { display: flex; gap: .5rem; align-items: flex-end; }
.row .grow { flex: 1; }
.row button { margin-bottom: .5rem; }
.help { background: color-mix(in srgb, var(--accent) 8%, transparent); padding: .5rem .7rem; border-radius: 8px; }
.count { display: block; text-align: right; margin-top: -.3rem; }
#toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%) translateY(150%); background: var(--fg); color: var(--bg); padding: .6rem 1rem; border-radius: 10px; transition: transform .2s; max-width: 92vw; z-index: 20; }
#toast.show { transform: translateX(-50%); }
#toast.err { background: var(--err); color: #fff; }
footer { text-align: center; padding: 1rem; font-size: .8rem; }
footer a { color: var(--muted); text-decoration: none; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; } }
