:root {
  --bg: #f6f5f3; --surface: #fff; --text: #1d1b19; --muted: #6f6a64; --line: #e4e0da;
  --accent: #c13584; --accent-ink: #fff; --ok: #1f7a4d; --warn: #9a6200; --bad: #b3261e;
  --chip: #f1eee9; --user: #fbeef5; --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151413; --surface: #1f1d1b; --text: #eeeae5; --muted: #a39d95; --line: #34312d;
    --accent: #e0559f; --chip: #2a2724; --user: #33212c; --ok: #5cc28d; --warn: #e0a640; --bad: #ef6b62;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151413; --surface: #1f1d1b; --text: #eeeae5; --muted: #a39d95; --line: #34312d;
  --accent: #e0559f; --chip: #2a2724; --user: #33212c; --ok: #5cc28d; --warn: #e0a640; --bad: #ef6b62;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .2rem; } h2 { font-size: 1.05rem; margin: 0 0 .8rem; } h3 { font-size: .95rem; margin: 1.2rem 0 .5rem; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }
.top { display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.25rem; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); }
.top nav { display: flex; gap: .2rem; flex: 1; flex-wrap: wrap; }
.top nav a { color: var(--muted); padding: .3rem .65rem; border-radius: 6px; }
.top nav a.on, .top nav a:hover { color: var(--text); background: var(--chip); text-decoration: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 1.5rem 16px 4rem; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; min-width: 0; }
.card.narrow { max-width: 380px; margin: 10vh auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.grid2.wide-left { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.grid2 > * { min-width: 0; } .span2 { grid-column: 1 / -1; }
@media (max-width: 820px) { .grid2, .grid2.wide-left { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.cols { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; } .cols > label { flex: 1; min-width: 140px; }
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .88rem; }
label.inline { flex-direction: row; align-items: center; font-weight: 400; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: .55rem .65rem; width: 100%; font-weight: 400; }
input[type=checkbox], input[type=radio] { width: auto; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button, .btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: .5rem .95rem; border-radius: 8px; cursor: pointer; display: inline-block; }
button:hover, .btn:hover { border-color: var(--muted); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.link { background: none; border: none; color: var(--muted); padding: .3rem; font-weight: 500; }
button.link.danger { color: var(--bad); }
button.small { padding: .15rem .5rem; font-size: .8rem; }
.muted { color: var(--muted); } .small { font-size: .82rem; } .warntext { color: var(--warn); }
.flash { padding: .65rem .9rem; border-radius: 8px; margin-bottom: .8rem; border: 1px solid var(--line); background: var(--surface); }
.flash.ok { border-color: var(--ok); } .flash.error { border-color: var(--bad); color: var(--bad); } .flash.warn { border-color: var(--warn); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; display: flex; flex-direction: column; color: var(--text); }
.stat .n { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: .8rem; align-items: center; padding: .6rem .3rem; border-top: 1px solid var(--line); color: var(--text); }
.row:first-of-type { border-top: none; } a.row:hover { background: var(--chip); text-decoration: none; border-radius: 6px; }
.row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.clip { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; flex: none; background: var(--chip);
  display: flex; align-items: center; justify-content: center; font-size: .65rem; color: var(--muted); }
.badge { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: .15rem .5rem; border-radius: 99px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.s-scheduled, .s-running { color: #2463b5; } .s-published, .s-idle { color: var(--ok); }
.s-failed, .s-error { color: var(--bad); } .s-publishing { color: var(--warn); }
.tabs { display: flex; gap: .3rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .3rem .8rem; border-radius: 99px; color: var(--muted); border: 1px solid var(--line); background: var(--surface); }
.tabs a.on { color: var(--text); border-color: var(--text); }
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem; }
.skill { flex-direction: row; align-items: flex-start; gap: .55rem; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 400; }
.skill span { display: flex; flex-direction: column; gap: .15rem; }
.skill:has(input:checked) { border-color: var(--accent); background: var(--user); }
#thread { display: flex; flex-direction: column; gap: .8rem; margin-bottom: 1rem; }
.msg { max-width: 860px; padding: .8rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--user); border-color: transparent; max-width: 680px; }
.msg.working { color: var(--muted); }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md blockquote { margin: .6rem 0; padding: .4rem .9rem; border-left: 3px solid var(--accent); background: var(--bg); white-space: pre-wrap; }
.md table { border-collapse: collapse; display: block; overflow-x: auto; } .md td, .md th { border: 1px solid var(--line); padding: .3rem .55rem; }
.md pre { overflow-x: auto; background: var(--bg); padding: .6rem; border-radius: 6px; }
.chip { display: inline-block; font-size: .8rem; background: var(--chip); padding: .2rem .6rem; border-radius: 6px; margin: 0 .3rem .5rem 0; }
.chip.err { color: var(--bad); }
.composer { position: sticky; bottom: 0; display: flex; gap: .6rem; background: var(--bg); padding: .8rem 0 1rem; }
.composer textarea { flex: 1; }
.drafts-made { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pill { background: var(--chip); padding: .25rem .7rem; border-radius: 99px; font-size: .85rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .7rem; margin-bottom: .8rem; }
.media-item img, .media-item video { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 6px; background: var(--chip); }
.row-actions { display: flex; gap: .25rem; margin-top: .25rem; }
.slides { padding-left: 1.2rem; display: flex; flex-direction: column; gap: .5rem; }
.problems { color: var(--warn); padding-left: 1.1rem; margin: 0 0 .5rem; font-size: .88rem; }
.log { list-style: none; padding: 0; margin: 0; font-size: .85rem; display: flex; flex-direction: column; gap: .3rem; }
.log .error { color: var(--bad); } .log .warn { color: var(--warn); }
.status { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .45rem; font-size: .9rem; }
.status li::before { content: "●"; margin-right: .5rem; }
.status .ok::before { color: var(--ok); } .status .bad::before { color: var(--bad); } .status .off::before { color: var(--muted); }
.dots::after { content: "…"; animation: blink 1.2s infinite; } @keyframes blink { 50% { opacity: .2; } }
#foldpreview { font-style: italic; }

.ptag { font-size: .7rem; font-weight: 700; padding: .05rem .4rem; border-radius: 4px; background: var(--chip); color: var(--text); }
.p-instagram { color: #c13584; } .p-linkedin { color: #0a66c2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .p-linkedin { color: #5aa6f0; } }
:root[data-theme="dark"] .p-linkedin { color: #5aa6f0; }
.excerpt { margin: 0; padding: .4rem .8rem; border-left: 3px solid var(--line); color: var(--muted); white-space: pre-wrap; }
details summary { cursor: pointer; margin-top: 1rem; }
.hidden-when-post { display: none; }

fieldset.tt { border: 1px solid var(--line); border-radius: 8px; padding: .7rem .9rem; margin: 0; }
fieldset.tt legend { font-weight: 600; font-size: .88rem; padding: 0 .3rem; }
.p-tiktok { color: var(--text); } .p-facebook { color: #1877f2; }

.targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .5rem; }
.target { display: flex; flex-direction: column; gap: .3rem; border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; }
.campaign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
h2.section { margin: 1.5rem 0 .8rem; }

img.checker { object-fit: contain; background: repeating-conic-gradient(#cfcfcf 0% 25%, #f4f4f4 0% 50%) 50% / 16px 16px; }
details.gen { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .6rem; }
details.gen summary { cursor: pointer; }

.bizswitch select { padding: .3rem .5rem; font-weight: 600; max-width: 220px; }
.top nav a .count { background: var(--accent); color: var(--accent-ink); border-radius: 99px; font-size: .7rem; padding: 0 .4rem; margin-left: .2rem; }
.idea h3 { margin: .6rem 0 .3rem; font-size: 1rem; }
