/* Postwerk 0.20 – Oberfläche. Eine Schrift, ein Akzent, Status als Farbe an der Kante. */
:root {
  --canvas: #eef0f3;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --ink: #16202a;
  --ink-2: #3c4651;
  --muted: #5c6670;
  --line: #dde1e6;
  --line-2: #e9ecf0;
  --accent: #0f7c6e;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1ee;
  --focus: #2e6db4;

  --st-draft: #8a949e;
  --st-review: #b8711a;
  --st-approved: #0f7c6e;
  --st-scheduled: #2e6db4;
  --st-published: #0b5a50;
  --st-failed: #b3261e;

  --r-s: 4px; --r-m: 8px; --r-l: 12px;
  --sidebar: 232px;
  --font: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--canvas);
  line-height: 1.45; font-feature-settings: "tnum" 1, "cv11" 1; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
p { margin: 0 0 10px; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Gerüst ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.side {
  background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px;
  display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh;
}
.brandmark { display: flex; align-items: center; gap: 10px; padding: 2px 6px; font-weight: 600; letter-spacing: .02em; }
.brandmark .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.tenant-switch { position: relative; }
.tenant-switch summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface-2);
}
.tenant-switch summary::-webkit-details-marker { display: none; }
.tenant-switch summary .chev { margin-left: auto; color: var(--muted); font-size: 12px; }
.tenant-switch .menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: 0 8px 24px rgba(22,32,42,.12); padding: 6px;
}
.tenant-switch .menu button, .tenant-switch .menu a {
  width: 100%; text-align: left; display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 0; background: none; font: inherit; color: var(--ink); border-radius: var(--r-s); cursor: pointer;
}
.tenant-switch .menu button:hover, .tenant-switch .menu a:hover { background: var(--surface-2); text-decoration: none; }
.avatar {
  width: 26px; height: 26px; border-radius: 6px; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 600; color: #fff; background: var(--accent); flex: none;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-m);
  color: var(--ink-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav a .count { margin-left: auto; font-size: 12px; color: var(--muted); }
.nav .group { font-size: 12px; color: var(--muted); padding: 12px 10px 4px; }
.side .foot { margin-top: auto; border-top: 1px solid var(--line-2); padding-top: 12px; font-size: 13px; }
.side .foot form { margin: 0; }
.main { min-width: 0; }
.pagehead {
  display: flex; align-items: center; gap: 16px; padding: 18px 28px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.pagehead .grow { flex: 1; }
.content { padding: 24px 28px 60px; }

/* ---------- Bausteine ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--r-m);
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 500;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { filter: brightness(.95); text-decoration: none; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: none; border-color: transparent; color: var(--accent); padding: 6px 8px; }
.btn.danger { background: var(--surface); color: var(--st-failed); border-color: var(--line); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; background: var(--surface); }
.seg a, .seg button { padding: 6px 12px; color: var(--ink-2); font: inherit; border: 0; background: none; cursor: pointer; }
.seg a + a, .seg button + button { border-left: 1px solid var(--line); }
.seg .active { background: var(--ink); color: #fff; }
.seg a:hover { text-decoration: none; background: var(--surface-2); }
.seg .active:hover { background: var(--ink); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card h2 { margin-bottom: 10px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 2fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr 1fr; } }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
label:first-child { margin-top: 0; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date], input[type=datetime-local], input[type=color], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-m); font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px rgba(46,109,180,.15); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.error { color: var(--st-failed); font-size: 13px; margin-top: 4px; }
.flash { padding: 10px 14px; border-radius: var(--r-m); margin-bottom: 16px; border: 1px solid; }
.flash.ok { background: #e8f3f0; border-color: #bfe0d8; color: #0b5a50; }
.flash.err { background: #fbeae9; border-color: #f0c3c0; color: #8b1d17; }
.flash.warn { background: #fbf1e3; border-color: #f0d7b3; color: #7d4b0c; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st-draft); }
.badge.draft::before { background: var(--st-draft); }
.badge.review::before { background: var(--st-review); }
.badge.approved::before { background: var(--st-approved); }
.badge.scheduled::before { background: var(--st-scheduled); }
.badge.published::before { background: var(--st-published); }
.badge.failed::before { background: var(--st-failed); }
.chip { display: inline-block; padding: 1px 7px; border-radius: var(--r-s); font-size: 11px; font-weight: 600; color: #fff; background: var(--ink-2); letter-spacing: .02em; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }
pre.copy { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-m); padding: 12px 14px; white-space: pre-wrap; font: inherit; font-size: 14px; margin: 0; }

/* ---------- Kennzahlen-Kacheln ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px 18px; display: block; color: inherit; border-left: 4px solid var(--line); }
.tile:hover { text-decoration: none; border-color: var(--ink-2); border-left-color: inherit; }
.tile .k { font-size: 28px; font-weight: 600; line-height: 1.1; }
.tile .l { color: var(--muted); font-size: 13px; margin-top: 4px; }
.tile.review { border-left-color: var(--st-review); }
.tile.approved { border-left-color: var(--st-approved); }
.tile.scheduled { border-left-color: var(--st-scheduled); }
.tile.failed { border-left-color: var(--st-failed); }
.tile.published { border-left-color: var(--st-published); }

/* ---------- Beitragskachel (Kalender, Board, Listen) ---------- */
.pcard {
  display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: start; padding: 8px 10px 8px 8px;
  background: var(--surface); border: 1px solid var(--line); border-left-width: 4px; border-left-color: var(--st-draft);
  border-radius: var(--r-m); color: inherit; font-size: 13px; line-height: 1.3; cursor: grab;
}
.pcard:hover { text-decoration: none; border-color: var(--ink-2); border-left-color: var(--st-draft); box-shadow: 0 2px 8px rgba(22,32,42,.08); }
.pcard.draft { border-left-color: var(--st-draft); } .pcard.draft:hover { border-left-color: var(--st-draft); }
.pcard.review { border-left-color: var(--st-review); } .pcard.review:hover { border-left-color: var(--st-review); }
.pcard.approved { border-left-color: var(--st-approved); } .pcard.approved:hover { border-left-color: var(--st-approved); }
.pcard.scheduled { border-left-color: var(--st-scheduled); } .pcard.scheduled:hover { border-left-color: var(--st-scheduled); }
.pcard.published { border-left-color: var(--st-published); cursor: default; } .pcard.published:hover { border-left-color: var(--st-published); }
.pcard.failed { border-left-color: var(--st-failed); } .pcard.failed:hover { border-left-color: var(--st-failed); }
.pcard .thumb { width: 44px; height: 55px; border-radius: 3px; background: var(--surface-2); object-fit: cover; display: block; border: 1px solid var(--line-2); }
.pcard .thumb.none { display: grid; place-items: center; color: var(--muted); font-size: 10px; }
.pcard .t { font-weight: 500; color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pcard .m { display: flex; gap: 6px; align-items: center; margin-top: 4px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.pcard .m .chip { font-size: 10px; padding: 0 5px; }
.ch { display: inline-flex; gap: 3px; vertical-align: middle; }
.ch i { width: 14px; height: 14px; border-radius: 3px; display: inline-grid; place-items: center; font-style: normal; font-size: 9px; font-weight: 700; color: #fff; }
.ch i.instagram { background: #c13584; } .ch i.facebook { background: #1877f2; } .ch i.linkedin { background: #0a66c2; }
.pcard.dragging { opacity: .5; }

/* ---------- Kalender ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; background: var(--line); gap: 1px; }
.cal .dow { background: var(--surface-2); padding: 8px 10px; font-size: 12px; color: var(--muted); font-weight: 500; }
.cal .day { background: var(--surface); min-height: 128px; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.cal .day.other { background: var(--surface-2); }
.cal .day.today .d { color: var(--accent); font-weight: 600; }
.cal .day .d { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; padding: 2px 4px; }
.cal .day .d .add { opacity: 0; color: var(--muted); font-size: 14px; line-height: 1; }
.cal .day:hover .d .add { opacity: 1; }
.cal .day.over { background: var(--accent-soft); }
.cal .day.past { background: #f9fafb; }
.cal.week .day { min-height: 420px; }
.cal .more { font-size: 12px; color: var(--muted); padding: 0 4px; }

/* ---------- Board ---------- */
.board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; padding-bottom: 8px; }
.col { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-l); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 300px; }
.col h3 { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-2); padding: 2px 4px 6px; }
.col h3 .n { color: var(--muted); font-weight: 500; }
.col.over { background: var(--accent-soft); }

/* ---------- Feed-Vorschau ---------- */
.phone { width: 360px; max-width: 100%; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; }
.phone .ph { padding: 14px 16px 10px; border-bottom: 1px solid var(--line-2); display: flex; gap: 12px; align-items: center; }
.phone .ph .pfp { width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 600; color: var(--muted); }
.feedgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.feedgrid a { position: relative; aspect-ratio: 1; background: var(--surface-2); display: block; overflow: hidden; }
.feedgrid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feedgrid .planned { outline: 2px solid var(--st-scheduled); outline-offset: -2px; }
.feedgrid .planned.review { outline-color: var(--st-review); }
.feedgrid .planned.draft { outline-color: var(--st-draft); }
.feedgrid .planned::after { content: attr(data-date); position: absolute; left: 4px; bottom: 4px; background: rgba(22,32,42,.8); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 3px; }
.feedgrid .ph { display: grid; place-items: center; color: var(--muted); font-size: 11px; text-align: center; padding: 6px; }

/* ---------- Beitrag ---------- */
.preview { background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; max-width: 420px; }
.preview .head { display: flex; gap: 10px; align-items: center; padding: 10px 12px; font-size: 13px; }
.preview .media img { width: 100%; display: block; }
.preview .media .none { aspect-ratio: 4/5; display: grid; place-items: center; color: var(--muted); background: var(--surface-2); font-size: 13px; }
.preview .cap { padding: 10px 12px 14px; font-size: 13px; white-space: pre-wrap; }
.timeline { font-size: 13px; }
.timeline div { padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.timeline div:last-child { border-bottom: 0; }
.assets { display: flex; gap: 8px; flex-wrap: wrap; }
.assets figure { margin: 0; width: 88px; }
.assets img, .assets .vid { width: 88px; height: 110px; object-fit: cover; border-radius: var(--r-s); display: block; border: 1px solid var(--line-2); }
.assets .vid { background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 12px; }
.assets figcaption { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; justify-content: space-between; }

/* ---------- Anmelden ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: 100%; max-width: 400px; padding: 28px; }
.auth .brandmark { padding: 0; margin-bottom: 22px; font-size: 18px; }

/* ---------- Mobil ---------- */
.menubtn { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(85vw, 300px); transform: translateX(-100%); transition: transform .2s; z-index: 30; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .side.open { transform: none; }
  .menubtn { display: inline-flex; }
  .pagehead, .content { padding-left: 16px; padding-right: 16px; }
  .cal .day { min-height: 80px; }
  .cal .pcard { grid-template-columns: 1fr; } .cal .pcard .thumb { display: none; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(6, 220px); overflow-x: auto; }
}

/* ---- Beitrag: Detail (0.24) ---- */
.cols-3-1 { grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr); }
@media (max-width: 1100px) { .cols-3-1 { grid-template-columns: 1fr; } }
.card.preview { padding: 0; max-width: 460px; }
.preview-media { position: relative; background: var(--surface-2); }
.preview-media img { width: 100%; display: block; aspect-ratio: 4/5; object-fit: cover; }
.preview-video, .preview-placeholder { aspect-ratio: 4/5; display: grid; place-content: center; text-align: center; gap: 6px; padding: 24px; }
.preview-video { background: var(--ink); color: #fff; }
.preview-placeholder span { font-size: 22px; font-weight: 600; line-height: 1.2; color: var(--ink); }
.preview-placeholder small { color: var(--muted); font-size: 12px; }
.preview-count { position: absolute; top: 10px; right: 10px; background: rgba(22,32,42,.78); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 999px; }
.preview-body { padding: 12px 14px 16px; font-size: 13px; }
.preview-caption { white-space: pre-wrap; margin-top: 8px; line-height: 1.45; }
pre.caption { white-space: pre-wrap; font: inherit; font-size: 13.5px; line-height: 1.5; margin: 10px 0 0; padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-m); }
ol.slides { margin: 0; padding-left: 20px; }
ol.slides li { margin-bottom: 8px; font-size: 13.5px; }
ol.slides li strong { display: block; }
ol.slides li span { color: var(--ink-2); }
dl.facts { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin: 0; font-size: 13px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.asset { width: 88px; }
.asset img, .asset-video { width: 88px; height: 110px; object-fit: cover; border-radius: var(--r-s); display: block; border: 1px solid var(--line-2); }
.asset-video { background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 12px; }
.asset .small { font-size: 11px; margin-top: 3px; }
.log { font-size: 13px; margin-bottom: 8px; line-height: 1.4; }
.btn.link { background: none; border: 0; padding: 0; color: var(--accent); font-size: 13px; }
.btn.link.danger { color: var(--st-failed); }
.btn.link.small { font-size: 11px; }
.btn.link:hover { text-decoration: underline; }

input[type=file] { font-size: 13px; padding: 8px; border: 1px dashed var(--line); border-radius: var(--r-m); width: 100%; background: var(--surface-2); }

/* ---- Verbindungen (0.25) ---- */
.connect-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
@media (max-width: 900px) { .connect-grid { grid-template-columns: 1fr; } }
.connect { border: 1px solid var(--line-2); border-radius: var(--r-l); padding: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.connect .btn { align-self: flex-start; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--st-draft); margin-right: 6px; vertical-align: middle; }
.dot.ok { background: var(--st-approved); } .dot.warn { background: var(--st-review); } .dot.err { background: var(--st-failed); }
.pick { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.pick-row { display: grid; grid-template-columns: auto auto 1fr; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--surface-2); margin: 0; color: var(--ink); cursor: pointer; }
.pick-row.sub { margin-left: 28px; }
.pick-row input { width: 18px; height: 18px; margin: 0; }
details.inline summary { cursor: pointer; color: var(--accent); font-size: 13px; list-style: none; }
details.inline summary::-webkit-details-marker { display: none; }
details.inline[open] { min-width: 360px; }
.flash a { color: inherit; font-weight: 600; }

/* 0.29.0 */
.ch i.threads { background: #111; } .ch i.google { background: #1a73e8; }

/* 0.29.1 Feldhilfe */
.help { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-left: 4px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-size: 10px; font-weight: 600; line-height: 1; cursor: help; vertical-align: 1px; }
.help:hover, .help:focus, .help:focus-within { border-color: var(--accent); color: var(--accent); outline: none; }
.help .tip { display: none; position: absolute; top: 100%; left: -10px; z-index: 30; width: 270px; padding-top: 7px; cursor: default; }
.help.right .tip { left: auto; right: -10px; }
.help:hover .tip, .help:focus .tip, .help:focus-within .tip { display: block; }
.help .tip-box { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); box-shadow: 0 8px 24px rgba(22,32,42,.12); color: var(--ink); font-size: 13px; font-weight: 400; line-height: 1.45; text-align: left; white-space: normal; }
.help .tip-box code { font-size: 12px; }
/* 0.31.0 Website und Webhook */
.ch i.wordpress { background: #21759b; } .ch i.webhook { background: #5b6470; }
