/* Redaktionsbereich – nach „Redaktionsbereich_Konzept“: dunkelgrüne Seitenleiste, Hunde-Kopfzeile, Karten. */
.studio { --side: #2f4a3c; --side-text: #eef0e6; background-color: #f1ebe0; }
.s-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--side) 250px, transparent 250px); }
.s-side { background: var(--side); color: var(--side-text); padding: 0 0 1.2rem; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.s-brand { display: block; padding: 1rem 1.1rem .9rem; background: var(--paper); text-decoration: none; color: var(--ink); text-align: center; }
.s-brand img { width: 100%; max-width: 210px; margin: 0 auto; }
.s-brand span { display: block; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 800; margin-top: .2rem; }
.s-nav { list-style: none; margin: .8rem 0 0; padding: 0 .7rem; }
.s-nav a, .s-nav button, .s-nav__group { display: flex; align-items: center; gap: .6rem; padding: .45rem .7rem; border-radius: 8px; color: var(--side-text); text-decoration: none; font-size: 1rem; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.s-nav__group { font-family: var(--font-hand); font-size: 1.3rem; padding-top: .7rem; cursor: default; flex-wrap: wrap; }
.s-nav__group ul { list-style: none; margin: .1rem 0 .3rem; padding: 0 0 0 1.9rem; width: 100%; }
.s-nav__group ul a { font-family: var(--font-sans); font-size: .93rem; padding: .25rem .5rem; opacity: .92; }
.s-nav a:hover, .s-nav button:hover { background: rgba(255, 255, 255, .1); }
.s-nav a[aria-current="page"] { background: var(--paper); color: var(--ink); }
.s-nav--bottom { margin-top: auto; padding-top: .8rem; border-top: 1px solid rgba(255, 255, 255, .15); }
.s-nav .icon { width: 1.25em; height: 1.25em; }

.s-main { min-width: 0; }
.s-top { position: relative; height: 112px; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--paper); }
.s-top__art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; }
.s-top__user { position: absolute; right: 1.2rem; top: .8rem; padding: .3rem .8rem; border-radius: 999px; background: rgba(250, 246, 238, .92); font-weight: 700; font-size: .9rem; }
.s-content { padding: 1.4rem clamp(14px, 2vw, 28px) 3rem; max-width: 1500px; }

.s-h1 { display: flex; align-items: center; gap: .45em; font-family: var(--font-hand); -webkit-text-stroke: .015em currentColor; font-size: clamp(1.7rem, 1.3rem + 1vw, 2.4rem); font-weight: 400; margin: 0; }
.s-h1 .icon { color: var(--terra); }
.s-h2 { display: flex; align-items: center; gap: .45em; font-family: var(--font-hand); font-size: 1.45rem; font-weight: 400; margin: 0 0 .6rem; }
.s-h2 .icon { color: var(--terra); }
.ki-step { margin-bottom: 1rem; }
.ki-step__no { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--terra); color: #fff; font-family: var(--font-body, inherit); font-size: .8em; }
.steam-q { flex: 1 1 18rem; }
.steam-hits { list-style: none; margin: 0; padding: 0; }
.steam-hits li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.steam-hits li:first-child { border-top: 0; }
.steam-hits__name { flex: 1 1 14rem; font-weight: 700; }
.steam-hits form { margin: 0; }
.ki-prompt { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: .82rem; margin-bottom: .6rem; }
.s-h3 { font-size: 1rem; font-weight: 700; margin: 1.1rem 0 .4rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.s-h3:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.s-kicker { margin: 0 0 .2rem; font-size: .85rem; color: var(--ink-soft); font-weight: 700; }
.s-help { display: block; color: var(--ink-soft); font-size: .84rem; margin: .2rem 0 .6rem; }
.s-muted { color: var(--ink-soft); }
.s-panel { padding: 1rem 1.15rem; margin-bottom: 1rem; }
.s-panel__head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .5rem; }
.s-panel__head .s-h2 { margin: 0; }
.s-pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.s-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.s-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.s-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }

.s-input, .studio .field input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .studio .field select, .studio .field textarea { width: 100%; padding: .55em .75em; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fffdf8; font-size: 1rem; }
.studio .field textarea { resize: vertical; }
.studio .field select[multiple] { min-height: 8rem; }
.field--check label, label.field--check { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; }
.field--check input { width: 1.15rem; height: 1.15rem; accent-color: var(--forest); }
.field--error input, .field--error select, .field--error textarea { border-color: #a33a1c; }
.studio .field ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; }
.studio .field ul label { display: inline-flex; gap: .35rem; align-items: center; font-weight: 500; }
.s-label { font-weight: 700; font-size: .9rem; }
.s-filter { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.s-filter .s-input { width: auto; min-width: 220px; }
.s-actions { display: grid; gap: .5rem; }
.s-actions--row { display: flex; flex-wrap: wrap; gap: .5rem; }
.s-btn-danger { border-color: #8c2f17; color: #8c2f17; }
.s-btn-danger:hover { background: #8c2f17; color: #fff; }
.s-danger { margin-top: 1.4rem; }

.s-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.s-table th { text-align: left; font-weight: 800; padding: .45rem .5rem; background: #efe6d6; }
.s-table td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.s-table a { color: var(--ink); font-weight: 600; }
.s-rowlink { display: inline-flex; align-items: center; gap: .6rem; }
.s-thumb { width: 48px; height: 34px; object-fit: cover; border-radius: 4px; flex: none; }
.s-thumb.img-placeholder { min-height: 0; }
.s-status, .s-pill { display: inline-flex; align-items: center; gap: .35em; padding: .1em .6em; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #ece4d6; white-space: nowrap; }
.s-status::before { content: ""; width: .55em; height: .55em; border-radius: 50%; background: currentColor; }
.s-status--published, .s-status--bestaetigt, .s-pill--ok { color: #2f6b3f; background: #dfeedd; }
.s-status--draft, .s-status--angekuendigt { color: #6b4a1a; background: var(--ochre-wash); }
.s-status--withdrawn, .s-status--abgesagt { color: #8c2f17; background: #f6dcd2; }
.s-status--unsicher, .s-pill--warn { color: #6b4a1a; background: #f6e3b5; }
.s-badge { display: inline-grid; place-items: center; min-width: 1.4em; height: 1.4em; padding: 0 .35em; border-radius: 999px; background: var(--terra); color: #fff; font-family: var(--font-sans); font-size: .78rem; font-weight: 800; }

.s-messages { list-style: none; margin: 0 0 1rem; padding: 0; }
.s-msg { padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: .5rem; background: var(--sage-wash); border: 1px solid #c9d0bb; }
.s-msg--error { background: #f6dcd2; border-color: #e3b3a3; }
.s-msg--warning { background: var(--ochre-wash); border-color: #ecc98f; }

/* Dashboard */
.s-dash { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; }
.s-welcome p { margin: .2rem 0 1rem; }
.s-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.s-quick a { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: .7rem; align-items: center; padding: .7rem; text-decoration: none; color: var(--ink); }
.s-quick__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 10px; background: var(--terra); color: #fff; }
.s-quick__icon .icon { width: 28px; height: 28px; }
.s-quick strong { display: block; font-size: .95rem; }
.s-quick small { color: var(--ink-soft); font-size: .8rem; }
.s-quick a:hover { border-color: var(--terra); }
.s-list { list-style: none; margin: 0; padding: 0; }
.s-list li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.s-list small { display: block; color: var(--ink-soft); font-size: .8rem; }
.s-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.s-links a { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) auto; gap: .6rem; align-items: center; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; background: #fffdf8; }
.s-links a:hover { border-color: var(--terra); }
.s-stats { margin: 0; }
.s-stats div { display: flex; justify-content: space-between; padding: .3rem 0; border-bottom: 1px dashed var(--line); }
.s-stats dd { margin: 0; font-weight: 800; font-size: 1.1rem; }
.s-tips .check-list { font-size: .88rem; }

/* Editor-Seite */
.s-editor__grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.s-sticky { position: sticky; top: 1rem; }
.s-imgfield img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-sm); margin: .4rem 0; border: 1px solid var(--line); }
.s-imgfield__btns { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .3rem; }
details.s-panel summary { cursor: pointer; margin: 0; }

.s-ed { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fffdf8; }
.ed-toolbar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: .25rem; padding: .4rem; border-bottom: 1px solid var(--line); background: #f6efe2; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.ed-btn { min-width: 2.3rem; min-height: 2.3rem; padding: .2rem .55rem; border: 1px solid var(--line-strong); border-radius: 6px; background: #fffdf8; font-weight: 800; cursor: pointer; }
.ed-btn[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: #fff; }
.ed-btn--primary { background: var(--forest); color: #fff; border-color: var(--forest); display: inline-flex; align-items: center; }
.ed-btn--danger { color: #8c2f17; border-color: #d9a594; font-weight: 600; }
.ed-area .ed-content { min-height: 320px; padding: 1rem 1.2rem; outline: none; font-size: 1.05rem; line-height: 1.65; }
.ed-content h2 { font-family: var(--font-hand); font-size: 1.7rem; font-weight: 400; margin: 1.1em 0 .3em; }
.ed-content h3 { font-family: var(--font-serif); font-size: 1.2rem; margin: 1em 0 .3em; }
.ed-content blockquote { border-left: 4px solid var(--sage-light); margin: 1em 0; padding-left: 1em; font-style: italic; }
.ed-content p.is-editor-empty:first-child::before { content: attr(data-placeholder); color: #9a9488; float: left; height: 0; pointer-events: none; }
.ed-figure, .ed-video { margin: 1rem 0; padding: .7rem; border: 2px dashed var(--line-strong); border-radius: var(--radius-sm); background: #faf4e8; display: grid; grid-template-columns: minmax(120px, 240px) minmax(0, 1fr); gap: .8rem; align-items: start; }
.ed-video { grid-template-columns: 1fr; }
.ed-figure img { width: 100%; border-radius: 4px; }
.ed-figure__fields { display: grid; gap: .45rem; }
.ed-figure__fields label { display: grid; gap: .15rem; font-size: .82rem; font-weight: 700; }
.ed-figure input, .ed-video input { padding: .4em .6em; border: 1px solid var(--line-strong); border-radius: 6px; font-weight: 400; }
.ProseMirror-selectednode { outline: 3px solid var(--terra); }

/* Bild-Dialog */
.picker { width: min(920px, 94vw); max-height: 86vh; border: 0; border-radius: var(--radius); padding: 1rem 1.2rem; background: var(--paper-light); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.picker::backdrop { background: rgba(30, 30, 30, .45); }
.picker__head { display: flex; justify-content: space-between; align-items: center; }
.picker__head h2 { font-family: var(--font-hand); font-weight: 400; margin: 0; }
.picker__tools { display: flex; gap: .6rem; margin: .7rem 0; }
.picker__status--error { padding: .6rem .8rem; border-radius: var(--radius-sm); background: #f6dcd2; border: 1px solid #e3b3a3; color: #7a2410; font-weight: 600; }
.picker__status--error::before { content: "⚠ "; }
.picker__tools input { flex: 1; padding: .5em .7em; border: 1px solid var(--line-strong); border-radius: 6px; }
.picker__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; overflow: auto; max-height: 60vh; }
.picker__item { display: grid; gap: .3rem; padding: .35rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; text-align: left; font-size: .78rem; }
.picker__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.picker__item:hover, .picker__item:focus-visible { border-color: var(--terra); }

.s-media { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; }
.s-media a { display: grid; gap: .3rem; padding: .5rem; color: var(--ink); text-decoration: none; font-size: .85rem; }
.s-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.s-media small { color: var(--ink-soft); }

/* Mehrfachauswahl + Löschen */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin: 0 0 .6rem; }
.bulk-bar__all { display: flex; align-items: center; gap: .4rem; font-size: .9rem; cursor: pointer; }
.bulk-bar .btn:disabled { opacity: .45; cursor: not-allowed; }
.s-check { width: 2.2rem; text-align: center; }
.s-check input, .bulk-bar input, .s-media__check input { width: 1.15rem; height: 1.15rem; accent-color: #8c2f17; cursor: pointer; }
.s-media__item { position: relative; }
.s-media__check { position: absolute; top: .9rem; left: .9rem; z-index: 1; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 6px; background: rgba(255, 255, 255, .92); box-shadow: var(--shadow); cursor: pointer; }
.bulk-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.bulk-list li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.s-messages-list { list-style: none; margin: 0; padding: 0; }
.s-unread { border-left: 4px solid var(--terra); }
.s-prewrap { white-space: pre-wrap; }
.s-plain { padding-left: 1.1rem; }

/* Anmeldung */
.s-login-page { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.s-login { width: min(420px, 100%); padding: 1.6rem; text-align: center; }
.s-login img { width: 240px; margin: 0 auto .4rem; }
.s-login form { text-align: left; margin-top: .8rem; }
.s-hint { font-size: .82rem; color: var(--ink-soft); margin-top: 1rem; }

@media (max-width: 1600px) {
  .s-dash .s-grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1200px) {
  .s-dash { grid-template-columns: minmax(0, 1fr); }
  .s-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .s-shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .s-side { position: static; height: auto; }
  .s-nav { display: flex; flex-wrap: wrap; gap: .2rem; }
  .s-nav__group ul { padding-left: 0; }
  .s-editor__grid, .s-grid2 { grid-template-columns: minmax(0, 1fr); }
  .s-sticky { position: static; }
  .s-top { height: 80px; }
}
@media (max-width: 640px) {
  .s-quick, .s-row2, .s-row3 { grid-template-columns: minmax(0, 1fr); }
  .s-table th:nth-child(n+3), .s-table td:nth-child(n+3) { display: none; }
  .s-table--select th:nth-child(3), .s-table--select td:nth-child(3) { display: table-cell; }   /* Auswahlspalte zählt mit */
  .s-table--select th:nth-child(n+4), .s-table--select td:nth-child(n+4) { display: none; }
  .ed-figure { grid-template-columns: 1fr; }
}

/* ProseMirror-Grundregeln (statt injizierter Inline-Styles, CSP-konform) */
.ProseMirror { position: relative; word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; font-variant-ligatures: none; font-feature-settings: "liga" 0; }
.ProseMirror [contenteditable="false"] { white-space: normal; }
.ProseMirror [contenteditable="false"] [contenteditable="true"] { white-space: pre-wrap; }
.ProseMirror pre { white-space: pre-wrap; }
.ProseMirror-hideselection *::selection { background: transparent; }
.ProseMirror-hideselection { caret-color: transparent; }
.ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; }
.ProseMirror-gapcursor::after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid black; animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; }
@keyframes ProseMirror-cursor-blink { to { visibility: hidden; } }
.ProseMirror-focused .ProseMirror-gapcursor { display: block; }
img.ProseMirror-separator { display: inline !important; border: none !important; margin: 0 !important; }
