:root {
  --bg: #f4f4f2;
  --card: #ffffff;
  --ink: #141414;
  --ink-2: #4a4a48;
  --muted: #7b7b78;
  --line: #e2e2de;
  --line-2: #d2d2cc;
  --accent: #141414;
  --ok: #2f6b45;
  --ok-bg: #e7f1ea;
  --warn: #8a5a12;
  --warn-bg: #f7eedb;
  --err: #a3302a;
  --err-bg: #f8e6e4;
  --info-bg: #e9edf3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.04);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3 { font-family: "Funnel Display", Inter, sans-serif; font-weight: 600; letter-spacing: -.01em; margin: 0 0 .4em; }
h1 { font-size: 26px; }
h2 { font-size: 17px; }
a { color: inherit; }
img { max-width: 100%; display: block; }
code { font: 13px/1.4 ui-monospace, Consolas, monospace; background: #f0f0ec; padding: 1px 5px; border-radius: 4px; word-break: break-all; }
code.block { display: block; padding: 10px 12px; white-space: pre-wrap; }

/* Kopf */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 58px; background: var(--ink); color: #fff; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: "Funnel Display", sans-serif; font-weight: 600; font-size: 16px; white-space: nowrap; }
.logo-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 700; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.who { flex: none; }
.nav a { text-decoration: none; color: #bdbdb8; padding: 8px 12px; border-radius: 7px; white-space: nowrap; font-weight: 500; font-size: 14px; }
.nav a:hover { color: #fff; }
.nav a.on { color: #fff; background: rgba(255,255,255,.12); }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #bdbdb8; white-space: nowrap; }
.who a { text-decoration: none; }
.who .link { color: #fff; }

main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }
main.wide { max-width: 1480px; }

/* Bausteine */
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap, .wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.block { margin-top: 34px; }
.muted { color: var(--muted); }
.small, small { font-size: 13px; }
.center { text-align: center; }
.right { text-align: right; }
.err-text { color: var(--err); }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.inline { display: inline; }
.hint { margin: 0; padding: 10px 12px; background: var(--warn-bg); color: var(--warn); border-radius: 8px; font-size: 14px; }

label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); font-size: 14px; }
input, select, textarea { font: inherit; font-size: 15px; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--ink); flex: none; }
input[type=color] { padding: 3px; height: 40px; }
input[type=file] { padding: 7px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }
.row > input, .row > select { width: auto; }
textarea { resize: vertical; line-height: 1.5; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-size: 13px; font-weight: 500; color: var(--ink-2); padding: 0 6px; }
details summary { cursor: pointer; font-size: 14px; color: var(--ink-2); }
details[open] summary { margin-bottom: 10px; }
details.inline summary { display: inline-block; padding: 9px 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 500 14px/1 Inter, sans-serif; padding: 11px 16px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #333; }
.btn.small { padding: 8px 12px; font-size: 13px; }
.btn.danger-outline { color: var(--err); border-color: #e3c3c0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--ink); text-decoration: underline; cursor: pointer; }
.link.danger { color: var(--err); }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; background: var(--info-bg); font-size: 14px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }

.chip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 20px; background: #ececea; color: var(--ink-2); white-space: nowrap; }
.chip-entwurf { background: #ececea; color: var(--ink-2); }
.chip-zur_freigabe { background: var(--warn-bg); color: var(--warn); }
.chip-freigegeben { background: var(--info-bg); color: #2c4a72; }
.chip-veroeffentlicht { background: var(--ok-bg); color: var(--ok); }
.chip-teilweise, .chip-fehler { background: var(--err-bg); color: var(--err); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table.small td { padding: 8px 6px; font-size: 13px; }
.table select { padding: 6px 8px; font-size: 13px; }
.acc { display: flex; align-items: center; gap: 8px; }
.acc img { border-radius: 50%; }

/* Login */
.auth { max-width: 420px; margin: 40px auto; }

/* Wochenplan */
.stats { display: flex; gap: 22px; flex-wrap: wrap; margin: 8px 0 18px; color: var(--ink-2); font-size: 14px; }
.stats b { color: var(--ink); font-size: 16px; }
.stats a { text-decoration: none; }
.bulk { padding: 12px 16px; margin-bottom: 18px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day { background: #ebebe8; border-radius: var(--radius); padding: 8px; min-height: 220px; display: flex; flex-direction: column; gap: 8px; }
.day.today { background: #e1e3e8; box-shadow: inset 0 0 0 2px var(--ink); }
.day header { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 13px; padding: 2px 4px; }
.day .add { text-decoration: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); font-size: 18px; }
.day .add:hover { background: #fff; color: var(--ink); }
.empty { color: #b0b0aa; text-align: center; margin: 20px 0; }
.post-card { display: block; background: #fff; border-radius: 8px; overflow: hidden; text-decoration: none; border: 1px solid var(--line); transition: border-color .15s; }
.post-card:hover { border-color: var(--ink); }
.post-card img { width: 100%; aspect-ratio: 4/5; object-fit: cover; background: #ddd; }
.post-card .no-img { display: grid; place-items: center; aspect-ratio: 4/5; background: repeating-linear-gradient(135deg, #f1f1ee 0 8px, #e9e9e5 8px 16px); color: var(--muted); font-size: 12px; }
.pc-body { display: flex; flex-direction: column; gap: 3px; padding: 8px 9px 10px; }
.pc-top { display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: 13px; }
.pc-top .chip { font-size: 10.5px; padding: 2px 6px; }
.pc-brand { font-size: 12px; color: var(--muted); }
.pc-topic { font-size: 13px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.post-card.status-fehler, .post-card.status-teilweise { border-color: #e3b9b5; }
.undated { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }

/* Marken */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.brand-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.brand-card:hover { border-color: var(--ink); }
.brand-card.off { opacity: .55; }
.swatch { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; font-family: "Funnel Display", sans-serif; font-weight: 600; font-size: 18px; flex: none; border: 1px solid rgba(0,0,0,.08); }
.brand-meta { display: flex; flex-direction: column; min-width: 0; }
.brand-meta small { color: var(--muted); }
.previews { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.previews figure, .crop-previews figure { margin: 0; }
.previews img { border-radius: 6px; border: 1px solid var(--line); }
figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.logo-prev { max-height: 48px; background: #555; padding: 6px; border-radius: 6px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 8px; padding: 12px 0; background: var(--card); border-top: 1px solid var(--line); margin-top: 6px; }
.brand-form > .sticky-actions { background: var(--bg); }
.brand-pick { padding: 8px 0; border-bottom: 1px solid var(--line); }
.brand-pick:last-child { border-bottom: 0; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 14px; margin-top: 8px; }
.pick-list label.check { align-items: flex-start; line-height: 1.3; }
.pick-list label.check small { display: block; }
.steps { margin: 0; padding-left: 18px; display: grid; gap: 6px; }

/* Medien */
.upload { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; padding: 14px 16px; }
.upload input[type=file] { flex: 1 1 260px; }
.upload select { width: auto; flex: 0 1 280px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 14px; }
.media-tile { position: relative; display: block; border-radius: 8px; overflow: hidden; background: #ddd; text-decoration: none; }
.media-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.media-cap { position: absolute; inset: auto 0 0 0; padding: 18px 8px 6px; font-size: 11.5px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.media-detail { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.focus-box { position: relative; display: inline-block; cursor: crosshair; border-radius: 8px; overflow: hidden; }
.focus-box img { max-height: 70vh; width: auto; }
.focus-dot { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.5), inset 0 0 0 2px rgba(0,0,0,.35); pointer-events: none; }
.crop-previews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; margin-top: 12px; }
.crop-previews img { border-radius: 6px; border: 1px solid var(--line); }

/* Editor */
.editor { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 24px; align-items: start; }
.preview-col { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; }
.phone { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.phone-head { padding: 10px 12px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line); }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.slides img { flex: 0 0 100%; scroll-snap-align: start; width: 100%; }
.no-img.big { display: grid; place-items: center; aspect-ratio: 4/5; padding: 24px; text-align: center; color: var(--muted); background: repeating-linear-gradient(135deg, #f4f4f1 0 10px, #ececE8 10px 20px); font-size: 14px; }
.phone-caption { padding: 12px; font-size: 13.5px; line-height: 1.5; max-height: 360px; overflow: auto; word-wrap: break-word; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; max-height: 300px; overflow: auto; padding: 2px; }
.pick { position: relative; padding: 0; border: 2px solid transparent; border-radius: 7px; overflow: hidden; background: #ddd; cursor: pointer; }
.pick img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.pick.on { border-color: var(--ink); }
.pick .num { position: absolute; top: 4px; left: 4px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 600; display: none; place-items: center; padding: 0 5px; }
.pick.on .num { display: grid; }
.pick .used { position: absolute; bottom: 3px; right: 4px; font-size: 10px; color: #fff; text-shadow: 0 1px 2px #000; }
.rewrite input { flex: 1; }

/* Freigabe */
.approve-list { display: grid; gap: 18px; }
.approve { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; }
.approve-img { border-radius: 8px; overflow: hidden; }
.caption-text { font-size: 14.5px; line-height: 1.55; white-space: normal; }

.log { max-height: 420px; overflow: auto; font-size: 13px; display: grid; gap: 4px; }
.log small { color: var(--muted); margin-right: 6px; }

@media (max-width: 1100px) {
  .week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .cols, .media-detail, .editor, .approve { grid-template-columns: minmax(0, 1fr); }
  .preview-col { position: static; }
  .week { grid-template-columns: 1fr 1fr; }
  .who span, .who > a { display: none; }
}
@media (max-width: 560px) {
  main { padding: 20px 16px 80px; }
  .top { flex-wrap: wrap; height: auto; gap: 6px 12px; padding: 10px 16px 0; justify-content: space-between; }
  .nav { order: 3; flex-basis: 100%; padding-bottom: 8px; margin: 0 -8px; }
  .week { grid-template-columns: minmax(0, 1fr); }
  .day { min-height: 0; }
  .day .empty { margin: 4px 0; }
  .sticky-actions .btn { padding: 10px 12px; }
  .day .post-card { display: grid; grid-template-columns: 88px 1fr; }
  .day .post-card img, .day .post-card .no-img { aspect-ratio: 4/5; height: 100%; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .crop-previews { grid-template-columns: repeat(3, 1fr); }
  h1 { font-size: 22px; }
}

/* Reels */
video.reel { display: block; width: 100%; aspect-ratio: 9 / 16; max-height: 640px; background: #000; object-fit: contain; }
