/* Freigabeplattform – neutrales, austauschbares Designsystem (D-014).
   Markenfarben nur über die Variablen unten ändern. */
:root {
  --brand: #13aedb;
  --brand-strong: #0b8db3;
  --brand-ink: #5b6770;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --line: #e2e7eb;
  --line-strong: #cfd6dc;
  --text: #1f2a30;
  --muted: #64727b;
  --ok: #1f8a5b;
  --ok-bg: #e6f5ee;
  --info: #2a6fb0;
  --info-bg: #e8f1fa;
  --warn: #9a6200;
  --warn-bg: #fdf3e1;
  --danger: #b4232f;
  --danger-bg: #fbe9eb;
  --accent: #6a4bc4;
  --accent-bg: #efebfa;
  --done: #0f6e7f;
  --done-bg: #e2f4f6;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 32, .06), 0 2px 8px rgba(16, 24, 32, .04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tap: 44px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); }
img, video { max-width: 100%; display: block; }
a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; color: var(--text); }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
small, .muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

/* ---------- Kopfzeile ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 0 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand img { height: 22px; width: auto; }
.brand small { border-left: 1px solid var(--line); padding-left: 10px; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.mainnav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.mainnav a { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; white-space: nowrap; }
.mainnav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.mainnav a.active { color: var(--brand-strong); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.iconbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; background: transparent; color: var(--brand-ink); cursor: pointer; }
.iconbtn:hover { background: var(--surface-2); text-decoration: none; }
.iconbtn .dot { position: absolute; top: 6px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; font-weight: 700; text-align: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }
.menu { position: relative; }
.menu-panel { display: none; position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; z-index: 40; }
.menu.open .menu-panel { display: block; }
.menu-panel a, .menu-panel button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); text-decoration: none; }
.menu-panel .menu-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.navtoggle { display: none; }

/* ---------- Layout ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 20px 16px 80px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.sticky-side { position: sticky; top: 76px; }

/* ---------- Karten ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 16px; }
.card-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-foot { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.stat { padding: 14px 16px; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .85rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 16px; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list-item { display: flex; gap: 12px; align-items: center; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; }
a.list-link { color: inherit; display: block; }
a.list-link:hover { background: var(--surface-2); text-decoration: none; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.tone-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.tone-info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.tone-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.tone-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.tone-accent { background: var(--accent-bg); color: var(--accent); border-color: transparent; }
.tone-done { background: var(--done-bg); color: var(--done); border-color: transparent; }
.tone-muted { background: var(--surface-2); color: var(--muted); }
.pf { display: inline-block; flex-shrink: 0; vertical-align: middle; object-fit: contain; }
.when { font-variant-numeric: tabular-nums; white-space: nowrap; }
.when.past { color: var(--danger); }

/* ---------- Formulare ---------- */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date], input[type=time], input[type=month], input[type=search], input[type=number], select, textarea {
  width: 100%; min-height: var(--tap); padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font: inherit; color: var(--text);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; min-height: var(--tap); padding: 8px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; flex-shrink: 0; accent-color: var(--brand-strong); }
