/* ---------- App-Shell ---------- */
#app { min-height: 100dvh; }

.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100dvh; }
.side {
  background: var(--surface); border-right: 1px solid var(--border-soft);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 4px;
  position: sticky; top: 0; height: 100dvh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--accent);
  display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; flex: none;
}
.brand-txt { font-weight: 700; letter-spacing: -.01em; font-size: 14.5px; }
.brand-txt small { display: block; font-weight: 500; font-size: 11px; color: var(--text-faint); letter-spacing: .04em; text-transform: uppercase; }

.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px;
  cursor: pointer; color: var(--text-dim); font-weight: 550; font-size: 13.5px; border: none;
  background: transparent; width: 100%; text-align: left; transition: background .13s, color .13s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-3); color: var(--text); }
.nav-item .ic { width: 17px; display: grid; place-items: center; flex: none; }
.nav-item .count { margin-left: auto; font-size: 11px; background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 6px; font-weight: 700; }
.nav-sep { height: 1px; background: var(--border-soft); margin: 10px 4px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); padding: 8px 11px 4px; font-weight: 700; }

.client-switch {
  margin: 0 0 12px; padding: 9px 11px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--border-soft); cursor: pointer; display: flex; align-items: center; gap: 9px; width: 100%;
}
.client-switch:hover { border-color: var(--border); }
.client-switch .dot { width: 8px; height: 8px; border-radius: 99px; background: var(--accent); flex: none; }
.client-switch b { font-size: 13px; }

.side-foot { margin-top: auto; border-top: 1px solid var(--border-soft); padding-top: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 24px;
  border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(12px);
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 680; letter-spacing: -.015em; }
.content { padding: 22px 24px 80px; flex: 1; }
.content.flush { padding: 0; }

