/* Dokument-Editor. Die App ist durchgängig Dark/Glass; nur die Seite selbst bleibt bewusst weiß:
   so entspricht die Bildschirmansicht dem Ausdruck und frei gewählte Textfarben bleiben lesbar. */
.doc-editor {
    --ded-header-h: 52px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Menüleiste + Werkzeugleiste als eine schwebende Glasfläche */
.ded-chrome {
    position: sticky;
    top: calc(var(--topbar-height, 46px) + 8px + var(--ded-header-h));
    z-index: 5;
    box-sizing: border-box;
    width: min(100%, 1100px);
    margin: 0 auto 16px;
    padding: 4px 8px;
    border-radius: var(--r-md, 14px);
    background: var(--glass-dark-mid, rgba(18, 18, 26, 0.9));
    backdrop-filter: var(--blur-md, blur(28px));
    -webkit-backdrop-filter: var(--blur-md, blur(28px));
    border: 1px solid var(--rim-side, rgba(255, 255, 255, 0.13));
    box-shadow: var(--shadow-md, 0 4px 16px rgba(0, 0, 0, 0.34));
}

html.arg-standalone .ded-chrome { top: calc(8px + var(--ded-header-h)); }

.ded-menubar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding-bottom: 2px;
}

.ded-menubar + .ded-toolbar {
    border-top: 1px solid var(--rim-side, rgba(255, 255, 255, 0.13));
    padding-top: 4px;
}

.ded-menu-btn .mud-menu-activator,
.ded-menu-btn.mud-menu {
    font-size: 0.82rem;
}

.ded-menu-btn > .mud-menu-activator > button,
.ded-menu-btn > .mud-menu-activator {
    padding: 2px 10px;
    border-radius: var(--r-xs, 6px);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    opacity: 0.9;
}

.ded-menu-btn > .mud-menu-activator:hover {
    background: var(--glass-regular, rgba(255, 255, 255, 0.13));
    opacity: 1;
}

.ded-kbd {
    margin-left: 24px;
    float: right;
    opacity: 0.55;
    font-size: 0.75rem;
}

.ded-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1px;
}

.ded-sep {
    width: 1px;
    height: 20px;
    margin: 0 6px;
    background: var(--rim-side, rgba(255, 255, 255, 0.13));
}

.ded-btn.mud-icon-button {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: var(--r-xs, 6px);
}

.ded-btn.mud-icon-button .mud-icon-root { font-size: 1.15rem; }

.ded-btn--active.mud-icon-button {
    background: var(--c-accent-dim, rgba(74, 158, 255, 0.18));
    color: var(--c-accent, #4a9eff);
}

.ded-select > .mud-menu-activator,
.ded-iconmenu > .mud-menu-activator {
    display: flex;
    align-items: center;
    height: 30px;
    padding: 0 6px;
    border-radius: var(--r-xs, 6px);
    cursor: pointer;
    font-size: 0.82rem;
}

.ded-select > .mud-menu-activator { min-width: 88px; justify-content: space-between; }
.ded-select--wide > .mud-menu-activator { min-width: 124px; }
.ded-select--narrow > .mud-menu-activator { min-width: 40px; justify-content: center; }

.ded-select > .mud-menu-activator:hover,
.ded-iconmenu > .mud-menu-activator:hover {
    background: var(--glass-regular, rgba(255, 255, 255, 0.13));
}

.ded-select__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Arbeitsbereich: optionale Seitenleisten links/rechts, Seite in der Mitte */
.ded-body {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
}

.ded-side {
    box-sizing: border-box;
    flex: 0 0 280px;
    position: sticky;
    top: calc(var(--topbar-height, 46px) + 8px + var(--ded-header-h) + 96px);
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    padding: 12px;
    border-radius: var(--r-md, 14px);
    background: var(--glass-dark-mid, rgba(18, 18, 26, 0.9));
    backdrop-filter: var(--blur-md, blur(28px));
    -webkit-backdrop-filter: var(--blur-md, blur(28px));
    border: 1px solid var(--rim-side, rgba(255, 255, 255, 0.13));
    box-shadow: var(--shadow-md, 0 4px 16px rgba(0, 0, 0, 0.34));
}

@media (max-width: 1280px) {
    .ded-side { display: none; }
}

.doc-canvas {
    display: flex;
    justify-content: center;
    flex: 0 1 auto;
    padding: 0 0 24px;
}

/* Die Seitenfläche ist der ProseMirror-Knoten selbst (Breite/Ränder setzt die Paginierung inline);
   der Wrapper bleibt neutral und scrollt horizontal, wenn die Seite breiter als der Bildschirm ist. */
.ded-page {
    position: relative;
    --ded-gap-color: #1b1d29;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 8px;
}

.ded-page .doc-prose.rm-with-pagination {
    box-sizing: border-box;
    background: #fff;
    color: #000;
    border-radius: 2px;
    box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.42));
    --rm-page-gap-border-color: transparent;
}

