/* Dokument-Ansicht der Seiten-Bearbeitung (/Instance/Blocklayout, Modus „Dokument").
   Bewusst globale Datei statt Scoped-CSS — alle Selektoren unter .doc-root, kollisionsfrei. */

.doc-root {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 48px 64px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #2d2d2d;
    line-height: 1.6;
}

/* ── Abschnitts-Header (Blockgruppe) ─────────────────────────────────────── */

.doc-root .doc-section {
    padding: 10px 0 18px;
}

.doc-root .doc-section + .doc-section {
    border-top: 1px solid rgba(0, 0, 0, .06);
}

.doc-root .doc-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, .38);
    margin-bottom: 10px;
    min-height: 30px;
}

.doc-root .doc-section-actions {
    display: inline-flex;
    align-items: center;
    opacity: 0;
    transition: opacity .15s ease;
}

.doc-root .doc-section-header:hover .doc-section-actions {
    opacity: 1;
}

.doc-root .doc-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    flex: 0 0 auto;
}

.doc-root .doc-dot-on { background: #2e7d32; }
.doc-root .doc-dot-off { background: #bdbdbd; }
.doc-root .doc-dot-undef { background: #ef6c00; }

.doc-root .doc-disabled-hint,
.doc-root .doc-missing-hint {
    font-size: .8rem;
    color: rgba(0, 0, 0, .35);
    font-style: italic;
    padding: 2px 0 6px;
}

.doc-root .doc-missing-hint {
    color: #b26a00;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Typografie-Rollen ───────────────────────────────────────────────────── */

.doc-root .doc-kicker {
    font-size: .8rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, .45);
    margin: 4px 0;
}

.doc-root .doc-title {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 4px 0 10px;
}

.doc-root .doc-lead {
    font-size: 1.12rem;
    color: rgba(0, 0, 0, .72);
    margin: 4px 0 10px;
}

.doc-root .doc-heading {
    font-size: 1.4rem;
    font-weight: 650;
    margin: 14px 0 6px;
}

.doc-root .doc-subheading {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 10px 0 4px;
}

.doc-root .doc-body {
    margin: 6px 0;
}

/* HTML-Inhalte in Textrollen: mitgebrachte Abstände zaehmen */
.doc-root .doc-body p:first-child,
.doc-root .doc-benefit p:first-child { margin-top: 0; }
.doc-root .doc-body p:last-child,
.doc-root .doc-benefit p:last-child { margin-bottom: 0; }

.doc-root .doc-benefit {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 3px 0;
}

.doc-root .doc-benefit-check {
    color: #2e7d32;
    font-weight: 700;
    flex: 0 0 auto;
}

.doc-root .doc-cta {
    display: inline-block;
    margin: 10px 12px 10px 0;
}

.doc-root .doc-cta-chip {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 4px;
    background: #eceff1;
    border: 1px solid rgba(0, 0, 0, .12);
    font-weight: 600;
    font-size: .9rem;
    letter-spacing: .02em;
}

/* Bilder: begrenzte Hoehe, natuerliche Breite — mehrere fliessen nebeneinander
   (Badges/Siegel), statt als Riesenbilder untereinander zu stapeln. */
.doc-root .doc-media {
    display: inline-block;
    vertical-align: top;
    margin: 8px 12px 8px 0;
    max-width: 100%;
}

.doc-root .doc-media img {
    max-width: 100%;
    max-height: 220px;
    width: auto;
    height: auto;
    border-radius: 6px;
    display: block;
}

.doc-root .doc-gallery { margin: 12px 0; }

.doc-root .doc-gallery-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.doc-root .doc-gallery-url {
    font-family: ui-monospace, Consolas, monospace;
    font-size: .78rem;
    color: rgba(0, 0, 0, .4);
}

/* Leerer Block: dezenter Geister-Platzhalter statt "(leer)"-Zeile */
.doc-root .doc-ghost {
    display: inline-block;
    font-size: .76rem;
    font-style: italic;
    color: rgba(0, 0, 0, .32);
    border: 1px dashed rgba(0, 0, 0, .15);
    border-radius: 4px;
    padding: 1px 8px;
    font-family: ui-monospace, Consolas, monospace;
}

.doc-root .doc-card {
    margin: 10px 0;
    padding: 10px 14px;
    background: rgba(0, 0, 0, .025);
    border-radius: 6px;
    font-size: .9rem;
}

/* ── Meta-Chips (technische Blöcke) ──────────────────────────────────────── */

.doc-root .doc-meta {
    display: inline-block;
    margin: 3px 8px 3px 0;
    max-width: 100%;
}

.doc-root .doc-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .035);
    font-size: .78rem;
    color: rgba(0, 0, 0, .6);
    max-width: 100%;
}

.doc-root .doc-meta-name {
    font-family: ui-monospace, Consolas, monospace;
    color: rgba(0, 0, 0, .5);
    flex: 0 0 auto;
}

.doc-root .doc-meta-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-root .doc-meta-unknown { opacity: .7; }

/* ── Interaktion ─────────────────────────────────────────────────────────── */

.doc-root .doc-clickable {
    cursor: text;
    border-radius: 4px;
    transition: background .12s ease;
}

.doc-root .doc-clickable:hover {
    background: rgba(25, 118, 210, .05);
    outline: 1px dashed rgba(25, 118, 210, .25);
    outline-offset: 2px;
}

.doc-root .doc-locked { cursor: default; }

.doc-root .doc-editing { position: relative; }

/* Das Inline-Textfeld erbt die Typografie seiner Rolle vollstaendig. */
.doc-root .doc-inline-edit {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    line-height: inherit;
    width: 100%;
    border: none;
    outline: 2px solid rgba(25, 118, 210, .35);
    outline-offset: 2px;
    border-radius: 4px;
    background: rgba(25, 118, 210, .04);
    resize: vertical;
    padding: 0;
    margin: 0;
    field-sizing: content;
    min-height: 1.4em;
}

.doc-root .doc-editor-frame {
    margin: 8px 0;
    padding: 12px;
    border: 1px solid rgba(25, 118, 210, .3);
    border-radius: 8px;
    background: #fafcff;
}

.doc-root .doc-tech-panel {
    margin-top: 28px;
    opacity: .85;
}

/* ── Blockgruppen-Editoren: Grundelemente ────────────────────────────────── */

.doc-root .tb-varianten {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.doc-root .tb-kopfzeilen {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Eingabe in Ziel-Typografie: unscheinbar bis zum Hover/Fokus */
.doc-root input.tb-typo-kicker,
.doc-root input.tb-typo-titel,
.doc-root input.tb-typo-untertitel,
.doc-root input.tb-typo-zwischenzeile,
.doc-root input.tb-typo-body {
    width: 100%;
    border: 1px dashed transparent;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    padding: 4px 8px;
    font-family: inherit;
}

.doc-root input.tb-typo-kicker:hover,
.doc-root input.tb-typo-titel:hover,
.doc-root input.tb-typo-untertitel:hover,
.doc-root input.tb-typo-zwischenzeile:hover,
.doc-root input.tb-typo-body:hover {
    border-color: rgba(0, 0, 0, .18);
}

.doc-root input.tb-typo-kicker:focus,
.doc-root input.tb-typo-titel:focus,
.doc-root input.tb-typo-untertitel:focus,
.doc-root input.tb-typo-zwischenzeile:focus,
.doc-root input.tb-typo-body:focus {
    outline: 2px solid rgba(25, 118, 210, .45);
    outline-offset: 1px;
    background: rgba(25, 118, 210, .04);
}

.doc-root input.tb-typo-kicker {
    font-size: .8rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, .45);
}

.doc-root input.tb-typo-titel {
    font-size: 1.7rem;
    font-weight: 700;
}

.doc-root input.tb-typo-untertitel {
    font-size: 1.08rem;
    color: rgba(0, 0, 0, .65);
}

.doc-root input.tb-typo-zwischenzeile {
    font-size: .95rem;
    font-weight: 600;
    margin-top: 10px;
}

/* CTA buttonig: Knopf-Text direkt im Button tippen */
.doc-root .tb-cta-zeile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 4px;
    flex-wrap: wrap;
}

.doc-root input.tb-cta-knopf {
    width: 200px;
    text-align: center;
    font-weight: 650;
    font-size: .92rem;
    color: #fff;
    background: #1a66b8;
    border: none;
    border-radius: 6px;
    padding: 10px 14px;
    font-family: inherit;
    cursor: text;
}

.doc-root input.tb-cta-knopf:focus {
    outline: 2px solid rgba(0, 0, 0, .55);
    outline-offset: 2px;
}

.doc-root input.tb-cta-knopf::placeholder {
    color: rgba(255, 255, 255, .7);
    font-style: italic;
}

.doc-root .tb-cta-ziel-etikett {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .78rem;
    font-family: ui-monospace, Consolas, monospace;
    color: rgba(0, 0, 0, .45);
    border: 1px dashed rgba(0, 0, 0, .18);
    border-radius: 999px;
    padding: 3px 10px;
    cursor: pointer;
}

.doc-root .tb-cta-ziel-etikett:hover {
    color: #1a66b8;
    border-color: #1a66b8;
}

/* Bild-Serie als Kachel-Raster */
.doc-root .tb-bildserie {
    margin-top: 12px;
}

/* Serie nutzt die volle Breite: alle Kacheln teilen sich die Zeile gleichmäßig */
.doc-root .tb-bildserie-raster {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.doc-root .tb-bildserie-slot {
    flex: 1 1 0;
    min-width: 0;
}

.doc-root .tb-bildserie-slot img {
    max-width: 100%;
    max-height: 72px;
    width: auto;
    height: auto;
    margin: 0 auto;
    display: block;
}

.doc-root .tb-bildserie-slot .mud-button {
    min-width: 0;
    padding: 2px 6px;
    font-size: .62rem;
}

/* Kachel-Kompaktheit: Download-Knopf und Dateinamen-Zeile der eingebetteten
   Bild-Komponente sind im Serien-Raster nur Rauschen. */
.doc-root .tb-bildserie-slot .mud-icon-button {
    display: none;
}

.doc-root .tb-bildserie-slot div[style*="overflow: auto"] {
    display: none;
}

.doc-root .tb-abschnitt {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Repeater: Karten-Raster mit Hover-Löschen */
.doc-root .tb-repeater {
    margin-top: 14px;
}

.doc-root .tb-repeater-raster {
    display: grid;
    gap: 14px;
}

@media (max-width: 900px) {
    .doc-root .tb-repeater-raster {
        grid-template-columns: 1fr !important;
    }
}

.doc-root .tb-repeater-karte {
    position: relative;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    min-width: 0;
}

.doc-root .tb-karte-loeschen {
    position: absolute;
    top: 6px;
    right: 6px;
    border: none;
    background: none;
    color: rgba(0, 0, 0, .35);
    font-size: .85rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity .12s ease;
    z-index: 2;
}

.doc-root .tb-repeater-karte:hover .tb-karte-loeschen {
    opacity: 1;
}

.doc-root .tb-karte-loeschen:hover {
    color: #b3261e;
}

.doc-root .tb-repeater-fuss {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

/* Benefit-Überschrift: Versalien, kompakt */
.doc-root input.tb-typo-benefit {
    width: 100%;
    border: 1px dashed transparent;
    border-radius: 5px;
    background: transparent;
    color: inherit;
    padding: 3px 6px;
    font-family: inherit;
    font-size: .84rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.doc-root input.tb-typo-benefit:hover {
    border-color: rgba(0, 0, 0, .18);
}

.doc-root input.tb-typo-benefit:focus {
    outline: 2px solid rgba(25, 118, 210, .45);
    outline-offset: 1px;
}

/* Text-Abschnitt */
.doc-root .tb-textabschnitt {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.doc-root input.tb-typo-abschnitt {
    width: 100%;
    border: 1px dashed transparent;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    padding: 4px 8px;
    font-family: inherit;
    font-size: 1.18rem;
    font-weight: 650;
}

.doc-root input.tb-typo-abschnitt:hover {
    border-color: rgba(0, 0, 0, .18);
}

.doc-root input.tb-typo-abschnitt:focus {
    outline: 2px solid rgba(25, 118, 210, .45);
    outline-offset: 1px;
    background: rgba(25, 118, 210, .04);
}

.doc-root input.tb-galerie-feld {
    display: block;
    margin-bottom: 2px;
}

/* Telefon-Eingabe: das innere Eingabe-Papier der eingebetteten Komponente dehnt sich
   nicht von selbst — Mindestbreite erzwingen, damit die Rufnummer sichtbar ist. */
.doc-root .tb-telefonzeile .mud-paper {
    flex: 1 1 auto !important;
    min-width: 420px;
}

.doc-root .tb-telefonzeile {
    width: 100%;
}

/* Leichte Bild-Kachel (Auswahl lädt erst beim Klick) */
.doc-root .tb-bildslot-kachel {
    cursor: pointer;
    border-radius: 6px;
    padding: 2px;
}

.doc-root .tb-bildslot-kachel:hover {
    outline: 1px dashed rgba(25, 118, 210, .35);
    outline-offset: 2px;
}

.doc-root .tb-bildslot-kachel img {
    max-width: 100%;
    max-height: 80px;
    width: auto;
    height: auto;
    display: block;
    border-radius: 4px;
}

.doc-root .tb-bildslot-leer {
    border: 1px dashed rgba(0, 0, 0, .2);
    border-radius: 6px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, .35);
    font-size: .78rem;
}

.doc-root input.tb-typo-frage {
    width: 100%;
    border: 1px dashed transparent;
    border-radius: 5px;
    background: transparent;
    color: inherit;
    padding: 3px 6px;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 650;
}

.doc-root input.tb-typo-frage:hover {
    border-color: rgba(0, 0, 0, .18);
}

.doc-root input.tb-typo-frage:focus {
    outline: 2px solid rgba(25, 118, 210, .45);
    outline-offset: 1px;
}

/* Zugeklappte HTML-Vorschau (Klick öffnet TinyMCE) */
.doc-root .tb-html-vorschau {
    margin-top: 8px;
    font-size: .88rem;
    line-height: 1.5;
    cursor: text;
    border-radius: 6px;
    padding: 4px 6px;
    max-height: 180px;
    overflow: hidden;
}

.doc-root .tb-html-vorschau:hover {
    background: rgba(25, 118, 210, .05);
    outline: 1px dashed rgba(25, 118, 210, .25);
}

.doc-root .tb-html-vorschau p:first-child { margin-top: 0; }
.doc-root .tb-html-vorschau p:last-child { margin-bottom: 0; }