.error-text { color: var(--danger); font-size: .82rem; margin-top: 4px; }
.counter { font-size: .78rem; color: var(--muted); text-align: right; margin-top: 3px; }
.counter.over { color: var(--danger); font-weight: 700; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px; }
legend { font-weight: 700; padding: 0 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--brand-strong) 88%, #000); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: color-mix(in srgb, var(--ok) 88%, #000); }
.btn-warn { background: var(--warn-bg); border-color: #f0d49c; color: var(--warn); }
.btn-danger { background: var(--surface); border-color: #efc2c7; color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 34px; padding: 4px 10px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.inline { display: inline; }

/* ---------- Hinweise ---------- */
.flash { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; border: 1px solid transparent; }
.flash ul { margin: 6px 0 0; padding-left: 18px; }
.flash-success { background: var(--ok-bg); color: #145c3d; border-color: #bfe5d2; }
.flash-error { background: var(--danger-bg); color: #8b1a24; border-color: #f2c4c9; }
.flash-info { background: var(--info-bg); color: #1d5286; border-color: #c9ddf1; }
.notice { padding: 10px 12px; border-radius: var(--radius-sm); font-size: .9rem; }
.notice + .notice { margin-top: 6px; }
.notice-error { background: var(--danger-bg); color: #8b1a24; }
.notice-warn { background: var(--warn-bg); color: #6f4700; }
.notice-info { background: var(--info-bg); color: #1d5286; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.tabs a.active { color: var(--text); border-color: var(--brand); }
.tabs a:hover { text-decoration: none; color: var(--text); }

/* ---------- Monatsübersicht / Vorschläge ---------- */
.proposals { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.proposal { display: flex; flex-direction: column; overflow: hidden; }
.proposal.is-selected { border-color: var(--ok); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 35%, transparent); }
.proposal.is-declined { opacity: .72; }
.proposal .thumb { aspect-ratio: 4 / 3; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--muted); overflow: hidden; }
.proposal .thumb img { width: 100%; height: 100%; object-fit: cover; }
.proposal .card-body { flex: 1; }
.proposal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.variant-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.variant-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; color: var(--text); background: var(--surface); }
.variant-chip:hover { text-decoration: none; border-color: var(--brand); }

/* ---------- Medienbetrachter & Annotationen ---------- */
.viewer { background: #11181d; border-radius: var(--radius); overflow: hidden; position: relative; }
.viewer-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 240px; max-height: 72vh; }
.viewer-stage img, .viewer-stage video { max-height: 72vh; width: auto; max-width: 100%; margin: 0 auto; user-select: none; -webkit-user-drag: none; }
.media-frame { position: relative; display: inline-block; line-height: 0; }
.anno-mode .media-frame { touch-action: none; cursor: crosshair; }
.anno-layer { position: absolute; inset: 0; pointer-events: none; }
.anno-box { position: absolute; border: 2px solid #ffd400; background: rgba(255, 212, 0, .14); border-radius: 3px; pointer-events: auto; cursor: pointer; }
.anno-box.pending { border-style: dashed; border-color: var(--brand); background: rgba(19, 174, 219, .18); }
.anno-box.resolved { border-color: #9fb3bd; background: rgba(159, 179, 189, .12); }
.anno-box .num { position: absolute; top: -12px; left: -12px; min-width: 24px; height: 24px; border-radius: 12px; background: #ffd400; color: #111; font-size: 12px; font-weight: 800; line-height: 24px; text-align: center; padding: 0 5px; }
.anno-box.resolved .num { background: #9fb3bd; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: #1b252c; color: #dfe7ec; font-size: .85rem; flex-wrap: wrap; }
.viewer-bar .btn { background: transparent; color: #dfe7ec; border-color: #3a4852; min-height: 38px; }
.viewer-bar .btn.on { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.slide-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 22px; cursor: pointer; z-index: 3; }
.slide-nav.prev { left: 8px; } .slide-nav.next { right: 8px; }
.dots { display: flex; gap: 6px; justify-content: center; padding: 8px 0 2px; }
.dots button { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: #4b5a63; cursor: pointer; }
.dots button.on { background: #fff; }
.video-markers { position: relative; height: 18px; margin: 0 10px 8px; }
.video-markers .track { position: absolute; top: 8px; left: 0; right: 0; height: 3px; background: #3a4852; border-radius: 2px; }
.video-markers button { position: absolute; top: 2px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #ffd400; border: 2px solid #11181d; cursor: pointer; padding: 0; }
.filmstrip { display: flex; gap: 8px; overflow-x: auto; padding: 8px 10px 10px; background: #11181d; }
.filmstrip button { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; padding: 0; background: #222; cursor: pointer; }
.filmstrip button.on { border-color: var(--brand); }
.filmstrip img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Plattform-Vorschau ---------- */
.postbox { white-space: pre-wrap; word-wrap: break-word; font-size: .95rem; line-height: 1.55; }
.postbox .tag { color: var(--brand-strong); }
.diff ins { background: #d8f5e4; text-decoration: none; }
.diff del { background: #fbdcdf; }

/* ---------- Kommentare ---------- */
.comment { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: 0; }
.comment .avatar { width: 30px; height: 30px; font-size: .72rem; flex-shrink: 0; }
.comment .body { flex: 1; min-width: 0; }
.comment .meta { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.comment .text { white-space: pre-wrap; word-wrap: break-word; margin: 4px 0; }
.comment.resolved .text { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.comment.is-change { background: var(--warn-bg); margin: 0 -12px; padding: 12px; border-radius: var(--radius-sm); border-top: 0; }
.comment.is-internal { background: var(--accent-bg); margin: 0 -12px; padding: 12px; border-radius: var(--radius-sm); border-top: 0; }
.replies { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--line); }
.anno-ref { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; background: #fff6bf; color: #6a5400; font-size: .75rem; font-weight: 700; border: 0; cursor: pointer; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: .88rem; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.ok::before { background: var(--ok); } .timeline li.warn::before { background: var(--warn); } .timeline li.danger::before { background: var(--danger); } .timeline li.info::before { background: var(--info); }

/* ---------- Kalender ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.cal .dow { padding: 8px; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal .day { min-height: 118px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal .day.out { background: var(--surface-2); }
.cal .day.today .num { background: var(--brand-strong); color: #fff; }
.cal .num { display: inline-flex; width: 24px; height: 24px; border-radius: 12px; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; color: var(--muted); }
.cal-item { display: flex; gap: 5px; align-items: center; padding: 3px 5px; margin-top: 3px; border-radius: 5px; font-size: .76rem; color: var(--text); background: var(--surface-2); border-left: 3px solid var(--line-strong); overflow: hidden; }
.cal-item:hover { text-decoration: none; background: var(--info-bg); }
.cal-item .t { font-variant-numeric: tabular-nums; color: var(--muted); }
.cal-item .x { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-item .pf { width: 15px; height: 15px; }
.cal-item.tone-ok { border-left-color: var(--ok); } .cal-item.tone-warn { border-left-color: var(--warn); } .cal-item.tone-danger { border-left-color: var(--danger); }
.cal-item.tone-info { border-left-color: var(--info); } .cal-item.tone-accent { border-left-color: var(--accent); } .cal-item.tone-done { border-left-color: var(--done); }
.cal-list .daygroup { margin-bottom: 14px; }
.cal-list h3 { font-size: .9rem; color: var(--muted); margin: 0 0 6px; }

/* ---------- Mediathek / Upload ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.media-tile { position: relative; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.media-tile .pic { aspect-ratio: 1; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; }
.media-tile .pic img { width: 100%; height: 100%; object-fit: cover; }
.media-tile .cap { padding: 6px 8px; font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-tile .kind { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: .68rem; padding: 1px 6px; border-radius: 4px; }
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); background: var(--surface-2); cursor: pointer; }
.dropzone.drag { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.uploads { list-style: none; margin: 10px 0 0; padding: 0; }
.uploads li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: .85rem; }
.progress { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 340px; overflow-y: auto; padding: 4px; }
.picker label { margin: 0; position: relative; cursor: pointer; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid var(--line); aspect-ratio: 1; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: .7rem; color: var(--muted); text-align: center; }
.picker label img { width: 100%; height: 100%; object-fit: cover; }
.picker input { position: absolute; opacity: 0; }
.picker label.on { border-color: var(--brand-strong); box-shadow: 0 0 0 2px var(--brand); }
.picker .order { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 11px; background: var(--brand-strong); color: #fff; font-size: 12px; font-weight: 800; display: none; align-items: center; justify-content: center; }
.picker label.on .order { display: flex; }
.selected-media { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; }
.selected-media .sm { position: relative; width: 74px; height: 74px; border-radius: 6px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); font-size: .65rem; display: flex; align-items: center; justify-content: center; text-align: center; }
.selected-media .sm img { width: 100%; height: 100%; object-fit: cover; }
.selected-media .sm .ctl { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-between; background: rgba(0,0,0,.55); }
.selected-media .sm .ctl button { border: 0; background: none; color: #fff; font-size: 13px; padding: 2px 5px; cursor: pointer; }

/* ---------- Aktionsleiste (mobil) ---------- */
.actionbar { display: grid; gap: 8px; }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(560px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(16, 24, 32, .45); }
dialog .card-body { max-height: 75vh; overflow-y: auto; }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 420px; }
.auth-logo { text-align: center; margin-bottom: 18px; }
.auth-logo img { height: 28px; width: auto; margin: 0 auto; }

/* ---------- Responsiv ---------- */
@media (max-width: 1020px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .sticky-side { position: static; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .navtoggle { display: inline-flex; }
  .mainnav { display: none; position: fixed; top: 60px; left: 0; right: 0; bottom: 0; background: var(--surface); flex-direction: column; padding: 12px; gap: 2px; overflow-y: auto; z-index: 29; }
  .mainnav.open { display: flex; }
  .mainnav a { padding: 14px 12px; font-size: 1.05rem; }
  .brand small { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .page { padding: 14px 12px 110px; }
  h1 { font-size: 1.25rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proposals { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .page-head .row { width: 100%; }
  .cal-grid-wrap { display: none; }
  .hide-mobile { display: none !important; }
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table.responsive td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 12px; }
  .table.responsive td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: .8rem; }
  .mobile-sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(0,0,0,.08); }
  .viewer-stage { min-height: 200px; }
  .viewer-stage img, .viewer-stage video { max-height: 60vh; }
}
@media (min-width: 641px) { .show-mobile { display: none !important; } .cal-list.mobile-only { display: none; } }
@media print { .topbar, .no-print { display: none !important; } body { background: #fff; } .card { box-shadow: none; } }
.list > li > a.list-link { margin: -12px -16px; padding: 12px 16px; }
a.list-link.list-item { display: flex; }

.check.tap { min-width: var(--tap); min-height: var(--tap); padding: 0; justify-content: center; align-items: center; margin: -6px 0; }
.card-head > * { min-width: 0; }

/* ---------- Stift-Markierungen ---------- */
.anno-layer.drawing { pointer-events: auto; }
.pen-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pen-svg path.pen { fill: none; stroke-width: 4px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 1.5px rgba(0,0,0,.55)); }
.pen-svg path.pen.resolved { opacity: .35; }
.pen-svg path.pen.focus { stroke-width: 6px; }
.anno-num { position: absolute; transform: translate(-50%, -50%); min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; border: 2px solid #fff; background: #e5243b; color: #fff; font: 800 12px/22px var(--font); text-align: center; cursor: pointer; pointer-events: auto; box-shadow: 0 1px 4px rgba(0,0,0,.4); z-index: 2; }
.anno-num.resolved { background: #8a9aa3; }
.anno-layer.drawing .anno-num { pointer-events: none; }
.pen-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; background: #1b252c; border-top: 1px solid #2a363e; color: #dfe7ec; font-size: .85rem; }
.pen-tools .swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; padding: 0; }
.pen-tools .swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--brand); }
.pen-tools .btn { background: transparent; color: #dfe7ec; border-color: #3a4852; min-height: 36px; }
.pen-tools .btn[disabled] { opacity: .4; }

/* ---------- Auswahl im Monatsplan ---------- */
.proposal-group { margin-bottom: 26px; }
.group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.group-head .count { display: inline-flex; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; align-items: center; justify-content: center; font-size: .8rem; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.group-selected .count { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.group-declined .count { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.decision { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--radius-sm); margin-bottom: 10px; font-size: .85rem; }
.decision strong { font-size: .95rem; }
.decision-selected { background: var(--ok-bg); color: #145c3d; }
.decision-declined { background: var(--danger-bg); color: #8b1a24; }
.selection-progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 0 0 18px; }
.selection-progress i { display: block; height: 100%; background: var(--ok); }
.pen-tools[hidden], .uploads:empty { display: none; }

/* ---------- Kunden-Farbschema (D-027) ---------- */
.client-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; vertical-align: middle; color: var(--text); text-decoration: none; }
a.client-chip:hover { text-decoration: none; }
.client-chip .code { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 5px; background: var(--client); color: var(--client-on); font-size: .7rem; font-weight: 800; letter-spacing: .04em; flex-shrink: 0; }
.client-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.client-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--client); flex-shrink: 0; }
.client-stripe { background: var(--client); color: var(--client-on); }
.client-stripe-inner { max-width: 1280px; margin: 0 auto; padding: 6px 16px; display: flex; align-items: center; gap: 10px; font-size: .85rem; font-weight: 600; }
.client-stripe-inner .code { display: inline-flex; padding: 1px 7px; border-radius: 4px; border: 1.5px solid currentColor; font-size: .72rem; font-weight: 800; letter-spacing: .05em; }
.client-stripe a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
body.themed .page-head h1 { border-left: 5px solid var(--client); padding-left: 12px; }
body.themed .proposal.is-selected { border-color: var(--ok); }
.avatar.client-avatar { background: var(--client); color: var(--client-on); font-size: .7rem; letter-spacing: .03em; width: auto; min-width: 40px; padding: 0 7px; border-radius: 8px; }
.cal-item .client-dot { width: 8px; height: 8px; }
.client-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.color-swatches label { margin: 0; position: relative; cursor: pointer; }
.color-swatches input { position: absolute; opacity: 0; }
.color-swatches span { display: block; width: 36px; height: 36px; border-radius: 8px; border: 3px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.color-swatches input:checked + span { border-color: var(--text); }
.color-swatches input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
.color-swatches .taken::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1.5px rgba(0,0,0,.5); }

/* Farbschema: Primär- und Sekundärfarbe, Favicon (D-028) */
.client-stripe { border-bottom: 4px solid var(--client-2, transparent); }
body.themed .page-head h1 { border-left-color: var(--client-2, var(--client)); }
.client-chip .code { box-shadow: inset 0 -3px 0 var(--client-2, transparent); }
.client-chip .fav { width: 20px; height: 20px; border-radius: 4px; object-fit: contain; flex-shrink: 0; }
.client-dot { box-shadow: 0 0 0 2px var(--client-2, transparent); }
.avatar.client-avatar { box-shadow: inset 0 -4px 0 var(--client-2, transparent); }
.avatar.client-fav { background: #fff; border: 1px solid var(--line); padding: 4px; width: 40px; height: 40px; border-radius: 8px; }
.avatar.client-fav img { width: 100%; height: 100%; object-fit: contain; }
.hex-input { display: flex; gap: 8px; align-items: center; }
.hex-input input[type=color] { width: 44px; height: var(--tap); padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; flex-shrink: 0; }
.hex-input input[type=text] { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.hex-input input[type=text]:invalid { border-color: var(--danger); }
.scheme-preview { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.scheme-preview .sp-stripe { background: var(--client); color: var(--client-on); border-bottom: 4px solid var(--client-2); padding: 7px 12px; font-weight: 600; font-size: .85rem; }
.scheme-preview .sp-stripe .code { display: inline-flex; padding: 1px 7px; border-radius: 4px; border: 1.5px solid currentColor; font-size: .72rem; font-weight: 800; }
.scheme-preview .sp-body { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px; background: var(--surface); }
.scheme-preview .sp-h1 { font-weight: 700; font-size: 1.05rem; border-left: 5px solid var(--client-2); padding-left: 10px; }

/* Plattform-Logos (D-029) */
.page-head h1 .pf { width: 28px; height: 28px; margin-right: 4px; vertical-align: -4px; }
.tabs .pf, .variant-chip .pf { width: 18px; height: 18px; }
.btn .pf { width: 18px; height: 18px; }
.menu-panel a .pf { width: 18px; height: 18px; margin-right: 6px; }
.check .pf { width: 18px; height: 18px; margin-top: 1px; }

/* Inaktive Beiträge (D-030) */
.proposal.is-inactive { opacity: .6; border-style: dashed; }
.proposal.is-inactive .thumb { filter: grayscale(1); }
.decision-inactive { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--line-strong); }

/* ---------- Monatsplan: kompakte Vorschau-Karten ---------- */
.proposals { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.proposal-main { display: flex; gap: 14px; padding: 14px 14px 10px; align-items: flex-start; flex: 1; }
.proposal-main .card-body { padding: 0; min-width: 0; flex: 1; }
.proposal .thumb { position: relative; width: 120px; height: 120px; aspect-ratio: auto; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.proposal .thumb img { width: 100%; height: 100%; object-fit: cover; }
.proposal .thumb .thumb-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; font-size: .75rem; color: var(--muted); padding: 6px; }
.proposal .thumb .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; padding-left: 2px; }
.proposal .thumb .preview-tag { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(17, 24, 39, .62); color: #fff; font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-align: center; padding: 2px 0; }
.proposal .kicker { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 2px 0 2px; }
/* Beitragsart (Bildbeitrag / Karussell / Reel / Story) – für Kunden gut unterscheidbar */
.proposal .kicker-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0; }
.proposal .kicker-row .kicker { margin: 0; }
.kind { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700; line-height: 1; padding: 5px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.kind-image { background: #e8f1fb; color: #1d4f86; border-color: #c7dcf3; }
.kind-carousel { background: #f0ebfb; color: #5b3a9e; border-color: #dccff5; }
.kind-video { background: #fdece6; color: #a33a12; border-color: #f6cdbd; }
.kind-story { background: #fbe9f3; color: #9b2363; border-color: #f2cbe0; }
.internal-note summary { cursor: pointer; }
.internal-note-body { white-space: pre-line; margin-top: 8px; }
.kind-pick { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.kind-option { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 32px; }
.proposal .postbox { font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 640px) {
  .proposals { grid-template-columns: 1fr; }
  .proposal .thumb { width: 88px; height: 88px; }
  .proposal-main { gap: 12px; padding: 12px 12px 8px; }
}

.plan-toolbar { margin-bottom: 16px; }
dialog.wide { width: min(760px, calc(100vw - 24px)); }
dialog .card-head .btn-ghost { margin-left: auto; }
.preview-pick { display: flex; gap: 12px; align-items: flex-start; }
.preview-mini { position: relative; width: 88px; height: 88px; border-radius: 8px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: .72rem; color: var(--muted); }
.preview-mini img { width: 100%; height: 100%; object-fit: cover; }
.preview-mini .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.dropzone-sm { padding: 12px; font-size: .88rem; }
.proposal .postbox { cursor: pointer; }
.proposal .postbox.expanded { -webkit-line-clamp: unset; display: block; }

.import-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.import-thumbs figure { margin: 0; width: 72px; font-size: .62rem; color: var(--muted); text-align: center; overflow: hidden; }
.import-thumbs img, .import-thumbs .ph { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; background: var(--surface-2); }
.import-thumbs figcaption { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