.doc-prose {
    outline: none;
    font-family: Arial, sans-serif;
    font-size: 11pt;
    line-height: 1.5;
    word-wrap: break-word;
}

.doc-prose > * + * { margin-top: 0.6em; }
.doc-prose h1 { font-size: 22pt; line-height: 1.25; margin: 0.8em 0 0.3em; }
.doc-prose h2 { font-size: 16pt; line-height: 1.3; margin: 0.8em 0 0.3em; }
.doc-prose h3 { font-size: 13pt; line-height: 1.3; margin: 0.8em 0 0.3em; }
.doc-prose p { margin: 0; min-height: 1.5em; }
.doc-prose ul, .doc-prose ol { padding-left: 1.6em; margin: 0.4em 0; }
.doc-prose blockquote { margin: 0.8em 0; padding: 0.2em 1em; border-left: 3px solid #bdbdbd; color: #424242; }
.doc-prose hr { border: none; border-top: 1px solid #bdbdbd; margin: 1.2em 0; }
.doc-prose a { color: #1565c0; text-decoration: underline; cursor: pointer; }
.doc-prose mark { border-radius: 2px; padding: 0 1px; }

.doc-prose img {
    max-width: 100%;
    height: auto;
}


.doc-prose p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    float: left;
    height: 0;
    color: #9e9e9e;
    pointer-events: none;
}

.doc-prose table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
    margin: 0.8em 0;
    overflow: hidden;
}

.doc-prose td, .doc-prose th {
    position: relative;
    box-sizing: border-box;
    min-width: 1em;
    padding: 4px 8px;
    border: 1px solid #9e9e9e;
    vertical-align: top;
}

.doc-prose th {
    background: #eeeeee;
    font-weight: 600;
    text-align: left;
}

.doc-prose .selectedCell::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(25, 118, 210, 0.18);
    pointer-events: none;
}

.doc-prose .column-resize-handle {
    position: absolute;
    right: -2px;
    top: 0;
    bottom: -2px;
    width: 4px;
    background: #1976d2;
    pointer-events: none;
}

.doc-prose.resize-cursor { cursor: col-resize; }

.doc-swatches {
    display: grid;
    grid-template-columns: repeat(5, 24px);
    gap: 6px;
    padding: 8px 12px;
}

.doc-swatch {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(128, 128, 128, 0.6);
    border-radius: 4px;
    cursor: pointer;
}

@media print {
    body * { visibility: hidden; }
    .ded-page, .ded-page * { visibility: visible; }
    .ded-page {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: none;
        overflow: visible;
        padding: 0;
    }
    /* Seitenränder und -umbrüche setzt der Browser anhand der @page-Regel; die Bildschirm-Seiten entfallen */
    .ded-page .doc-prose.rm-with-pagination {
        width: auto !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none;
        border-radius: 0;
    }
    .rm-pages-wrapper, .rm-page-header, .rm-page-footer, .rm-first-page-header { display: none !important; }
    .ded-comment { background: transparent !important; border: none !important; }
    .ded-search-hit { background: transparent !important; }
}
}

/* Übersicht */
.docs-hero {
    padding: 14px 18px 16px;
}

