/* ==========================================================================
   Verwaltung: Changelog & Ankuendigungen
   ========================================================================== */

.mod-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Verlauf */
.cl-list { display: grid; gap: 12px; }
.cl-item { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); transition: border-color 0.2s, background 0.2s; }
.cl-item:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.cl-type { flex: none; padding: 4px 12px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.cl-type.is-changelog { background: rgba(24, 223, 207, 0.14); color: var(--accent); }
.cl-type.is-announcement { background: rgba(177, 140, 255, 0.16); color: #c5a9ff; }
.cl-item-main { display: grid; flex: 1; min-width: 0; gap: 2px; }
.cl-item-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-item-main small { color: var(--muted); font-size: 0.8rem; }
.cl-item-actions { display: flex; flex: none; align-items: center; gap: 8px; }
.cl-item-actions .btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; margin-right: 4px; }

/* Editor: zwei Spalten mit Live-Vorschau */
.dlg.dlg-xl { width: min(1240px, calc(100% - 24px)); }
.cl-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); min-height: 0; overflow: hidden; }
.cl-edit { display: grid; align-content: start; gap: 16px; min-width: 0; padding: 20px 22px; overflow-y: auto; }
.cl-side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: rgba(1, 16, 21, 0.5); }
.cl-side-head { display: grid; gap: 2px; padding: 16px 20px 10px; }
.cl-side-head span { color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.cl-pv { flex: 1; min-height: 0; padding: 4px 20px 22px; overflow-y: auto; }

.cl-group { gap: 14px; }
.cl-add { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-form .dlg-foot { align-items: center; }
.cl-confirm { display: flex; flex-wrap: wrap; flex: 1 1 auto; align-items: center; gap: 10px; color: #f4dfae; font-size: 0.88rem; }
.cl-confirm[hidden] { display: none; }
.cl-confirm b { color: #fff; }

/* Formatierungsleiste */
.md-label { color: var(--muted); font-size: 0.84rem; font-weight: 500; }
.md-label:empty { display: none; }
.md-tools { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: rgba(1, 16, 21, 0.6); }
.md-tools button { min-width: 30px; height: 28px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; font-size: 0.85rem; cursor: pointer; transition: background 0.15s, color 0.15s; }
.md-tools button:hover { background: rgba(24, 223, 207, 0.14); color: var(--accent); }
.md-field textarea { border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; }

/* Felder (Changelog) */
.cl-section { display: grid; gap: 10px; margin-bottom: 12px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 16px; background: rgba(1, 16, 21, 0.55); }
.cl-section:last-child { margin-bottom: 0; }
.cl-section-head { display: flex; align-items: center; gap: 8px; }
.cl-section-head input { flex: 1; min-width: 0; font-weight: 600; }
.cl-entries { display: grid; gap: 6px; }
.cl-entry { display: flex; align-items: center; gap: 8px; }
.cl-entry input { flex: 1; min-width: 0; }
.cl-entry input:disabled { opacity: 0.45; }
.cl-kind { flex: none; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: rgba(1, 16, 21, 0.7); font: 700 1.05rem/1 ui-monospace, Consolas, monospace; cursor: pointer; transition: transform 0.12s, border-color 0.15s, background 0.15s; }
.cl-kind:hover { transform: scale(1.06); }
.cl-kind.is-add { color: #6ee7a0; border-color: rgba(110, 231, 160, 0.45); background: rgba(110, 231, 160, 0.1); }
.cl-kind.is-edit { color: #ffc857; border-color: rgba(255, 200, 87, 0.45); background: rgba(255, 200, 87, 0.1); }
.cl-kind.is-remove { color: #ff6b6b; border-color: rgba(255, 107, 107, 0.45); background: rgba(255, 107, 107, 0.1); }
.cl-kind.is-space { color: var(--muted); }

/* Bausteine (Ankuendigung) */
.cl-block { display: grid; gap: 10px; margin-bottom: 12px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 16px; background: rgba(1, 16, 21, 0.55); }
.cl-block:last-child { margin-bottom: 0; }
.cl-block-head { display: flex; align-items: center; gap: 8px; }
.cl-block-type { color: var(--accent); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

/* Farben und Schalter */
.cl-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cl-swatch { width: 28px; height: 28px; border: 2px solid transparent; border-radius: 50%; background: var(--c); cursor: pointer; transition: transform 0.12s, border-color 0.15s; }
.cl-swatch:hover { transform: scale(1.12); border-color: rgba(255, 255, 255, 0.6); }
.cl-colors input[type="color"] { width: 38px; height: 30px; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: none; cursor: pointer; }
.cl-switch { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 0.92rem; cursor: pointer; }
.cl-switch input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Vorschau (aehnlich Discord Components V2) */
.cl-pv-card { --pc: #18dfcf; display: grid; gap: 10px; padding: 14px 16px 14px 18px; border: 1px solid rgba(255, 255, 255, 0.06); border-left: 4px solid var(--pc); border-radius: 12px; background: #2b2d31; color: #dbdee1; font-family: "gg sans", "Segoe UI", system-ui, sans-serif; font-size: 0.93rem; line-height: 1.45; overflow-wrap: anywhere; }
.cl-pv-banner, .cl-pv-image { display: block; width: 100%; height: auto; border-radius: 8px; }
.cl-pv-image { max-height: 320px; object-fit: contain; }
.cl-pv-sep { width: 100%; height: 1px; margin: 2px 0; border: 0; background: rgba(255, 255, 255, 0.1); }
.cl-pv-sep.is-large { margin: 8px 0; }
.cl-pv-text a { color: #00a8fc; text-decoration: none; }
.cl-pv-text a:hover { text-decoration: underline; }
.cl-pv-text .tr-h { margin: 2px 0; font-weight: 700; color: #fff; }
.cl-pv-text .tr-h1 { font-size: 1.5em; } .cl-pv-text .tr-h2 { font-size: 1.25em; } .cl-pv-text .tr-h3 { font-size: 1.08em; }
.cl-pv-text .tr-sub { color: #949ba4; font-size: 0.78em; }
.cl-pv-text blockquote { margin: 3px 0; padding: 0 0 0 10px; border-left: 4px solid #4e5058; }
.cl-pv-text code { padding: 1px 5px; border-radius: 4px; background: #1e1f22; font-size: 0.86em; }
.cl-pv-text pre { margin: 4px 0; padding: 8px 10px; overflow-x: auto; border: 1px solid #1e1f22; border-radius: 6px; background: #1e1f22; }
.cl-pv-text pre code { padding: 0; background: none; }
.cl-pv-code { margin: 6px 0 0; padding: 9px 12px; overflow-x: auto; border: 1px solid #1e1f22; border-radius: 6px; background: #1e1f22; font: 0.84rem/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; }
.cl-pv-code .k-add { color: #6ee7a0; } .cl-pv-code .k-edit { color: #e6c44f; } .cl-pv-code .k-remove { color: #f2686b; }
.cl-pv-text .tr-spoiler { border-radius: 3px; background: #1e1f22; color: transparent; cursor: pointer; }
.cl-pv-text .tr-spoiler.is-open { color: inherit; }
.cl-pv-text .tr-mention { padding: 0 4px; border-radius: 4px; background: color-mix(in srgb, var(--mc, #5865f2) 26%, transparent); color: var(--mc, #c9cdfb); font-weight: 500; }
.cl-pv-text .tr-mention.is-channel { --mc: #7aa2ff; }
.cl-pv-text .tr-emoji { width: 1.3em; height: 1.3em; vertical-align: -0.25em; }

@media (max-width: 960px) {
  .cl-layout { grid-template-columns: 1fr; overflow-y: auto; }
  .cl-edit { overflow: visible; }
  .cl-side { border-left: 0; border-top: 1px solid var(--line); }
  .cl-pv { overflow: visible; }
}
@media (max-width: 640px) {
  .cl-item { flex-wrap: wrap; }
  .cl-item-actions { width: 100%; justify-content: flex-end; }
  .cl-edit { padding: 16px; }
}

/* Eingabefelder in Feldern und Eintraegen (ausserhalb von .fld) */
.cl-section-head input, .cl-entry input {
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(1, 16, 21, 0.75);
  color: var(--text);
  font: inherit;
  font-size: 0.93rem;
}
.cl-section-head input:focus, .cl-entry input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(24, 223, 207, 0.14); }
.cl-entry input::placeholder, .cl-section-head input::placeholder { color: #5f8484; }
.cl-block .fld { gap: 6px; }
.cl-block .md-field { margin: 0; }

/* Schalter-Kaestchen im Look der Seite */
.cl-switch input { flex: none; appearance: none; -webkit-appearance: none; display: grid; place-content: center; width: 20px; height: 20px; margin: 0; border: 1px solid var(--line-strong); border-radius: 6px; background: rgba(1, 16, 21, 0.75); cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.cl-switch input::after { content: ""; width: 10px; height: 6px; margin-top: -2px; border: solid var(--on-accent); border-width: 0 0 2.5px 2.5px; opacity: 0; transform: rotate(-45deg) scale(0.6); transition: opacity 0.12s, transform 0.12s; }
.cl-switch input:checked { border-color: var(--accent); background: var(--accent); }
.cl-switch input:checked::after { opacity: 1; transform: rotate(-45deg) scale(1); }
.cl-switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Auswahl "Banner oben / unten / kein Banner" */
.cl-seg { display: inline-grid; grid-auto-flow: column; gap: 4px; width: fit-content; max-width: 100%; padding: 4px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(1, 16, 21, 0.75); }
.cl-seg label { position: relative; cursor: pointer; }
.cl-seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.cl-seg span { display: block; padding: 7px 16px; border-radius: 9px; color: var(--muted); font-size: 0.88rem; font-weight: 600; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.cl-seg label:hover span { color: var(--text); }
.cl-seg input:checked + span { background: var(--accent); color: var(--on-accent); }
.cl-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Ankuendigungen: Ziel-Kanal */
.cl-type.is-team { background: rgba(168, 85, 247, 0.16); color: #d8b4fe; }
.cl-hint { display: block; margin-top: 6px; color: var(--muted, #9aa3ad); font-size: 0.78rem; }

/* ---------- Events ---------- */
.ev-sec { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; font-size: 0.95rem; font-style: normal; color: var(--muted); }
.ev-sec span { padding: 1px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 0.75rem; }
.ev-item { display: flex; align-items: flex-start; gap: 16px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.ev-item.is-done { opacity: 0.55; }
.ev-date { flex: none; display: grid; justify-items: center; width: 54px; padding: 6px 0; border-radius: 12px; background: rgba(24, 223, 207, 0.1); border: 1px solid rgba(24, 223, 207, 0.3); }
.ev-date b { font-size: 1.3rem; line-height: 1.1; }
.ev-date span { font-size: 0.72rem; text-transform: uppercase; color: var(--muted); }
.ev-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.ev-main small { color: var(--muted); }
.ev-main p { margin: 4px 0 0; color: var(--muted); font-size: 0.88rem; white-space: pre-wrap; }
.ev-form { display: grid; gap: 14px; }
.ev-drop { position: relative; display: grid; place-items: center; min-height: 120px; padding: 14px; border: 2px dashed var(--line); border-radius: 14px; cursor: pointer; text-align: center; transition: border-color 0.2s, background 0.2s; }
.ev-drop:hover, .ev-drop.is-over { border-color: var(--accent, #18dfcf); background: rgba(24, 223, 207, 0.06); }
.ev-preview { max-height: 220px; max-width: 100%; border-radius: 10px; margin-bottom: 8px; }
.ev-drop-text { color: var(--muted); font-size: 0.86rem; }
