/* ══════════════════════════════════════════════════════════════════════════
   Einsatzchronik – Zeitstrahl, Einsatzbericht, Gefechtsgliederung
   Farben ausschließlich aus den Theme-Variablen (base.html / mis-shell.css).
   ══════════════════════════════════════════════════════════════════════════ */

.chr {
    --chr-hot:    var(--mis-hot, var(--mis-accent-fg));
    --chr-line:   var(--mis-border);
    --chr-card:   var(--mis-bg-surface);
    --chr-card-2: var(--mis-bg-elevated);
    --chr-text:   var(--mis-text-primary);
    --chr-muted:  var(--mis-text-secondary);
    --chr-faint:  var(--mis-text-muted);
    --chr-mono:   ui-monospace, "Roboto Mono", Consolas, "Liberation Mono", monospace;
    --chr-axis:   50%;
    width: min(1240px, 100%); margin: 0 auto;
}

/* ── Werkzeugleiste ── */
.chr-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 26px 0 8px; }
.chr-search { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.chr-search input {
    width: 100%; height: 38px; padding: 0 12px 0 36px;
    background: var(--chr-card); border: 1px solid var(--chr-line); color: var(--chr-text); font-size: 14px;
}
.chr-search input::placeholder { color: var(--chr-faint); }
.chr-search input:focus { outline: none; border-color: var(--chr-hot); }
.chr-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--chr-faint); pointer-events: none; }
.chr-count { color: var(--chr-faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chr-tools { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.chr-btn {
    display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px;
    border: 1px solid var(--chr-line); background: var(--chr-card); color: var(--chr-text);
    font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer;
    clip-path: var(--mis-plate-sm); transition: border-color .15s, background .15s;
}
.chr-btn:hover { border-color: var(--chr-hot); color: var(--chr-text); }
.chr-btn--primary { background: var(--mis-accent-solid); border-color: var(--mis-accent-solid); color: #fff; }
.chr-btn--primary:hover { background: var(--mis-accent-solid-hover); color: #fff; }
.chr-btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
.chr-btn--danger:hover { border-color: var(--mis-danger); color: var(--mis-danger); }

.chr-empty-camps { margin: 6px 0 0; padding: 10px 14px; border: 1px dashed var(--chr-line); color: var(--chr-muted); font-size: 13px; }
.chr-empty-camps a { color: var(--chr-text); font-weight: 600; }

/* ── Zeitstrahl ── */
.chr-line { position: relative; padding: 22px 0 30px; }
.chr-line::before {
    content: ""; position: absolute; left: var(--chr-axis); top: 0; bottom: 0; width: 2px; transform: translateX(-50%);
    background: linear-gradient(180deg, transparent, var(--chr-line) 30px, var(--chr-line) calc(100% - 30px), transparent);
}
.chr-year { position: relative; display: flex; justify-content: center; margin: 4px 0 24px; }
.chr-year span, .chr-end span {
    padding: 3px 12px; background: var(--mis-bg-canvas); border: 1px solid var(--chr-line);
    font: 500 12px var(--chr-mono); letter-spacing: .14em; color: var(--chr-muted);
}
.chr-end { position: relative; display: flex; justify-content: center; }
.chr-end span { font-size: 11px; color: var(--chr-faint); }

/* Kampagnen-Block */
.chr-camp {
    position: relative; margin-bottom: 36px;
    border: 1px solid color-mix(in srgb, var(--chr-hot) 25%, var(--chr-line));
    background: linear-gradient(180deg, color-mix(in srgb, var(--mis-accent) 12%, transparent), color-mix(in srgb, var(--chr-card) 55%, transparent) 170px);
}
.chr-camp::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: var(--mis-dots); background-size: 22px 22px;
}
.chr-camp-head {
    position: relative; overflow: hidden; padding: 26px 28px 24px;
    border-bottom: 1px solid color-mix(in srgb, var(--chr-hot) 25%, var(--chr-line));
    background: linear-gradient(105deg, color-mix(in srgb, var(--mis-accent) 55%, transparent), color-mix(in srgb, var(--chr-card-2) 92%, transparent) 62%);
}
.chr-camp-head > img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35;
    -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000 90%); mask-image: linear-gradient(100deg, transparent 30%, #000 90%);
}
.chr-camp-in { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; }
.chr-kicker { font: 500 11px var(--chr-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--chr-hot); margin-bottom: 6px; }
.chr-camp h2 { margin: 0; font-size: clamp(23px, 2.7vw, 31px); font-weight: 800; line-height: 1.15; text-wrap: balance; }
.chr-camp h2 a { color: var(--chr-text); text-decoration: none; }
.chr-camp h2 a:hover { color: var(--chr-hot); }
.chr-camp-desc { margin: 8px 0 0; max-width: 680px; color: var(--chr-muted); font-size: 14.5px; line-height: 1.6; }
.chr-camp-meta {
    display: grid; gap: 6px; min-width: 190px; padding-left: 18px;
    border-left: 1px solid color-mix(in srgb, var(--chr-text) 15%, transparent); font-size: 12.5px; color: var(--chr-text);
}
.chr-camp-meta span { display: flex; align-items: center; gap: 8px; }
.chr-camp-meta svg { color: var(--chr-hot); flex: none; }
.chr-camp-body { position: relative; padding: 20px 22px 16px; }
.chr-camp-mark {
    position: absolute; left: var(--chr-axis); bottom: -8px; width: 14px; height: 14px; z-index: 2;
    background: var(--chr-hot); transform: translateX(-50%) rotate(45deg); box-shadow: 0 0 0 4px var(--mis-bg-canvas);
}

/* Einzeloperation: abgegrenzt durch Passermarken, ohne Kopf */
.chr-solo { position: relative; margin: 0 0 36px; padding: 14px 22px; }
.chr-reg { position: absolute; width: 16px; height: 16px; border: 0 solid var(--chr-muted); opacity: .7; }
.chr-reg.tl { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.chr-reg.tr { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.chr-reg.bl { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.chr-reg.br { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }

/* Einsatzzeile */
.chr-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); align-items: stretch; }
.chr-row[data-href] { cursor: pointer; }
.chr-row + .chr-row { margin-top: 14px; }
.chr-row::before { content: ""; position: absolute; top: 50%; left: calc(50% - 28px); right: calc(50% - 28px); height: 1px; background: var(--chr-line); }
.chr-node {
    grid-column: 2; grid-row: 1; align-self: center; justify-self: center; width: 14px; height: 14px; z-index: 2;
    border-radius: 50%; background: var(--mis-bg-canvas); border: 2px solid var(--chr-hot); transition: background .15s;
}
.chr-solo .chr-node { border-radius: 0; transform: rotate(45deg); border-color: var(--chr-muted); }
.chr-row.is-planned .chr-node { border-style: dashed; border-color: var(--chr-faint); }
.chr-row[data-href]:hover .chr-node { background: var(--chr-hot); }
.chr-solo .chr-row[data-href]:hover .chr-node { background: var(--chr-muted); }

.chr-card, .chr-sum { min-width: 0; grid-row: 1; background: var(--chr-card); border: 1px solid var(--chr-line); transition: border-color .15s, background .15s; }
.chr-card { position: relative; overflow: hidden; isolation: isolate; grid-column: 1; display: flex; min-height: 132px; padding: 18px 20px; clip-path: var(--mis-plate); }
.chr-sum { grid-column: 3; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 16px 20px; }
.chr-row.is-flip .chr-card { grid-column: 3; }
.chr-row.is-flip .chr-sum { grid-column: 1; }
.chr-row[data-href]:hover .chr-card, .chr-row[data-href]:hover .chr-sum {
    border-color: color-mix(in srgb, var(--chr-hot) 55%, var(--chr-line)); background: var(--chr-card-2);
}
.chr-card-in { position: relative; z-index: 1; min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; }

/* Titelbild füllt die ganze Karte und läuft zur Textseite und zu den Rändern in den Kartenhintergrund aus */
.chr-card-bg {
    position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover;
    filter: saturate(.8) brightness(.85); opacity: .9; transition: opacity .2s, transform .4s;
    -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.18) 0%, rgba(0,0,0,.55) 35%, #000 80%);
            mask-image: linear-gradient(90deg, rgba(0,0,0,.18) 0%, rgba(0,0,0,.55) 35%, #000 80%);
}
.chr-card.has-img::after {   /* weicher Übergang oben/unten in den Kartenhintergrund */
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(180deg, color-mix(in srgb, var(--chr-card) 55%, transparent) 0%, transparent 30%, transparent 70%, color-mix(in srgb, var(--chr-card) 65%, transparent) 100%);
}
.chr-row[data-href]:hover .chr-card-bg { opacity: 1; transform: scale(1.02); }

/* Schrift über dem Bild: dunkle Kontur + leichte Transparenz, damit sie lesbar bleibt und trotzdem ins Bild übergeht */
.chr-card.has-img .chr-card-in {
    --chr-outline: 0 0 1px rgba(0,0,0,.95), 1px 1px 0 rgba(0,0,0,.55), -1px -1px 0 rgba(0,0,0,.55), 1px -1px 0 rgba(0,0,0,.55), -1px 1px 0 rgba(0,0,0,.55), 0 2px 10px rgba(0,0,0,.65);
    text-shadow: var(--chr-outline);
}
.chr-card.has-img h3, .chr-card.has-img h3 a { color: color-mix(in srgb, var(--chr-text) 92%, transparent); }
.chr-card.has-img .chr-when { color: color-mix(in srgb, var(--chr-text) 82%, transparent); }
.chr-card.has-img .chr-when svg { filter: drop-shadow(0 0 1px rgba(0,0,0,.9)) drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.chr-card.has-img .chr-dtg { color: color-mix(in srgb, var(--chr-hot) 88%, white); }
.chr-dtg { font: 500 11.5px var(--chr-mono); letter-spacing: .08em; color: var(--chr-hot); }
.chr-card h3 { margin: 0; font-size: clamp(17px, 1.8vw, 21px); font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; text-wrap: balance; }
.chr-card h3 a { color: var(--chr-text); text-decoration: none; }
.chr-when { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--chr-muted); }
.chr-when span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chr-tag { align-self: flex-start; font: 500 10.5px var(--chr-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--chr-faint); }
.chr-sum p { margin: 0; color: var(--chr-text); opacity: .88; font-size: 14px; line-height: 1.6; }
.chr-sum p.is-none { color: var(--chr-faint); opacity: 1; font-style: italic; }
.chr-sum-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chr-read { display: inline-flex; align-items: center; gap: 7px; color: var(--chr-hot); font-size: 13px; font-weight: 700; text-decoration: none; }
.chr-read:hover { color: var(--chr-hot); text-decoration: underline; }
.chr-chip { display: inline-flex; align-items: center; padding: 1px 8px; font: 500 10.5px var(--chr-mono); letter-spacing: .1em; text-transform: uppercase; border: 1px solid currentColor; }
.chr-chip--ok { color: var(--mis-success); }
.chr-chip--draft { color: var(--mis-warning); }
.chr-chip--empty { color: var(--chr-faint); }
.chr-chip--plan { color: var(--chr-muted); }
.chr-sum-foot .chr-btn { margin-left: auto; }

.chr-more { position: relative; display: flex; justify-content: center; margin-top: 16px; }
.chr-more button {
    display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 16px; cursor: pointer;
    background: var(--chr-card-2); border: 1px solid var(--chr-line); color: var(--chr-text); font-size: 13px; font-weight: 600;
}
.chr-more button:hover { border-color: var(--chr-hot); }
.chr-more svg { transition: transform .15s; }
.chr-more button[aria-expanded="true"] svg { transform: rotate(180deg); }
.chr-camp.is-searching .chr-more { display: none; }
.chr-nothing { position: relative; padding: 40px; text-align: center; background: var(--chr-card); border: 1px solid var(--chr-line); }
.chr-nothing p { margin: 6px 0 0; color: var(--chr-muted); }

/* ── Einsatzbericht ── */
.chr-article { max-width: 880px; margin: 0 auto; padding: 34px 0 70px; }
.chr-chief { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.chr-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 30px; }
.chr-fact { padding: 12px 14px; background: var(--chr-card); border-top: 2px solid var(--chr-line); clip-path: var(--mis-plate-sm); min-width: 0; }
.chr-fact:first-child { border-top-color: var(--chr-hot); }
.chr-fact b { display: block; font: 500 15px var(--chr-mono); color: var(--chr-text); overflow-wrap: anywhere; }
.chr-fact span { font-size: 11.5px; color: var(--chr-muted); font-weight: 600; }
.chr-lead { margin: 0 0 22px; font-size: 19px; line-height: 1.65; color: var(--chr-text); max-width: 68ch; }
.chr-body { color: var(--chr-text); line-height: 1.75; font-size: 15.5px; }
.chr-body > * { max-width: 68ch; }
.chr-body h2, .chr-body h3 { margin: 30px 0 10px; font-weight: 800; line-height: 1.25; }
.chr-body h2 { font-size: 22px; }
.chr-body h3 { font-size: 18px; }
.chr-body p { margin: 0 0 14px; opacity: .9; }
.chr-body img, .chr-body figure { max-width: 100%; height: auto; }
.chr-body figure { margin: 22px 0; }
.chr-body blockquote { margin: 22px 0; padding: 12px 18px; border-left: 3px solid var(--chr-hot); background: var(--chr-card); }
.chr-quote { margin: 26px 0; padding: 14px 20px; border-left: 3px solid var(--chr-hot); background: var(--chr-card); font-size: 17px; line-height: 1.6; max-width: 68ch; }
.chr-quote footer { margin-top: 6px; color: var(--chr-muted); font-size: 12.5px; }
.chr-byline { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 34px; padding-top: 14px; border-top: 1px solid var(--chr-line); font-size: 12.5px; color: var(--chr-faint); }
.chr-byline a { color: var(--chr-muted); }
.chr-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
.chr-pn a { display: block; padding: 12px 16px; background: var(--chr-card); border: 1px solid var(--chr-line); text-decoration: none; color: var(--chr-text); clip-path: var(--mis-plate-sm); }
.chr-pn a:hover { border-color: var(--chr-hot); color: var(--chr-text); }
.chr-pn small { display: block; font: 500 10.5px var(--chr-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--chr-faint); }
.chr-pn strong { font-size: 14.5px; }
.chr-pn .is-older { grid-column: 2; text-align: right; }

/* ── Gefechtsgliederung ── */
.chr-orbat { margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--chr-line); }
.chr-ob-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px 20px; flex-wrap: wrap; }
.chr-ob-head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.chr-ob-sum { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--chr-muted); }
.chr-ob-sum b { margin-right: 4px; color: var(--chr-text); font: 500 14px var(--chr-mono); }
.chr-ob-hqwrap { position: relative; }
.chr-ob-hqwrap.has-tree::after { content: ""; position: absolute; left: 50%; bottom: -24px; width: 2px; height: 24px; background: var(--chr-line); transform: translateX(-50%); }
.chr-ob-hq {
    max-width: 580px; margin: 22px auto 0; padding: 14px 16px 12px;
    background: linear-gradient(110deg, color-mix(in srgb, var(--mis-accent) 38%, transparent), var(--chr-card) 70%);
    border: 1px solid color-mix(in srgb, var(--chr-hot) 30%, var(--chr-line)); clip-path: var(--mis-plate);
}
.chr-ob-tree { position: relative; display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 12px; margin-top: 24px; padding-top: 22px; }
.chr-ob-tree.no-hq { margin-top: 18px; padding-top: 0; }
.chr-ob-tree:not(.no-hq)::before {
    content: ""; position: absolute; top: 0; height: 2px; background: var(--chr-line);
    left: calc((100% - (var(--cols, 4) - 1) * 12px) / (2 * var(--cols, 4)));
    right: calc((100% - (var(--cols, 4) - 1) * 12px) / (2 * var(--cols, 4)));
}
.chr-ob-el { position: relative; min-width: 0; padding: 12px 12px 10px; background: var(--chr-card); border: 1px solid var(--chr-line); border-top: 2px solid var(--el, var(--chr-muted)); }
.chr-ob-tree:not(.no-hq) .chr-ob-el.is-first-row::before { content: ""; position: absolute; left: 50%; top: -24px; width: 2px; height: 22px; background: var(--chr-line); transform: translateX(-50%); }
.chr-ob-elhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.chr-ob-call { display: block; font-weight: 800; font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.chr-ob-fill { font: 500 11px var(--chr-mono); color: var(--chr-faint); white-space: nowrap; }
.chr-ob-slots { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.chr-ob-hq .chr-ob-slots { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 16px; }
.chr-ob-tree.is-single .chr-ob-slots { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 16px; }
.chr-slot { display: grid; grid-template-columns: 3px minmax(0, 1fr); gap: 8px; min-width: 0; }
.chr-slot::before { content: ""; background: var(--chr-line); }
.chr-slot-role { display: block; font-size: 11px; font-weight: 600; color: var(--chr-faint); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chr-slot-who { display: block; font-size: 13.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--chr-text); }
.chr-slot-who a { color: inherit; text-decoration: none; }
.chr-slot-who a:hover { color: var(--chr-hot); }
.chr-slot-rk { margin-right: 5px; font: 500 11px var(--chr-mono); color: var(--chr-faint); }
.chr-slot.is-lead::before { background: var(--chr-hot); }
.chr-slot.is-lead .chr-slot-who { font-weight: 700; }
.chr-slot.is-open::before { background: repeating-linear-gradient(180deg, var(--chr-line) 0 3px, transparent 3px 6px); }
.chr-slot.is-open .chr-slot-who { color: var(--chr-faint); font-style: italic; }
.chr-slot.is-me .chr-slot-who::after { content: "Du"; margin-left: 6px; padding: 0 5px; font: 500 10px var(--chr-mono); color: var(--mis-bg-canvas); background: var(--chr-hot); vertical-align: 1px; }
.chr-ob-note { margin-top: 14px; font-size: 11.5px; color: var(--chr-faint); }

/* ── Editor ── */
.chr-form { display: grid; gap: 20px; max-width: 920px; margin: 0 auto; padding: 30px 0 70px; }
.chr-form label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.chr-form .chr-hint { display: flex; justify-content: space-between; gap: 12px; margin-top: 5px; font-size: 12px; color: var(--chr-faint); }
.chr-form .chr-err { margin-top: 5px; font-size: 12.5px; color: var(--mis-danger); }
.chr-form .chr-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chr-form-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chr-form-foot .chr-btn--danger { margin-left: auto; }
.chr-perm { padding: 12px 16px; background: var(--chr-card); border-left: 3px solid var(--chr-hot); color: var(--chr-muted); font-size: 13px; }
.chr-form .ck-editor__editable { min-height: 340px; }

@media (prefers-reduced-motion: reduce) {
    .chr *, .chr *::before { transition: none !important; }
}

@media (max-width: 1000px) {
    .chr-sum { padding: 14px 15px; }
    .chr-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chr-ob-tree:not(.is-single) { --cols: 2 !important; }
    .chr-ob-tree .chr-ob-el:nth-child(n+3)::before { display: none; }
}

@media (max-width: 760px) {
    .chr { --chr-axis: 9px; }
    .chr-line { padding-left: 28px; }
    .chr-tools { margin-left: 0; }
    .chr-search { max-width: none; }
    .chr-camp-head { padding: 18px 16px; }
    .chr-camp-in { grid-template-columns: 1fr; }
    .chr-camp-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; min-width: 0; padding-left: 0; border-left: 0; }
    .chr-camp-body { padding: 14px 12px; }
    .chr-camp-mark { left: -19px; bottom: auto; top: 30px; }
    .chr-solo { padding: 12px; }
    .chr-row, .chr-row.is-flip { display: flex; flex-direction: column; }
    .chr-row::before { left: -32px; right: auto; width: 32px; top: 34px; }
    .chr-solo .chr-row::before { left: -31px; width: 31px; }
    .chr-node { position: absolute; left: -32px; top: 34px; transform: translate(-50%, -50%); }
    .chr-solo .chr-node { left: -31px; transform: translate(-50%, -50%) rotate(45deg); }
    .chr-card { clip-path: none; border-bottom: 0; }
    .chr-card { min-height: 110px; padding: 14px 16px; }
    .chr-card h3 { font-size: 18px; }
    .chr-sum { border-top: 1px dashed var(--chr-line); }
    .chr-lead { font-size: 17px; }
    .chr-pn { grid-template-columns: 1fr; }
    .chr-pn .is-older { grid-column: auto; }
    .chr-ob-hqwrap.has-tree::after { left: 14px; }
    .chr-ob-tree, .chr-ob-tree:not(.no-hq) { grid-template-columns: 1fr; padding: 0 0 0 28px; }
    .chr-ob-tree:not(.no-hq)::before { left: 14px; right: auto; top: -24px; bottom: 22px; width: 2px; height: auto; }
    .chr-ob-tree.no-hq { padding-left: 0; }
    .chr-ob-tree:not(.no-hq) .chr-ob-el::before,
    .chr-ob-tree:not(.no-hq) .chr-ob-el.is-first-row::before { display: block; content: ""; position: absolute; left: -15px; top: 22px; width: 15px; height: 2px; background: var(--chr-line); transform: none; }
    .chr-form .chr-grid2 { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Kampagne anlegen / bearbeiten (.cf)
   ══════════════════════════════════════════════════════════════════════════ */
.cf { padding: 26px 0 60px; }
.cf-head { max-width: 760px; margin-bottom: 22px; }
.cf-back { display: inline-block; margin-bottom: 14px; color: var(--chr-hot); font-size: 13.5px; font-weight: 700; text-decoration: none; }
.cf-back:hover { color: var(--chr-hot); text-decoration: underline; }
.cf-head h1 { margin: 2px 0 8px; font-size: clamp(28px, 4vw, 40px); font-weight: 800; line-height: 1.1; }
.cf-head p { margin: 0; color: var(--chr-muted); font-size: 14.5px; }
.cf-error { margin-bottom: 18px; padding: 10px 14px; border-left: 3px solid var(--mis-danger); background: color-mix(in srgb, var(--mis-danger) 12%, var(--chr-card)); font-size: 13.5px; }

.cf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 24px; align-items: start; }
/* minmax(0,1fr): sonst drückt die Editor-Werkzeugleiste die Spalte breiter als das Raster (Überlagerung der Seitenleiste) */
.cf-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.cf-main > * { min-width: 0; }
.cf-aside { min-width: 0; }
.cf-sticky { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
/* Mitlaufen nur, wo ausdrücklich gewünscht (Vorschau im Kampagnenformular) */
.cf-sticky--follow { position: sticky; top: calc(var(--mis-nav-h, 64px) + 16px); }
.cf-aside-label { font: 500 11px var(--chr-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--chr-faint); }

.cf-panel { position: relative; min-width: 0; padding: 20px 22px 22px; background: var(--chr-card); border: 1px solid var(--chr-line); border-top: 2px solid var(--chr-line); }
.cf-panel:focus-within { border-top-color: var(--chr-hot); }
.cf-panel-title { margin: 0 0 14px; font-size: 17px; font-weight: 800; }
.cf-panel-lead { margin: -6px 0 14px; color: var(--chr-muted); font-size: 13px; }

.cf-field + .cf-field { margin-top: 14px; }
.cf-field > label:first-child { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--chr-text); }
.cf-req, .cf-opt { font: 500 10px var(--chr-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--chr-faint); }
.cf-req { color: var(--chr-hot); }
.cf-hint { margin-top: 5px; font-size: 12px; color: var(--chr-faint); }
.cf input[type="text"], .cf input[type="date"], .cf select, .cf textarea {
    width: 100%; padding: 10px 12px; background: var(--mis-bg-canvas); color: var(--chr-text);
    border: 1px solid var(--chr-line); border-radius: 0; font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
.cf textarea { resize: vertical; line-height: 1.6; min-height: 110px; }
.cf input:focus, .cf select:focus, .cf textarea:focus { outline: none; border-color: var(--chr-hot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--chr-hot) 18%, transparent); }
.cf input::placeholder, .cf textarea::placeholder { color: var(--chr-faint); }
.cf input[type="date"] { max-width: 240px; color-scheme: dark; }

/* Kampagnenende: Auswahlkarten */
.cf-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.cf-opt-card { position: relative; display: block; cursor: pointer; }
.cf-opt-card input { position: absolute; opacity: 0; pointer-events: none; }
.cf-opt-body { display: block; height: 100%; padding: 11px 13px; background: var(--mis-bg-canvas); border: 1px solid var(--chr-line); transition: border-color .15s, background .15s; }
.cf-opt-body b { display: block; font-size: 13.5px; }
.cf-opt-body small { display: block; margin-top: 2px; color: var(--chr-faint); font-size: 11.5px; line-height: 1.35; }
.cf-opt-card:hover .cf-opt-body { border-color: color-mix(in srgb, var(--chr-hot) 50%, var(--chr-line)); }
.cf-opt-card input:checked + .cf-opt-body { border-color: var(--chr-hot); background: color-mix(in srgb, var(--mis-accent) 18%, var(--mis-bg-canvas)); box-shadow: inset 0 -2px 0 var(--chr-hot); }
.cf-opt-card input:focus-visible + .cf-opt-body { outline: 2px solid var(--chr-hot); outline-offset: 2px; }
.cf-opt-card.is-disabled { cursor: not-allowed; opacity: .5; }

/* Bilder */
.cf-images { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 16px; }
.cf-images .cf-field + .cf-field { margin-top: 0; }
.cf-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cf-drop {
    position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer;
    background: var(--mis-bg-canvas) var(--mis-dots); background-size: auto, 18px 18px;
    border: 1px dashed var(--chr-line); text-align: center; transition: border-color .15s;
}
.cf-drop--wide { aspect-ratio: 21 / 8; }
.cf-drop--square { aspect-ratio: 1; }
.cf-drop:hover { border-color: var(--chr-hot); }
.cf-file:focus-visible + * , .cf-drop:focus-within { outline: 2px solid var(--chr-hot); }
.cf-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cf-drop--square img { object-fit: contain; padding: 10px; }
.cf-drop-text { position: relative; padding: 8px; }
.cf-drop-text b { display: block; font-size: 13px; }
.cf-drop-text small { display: block; color: var(--chr-faint); font-size: 11.5px; }
.cf-drop.has-image .cf-drop-text { opacity: 0; padding: 6px 10px; background: rgba(0, 0, 0, .65); transition: opacity .15s; }
.cf-drop.has-image:hover .cf-drop-text { opacity: 1; }
.cf-check { display: flex; align-items: center; gap: 7px; margin-top: 8px; color: var(--chr-muted); font-size: 12.5px; cursor: pointer; }

.cf-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 6px 0 0; }

/* Vorschau + Dateien */
.cf-preview { margin: 0; }
.cf-preview .chr-camp-head { padding: 20px 20px 18px; }
.cf-preview .chr-camp-in { grid-template-columns: 1fr; gap: 14px; }
.cf-preview .chr-camp-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-left: 0; border-left: 0; min-width: 0; }
.cf-preview h2 { font-size: 23px; overflow-wrap: anywhere; }
.cf-files .cf-panel-title { font-size: 15px; }
.cf-file-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin-bottom: 6px; background: var(--mis-bg-canvas); border: 1px solid var(--chr-line); font-size: 13px; }
.cf-file-row a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--chr-text); text-decoration: none; }
.cf-file-row a:hover { color: var(--chr-hot); }
.cf-x { border: 0; background: none; color: var(--chr-faint); cursor: pointer; padding: 0 4px; }
.cf-x:hover { color: var(--mis-danger); }
.cf-upload { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
.cf-upload input[type="file"] { font-size: 12.5px; color: var(--chr-muted); }
.cf-upload .chr-btn { justify-self: start; }


@media (max-width: 1000px) {
    .cf-grid { grid-template-columns: 1fr; }
    .cf-sticky--follow { position: static; }
}
@media (max-width: 600px) {
    .cf-seg { grid-template-columns: 1fr; }
    .cf-images { grid-template-columns: 1fr; }
    .cf-drop--square { max-width: 160px; }
    .cf-panel { padding: 16px; }
}

/* ── Einsatzbericht-Editor & gemeinsame Formular-Helfer ── */
.cf-row { display: grid; gap: 16px; }
.cf-row .cf-field + .cf-field { margin-top: 0; }
.cf-row--2  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cf-row--21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cf-seg--2  { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }
.cf input[type="time"], .cf input[type="number"] {
    width: 100%; padding: 10px 12px; background: var(--mis-bg-canvas); color: var(--chr-text);
    border: 1px solid var(--chr-line); border-radius: 0; font-size: 14px; color-scheme: dark;
}
.cf input[type="time"]:focus, .cf input[type="number"]:focus { outline: none; border-color: var(--chr-hot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--chr-hot) 18%, transparent); }
.cf .cf-row input[type="date"] { max-width: none; }
.cf .chr-err { margin-top: 5px; font-size: 12.5px; color: var(--mis-danger); }
.cf-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 13.5px; }
.cf-facts dt { color: var(--chr-faint); font-weight: 600; }
.cf-facts dd { margin: 0; overflow-wrap: anywhere; }
.cf-facts-img { display: block; width: 100%; aspect-ratio: 21 / 8; object-fit: cover; margin-top: 12px; }
.cf .ck.ck-editor { width: 100%; min-width: 0; }
.cf .ck-editor__editable { min-height: 360px; }
/* Breite begrenzen – CKEditor gruppiert überzählige Buttons dann selbst ins „⋮“-Menü (kein flex-wrap!) */
.cf .ck.ck-editor__top, .cf .ck.ck-sticky-panel, .cf .ck.ck-toolbar { max-width: 100%; min-width: 0; }
@media (max-width: 600px) {
    .cf-row--2, .cf-row--21 { grid-template-columns: 1fr; }
}