.docs-new-row {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.docs-new {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
}

.docs-new__page {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    aspect-ratio: 210 / 297;
    border-radius: 4px;
    background: #fff;
    color: var(--c-accent, #4a9eff);
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.3));
    transition: transform var(--dur-med, 230ms) var(--ease-spring, ease), box-shadow var(--dur-med, 230ms) var(--ease-smooth, ease);
}

.docs-new:hover .docs-new__page {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md, 0 4px 16px rgba(0, 0, 0, 0.34));
}

.docs-new:disabled { opacity: 0.6; cursor: default; }
.docs-new__label { font-size: 0.8rem; opacity: 0.85; }

.docs-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.docs-search {
    flex: 0 1 340px;
    min-width: 220px;
}

.docs-filters {
    display: flex;
    gap: 4px;
    padding: 3px;
    border-radius: var(--r-pill, 9999px);
    background: var(--glass-thin, rgba(255, 255, 255, 0.09));
    border: 1px solid var(--rim-side, rgba(255, 255, 255, 0.13));
}

.docs-filter {
    padding: 5px 14px;
    border: none;
    border-radius: var(--r-pill, 9999px);
    background: transparent;
    color: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    opacity: 0.8;
    transition: background var(--dur-fast, 130ms) ease, opacity var(--dur-fast, 130ms) ease;
}

.docs-filter:hover { opacity: 1; background: var(--glass-regular, rgba(255, 255, 255, 0.13)); }

.docs-filter--active,
.docs-filter--active:hover {
    opacity: 1;
    background: var(--c-accent-dim, rgba(74, 158, 255, 0.18));
    color: var(--c-accent, #4a9eff);
}

.docs-count { margin-left: 4px; opacity: 0.7; font-variant-numeric: tabular-nums; }

.docs-sort > .mud-menu-activator {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--r-xs, 6px);
    font-size: 0.82rem;
    cursor: pointer;
}

.docs-sort > .mud-menu-activator:hover { background: var(--glass-regular, rgba(255, 255, 255, 0.13)); }

.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
}

.doc-tile {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    overflow: hidden;
}

.doc-tile__thumb {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 14px 14px 0;
    background: rgba(0, 0, 0, 0.18);
}

/* Miniatur im Seitenverhältnis A4; der Text läuft nach unten aus und wird abgeschnitten wie eine echte Seite */
.doc-tile__sheet {
    box-sizing: border-box;
    width: 100%;
    max-width: 170px;
    height: 200px;
    padding: 12px 12px 0;
    overflow: hidden;
    background: #fff;
    color: #424242;
    font-size: 0.6rem;
    line-height: 1.45;
    border-radius: 3px 3px 0 0;
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.3));
}

.doc-tile__badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 1px 8px;
    border-radius: var(--r-pill, 9999px);
    font-size: 0.65rem;
    background: var(--glass-dark, rgba(10, 10, 16, 0.82));
    border: 1px solid var(--rim-side, rgba(255, 255, 255, 0.13));
}

.doc-tile__footer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 6px 10px 12px;
}

.doc-tile__icon { margin-top: 2px; flex: 0 0 auto; }
.doc-tile__text { min-width: 0; flex: 1; }

.doc-tile__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-tile__sub { opacity: 0.65; }

/* Listenansicht */
.docs-list { overflow: hidden; }

.docs-list__row {
    display: grid;
    grid-template-columns: minmax(180px, 3fr) 110px minmax(120px, 2fr) 150px 44px;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--rim-side, rgba(255, 255, 255, 0.08));
}

.docs-list__row:last-child { border-bottom: none; }
.docs-list__row:hover { background: var(--glass-thin, rgba(255, 255, 255, 0.09)); }

.docs-list__row--head {
    cursor: default;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.65;
}

.docs-list__row--head:hover { background: transparent; }

.docs-list__title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .docs-list__row { grid-template-columns: minmax(120px, 1fr) 44px; }
    .docs-list__row > span:nth-child(2),
    .docs-list__row > span:nth-child(3),
    .docs-list__row > span:nth-child(4) { display: none; }
}

/* Kopfzeile des Editors */
.ded-header {
    position: sticky;
    top: calc(var(--topbar-height, 46px) + 8px);
    z-index: 6;
    box-sizing: border-box;
    height: var(--ded-header-h);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 24px;
}