/* ---------- Kalender ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; row-gap: 8px; }
.cal-title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; min-width: 190px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border-soft); border: 1px solid var(--border-soft); border-radius: var(--r-md); overflow: hidden; }
.cal-dow { background: var(--surface); padding: 9px 10px; font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; overflow: hidden; }
.cal-cell { background: var(--bg); min-height: 128px; padding: 7px; display: flex; flex-direction: column; gap: 5px; transition: background .12s; min-width: 0; }
.cal-top { display: flex; align-items: center; justify-content: space-between; }
.cal-dots { display: none; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 16px; }

/* Liste unter dem Kalender (Handy: ganzer Monat, überall: ohne Termin) */
.ag-month { display: none; }
.ag-day, .ag-undated { margin-top: 18px; scroll-margin-top: 70px; border-radius: var(--r-md); transition: background .4s; }
.ag-day.flash { background: var(--accent-soft); }
.ag-date { font-size: 11.5px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; margin: 0 2px 8px; }
.ag-undated-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.ag-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; margin-bottom: 8px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-md); min-width: 0;
}
.ag-undated-list .ag-item { margin: 0; }
.ag-item:hover { background: var(--surface-2); }
.ag-thumb { width: 42px; height: 52px; border-radius: 7px; overflow: hidden; background: var(--surface-3); flex: none; display: grid; place-items: center; color: var(--text-faint); }
.ag-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ag-main { flex: 1; min-width: 0; }
.ag-title { font-weight: 650; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.ag-new { width: 7px; height: 7px; border-radius: 99px; background: var(--accent); flex: none; }
.ag-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-item .badge { flex: none; }
.cal-cell.other { background: var(--surface); opacity: .45; }
.cal-cell.today .cal-num { background: var(--accent); color: #fff; }
.cal-cell.drop { background: var(--accent-soft); outline: 1px dashed var(--accent); outline-offset: -3px; }
.cal-num { font-size: 11.5px; font-weight: 700; color: var(--text-dim); width: 21px; height: 21px; display: grid; place-items: center; border-radius: 99px; }
.cal-add { opacity: 0; border: none; background: var(--surface-2); color: var(--text-dim); border-radius: 6px; width: 21px; height: 21px; cursor: pointer; font-size: 14px; line-height: 1; }
.cal-cell:hover .cal-add { opacity: 1; }

.chip {
  display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--border-soft); cursor: pointer;
  font-size: 11.5px; overflow: hidden; border-left: 3px solid var(--draft); position: relative;
}
.chip:hover { background: var(--surface-3); }
.chip.s-review { border-left-color: var(--review); }
.chip.s-changes { border-left-color: var(--changes); }
.chip.s-approved { border-left-color: var(--approved); }
.chip.s-scheduled { border-left-color: var(--scheduled); }
.chip.s-published { border-left-color: var(--published); }
.chip img { width: 26px; height: 26px; border-radius: 4px; object-fit: cover; flex: none; background: var(--surface-3); }
.chip .ct { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; font-weight: 550; }
.chip .tm { color: var(--text-faint); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chip .nb { position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 99px; background: var(--accent); }

/* ---------- Board / Liste ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.post-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-md); overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s var(--ease); }
.post-card:hover { border-color: var(--border); transform: translateY(-2px); }
.post-card .thumb { aspect-ratio: 4/5; background: var(--surface-2); position: relative; overflow: hidden; }
.post-card .thumb img, .post-card .thumb video { width: 100%; height: 100%; object-fit: cover; }
.post-card .thumb .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-faint); font-size: 26px; }
.post-card .meta { padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 7px; }
.post-card .meta .t { font-weight: 600; font-size: 13px; line-height: 1.3; }
.type-tag { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.62); backdrop-filter: blur(6px); border-radius: 6px; padding: 3px 7px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.var-tag { position: absolute; top: 8px; left: 8px; background: var(--accent); color: #fff; border-radius: 6px; padding: 3px 7px; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.cmt-tag { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,.62); backdrop-filter: blur(6px); border-radius: 6px; padding: 3px 7px; font-size: 10.5px; font-weight: 650; }

/* ---------- Post-Detail ---------- */
.detail { display: grid; grid-template-columns: minmax(0,1fr) 380px; min-height: calc(100dvh - 57px); }
.detail-stage { padding: 26px; display: flex; flex-direction: column; align-items: center; gap: 18px; background: radial-gradient(1000px 520px at 50% -8%, #17171a, var(--bg)); min-width: 0; container: stage / inline-size; }
.detail-side { border-left: 1px solid var(--border-soft); background: var(--surface); display: flex; flex-direction: column; height: calc(100dvh - 57px); position: sticky; top: 57px; }
.detail-side .tabs { display: flex; border-bottom: 1px solid var(--border-soft); padding: 0 8px; gap: 2px; flex: none; }
.detail-side .tab { padding: 12px 12px 10px; border: none; background: none; cursor: pointer; color: var(--text-faint); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; }
.detail-side .tab.active { color: var(--text); border-bottom-color: var(--accent); }
.detail-side .pane { overflow: auto; flex: 1; padding: 16px; }
.detail-side .composer { border-top: 1px solid var(--border-soft); padding: 12px; flex: none; background: var(--surface-2); }

.preview-modes { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border-soft); padding: 3px; border-radius: 99px; }
.preview-modes button { border: none; background: transparent; color: var(--text-dim); padding: 6px 13px; border-radius: 99px; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.preview-modes button.active { background: var(--surface-3); color: var(--text); }

/* ---------- Varianten (Kernfeature) ---------- */
.variants {
  width: 100%; max-width: 760px; border: 1px solid var(--accent);
  background: color-mix(in oklab, var(--accent) 7%, var(--surface));
  border-radius: var(--r-lg); padding: 14px; box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 8%, transparent);
}
.variants.single { border-color: var(--border-soft); background: var(--surface); box-shadow: none; }
.variants-head { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.variants-head .lbl { font-weight: 700; font-size: 13px; letter-spacing: -.01em; }
.variants-head .hint { font-size: 11.5px; color: var(--text-dim); }
.variants-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.vcard {
  flex: none; width: 108px; border-radius: 10px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; background: var(--surface-2); position: relative; scroll-snap-align: start;
  transition: border-color .15s, transform .12s var(--ease);
}
.vcard:hover { transform: translateY(-2px); }
.vcard.active { border-color: var(--accent); }
.vcard .vm { aspect-ratio: 1; background: var(--surface-3); }
.vcard .vm img, .vcard .vm video { width: 100%; height: 100%; object-fit: cover; }
.vcard .vl { padding: 6px 7px; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard .picks { position: absolute; top: 5px; right: 5px; display: flex; gap: -4px; }
.vcard .picks span { width: 19px; height: 19px; border-radius: 99px; background: var(--approved); color: #05231a; font-size: 9.5px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); margin-left: -6px; }
.vcard .star { position: absolute; top: 5px; left: 5px; font-size: 11px; background: rgba(0,0,0,.6); border-radius: 5px; padding: 1px 5px; }
.vcard .del { position: absolute; bottom: 30px; right: 5px; opacity: 0; background: rgba(0,0,0,.7); border: none; color: #f87171; border-radius: 5px; padding: 2px 6px; cursor: pointer; font-size: 11px; }
.vcard:hover .del { opacity: 1; }
.vadd { flex: none; width: 108px; border: 1px dashed var(--border); border-radius: 10px; background: transparent; color: var(--text-dim); cursor: pointer; display: grid; place-items: center; gap: 4px; font-size: 11.5px; min-height: 134px; }
.vadd:hover { border-color: var(--accent); color: var(--text); }

/* A/B Vergleich mit Wischregler */
.compare-wrap { position: relative; width: 100%; max-width: 560px; margin-inline: auto; border-radius: var(--r-md); overflow: hidden; background: #000; user-select: none; touch-action: none; }
.compare-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.compare-wrap .b-layer { clip-path: inset(0 0 0 var(--split, 50%)); }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 2px; background: #fff; box-shadow: 0 0 12px rgba(0,0,0,.6); cursor: ew-resize; }
.compare-handle::after { content: '⇄'; position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: 34px; height: 34px; border-radius: 99px; background: #fff; color: #111; display: grid; place-items: center; font-size: 15px; font-weight: 700; }
.compare-tag { position: absolute; bottom: 10px; padding: 4px 10px; border-radius: 99px; background: rgba(0,0,0,.65); font-size: 11.5px; font-weight: 650; backdrop-filter: blur(6px); }
.compare-side-by-side { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 760px; }
.compare-side-by-side figure { margin: 0; }
.compare-side-by-side figcaption { font-size: 11.5px; padding: 6px 2px; color: var(--text-dim); font-weight: 600; }
.compare-side-by-side img, .compare-side-by-side video { border-radius: 10px; width: 100%; background: #000; }

/* ---------- Kommentare ---------- */
.cmt { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.cmt:last-child { border-bottom: none; }
.cmt .avatar { width: 28px; height: 28px; font-size: 11px; }
.cmt .body { flex: 1; min-width: 0; }
.cmt .who { font-weight: 650; font-size: 12.5px; }
.cmt .when { color: var(--text-faint); font-size: 11px; }
.cmt .txt { font-size: 13.3px; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.cmt .ctx { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 11px; color: var(--text-dim); background: var(--surface-2); padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border-soft); cursor: pointer; }
.cmt.cr { background: color-mix(in oklab, var(--changes) 7%, transparent); margin-inline: -16px; padding-inline: 16px; border-left: 2px solid var(--changes); }
.cmt.cr.done { opacity: .5; border-left-color: var(--approved); background: transparent; }
.cmt-actions { display: flex; gap: 8px; margin-top: 7px; }
.cmt-actions button { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 11.5px; padding: 0; font-weight: 600; }
.cmt-actions button:hover { color: var(--text); }

.seg { display: flex; background: var(--surface-3); border-radius: 8px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: none; background: transparent; color: var(--text-dim); padding: 6px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; }
.seg button.active { background: var(--surface); color: var(--text); }
.seg button.active.cr { background: var(--changes); color: #2a1a00; }

/* ---------- Statistik ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-md); padding: 15px 16px; }
.kpi .k { font-size: 11.5px; color: var(--text-dim); font-weight: 600; }
.kpi .v { font-size: 27px; font-weight: 720; letter-spacing: -.03em; margin-top: 5px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 44px; align-items: center; gap: 10px; padding: 6px 0; font-size: 12.5px; }
.bar-track { height: 9px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--accent); transition: width .5s var(--ease); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 74px; }
.spark div { flex: 1; background: var(--surface-3); border-radius: 3px 3px 0 0; min-height: 3px; position: relative; }
.spark div.has { background: var(--accent); }

/* ---------- Upload / Editor ---------- */
.dropzone { border: 1.5px dashed var(--border); border-radius: var(--r-md); padding: 30px; text-align: center; color: var(--text-dim); transition: all .15s; cursor: pointer; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.up-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; }
.up-item .pb { height: 4px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.up-item .pb i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }

.editor-stage { background: #0d0d0e; border-radius: var(--r-md); display: grid; place-items: center; overflow: hidden; position: relative; min-height: 320px; }
.editor-stage canvas { max-width: 100%; max-height: 54dvh; touch-action: none; }
.crop-box { position: absolute; border: 1px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); cursor: move; }
.crop-box .h { position: absolute; width: 13px; height: 13px; background: #fff; border-radius: 2px; }
.crop-box .h.nw { left: -7px; top: -7px; cursor: nwse-resize; }
.crop-box .h.ne { right: -7px; top: -7px; cursor: nesw-resize; }
.crop-box .h.sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.crop-box .h.se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.crop-box .g { position: absolute; background: rgba(255,255,255,.28); }
.tool-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ratio-btn { padding: 6px 10px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: 12px; font-weight: 600; }
.ratio-btn.active { border-color: var(--accent); background: var(--accent-soft); }
input[type=range] { width: 100%; accent-color: var(--accent); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 22px; background: radial-gradient(800px 480px at 50% 0%, #1a1a1e, var(--bg)); }
.login-card { width: min(400px, 100%); }
.login-card .brand { justify-content: center; padding-bottom: 22px; }

/* ---------- Responsive ---------- */
.mobile-nav { display: none; }
@media (max-width: 1100px) {
  .detail { grid-template-columns: 1fr; }
  .detail-side { border-left: none; border-top: 1px solid var(--border-soft); height: auto; position: static; }
  .detail-side .pane { max-height: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .side.open { display: flex; position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 60; box-shadow: var(--shadow); }
  .content { padding: 16px 14px 90px; }
  .topbar { padding: 12px 14px; }
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: color-mix(in oklab, var(--surface) 94%, transparent); backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-soft); padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
  }
  .mobile-nav button { flex: 1; background: none; border: none; color: var(--text-faint); display: grid; gap: 3px; justify-items: center; padding: 5px 0; font-size: 10px; font-weight: 600; cursor: pointer; }
  .mobile-nav button.active { color: var(--accent); }
  .cal-cell { min-height: 92px; padding: 5px; }
  .chip { padding: 3px 5px; gap: 4px; }
  .chip img, .chip .tm { display: none; }
  .cal-grid { font-size: 11px; }
  .cal-dow { padding: 8px 6px; }
  .detail-stage { padding: 14px 10px; }
  .compare-side-by-side { grid-template-columns: 1fr; }
  .kpi .v { font-size: 23px; }
}
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55; }

/* Bühne: Vorschau so skalieren, dass der Versionen-Block ohne Scrollen sichtbar bleibt */
.detail-stage { overflow-y: auto; max-height: calc(100dvh - 57px); }

/* Varianten bleiben immer sichtbar – das ist der Kern der Abstimmung */
.variants-dock {
  position: sticky; bottom: 0; z-index: 5; width: 100%; max-width: 760px;
  padding: 16px 0 4px; margin-top: auto;
  background: linear-gradient(transparent, color-mix(in oklab, var(--bg) 92%, transparent) 18%, var(--bg) 34%);
  backdrop-filter: blur(4px);
}
.detail-stage { padding-bottom: 8px; }
.vadd { gap: 8px; }
@media (max-width: 1100px) {
  .detail-stage { overflow: visible; max-height: none; }
}

/* Dialoge nie höher als der Bildschirm */
dialog { max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
dialog .dlg-body { overflow: auto; flex: 1; min-height: 0; }
dialog .dlg-head, dialog .dlg-foot { flex: none; }
.compare-wrap { max-height: calc(100dvh - 300px); }

/* Titel im Topbar nicht umbrechen */
.topbar h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }

@media (max-width: 860px) {
  .variants-dock { position: static; background: none; backdrop-filter: none; padding-top: 12px; }
  .variants { padding: 12px 11px; }
  .variants-head { flex-wrap: wrap; row-gap: 6px; }
  .variants-head .lbl { flex: 1 0 auto; }
  .variants-head .hint { flex: 1 0 100%; order: 9; }
  .vcard { width: 96px; }
  .vadd { width: 96px; min-height: 120px; }
  .topbar h1 { max-width: 40vw; font-size: 15.5px; }
  .detail-side .pane { max-height: 62vh; }
}

/* ---------- Caption ---------- */
.tab-dot { display: inline-block; width: 7px; height: 7px; border-radius: 99px; background: var(--changes); margin-left: 6px; vertical-align: 1px; }
.cap-pane .cap-intro { margin: 0 0 14px; font-size: 12.5px; line-height: 1.5; color: var(--text-dim); }
.cap-pane textarea { width: 100%; resize: vertical; line-height: 1.5; }
.cap-pane .cap-text { min-height: 180px; }
.cap-meta { display: flex; justify-content: flex-end; margin-top: 5px; }
.cap-count { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.cap-count.over { color: #f87171; font-weight: 700; }
.cap-foot { display: grid; gap: 4px; margin-top: 10px; }
.cap-read { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; padding: 12px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--r-md); margin-bottom: 10px; }
.cap-read.tags { color: var(--text-dim); }
.cap-todo { padding: 12px 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; cursor: pointer; border-left: 3px solid var(--changes); }
.cap-todo:hover { background: var(--surface-2); }
.chip .cap-miss { color: var(--changes); font-size: 10px; flex: none; }
.ig-caption.editable, .reel-cap.editable { cursor: text; border-radius: 6px; transition: background .15s; }
.ig-caption.editable:hover { background: rgba(255,255,255,.06); }
.reel-bottom .reel-cap.editable { position: relative; z-index: 3; }

/* ---------- Kalender auf dem Handy: Punkte im Raster, Beiträge als Liste darunter ---------- */
@media (max-width: 640px) {
  .cal-head { gap: 8px; }
  .cal-title { font-size: 17px; min-width: 0; flex: 1; order: 3; flex-basis: 100%; }
  .cal-count { display: none; }
  .cal-grid { border-radius: 10px; }
  .cal-dow { padding: 7px 0; text-align: center; font-size: 10px; letter-spacing: .03em; }
  .cal-cell { min-height: 52px; padding: 5px 2px; gap: 3px; align-items: center; }
  .cal-cell.has { cursor: pointer; }
  .cal-top { justify-content: center; }
  .cal-num { width: 24px; height: 24px; font-size: 12px; }
  .cal-add { display: none; }
  .cal-cell .chip { display: none; }
  .cal-dots { display: flex; gap: 3px; align-items: center; justify-content: center; flex-wrap: wrap; }
  .cal-dots i { width: 6px; height: 6px; border-radius: 99px; display: block; }
  .cal-dots span { font-size: 9px; color: var(--text-faint); font-weight: 700; }
  .ag-month { display: block; }
  .ag-undated-list { grid-template-columns: 1fr; gap: 0; }
  .ag-undated-list .ag-item { margin-bottom: 8px; }
  .cal-legend { gap: 6px 12px; }
  .hide-xs { display: none; }
}
@media (max-width: 360px) {
  .ag-item .badge { display: none; }
}

/* ---------- Bühne ohne Telefonrahmen ----------
   --dock = gemessene Höhe des Versionen-Blocks (post.js), --reserve = alles, was außer der Vorschau
   in die Bildschirmhöhe passen muss. So überdeckt der Block nie die Vorschau. */
.stage-view { width: 100%; display: flex; justify-content: center; }
.detail-stage { --reserve: 34dvh; }
.detail-stage:not(.dock-sticky) .variants-dock { position: static; background: none; backdrop-filter: none; }
@media (min-width: 1101px) {
  .detail-stage.dock-sticky { --reserve: calc(var(--dock, 280px) + 150px); }
  .detail-stage { padding-top: 18px; gap: 14px; }
}
@media (max-width: 1100px) {
  .variants-dock { position: static; background: none; backdrop-filter: none; padding-top: 12px; }
}
@media (max-width: 640px) {
  /* Kopfzeile auf dem Handy: Knöpfe nur als Symbol, damit der Titel Platz hat */
  .topbar .btn.btn-sm { font-size: 0; gap: 0; padding: 0 9px; min-height: 34px; }
  .topbar .badge { font-size: 9.5px; }
}

/* ---------- Slides (Carousel / Story) ---------- */
.slides { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--border-soft); }
.slides .variants-head { margin-bottom: 8px; }
.variants.combined .vcard { width: 82px; }
.variants.combined .vadd { width: 82px; min-height: 106px; }
.vcard .vcount { position: absolute; bottom: 30px; left: 5px; font-size: 9.5px; font-weight: 700; background: rgba(0,0,0,.7); color: #fff; border-radius: 5px; padding: 1px 5px; }
.slides-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: thin; }
.slide {
  position: relative; flex: none; width: 50px; aspect-ratio: 4/5; border-radius: 9px; border: 2px solid transparent;
  background: var(--surface-3); overflow: hidden; cursor: pointer; padding: 0; display: grid; place-items: center;
  color: var(--text-dim); font-size: 16px; transition: transform .12s var(--ease);
}
.slide:hover { transform: translateY(-1px); }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide.active { border-color: var(--accent); }
.slide.empty { border: 2px dashed var(--border); background: transparent; }
.slide.empty.active { border-color: var(--accent); }
.slide .num { position: absolute; left: 4px; bottom: 3px; font-size: 10px; font-weight: 800; background: rgba(0,0,0,.7); color: #fff; border-radius: 5px; padding: 0 5px; line-height: 16px; }
.slide .vers { position: absolute; top: 3px; right: 3px; font-size: 9.5px; font-weight: 800; background: var(--accent); color: #fff; border-radius: 99px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; }
.slide.add { border: 2px dashed var(--border); background: transparent; }
.slide.add:hover { border-color: var(--accent); color: var(--text); }
.slide-tools { display: flex; gap: 2px; }
.slide-tools .btn-icon { width: 30px; height: 30px; padding: 6px; }
.slide-tools .btn:disabled { opacity: .35; cursor: default; }
.warn-line { margin-top: 10px; padding: 9px 11px; border-radius: 9px; background: color-mix(in oklab, var(--changes) 14%, transparent); color: var(--changes); font-size: 12px; line-height: 1.45; }

/* ---------- Neuer Beitrag: Format + Dateiauswahl ---------- */
.type-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-bottom: 14px; }
@media (max-width: 480px) { .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dropzone {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 16px 12px;
  border: 1.5px dashed var(--border); border-radius: var(--r-md); background: var(--surface-2); color: var(--text-dim);
  cursor: pointer; font-weight: 600; font-size: 13px; text-align: center;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.chip:has(.nb) { padding-right: 12px; }
.chip .cap-miss { margin-right: 2px; }

/* ---------- Neuer Beitrag wie bei Instagram ---------- */
.np-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.np-types.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.np-type {
  display: grid; justify-items: center; align-content: center; gap: 7px; padding: 20px 10px; min-height: 138px; text-align: center;
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-2); color: var(--text-dim); cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s var(--ease);
}
.np-type:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text); transform: translateY(-1px); }
.np-type b { color: var(--text); font-size: 14.5px; }
.np-type span { font-size: 11.5px; line-height: 1.4; }
.np-foot { margin: 16px -20px -16px; }
.np-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; }
.np-item { position: relative; flex: none; width: 96px; aspect-ratio: 4/5; border-radius: 10px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border-soft); }
.np-item img, .np-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-item .num { position: absolute; left: 5px; top: 5px; font-size: 10.5px; font-weight: 800; background: rgba(0,0,0,.7); color: #fff; border-radius: 6px; padding: 1px 6px; }
.np-ctrl { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 4px; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.np-ctrl button { width: 24px; height: 24px; border-radius: 99px; border: none; background: rgba(255,255,255,.9); color: #111; font-weight: 800; cursor: pointer; line-height: 1; }
.np-ctrl button:disabled { opacity: .25; cursor: default; }
.np-add { display: grid; place-items: center; align-content: center; gap: 4px; color: var(--text-dim); border: 1.5px dashed var(--border); background: transparent; cursor: pointer; font-size: 11.5px; font-weight: 600; }
.np-add:hover { border-color: var(--accent); color: var(--text); }
.np-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.dropzone.big { padding: 30px 16px; font-size: 14px; }
@media (max-width: 560px) {
  .np-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .np-types.two { grid-template-columns: 1fr; }
  .np-fields { grid-template-columns: 1fr; }
  .np-item { width: 80px; }
}
