[hidden] { display: none !important; }
:root {
  --brand: #18667a; --brand-dark: #124f5f; --brand-light: #eef6f7;
  --ink: #0f1d2b; --muted: #64748b; --line: #e2e8f0; --bg: #f8fafc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; }
a { color: var(--brand); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.05rem; margin: 0; }
small, .hint { color: var(--muted); font-size: .85rem; }

.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .75rem 1.5rem; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .75rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand-logo { height: 52px; width: auto; display: block; }
.brand span { padding-left: .75rem; border-left: 1px solid var(--line); color: var(--muted); font-weight: 500; }
@media (max-width: 720px) { .brand span { display: none; } }
.login-logo { display: block; width: 220px; max-width: 70%; margin: 0 auto .5rem; }
.card.narrow h1 { text-align: center; font-size: 1.2rem; }
.tag-suggest { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; font-size: .82rem; color: var(--muted); }
.tag-suggest button { font: inherit; padding: .15rem .55rem; border-radius: 999px; border: 1px solid #cbd5e1; background: #fff; color: var(--brand-dark); cursor: pointer; }
.tag-suggest button:hover { background: var(--brand-light); border-color: var(--brand); }
.tag-suggest button.used { opacity: .35; pointer-events: none; }
.logo { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: .5rem; background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem; vertical-align: middle; }
.topbar nav { display: flex; gap: .25rem; flex: 1; }
.topbar nav a { padding: .45rem .8rem; border-radius: .5rem; text-decoration: none; color: var(--muted); font-weight: 500; }
.topbar nav a.active, .topbar nav a:hover { background: var(--brand-light); color: var(--brand-dark); }
.user { color: var(--muted); font-size: .9rem; }

.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.pagehead h1 { margin: 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: .9rem; padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: 0 1px 2px rgb(0 0 0 / .04); }
.card.narrow { max-width: 420px; margin: 8vh auto; }
.narrow-left { max-width: 520px; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack > .btn, form.stack > .btn { align-self: flex-start; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: .5rem; }
@media (max-width: 720px) { .row, .row4 { grid-template-columns: 1fr; } }

label { display: flex; flex-direction: column; gap: .35rem; font-weight: 500; font-size: .9rem; }
label.inline { flex-direction: row; align-items: center; font-weight: 400; }
.lbl { display: block; font-weight: 500; font-size: .9rem; margin-bottom: .35rem; }
input:not([type=checkbox]):not([type=file]), select, textarea {
  font: inherit; padding: .55rem .7rem; border: 1px solid #cbd5e1; border-radius: .55rem; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 30%, transparent); border-color: var(--brand); }
input:disabled, textarea:disabled, select:disabled { background: #f1f5f9; color: var(--muted); }
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 500; font-size: .9rem; margin-bottom: .35rem; }

.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1rem; border-radius: .55rem; border: 1px solid transparent; background: var(--brand); color: #fff; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--brand-dark); }
.btn.ghost { background: #fff; color: #334155; border-color: #cbd5e1; }
.btn.ghost:hover { background: #f1f5f9; }
.btn.danger { background: #dc2626; }
.btn.small { padding: .3rem .65rem; font-size: .85rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.actions select { width: auto; }
.right { margin-left: auto; }

.alert { padding: .7rem 1rem; border-radius: .6rem; margin-bottom: 1rem; background: #ecfdf5; color: #065f46; }
.alert.error { background: #fef2f2; color: #991b1b; }

.platforms { display: flex; flex-wrap: wrap; gap: .5rem; }
.pchip { flex-direction: row; cursor: pointer; }
.pchip input { position: absolute; opacity: 0; pointer-events: none; }
.pchip span { padding: .4rem .8rem; border: 1px solid #cbd5e1; border-radius: .55rem; background: #fff; font-weight: 500; }
.pchip input:checked + span { background: var(--c); border-color: var(--c); color: #fff; }
.pchip input:focus-visible + span { outline: 2px solid var(--brand); }

.counter { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .82rem; color: var(--muted); margin-top: -.5rem; }
.counter .near { color: #b45309; font-weight: 600; }
.counter .over { color: #dc2626; font-weight: 700; }

.preview img { max-width: 320px; max-height: 240px; border-radius: .6rem; border: 1px solid var(--line); display: block; margin: .25rem 0 .5rem; }
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .6rem; border-radius: 999px; background: #f1f5f9; font-size: .8rem; font-weight: 500; white-space: nowrap; }
.badge i { width: .5rem; height: .5rem; border-radius: 50%; }
.chip { display: inline-block; padding: .1rem .45rem; border-radius: .35rem; color: #fff; font-size: .75rem; margin: 0 .2rem .2rem 0; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border-bottom: 1px solid var(--line); padding: .5rem; }
td { border-bottom: 1px solid #f1f5f9; padding: .6rem .5rem; vertical-align: top; }
tr.muted td { color: #94a3b8; }

.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.toolbar label { flex-direction: row; align-items: center; gap: .5rem; }
.toolbar select, .toolbar input { width: auto; }
.legend { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .8rem; color: var(--muted); margin-left: auto; }
.legend i { display: inline-block; width: .65rem; height: .65rem; border-radius: 2px; margin-right: .3rem; vertical-align: middle; }
.copyrow { display: flex; gap: .5rem; }
.copyrow input { font-family: ui-monospace, monospace; font-size: .85rem; }
details summary { cursor: pointer; font-weight: 500; }

/* FullCalendar */
.fc { --fc-border-color: var(--line); --fc-today-bg-color: #eef6f7; --fc-button-bg-color: #fff; --fc-button-text-color: #334155; --fc-button-border-color: #cbd5e1; --fc-button-hover-bg-color: #f1f5f9; --fc-button-hover-border-color: #cbd5e1; --fc-button-active-bg-color: var(--brand); --fc-button-active-border-color: var(--brand); font-size: .88rem; }
.fc .fc-button-primary:not(:disabled).fc-button-active { color: #fff; }
.fc .fc-toolbar-title { font-size: 1.15rem; }
.fc .fc-event { cursor: pointer; border-radius: 5px; padding: 1px 3px; }
.fc .fc-daygrid-event { white-space: normal; }

/* Vorschaubilder in der Beitragsliste */
.thumb-col { width: 88px; }
.thumb { display: block; width: 72px; height: 72px; object-fit: cover; border-radius: .5rem; border: 1px solid var(--line); background: #f1f5f9; }
.thumb-empty { display: grid; place-items: center; color: #cbd5e1; font-size: 1.2rem; }
td { vertical-align: middle; }

/* ===================== Erweiterungen v4 ===================== */
.btn.success { background: #16a34a; }
.btn.success:hover { background: #15803d; }
.actions form { display: inline-flex; gap: .5rem; align-items: center; margin: 0; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 200px; }
.ok-text { color: #15803d; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .card, .card + .grid2 { margin-top: 1.25rem; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .75rem; }
.boxed { border: 1px solid var(--line); border-radius: .7rem; padding: 1rem; background: #fcfdfe; }
.subnav { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.25rem 0 1rem; }
.subnav a { padding: .3rem .7rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; font-size: .85rem; }
.row-inline { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.row-inline label { flex: 1; min-width: 240px; }
.toolbar label.inline { flex-direction: row; font-weight: 400; }
@media (max-width: 900px) { .grid2, .row3 { grid-template-columns: 1fr; } }

/* Tabellen-Aktionen */
.row-actions { white-space: nowrap; text-align: right; }
.row-actions form { display: inline; }
.icon-btn { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: .5rem; border: 1px solid #cbd5e1; background: #fff; cursor: pointer; text-decoration: none; color: #334155; font-size: .95rem; }
.icon-btn:hover { background: var(--brand-light); border-color: var(--brand); }
.swatch { display: inline-block; width: .9rem; height: .9rem; border-radius: 3px; }
.daylist { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .82rem; color: var(--muted); }

/* Editor-Layout */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.25rem; align-items: start; }
.editor-grid > form.card, .editor-grid aside .card { margin-bottom: 0; }
@media (max-width: 1000px) { .editor-grid { grid-template-columns: 1fr; } }
.sticky-actions { position: sticky; bottom: 0; background: #fff; padding: .75rem 0 .25rem; border-top: 1px solid var(--line); }
.tag-suggest button.set { color: #fff; background: var(--brand); border-color: var(--brand); }
.tag-suggest a { margin-left: .25rem; }

/* Bilder */
.imggrid { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .5rem; }
.imggrid-inline { display: contents; }
.imgitem { position: relative; width: 104px; height: 104px; border-radius: .6rem; overflow: hidden; border: 1px solid var(--line); background: #f1f5f9; }
.imgitem img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.imgitem[draggable="true"] { cursor: grab; }
.imgitem.dragging { opacity: .4; }
.imgitem:first-child::after { content: 'Titelbild'; position: absolute; left: 4px; bottom: 4px; background: rgb(0 0 0 / .6); color: #fff; font-size: .65rem; padding: 1px 5px; border-radius: 4px; }
.imgitem .rm, .imgitem .dl { position: absolute; top: 4px; width: 1.5rem; height: 1.5rem; display: grid; place-items: center; border-radius: 50%; background: rgb(255 255 255 / .92); font-size: .75rem; cursor: pointer; text-decoration: none; color: #0f1d2b; flex-direction: row; font-weight: 600; }
.imgitem .rm { right: 4px; color: #dc2626; }
.imgitem .dl { right: 32px; }
.imgitem .rm input { display: none; }
.imgitem.removed { opacity: .35; outline: 2px solid #dc2626; }
.imgitem.new { border-style: dashed; }
.badge-new { position: absolute; right: 4px; top: 4px; background: var(--brand); color: #fff; font-size: .65rem; padding: 1px 6px; border-radius: 999px; }

/* Vorschau */
.ptabs { display: flex; flex-wrap: wrap; gap: .3rem; margin: .6rem 0; }
.ptabs button { font: inherit; font-size: .8rem; padding: .2rem .6rem; border-radius: .4rem; border: 1px solid var(--line); background: #f8fafc; cursor: pointer; }
.ptabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pv { border: 1px solid var(--line); border-radius: .8rem; overflow: hidden; background: #fff; font-size: .85rem; }
.pv-head { display: flex; gap: .5rem; align-items: center; padding: .6rem .7rem; }
.pv-head small { display: block; color: var(--muted); font-size: .72rem; }
.pv-avatar { width: 2.1rem; height: 2.1rem; border-radius: 50%; object-fit: contain; border: 1px solid var(--line); background: #fff; }
.pv-text { padding: 0 .7rem .6rem; line-height: 1.4; word-wrap: break-word; }
.pv-ig .pv-text { padding-top: .2rem; }
.pv-link { color: #2563eb; }
.pv-more { color: var(--muted); }
.pv-img { position: relative; aspect-ratio: 1.91/1; background: #f1f5f9; }
.pv-img.sq { aspect-ratio: 4/5; }
.pv-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-noimg { display: grid; place-items: center; color: var(--muted); font-size: .8rem; }
.pv-count { position: absolute; right: .5rem; top: .5rem; background: rgb(0 0 0 / .6); color: #fff; font-size: .7rem; padding: .1rem .45rem; border-radius: 999px; }
.pv-icons { padding: .5rem .7rem; color: #334155; letter-spacing: .3rem; }
.pv-bar { border-top: 1px solid var(--line); letter-spacing: 0; font-size: .78rem; text-align: center; }
.pv-x .pv-img { margin: 0 .7rem; width: auto; border-radius: .8rem; overflow: hidden; aspect-ratio: 16/9; }

/* Kommentare / Freigabe */
.comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; max-height: 360px; overflow-y: auto; font-size: .88rem; }
.comments li { background: #f8fafc; border-radius: .6rem; padding: .5rem .7rem; }
.comments .c-head { font-size: .8rem; margin-bottom: .15rem; }
.comments .c-approved { background: #ecfdf5; }
.comments .c-changes { background: #fffbeb; }
.comments .c-published, .comments .c-submitted { background: transparent; padding: 0 .2rem; color: var(--muted); }

/* Schnellansicht (Kalender) */
dialog.modal { border: 0; border-radius: 1rem; padding: 0; width: min(760px, 94vw); box-shadow: 0 20px 60px rgb(0 0 0 / .25); }
dialog.modal::backdrop { background: rgb(15 29 43 / .45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal-head .x { border: 0; background: none; font-size: 1.1rem; cursor: pointer; }
.modal-body { display: grid; grid-template-columns: 240px 1fr; gap: 1.25rem; padding: 1.25rem; }
@media (max-width: 640px) { .modal-body { grid-template-columns: 1fr; } }
.q-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; align-content: start; }
.q-imgs a:first-child { grid-column: 1 / -1; }
.q-imgs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .5rem; display: block; }
.q-text { white-space: pre-wrap; max-height: 240px; overflow-y: auto; font-size: .9rem; background: #f8fafc; padding: .6rem; border-radius: .5rem; }

/* Themen im Kalender */
.fc .theme-event { font-size: .72rem; border: 0 !important; }
.fc .theme-holiday { background: #fee2e2 !important; color: #991b1b !important; }
.fc .theme-action { background: #e0f2fe !important; color: #075985 !important; }
.fc .theme-event .fc-event-title, .fc .theme-event .fc-event-main { color: inherit !important; }
.fc .fc-bg-event.theme-bg { opacity: .45; }
.fc .fc-bg-event .fc-event-title { font-size: .68rem; font-style: normal; color: #78350f; margin: 2px 3px; }