html.arg-standalone .ded-header { top: 8px; }

.ded-header__spacer { flex: 1; }

.ded-title {
    flex: 0 1 560px;
    min-width: 160px;
}

.ded-title .mud-input-slot,
.ded-title input {
    font-size: 1.25rem;
    font-weight: 500;
}

.ded-status {
    opacity: 0.75;
    white-space: nowrap;
}

/* Suchtreffer, Kommentar-Anker, Inhaltsverzeichnis */
.ded-search-hit {
    background: rgba(255, 152, 0, 0.45);
    border-radius: 2px;
}

.ded-comment {
    background: rgba(255, 213, 79, 0.4);
    border-bottom: 2px solid rgba(255, 179, 0, 0.8);
    cursor: pointer;
}

.doc-prose [data-toc] {
    margin: 0.8em 0;
    padding: 0.4em 1em;
    border-left: 3px solid #1976d2;
    background: #f5f8fc;
}

.doc-prose [data-toc] ul { margin: 0.2em 0; }
.doc-prose [data-toc] li p { min-height: 0; }

/* Suchleiste */
.ded-findbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 6px 4px 2px;
    border-top: 1px solid var(--rim-side, rgba(255, 255, 255, 0.13));
    margin-top: 4px;
}

.ded-findbar .mud-input-control { max-width: 220px; }
.ded-findbar__count { font-size: 0.8rem; opacity: 0.75; min-width: 64px; text-align: center; }

/* Kommentar-Panel */
.dcp { display: flex; flex-direction: column; gap: 10px; }
.dcp__head { display: flex; align-items: center; }
.dcp__switch { margin-left: -4px; }

.dcp__thread {
    padding: 10px 12px;
    border-radius: var(--r-sm, 10px);
    background: var(--glass-thin, rgba(255, 255, 255, 0.09));
    border: 1px solid var(--rim-side, rgba(255, 255, 255, 0.13));
    cursor: pointer;
}

.dcp__thread--active { border-color: var(--c-accent, #4a9eff); background: var(--c-accent-dim, rgba(74, 158, 255, 0.18)); }
.dcp__thread--resolved { opacity: 0.6; }

.dcp__quote {
    margin-bottom: 6px;
    padding-left: 8px;
    border-left: 3px solid rgba(255, 193, 7, 0.8);
    font-size: 0.78rem;
    opacity: 0.8;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.dcp__composer { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm, 10px); background: var(--glass-regular, rgba(255, 255, 255, 0.13)); }
.dcp__meta { display: flex; justify-content: space-between; gap: 8px; font-size: 0.75rem; opacity: 0.8; }
.dcp__text { font-size: 0.85rem; white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.dcp__reply { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--rim-side, rgba(255, 255, 255, 0.2)); }
.dcp__reply-box { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.dcp__actions { display: flex; gap: 4px; margin-top: 4px; }
.dcp__link { padding: 0; min-width: 0; font-size: 0.72rem; opacity: 0.7; }

.dgl { display: flex; flex-direction: column; gap: 2px; }
.dgl__title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.65; margin-bottom: 6px; }
.dgl__item {
    padding: 4px 8px;
    border: none;
    border-radius: var(--r-xs, 6px);
    background: transparent;
    color: inherit;
    text-align: left;
    font-size: 0.82rem;
    cursor: pointer;
}
.dgl__item:hover { background: var(--glass-regular, rgba(255, 255, 255, 0.13)); }
.dgl__item--l2 { padding-left: 20px; }
.dgl__item--l3 { padding-left: 32px; opacity: 0.85; }
.dgl__item--selected,
.dgl__item--selected:hover { background: var(--c-accent-dim, rgba(74, 158, 255, 0.18)); color: var(--c-accent, #4a9eff); }

/* Ordner in der Übersicht, Breadcrumbs, Vorlagenreihe */
.docs-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 0.9rem; }
.docs-crumb { padding: 2px 8px; border: none; border-radius: var(--r-xs, 6px); background: transparent; color: inherit; cursor: pointer; }
.docs-crumb:hover { background: var(--glass-regular, rgba(255, 255, 255, 0.13)); }
.docs-crumb--current { font-weight: 600; cursor: default; }
.docs-crumb--current:hover { background: transparent; }

.docs-folder {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 6px 10px 14px;
    cursor: pointer;
}

.docs-folder__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }

.docs-star { position: absolute; top: 6px; left: 8px; color: #ffc107; font-size: 1rem; }

/* Bilder als Figure-Block: Ausrichtung, Umfluss (nur seitenlos/Druck), freie Position, Unterschrift */
.doc-prose figure.ded-fig {
    position: relative;
    margin: 0.6em 0;
    max-width: 100%;
    box-sizing: border-box;
}

.doc-prose figure.ded-fig img { cursor: grab; max-width: 100%; }
.doc-prose figure.ded-fig--free-behind img,
.doc-prose figure.ded-fig--free-front img { cursor: move; }

.ded-fig--left, .ded-fig--wrap-left { margin-left: 0 !important; margin-right: auto !important; }
.ded-fig--center { margin-left: auto !important; margin-right: auto !important; }
.ded-fig--right, .ded-fig--wrap-right { margin-left: auto !important; margin-right: 0 !important; }

/* Textumfluss braucht einen durchgehenden Textfluss: mit Seiten-Paginierung bleibt es bei der Ausrichtung als Block */
.doc-prose:not(.rm-with-pagination) .ded-fig--wrap-left { float: left; margin: 4px 16px 8px 0 !important; }
.doc-prose:not(.rm-with-pagination) .ded-fig--wrap-right { float: right; margin: 4px 0 8px 16px !important; }

/* frei: aus dem Textfluss genommen, die Verschiebung (dx/dy) steht als Margin am Element */
.doc-prose figure.ded-fig--free-behind,
.doc-prose figure.ded-fig--free-front { position: absolute; margin-right: 0; }
.doc-prose figure.ded-fig--free-behind { z-index: -1; }
.doc-prose figure.ded-fig--free-front { z-index: 3; }

/* eigener Stacking-Kontext, damit "hinter dem Text" hinter dem Text, aber vor dem weißen Seitenhintergrund liegt */
.doc-prose { isolation: isolate; }

.ded-fig__cap {
    margin-top: 4px;
    padding: 0 4px;
    text-align: center;
    font-size: 9pt;
    color: #555;
    outline: none;
    min-height: 1.2em;
}

.ded-fig__cap:empty::before { content: attr(data-placeholder); color: #9e9e9e; }

/* seitenloser Modus */
.ded-page .doc-prose.ded-pageless {
    box-sizing: border-box;
    width: min(100%, 794px);
    min-height: 1123px;
    padding: 72px 80px;
    background: #fff;
    color: #000;
    border-radius: 2px;
    box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.42));
}

@media (max-width: 900px) {
    .ded-page .doc-prose.ded-pageless { padding: 32px 24px; min-height: 60vh; }
}

@media print {
    .ded-fig--wrap-left { float: left; margin: 4px 16px 8px 0 !important; }
    .ded-fig--wrap-right { float: right; margin: 4px 0 8px 16px !important; }
    .ded-page .doc-prose.ded-pageless { width: auto; padding: 0; min-height: 0; box-shadow: none; border-radius: 0; }
}

.ded-img-box {
    position: absolute;
    display: none;
    z-index: 3;
    box-sizing: border-box;
    border: 2px solid var(--c-accent, #4a9eff);
    pointer-events: none;
}

.ded-img-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    box-sizing: border-box;
    background: #fff;
    border: 2px solid var(--c-accent, #4a9eff);
    border-radius: 3px;
    pointer-events: auto;
}

.ded-img-grip {
    position: absolute;
    display: none;
    top: -26px;
    left: 50%;
    width: 24px;
    height: 24px;
    margin-left: -12px;
    border-radius: 50%;
    background: var(--c-accent, #4a9eff);
    cursor: move;
    pointer-events: auto;
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.3));
}

.ded-img-grip::before {
    content: "\2725";
    display: block;
    color: #fff;
    font-size: 15px;
    line-height: 24px;
    text-align: center;
}

.ded-img-handle--nw { left: -7px; top: -7px; cursor: nwse-resize; }
.ded-img-handle--ne { right: -7px; top: -7px; cursor: nesw-resize; }
.ded-img-handle--sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.ded-img-handle--se { right: -7px; bottom: -7px; cursor: nwse-resize; }

@media print { .ded-img-box { display: none !important; } }

/* Bild-Werkzeugleiste (zweite Zeile, nur bei markiertem Bild) */
.ded-toolbar--image {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--rim-side, rgba(255, 255, 255, 0.13));
}

.ded-toolbar__label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.65; margin: 0 8px 0 4px; }

.ded-imgbtn {
    padding: 3px 10px;
    border: none;
    border-radius: var(--r-xs, 6px);
    background: transparent;
    color: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}

.ded-imgbtn:hover:not(:disabled) { background: var(--glass-regular, rgba(255, 255, 255, 0.13)); }
.ded-imgbtn:disabled { opacity: 0.4; cursor: not-allowed; }
.ded-imgbtn--active, .ded-imgbtn--active:hover:not(:disabled) { background: var(--c-accent-dim, rgba(74, 158, 255, 0.18)); color: var(--c-accent, #4a9eff); }

/* Abstände: Menüleiste und Werkzeugleiste luftiger */
.ded-menubar { gap: 6px; padding: 2px 4px 6px; }

.ded-menubar .mud-menu-activator {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: var(--r-xs, 6px);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    opacity: 0.92;
}

.ded-menubar .mud-menu-activator:hover { background: var(--glass-regular, rgba(255, 255, 255, 0.13)); opacity: 1; }

.ded-toolbar { gap: 3px; padding: 2px 4px; }
.ded-sep { margin: 0 10px; height: 22px; }
.ded-select > .mud-menu-activator, .ded-iconmenu > .mud-menu-activator { padding: 0 10px; }
.ded-btn.mud-icon-button { width: 32px; height: 32px; }

/* Listen: Platz für mehrstellige Nummern; Zeichen/Nummern folgen der Schrift des Eintrags (Variablen setzt ListMarkerStyle) */
.doc-prose ul, .doc-prose ol { padding-left: 2.4em; }
.doc-prose li { --ded-ms: initial; --ded-mf: initial; }
.doc-prose li::marker { font-size: var(--ded-ms, 1em); font-family: var(--ded-mf, inherit); }

/* Überschriften landen beim Springen unterhalb der schwebenden Leiste */
.doc-prose h1, .doc-prose h2, .doc-prose h3 { scroll-margin-top: 190px; }

/* Seitenumbruch */
.ded-page-break {
    position: relative;
    margin: 0;
    padding: 0;
    border-top: 1px dashed rgba(0, 0, 0, 0.35);
    cursor: default;
}

.ded-page-break__label {
    position: absolute;
    right: 0;
    top: 2px;
    font-size: 0.65rem;
    color: #9e9e9e;
    pointer-events: none;
}

.ded-page-break.ProseMirror-selectednode { border-top-color: var(--c-accent, #4a9eff); }

/* Inhaltsverzeichnis: Einträge sind Sprungziele (Lesemodus: Klick, Bearbeiten: Strg+Klick) */
.doc-prose [data-toc] li > p { cursor: pointer; }
.doc-prose [data-toc] li > p:hover { text-decoration: underline; }

@media print {
    .ded-page-break { break-after: page; height: 0 !important; border: none; }
    .ded-page-break__label { display: none; }
}

/* Bilder in Kopf-/Fußzeile müssen in den Seitenrand passen, sonst schneidet die Seite sie ab */
.ded-hf-img {
    max-width: 100%;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}

/* Die Klasse sitzt je nach Ansicht auf der Tabelle (gespeichert) oder auf ihrem Wrapper (Editor) */
.doc-prose .ded-zebra tr:nth-child(even) td,
.doc-prose table.ded-zebra tr:nth-child(even) td {
    background: #f3f4f6;
}
@media print {
    .doc-prose .ded-zebra tr:nth-child(even) td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
