* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f7fa;
    color: #111827;
}

/* =========================================================
   LEXCRAFT STARTSEITE
   Eigenständige Präsentations- und Anmeldeebene. Die
   bestehende Arbeitsoberfläche bleibt darunter unverändert.
   ========================================================= */

.startup-screen {
    --startup-navy: #06182f;
    --startup-blue: #0b2b4d;
    --startup-teal: #20c6b4;
    position: fixed;
    inset: 0;
    z-index: 50000;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: auto;
    color: #f8fbff;
    background:
        radial-gradient(
            circle at 16% 15%,
            rgba(31, 198, 180, .17),
            transparent 31rem
        ),
        radial-gradient(
            circle at 84% 82%,
            rgba(37, 99, 235, .16),
            transparent 34rem
        ),
        linear-gradient(
            145deg,
            var(--startup-navy) 0%,
            var(--startup-blue) 54%,
            #071a32 100%
        );
    font-family:
        Inter,
        "SF Pro Display",
        "Segoe UI",
        Arial,
        sans-serif;
    isolation: isolate;
}

.startup-screen::after {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(
            118deg,
            transparent 25%,
            rgba(255, 255, 255, .035) 48%,
            transparent 70%
        );
    content: "";
    pointer-events: none;
}

.startup-screen-pattern {
    position: fixed;
    inset: 0;
    z-index: -2;
    opacity: 0;
    background-image:
        linear-gradient(
            rgba(255, 255, 255, .035) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, .035) 1px,
            transparent 1px
        );
    background-size: 58px 58px;
    mask-image:
        radial-gradient(
            circle at center,
            black,
            transparent 78%
        );
    -webkit-mask-image:
        radial-gradient(
            circle at center,
            black,
            transparent 78%
        );
    pointer-events: none;
    animation:
        startup-pattern-arrival
        .52s
        ease-out
        .04s
        both;
}

.startup-stage {
    position: relative;
    width: min(100%, 520px);
    min-height: 680px;
    min-height: max(680px, 100dvh);
    margin: 0 auto;
}

.startup-brand {
    position: absolute;
    top: 50%;
    left: 50%;
    width: max-content;
    text-align: center;
    opacity: 0;
    transform: translate(-50%, -50%);
    animation:
        startup-brand-intro
        1.48s
        cubic-bezier(.22, .72, .24, 1)
        .05s
        both;
}

.startup-brand::after {
    position: absolute;
    bottom: -24px;
    left: 50%;
    width: 154px;
    height: 1px;
    opacity: 0;
    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(32, 198, 180, .95) 50%,
            transparent
        );
    content: "";
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    animation:
        startup-precision-line
        .58s
        cubic-bezier(.2, .75, .25, 1)
        .34s
        both;
}

.startup-wordmark {
    margin: 0;
    opacity: 0;
    font-size: clamp(48px, 7vw, 68px);
    font-weight: 760;
    line-height: .94;
    letter-spacing: -.055em;
    text-shadow: 0 14px 36px rgba(0, 0, 0, .24);
    clip-path: inset(0 100% 0 0);
    animation:
        startup-wordmark-reveal
        .88s
        cubic-bezier(.2, .78, .25, 1)
        .12s
        both;
}

.startup-wordmark-lex {
    color: #f7fbff;
}

.startup-wordmark-craft {
    color: var(--startup-teal);
}

.startup-brand p {
    margin: 14px 0 0;
    opacity: 0;
    color: rgba(232, 242, 250, .66);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .28em;
    text-transform: uppercase;
    transform: translateY(5px);
    animation:
        startup-tagline-reveal
        .42s
        ease-out
        .56s
        both;
}

.startup-login-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(438px, calc(100vw - 32px));
    padding: 34px 36px 28px;
    overflow: hidden;
    visibility: hidden;
    color: #14243a;
    background: rgba(251, 252, 250, .97);
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 22px;
    box-shadow:
        0 34px 90px rgba(0, 8, 22, .34),
        0 8px 26px rgba(0, 8, 22, .16),
        inset 0 1px 0 rgba(255, 255, 255, .92);
    opacity: 0;
    transform:
        translate(-50%, calc(-50% + 14px));
    animation:
        startup-card-reveal
        .76s
        cubic-bezier(.2, .78, .25, 1)
        1.32s
        both;
}

.startup-card-accent {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background:
        linear-gradient(
            90deg,
            transparent,
            var(--startup-teal),
            transparent
        );
    opacity: .9;
    transform: scaleX(0);
    transform-origin: center;
    animation:
        startup-card-accent-reveal
        .58s
        cubic-bezier(.2, .78, .25, 1)
        1.58s
        both;
}

.startup-card-wordmark {
    margin-bottom: 20px;
    color: #10223a;
    font-size: 20px;
    font-weight: 760;
    line-height: 1;
    letter-spacing: -.045em;
}

.startup-card-wordmark strong {
    color: #0da495;
    font-weight: inherit;
}

.startup-card-wordmark,
.startup-login-heading,
.startup-form,
.startup-login-footer {
    opacity: 0;
    transform: translateY(6px);
    animation:
        startup-card-content-reveal
        .44s
        cubic-bezier(.2, .72, .25, 1)
        both;
}

.startup-card-wordmark {
    animation-delay: 1.58s;
}

.startup-login-heading {
    animation-delay: 1.65s;
}

.startup-form {
    animation-delay: 1.74s;
}

.startup-login-footer {
    animation-delay: 1.83s;
}

.startup-login-heading > span {
    display: block;
    margin-bottom: 9px;
    color: #0b8d82;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.startup-login-heading h2 {
    margin: 0;
    color: #10223a;
    font-size: 28px;
    font-weight: 740;
    line-height: 1.15;
    letter-spacing: -.035em;
}

.startup-login-heading p {
    margin: 10px 0 25px;
    color: #647184;
    font-size: 14px;
    line-height: 1.55;
}

.startup-form {
    display: grid;
    gap: 9px;
}

.startup-form-fields {
    display: grid;
    gap: 9px;
}

.startup-form-fields[hidden] {
    display: none;
}

.startup-form label {
    margin-top: 4px;
    color: #34445a;
    font-size: 12px;
    font-weight: 720;
}

.startup-form input {
    width: 100%;
    height: 52px;
    padding: 0 15px;
    color: #15263d;
    background: #f7f9fa;
    border: 1px solid #d9e0e6;
    border-radius: 10px;
    outline: none;
    font-family: inherit;
    font-size: 15px;
    transition:
        background-color .16s ease,
        border-color .16s ease,
        box-shadow .16s ease;
}

.startup-form input::placeholder {
    color: #9aa5b2;
}

.startup-form input:hover {
    border-color: #bec9d2;
}

.startup-form input:focus {
    background: #fff;
    border-color: #16a99b;
    box-shadow: 0 0 0 4px rgba(22, 169, 155, .12);
}

.startup-login-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 52px;
    margin-top: 11px;
    padding: 0 17px 0 19px;
    color: #fff;
    background:
        linear-gradient(
            135deg,
            #18bbaa,
            #0c978c
        );
    border: 0;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(12, 151, 140, .22);
    font-family: inherit;
    font-size: 14px;
    font-weight: 760;
    letter-spacing: .005em;
    transition:
        box-shadow .18s ease,
        transform .18s ease,
        filter .18s ease;
}

.startup-login-button:hover {
    box-shadow: 0 14px 30px rgba(12, 151, 140, .29);
    filter: brightness(1.035);
    transform: translateY(-1px);
}

.startup-login-button:focus-visible {
    outline: 3px solid rgba(32, 198, 180, .28);
    outline-offset: 3px;
}

.startup-login-button:disabled {
    cursor: wait;
    filter: saturate(.7);
    transform: none;
}

.startup-login-status {
    min-height: 1.35rem;
    margin: 0;
    color: rgba(225, 235, 246, 0.78);
    font-size: 0.76rem;
    line-height: 1.45;
}

.startup-login-status.is-error {
    color: #ffd0d0;
}

.startup-login-status.is-local {
    color: rgba(160, 231, 220, 0.92);
}

.startup-login-status.is-success {
    color: #08786f;
}

.startup-login-button-arrow {
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    transition: transform .18s ease;
}

.startup-login-button:hover
.startup-login-button-arrow {
    transform: translateX(3px);
}

.startup-login-footer {
    margin: 22px 0 0;
    color: #8a95a3;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-align: center;
}

.startup-screen.is-leaving {
    pointer-events: none;
    animation:
        startup-screen-exit
        .46s
        cubic-bezier(.4, 0, .2, 1)
        forwards;
}

@keyframes startup-pattern-arrival {
    from {
        opacity: .1;
    }

    to {
        opacity: .22;
    }
}

@keyframes startup-brand-intro {
    0% {
        opacity: 0;
        transform:
            translate(-50%, calc(-50% + 8px));
    }

    16%, 76% {
        opacity: 1;
        transform: translate(-50%, -50%);
    }

    100% {
        opacity: 0;
        transform:
            translate(-50%, calc(-50% - 8px));
    }
}

@keyframes startup-wordmark-reveal {
    from {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        clip-path: inset(0 0 0 0);
        transform: translateY(0);
    }
}

@keyframes startup-tagline-reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes startup-precision-line {
    0% {
        opacity: 0;
        transform: translateX(-50%) scaleX(0);
    }

    55% {
        opacity: 1;
        transform: translateX(-50%) scaleX(1);
    }

    100% {
        opacity: .9;
        transform: translateX(-50%) scaleX(.54);
    }
}

@keyframes startup-card-reveal {
    0% {
        visibility: hidden;
        opacity: 0;
        transform:
            translate(-50%, calc(-50% + 14px));
    }

    1% {
        visibility: visible;
    }

    100% {
        visibility: visible;
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes startup-card-accent-reveal {
    to {
        transform: scaleX(1);
    }
}

@keyframes startup-card-content-reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes startup-screen-exit {
    to {
        visibility: hidden;
        opacity: 0;
    }
}

.startup-screen.is-leaving
.startup-login-card {
    animation:
        startup-card-exit
        .34s
        cubic-bezier(.4, 0, .2, 1)
        forwards;
}

@keyframes startup-card-exit {
    from {
        visibility: visible;
        opacity: 1;
        transform: translate(-50%, -50%);
    }

    to {
        visibility: visible;
        opacity: 0;
        transform:
            translate(-50%, calc(-50% - 7px));
    }
}

@media (max-width: 520px) {
    .startup-login-card {
        padding: 30px 24px 25px;
        border-radius: 18px;
    }

    .startup-wordmark {
        font-size: 52px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .startup-brand,
    .startup-brand::after,
    .startup-wordmark,
    .startup-brand p,
    .startup-login-card,
    .startup-card-accent,
    .startup-card-wordmark,
    .startup-login-heading,
    .startup-form,
    .startup-login-footer,
    .startup-screen-pattern,
    .startup-screen.is-leaving,
    .startup-screen.is-leaving
    .startup-login-card {
        animation: none;
    }

    .startup-brand {
        display: none;
    }

    .startup-login-card {
        visibility: visible;
        opacity: 1;
        transform: translate(-50%, -50%);
    }

    .startup-card-accent {
        transform: scaleX(1);
    }

    .startup-card-wordmark,
    .startup-login-heading,
    .startup-form,
    .startup-login-footer {
        opacity: 1;
        transform: translateY(0);
    }

    .startup-screen-pattern {
        opacity: .22;
    }

    .startup-screen.is-leaving {
        visibility: hidden;
        opacity: 0;
    }
}

.app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    height: 100vh;
}

.sidebar {
    background: #1f2937;
    color: white;
    padding: 30px 18px;
}

.brand {
    color: #14b8a6;
    font-size: 25px;
    font-weight: bold;
    letter-spacing: -0.02em;
    margin: 0 12px 38px;
}

.nav-item {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 4px;
    cursor: pointer;
    color: #d1d5db;
    font-size: 15px;
    font-weight: 600;
}

.nav-item:hover,
.nav-item.active {
    background: #374151;
    color: white;
}

.main {
    background: #f8fafc;
    overflow: auto;
}

.page {
    padding: 42px 56px;
    max-width: 1120px;
}

.page h1 {
    margin: 0 0 8px;
    font-size: 32px;
}

.page-description {
    color: #6b7280;
    margin-bottom: 34px;
}

.create-area {
    margin-bottom: 36px;
}

.create-area label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    color: #6b7280;
    margin-bottom: 8px;
}

.create-row {
    display: flex;
    gap: 12px;
}

input {
    height: 42px;
    width: 320px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 15px;
}

button {
    height: 42px;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    font-weight: bold;
    cursor: pointer;
}

.primary-button {
    background: #14b8a6;
    color: white;
}

.primary-button:hover {
    background: #0f766e;
}

.secondary-button {
    background: #e5e7eb;
    color: #111827;
}

.danger-button {
    background: #fee2e2;
    color: #991b1b;
}

.topbar-button.topbar-danger-button {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #b91c1c;
}

.topbar-button.topbar-danger-button:hover {
    background: #ffe4e6;
}

.case-action-button {
    min-width: 108px;
}

.section-title {
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6b7280;
    margin-bottom: 12px;
}

.list {
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.list-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.list-row:last-child {
    border-bottom: none;
}

.item-title {
    font-weight: bold;
}

.item-meta {
    margin-top: 4px;
    color: #6b7280;
    font-size: 13px;
}

.actions {
    display: flex;
    gap: 8px;
}

.text-button {
    background: transparent;
    color: #64748b;
    padding-left: 8px;
    padding-right: 8px;
}

.text-button:hover {
    color: #0f172a;
    text-decoration: underline;
}

.template-use-panel {
    padding: 18px 20px;
    background: #f1f5f9;
    border-bottom: 1px solid #dbe3ec;
}

.template-use-panel label {
    display: block;
    margin-bottom: 8px;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.template-use-controls {
    display: grid;
    grid-template-columns:
        minmax(260px, 1fr) auto auto;
    align-items: center;
    gap: 10px;
}

.template-use-controls input {
    width: 100%;
    background: white;
}

.dashboard-subsection {
    margin-top: 34px;
}

.empty-state {
    background: white;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    padding: 34px;
    color: #6b7280;
}

@media (max-width: 820px) {
    .app-shell {
        grid-template-columns: 190px 1fr;
    }

    .page {
        padding: 30px 26px;
    }

    .template-use-controls {
        grid-template-columns: 1fr;
    }

    .template-use-controls button {
        width: 100%;
    }
}

/* =========================================================
   LEXCRAFT ARBEITSBEREICH
   Editoriales Dashboard mit horizontaler Navigation. Alle
   Selektoren sind absichtlich auf die Verwaltungsshell
   begrenzt, damit Editor und Ausführung unverändert bleiben.
   ========================================================= */

.workspace-size-guard {
    position: fixed;
    inset: 0;
    z-index: 49000;
    display: none;
    min-height: 100vh;
    min-height: 100dvh;
    place-items: center;
    overflow: auto;
    padding: 84px 28px 42px;
    color: #f7fbff;
    background:
        radial-gradient(
            circle at 18% 18%,
            rgba(27, 197, 178, .14),
            transparent 28rem
        ),
        linear-gradient(
            145deg,
            #06172c 0%,
            #0a2948 56%,
            #071a32 100%
        );
    font-family:
        Inter,
        "SF Pro Text",
        "Segoe UI",
        Arial,
        sans-serif;
    isolation: isolate;
}

.workspace-size-guard.is-visible {
    display: grid;
}

.workspace-size-guard-pattern {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: .2;
    background-image:
        linear-gradient(
            rgba(255, 255, 255, .04) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, .04) 1px,
            transparent 1px
        );
    background-size: 48px 48px;
    mask-image: linear-gradient(
        140deg,
        rgba(0, 0, 0, .7),
        transparent 68%
    );
    pointer-events: none;
}

.workspace-size-guard-brand {
    position: fixed;
    top: 33px;
    left: 50%;
    transform: translateX(-50%);
    color: #f8fbff;
    font-size: 25px;
    font-weight: 630;
    line-height: 1;
    letter-spacing: -.045em;
}

.workspace-size-guard-brand strong {
    color: #2bd0bd;
    font-weight: 780;
}

.workspace-size-guard-panel {
    width: min(100%, 590px);
    padding: clamp(34px, 6vw, 58px);
    border: 1px solid rgba(255, 255, 255, .15);
    background: rgba(6, 24, 47, .7);
    box-shadow:
        0 30px 90px rgba(0, 0, 0, .3),
        0 1px 0 rgba(255, 255, 255, .07) inset;
    text-align: center;
    backdrop-filter: blur(18px);
}

.workspace-size-guard-kicker {
    display: block;
    margin-bottom: 14px;
    color: #5be0d0;
    font-size: 10px;
    font-weight: 820;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.workspace-size-guard-panel h2 {
    max-width: 430px;
    margin: 0 auto 18px;
    color: white;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(31px, 5vw, 44px);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -.035em;
}

.workspace-size-guard-panel > p:not(.workspace-size-guard-status) {
    max-width: 455px;
    margin: 0 auto;
    color: rgba(238, 245, 251, .72);
    font-size: 14px;
    line-height: 1.65;
}

.workspace-size-guard-requirement {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin: 25px auto 22px;
    padding: 8px 13px;
    border: 1px solid rgba(91, 224, 208, .22);
    color: rgba(227, 255, 251, .82);
    background: rgba(43, 208, 189, .07);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .025em;
}

#workspaceFullscreenButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 190px;
    height: 45px;
    padding: 0 20px;
    border: 1px solid #2bd0bd;
    border-radius: 4px;
    color: #06182f;
    background: #2bd0bd;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .2);
    font-size: 12px;
    font-weight: 800;
}

#workspaceFullscreenButton:hover {
    border-color: #6be5d7;
    background: #6be5d7;
}

#workspaceFullscreenButton:focus-visible {
    outline: 3px solid rgba(91, 224, 208, .36);
    outline-offset: 4px;
}

.workspace-size-guard-status {
    min-height: 19px;
    margin: 15px auto 0;
    color: rgba(255, 255, 255, .68);
    font-size: 11px;
    line-height: 1.45;
}

.workspace-shell {
    --workspace-navy: #071a32;
    --workspace-ink: #14243a;
    --workspace-muted: #667386;
    --workspace-line: #d9dee4;
    --workspace-paper: #f7f5ef;
    --workspace-teal: #12a999;
    --workspace-teal-dark: #087c72;
    display: grid;
    grid-template-rows: 76px 54px minmax(0, 1fr);
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    color: var(--workspace-ink);
    background: var(--workspace-paper);
    font-family:
        Inter,
        "SF Pro Text",
        "Segoe UI",
        Arial,
        sans-serif;
}

.workspace-global-header {
    position: relative;
    z-index: 40;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    min-width: 0;
    padding: 0 clamp(22px, 4vw, 58px);
    color: white;
    background:
        linear-gradient(
            118deg,
            #06172c 0%,
            var(--workspace-navy) 52%,
            #0a2541 100%
        );
    box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset;
}

.workspace-header-spacer {
    min-width: 0;
}

.workspace-wordmark {
    grid-column: 2;
    justify-self: center;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: #f8fbff;
    background: transparent;
    box-shadow: none;
    font-family:
        Inter,
        "SF Pro Display",
        "Segoe UI",
        sans-serif;
    font-size: 32px;
    font-weight: 620;
    line-height: 1;
    letter-spacing: -.045em;
    cursor: pointer;
}

.workspace-wordmark strong {
    color: #2bd0bd;
    font-weight: 760;
}

.workspace-wordmark:hover {
    color: white;
    background: transparent;
}

.workspace-account {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.workspace-account-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 4px 3px 4px 6px;
    border: 1px solid transparent;
    border-radius: 22px;
    color: inherit;
    background: transparent;
    box-shadow: none;
    font: inherit;
    cursor: pointer;
    transition:
        border-color 150ms ease,
        background 150ms ease;
}

.workspace-account-identity:hover,
.workspace-account-identity[aria-expanded="true"] {
    border-color: rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .075);
}

.workspace-account-identity:focus-visible {
    outline: 2px solid rgba(58, 218, 200, .72);
    outline-offset: 3px;
}

.workspace-account-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
    text-align: right;
}

.workspace-account-name {
    overflow: hidden;
    color: rgba(245, 249, 255, .78);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .015em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-account-meta {
    display: block;
    overflow: hidden;
    color: rgba(245, 249, 255, 0.55);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-account-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
    color: #e9fffb;
    background: rgba(25, 190, 171, .13);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
}

.workspace-account-menu-host {
    position: relative;
    min-width: 0;
}

.workspace-account-chevron {
    margin: -3px 4px 0 -4px;
    color: rgba(239, 248, 251, .55);
    font-size: 13px;
    line-height: 1;
    transition: transform 150ms ease;
}

.workspace-account-identity[aria-expanded="true"]
.workspace-account-chevron {
    transform: rotate(180deg) translateY(-1px);
}

.workspace-profile-menu[hidden],
.workspace-profile-dialog-backdrop[hidden] {
    display: none;
}

.workspace-profile-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 13px);
    z-index: 70;
    width: min(330px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid #d8e0e4;
    border-radius: 13px;
    color: #14243a;
    background: #ffffff;
    box-shadow:
        0 20px 52px rgba(5, 22, 42, .22),
        0 2px 8px rgba(5, 22, 42, .08);
}

.workspace-profile-menu::before {
    position: absolute;
    right: 22px;
    top: -6px;
    width: 11px;
    height: 11px;
    border-top: 1px solid #d8e0e4;
    border-left: 1px solid #d8e0e4;
    background: #f6fbfa;
    content: "";
    transform: rotate(45deg);
}

.workspace-profile-summary {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 18px;
    background:
        linear-gradient(135deg, #f3fbfa 0%, #f8fbfc 100%);
}

.workspace-profile-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(10, 144, 130, .25);
    border-radius: 50%;
    color: #086f67;
    background: rgba(18, 169, 153, .11);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
}

.workspace-profile-summary > span:last-child {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.workspace-profile-summary strong,
.workspace-profile-summary > span:last-child > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-profile-summary strong {
    color: #14243a;
    font-size: 14px;
    font-weight: 730;
}

.workspace-profile-summary > span:last-child > span {
    color: #6c7887;
    font-size: 11px;
    font-weight: 560;
}

.workspace-profile-details {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 16px 18px;
    border-top: 1px solid #e5eaed;
    border-bottom: 1px solid #e5eaed;
}

.workspace-profile-details > div {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: baseline;
    gap: 10px;
}

.workspace-profile-details dt {
    color: #89939e;
    font-size: 9px;
    font-weight: 760;
    letter-spacing: .085em;
    text-transform: uppercase;
}

.workspace-profile-details dd {
    overflow: hidden;
    margin: 0;
    color: #304155;
    font-size: 12px;
    font-weight: 650;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-profile-actions {
    display: grid;
    gap: 2px;
    padding: 8px;
}

.workspace-profile-actions button {
    display: flex;
    min-height: 40px;
    align-items: center;
    justify-content: space-between;
    padding: 0 11px;
    border: 0;
    border-radius: 7px;
    color: #304155;
    background: transparent;
    box-shadow: none;
    font-size: 11px;
    font-weight: 680;
    text-align: left;
}

.workspace-profile-actions button:hover,
.workspace-profile-actions button:focus-visible {
    color: #0a756c;
    background: #edf8f6;
}

.workspace-profile-actions
.workspace-profile-logout {
    color: #9a3f49;
}

.workspace-profile-actions
.workspace-profile-logout:hover,
.workspace-profile-actions
.workspace-profile-logout:focus-visible {
    color: #8a303b;
    background: #fff1f2;
}

.workspace-profile-actions button:disabled {
    opacity: .58;
    cursor: wait;
}

.workspace-profile-status {
    display: none;
    margin: 0;
    padding: 0 18px 14px;
    color: #61707e;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.45;
}

.workspace-profile-status:not(:empty) {
    display: block;
}

.workspace-profile-status[data-state="error"] {
    color: #a43d49;
}

.workspace-profile-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(3, 18, 34, .52);
    backdrop-filter: blur(5px);
}

.workspace-profile-dialog {
    width: min(440px, 100%);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 15px;
    color: #14243a;
    background: #ffffff;
    box-shadow: 0 30px 90px rgba(3, 18, 34, .35);
}

.workspace-profile-dialog > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid #e2e7ea;
    background: #f7faf9;
}

.workspace-profile-dialog > header span {
    color: #0a8a7e;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.workspace-profile-dialog h2 {
    margin: 5px 0 0;
    color: #14243a;
    font-family: inherit;
    font-size: 21px;
    font-weight: 730;
    letter-spacing: -.02em;
}

.workspace-profile-dialog-close {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    padding: 0;
    border: 1px solid #dce3e6;
    border-radius: 8px;
    color: #6b7784;
    background: #ffffff;
    font-size: 20px;
    line-height: 1;
}

.workspace-profile-dialog form {
    display: grid;
    gap: 16px;
    padding: 22px 24px 24px;
}

.workspace-profile-dialog form > p:first-child {
    margin: 0 0 2px;
    color: #687584;
    font-size: 11px;
    line-height: 1.55;
}

.workspace-profile-dialog label {
    display: grid;
    gap: 7px;
    color: #35465a;
    font-size: 10px;
    font-weight: 720;
}

.workspace-profile-dialog input {
    width: 100%;
    min-height: 43px;
    padding: 0 12px;
    border: 1px solid #ccd5da;
    border-radius: 8px;
    color: #14243a;
    background: #ffffff;
    font: inherit;
    font-size: 13px;
    outline: none;
}

.workspace-profile-dialog input:focus {
    border-color: #17a999;
    box-shadow: 0 0 0 3px rgba(23, 169, 153, .12);
}

.workspace-profile-dialog-status {
    min-height: 17px;
    margin: -2px 0 0;
    color: #687584;
    font-size: 10px;
    font-weight: 620;
    line-height: 1.45;
}

.workspace-profile-dialog-status[data-state="error"] {
    color: #a43d49;
}

.workspace-profile-dialog-status[data-state="success"] {
    color: #087c72;
}

.workspace-profile-dialog footer {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 2px;
}

.workspace-profile-dialog footer button {
    min-height: 38px;
    padding: 0 15px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 730;
}

.workspace-profile-dialog-cancel {
    border: 1px solid #d4dce0;
    color: #526170;
    background: #ffffff;
}

.workspace-profile-dialog-save {
    border: 1px solid #0c8f83;
    color: #ffffff;
    background: #0f9f92;
}

.workspace-profile-dialog-save:hover {
    border-color: #087a70;
    background: #0b8b80;
}

.workspace-profile-dialog-save:disabled {
    opacity: .58;
    cursor: wait;
}

.workspace-resource-delete-dialog {
    width: min(470px, 100%);
}

.workspace-resource-delete-dialog > header {
    background: linear-gradient(135deg, #fff7f7, #fbfaf9);
}

.workspace-resource-delete-dialog > header span {
    color: #9a4148;
}

.workspace-resource-delete-dialog-body {
    display: grid;
    gap: 18px;
    padding: 22px 24px 24px;
}

.workspace-resource-delete-dialog-body > p:first-child {
    margin: 0;
    color: #536172;
    font-size: 12px;
    line-height: 1.6;
}

.workspace-resource-delete-warning {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    padding: 13px 14px;
    border: 1px solid #f0d2d5;
    border-radius: 9px;
    color: #7f343c;
    background: #fff5f5;
}

.workspace-resource-delete-warning > span {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: #a84750;
    font-size: 13px;
    font-weight: 820;
}

.workspace-resource-delete-warning p {
    margin: 0;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.5;
}

.workspace-resource-delete-dialog-status {
    min-height: 0;
    margin: -4px 0 0;
}

.workspace-resource-delete-dialog-status:empty {
    display: none;
}

.workspace-resource-delete-confirm {
    border: 1px solid #983e47;
    color: #ffffff;
    background: #a84750;
}

.workspace-resource-delete-confirm:hover,
.workspace-resource-delete-confirm:focus-visible {
    border-color: #7e3038;
    background: #913942;
}

.workspace-primary-nav {
    display: flex;
    align-items: stretch;
    justify-content: center;
    min-width: 0;
    padding: 0 clamp(18px, 4vw, 52px);
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: 1px solid #dfe3e7;
    background: rgba(255, 255, 255, .88);
    scrollbar-width: none;
}

.workspace-primary-nav::-webkit-scrollbar {
    display: none;
}

.workspace-nav-button {
    position: relative;
    height: 54px;
    flex: 0 0 auto;
    padding: 0 27px;
    border: 0;
    border-radius: 0;
    color: #6a7482;
    background: transparent;
    font-size: 15px;
    font-weight: 640;
    letter-spacing: -.005em;
}

.workspace-nav-button::after {
    position: absolute;
    right: 27px;
    bottom: -1px;
    left: 27px;
    height: 2px;
    background: transparent;
    content: "";
}

.workspace-nav-button:hover {
    color: var(--workspace-ink);
    background: transparent;
}

.workspace-nav-button.active {
    color: var(--workspace-navy);
    font-weight: 760;
}

.workspace-nav-button.active::after {
    background: var(--workspace-teal);
}

.workspace-wordmark:focus-visible,
.workspace-nav-button:focus-visible,
.workspace-dashboard-page button:focus-visible {
    outline: 3px solid rgba(18, 169, 153, .28);
    outline-offset: 3px;
}

.workspace-main {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, .46),
            transparent 210px
        ),
        var(--workspace-paper);
}

.workspace-shell .page {
    width: min(100%, 1380px);
    max-width: none;
    margin: 0 auto;
    padding: 46px clamp(30px, 4.5vw, 68px) 54px;
}

.workspace-shell .page > h1 {
    margin: 0 0 9px;
    color: var(--workspace-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(34px, 3.5vw, 46px);
    font-weight: 500;
    line-height: 1.06;
    letter-spacing: -.035em;
}

.workspace-shell .page-description {
    color: var(--workspace-muted);
}

.workspace-dashboard-page {
    width: min(100%, 1480px);
    min-height: 100%;
    margin: 0 auto;
    padding: 42px clamp(28px, 4.5vw, 68px) 38px;
}

.workspace-dashboard-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    padding-bottom: 31px;
}

.workspace-dashboard-kicker {
    display: block;
    margin-bottom: 7px;
    color: var(--workspace-teal-dark);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .19em;
    text-transform: uppercase;
}

.workspace-dashboard-heading h1 {
    margin: 0;
    color: var(--workspace-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(32px, 2.7vw, 36px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -.05em;
}

.workspace-dashboard-primary-action {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    height: auto;
    padding: 9px 2px 8px;
    border: 0;
    border-bottom: 1px solid rgba(8, 124, 114, .45);
    border-radius: 0;
    color: var(--workspace-teal-dark);
    background: transparent;
    font-size: 13px;
    font-weight: 750;
}

.workspace-dashboard-primary-action:hover {
    color: #055c55;
    border-bottom-color: #055c55;
    background: transparent;
}

.workspace-dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, 2.15fr) minmax(285px, .85fr);
    align-items: stretch;
    min-height: 355px;
    border-top: 1px solid var(--workspace-line);
    border-bottom: 1px solid var(--workspace-line);
}

.workspace-dashboard-cases {
    min-width: 0;
    padding: 28px clamp(30px, 4vw, 58px) 28px 0;
}

.workspace-dashboard-quickstart {
    min-width: 0;
    padding: 28px 0 28px clamp(30px, 4vw, 52px);
    border-left: 1px solid var(--workspace-line);
}

.workspace-dashboard-columns h2,
.workspace-dashboard-recent h2 {
    margin: 0 0 13px;
    color: #778190;
    font-size: 10px;
    font-weight: 820;
    line-height: 1.2;
    letter-spacing: .17em;
    text-transform: uppercase;
}

.workspace-dashboard-case-list,
.workspace-dashboard-template-list {
    border-top: 1px solid var(--workspace-line);
}

.workspace-dashboard-case-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    min-height: 91px;
    padding: 18px 16px 18px 21px;
    border-bottom: 1px solid var(--workspace-line);
    background: transparent;
}

.workspace-dashboard-case-row.is-primary {
    background: linear-gradient(
        90deg,
        rgba(18, 169, 153, .075),
        rgba(18, 169, 153, .015) 58%,
        transparent
    );
}

.workspace-dashboard-case-row.is-primary::before {
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 0;
    width: 3px;
    border-radius: 2px;
    background: var(--workspace-teal);
    content: "";
}

.workspace-dashboard-case-copy {
    min-width: 0;
}

.workspace-dashboard-case-copy h3 {
    overflow: hidden;
    margin: 0 0 7px;
    color: #17263a;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(20px, 2vw, 25px);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -.022em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-dashboard-case-copy p {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    color: #59677a;
    font-size: 13px;
    line-height: 1.45;
}

.workspace-dashboard-row-action,
.workspace-dashboard-template-action,
.workspace-dashboard-more,
.workspace-dashboard-recent-list button {
    height: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.workspace-dashboard-row-action {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    padding: 7px 0 7px 14px;
    color: #3f4c5e;
    background: transparent;
    font-size: 12px;
    font-weight: 760;
}

.workspace-dashboard-row-action:hover {
    color: var(--workspace-teal-dark);
    background: transparent;
}

.workspace-dashboard-template-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    width: 100%;
    min-height: 64px;
    padding: 14px 3px;
    border-bottom: 1px solid var(--workspace-line);
    color: #27364a;
    background: transparent;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
}

.workspace-dashboard-template-action:hover {
    color: var(--workspace-teal-dark);
    background: transparent;
}

.workspace-dashboard-template-action span:first-child {
    overflow: hidden;
    display: -webkit-box;
    text-overflow: ellipsis;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.workspace-dashboard-more {
    margin-top: 17px;
    padding: 6px 0;
    color: #6a7482;
    background: transparent;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .02em;
}

.workspace-dashboard-more:hover {
    color: var(--workspace-teal-dark);
    background: transparent;
}

.workspace-dashboard-empty {
    display: flex;
    min-height: 136px;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 22px;
    border-bottom: 1px solid var(--workspace-line);
    color: var(--workspace-muted);
    font-size: 13px;
    line-height: 1.5;
}

.workspace-dashboard-empty strong {
    color: var(--workspace-ink);
}

.workspace-dashboard-empty.compact {
    min-height: 76px;
    padding-right: 0;
    padding-left: 0;
}

.workspace-dashboard-recent {
    display: grid;
    grid-template-columns: minmax(150px, .32fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(24px, 4vw, 60px);
    padding: 31px 0 22px;
}

.workspace-dashboard-recent h2 {
    margin: 0;
}

.workspace-dashboard-recent-list {
    display: flex;
    align-items: center;
    min-width: 0;
}

.workspace-dashboard-recent-list button {
    overflow: hidden;
    max-width: 33.333%;
    padding: 3px clamp(18px, 2.2vw, 30px);
    border-right: 1px solid var(--workspace-line);
    color: #364357;
    background: transparent;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-dashboard-recent-list button:first-child {
    padding-left: 0;
}

.workspace-dashboard-recent-list button:last-child {
    border-right: 0;
}

.workspace-dashboard-recent-list button:hover {
    color: var(--workspace-teal-dark);
    background: transparent;
}

.workspace-dashboard-recent-empty {
    color: var(--workspace-muted);
    font-size: 13px;
}

@media (max-width: 900px) {
    .workspace-dashboard-columns {
        grid-template-columns: 1fr;
    }

    .workspace-dashboard-cases {
        padding-right: 0;
    }

    .workspace-dashboard-quickstart {
        padding: 28px 0;
        border-top: 1px solid var(--workspace-line);
        border-left: 0;
    }

    .workspace-dashboard-recent {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 700px) {
    .workspace-shell {
        grid-template-rows: 68px 50px minmax(0, 1fr);
    }

    .workspace-global-header {
        padding: 0 18px;
    }

    .workspace-wordmark {
        font-size: 28px;
    }

    .workspace-account-copy {
        display: none;
    }

    .workspace-account-avatar {
        width: 31px;
        height: 31px;
        flex-basis: 31px;
        font-size: 10px;
    }

    .workspace-primary-nav {
        justify-content: flex-start;
        padding: 0 8px;
    }

    .workspace-nav-button {
        height: 50px;
        padding: 0 18px;
        font-size: 14px;
    }

    .workspace-nav-button::after {
        right: 18px;
        left: 18px;
    }

    .workspace-shell .page,
    .workspace-dashboard-page {
        padding: 30px 18px 34px;
    }

    .workspace-dashboard-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 19px;
        padding-bottom: 28px;
    }

    .workspace-dashboard-heading h1 {
        font-size: 32px;
    }

    .workspace-dashboard-case-row {
        grid-template-columns: 1fr;
        gap: 7px;
        padding-top: 17px;
        padding-bottom: 17px;
    }

    .workspace-dashboard-row-action {
        justify-self: start;
        padding-left: 0;
    }

    .workspace-dashboard-recent-list {
        align-items: stretch;
        flex-direction: column;
    }

    .workspace-dashboard-recent-list button {
        width: 100%;
        max-width: none;
        padding: 10px 0;
        border-right: 0;
        border-bottom: 1px solid var(--workspace-line);
    }

    .workspace-dashboard-recent-list button:last-child {
        border-bottom: 0;
    }
}

.editor-shell {
    height: 100vh;
    display: grid;
    grid-template-rows: 64px 1fr;
    background: #f3f4f6;
}

.editor-topbar {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.editor-title {
    font-size: 18px;
    font-weight: bold;
}

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

.editor-layout {
    display: grid;
    grid-template-columns: 340px 1fr 260px;
    height: calc(100vh - 64px);
}

.editor-panel {
    background: white;
    border-right: 1px solid #e5e7eb;
    padding: 24px;
}

.properties-panel {
    background: white;
    border-left: 1px solid #e5e7eb;
    padding: 24px;
}

.editor-panel h2,
.properties-panel h2 {
    margin: 0 0 20px;
    font-size: 18px;
}

.document-area {
    overflow: auto;
    padding: 42px;
    background: #eef1f5;
}

.paper {
    width: 210mm;
    min-height: 297mm;
    background: white;
    margin: 0 auto;
    padding: 56px;
    box-shadow: 0 16px 40px rgba(0,0,0,.12);
}

.paper h1 {
    margin-top: 0;
    font-size: 28px;
}

.small-hint {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

.mt-24 {
    margin-top: 24px;
}

.document-toolbar {
    margin-bottom: 32px;
    display: flex;
    gap: 10px;
}

.doc-element {
    outline: none;
    margin-bottom: 18px;
    padding: 6px;
    border-radius: 6px;
}

.doc-element:hover {
    background: #f8fafc;
}

.doc-element.heading {
    font-size: 16px;
    line-height: 1.7;
    font-weight: bold;
}

.doc-element.paragraph {
    font-size: 16px;
    line-height: 1.7;
    font-weight: normal;
}

.doc-element:empty {
    min-height: 28px;
    border: 1px dashed #d1d5db;
    background: #fafafa;
}

.doc-element:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}

.doc-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 12px;
    margin-bottom: 14px;
}

.doc-actions {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 10px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: .15s;
    white-space: nowrap;
}

.doc-row:hover .doc-actions {
    opacity: 1;
}

.mini-button,
.mini-danger-button {
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 6px;
}

.mini-button {
    background: #e5e7eb;
    color: #111827;
}

.mini-danger-button {
    background: #fee2e2;
    color: #991b1b;
}

.doc-row {
    position: relative;
    margin-bottom: 14px;
    padding: 6px 34px 6px 6px;
    border-radius: 8px;
}

.doc-row.selected {
    background: #f8fafc;
    outline: 1px solid #d1d5db;
}

.element-menu-button {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 26px;
    height: 26px;
    padding: 0;
    background: transparent;
    color: #6b7280;
    font-size: 20px;
}

.element-menu-button:hover {
    background: #e5e7eb;
    color: #111827;
}

.element-menu {
    position: absolute;
    right: 6px;
    top: 36px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 6px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    min-width: 140px;
}

.element-menu button {
    background: white;
    color: #111827;
    text-align: left;
    height: 34px;
    border-radius: 6px;
}

.element-menu button:hover {
    background: #f3f4f6;
}

.element-menu .danger-text {
    color: #991b1b;
}

.doc-row {
    position: relative;
    margin-bottom: 14px;
    padding: 6px 34px 6px 6px;
    border-radius: 8px;
}

.doc-row.selected {
    background: #f8fafc;
    outline: 1px solid #d1d5db;
}

.element-menu-button {
    display: none;
    position: absolute;
    right: 6px;
    top: 6px;
    width: 26px;
    height: 26px;
    padding: 0;
    background: transparent;
    color: #6b7280;
    font-size: 20px;
}

.doc-row.selected .element-menu-button {
    display: block;
}

.element-menu-button:hover {
    background: #e5e7eb;
    color: #111827;
}

.element-menu {
    display: none;
    position: absolute;
    right: 6px;
    top: 36px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 6px;
    z-index: 20;
    flex-direction: column;
    min-width: 140px;
}

.element-menu.open {
    display: flex;
}

.element-menu button {
    background: white;
    color: #111827;
    text-align: left;
    height: 34px;
    border-radius: 6px;
}

.element-menu button:hover {
    background: #f3f4f6;
}

.element-menu .danger-text {
    color: #991b1b;
}

.outside-paper {
    max-width: 210mm;
    margin: 0 auto 16px auto;
}

.doc-row {
    margin-bottom: 4px;
    padding: 2px 34px 2px 4px;
}

.doc-row.selected {
    background: transparent;
    outline: 1px solid #d1d5db;
}

.doc-element {
    width: 100%;
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.45;
    margin: 0;
    padding: 2px 4px;
}

.doc-element.heading {
    font-size: 16px;
    line-height: 1.45;
    font-weight: bold;
}

.doc-element.paragraph {
    font-size: 16px;
    line-height: 1.45;
    font-weight: normal;
}

.paper {
    overflow-wrap: break-word;
}

.doc-element.heading {
    display: block;
    width: 100%;
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.property-empty {
    margin-top: 18px;
    padding: 18px;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    color: #6b7280;
    background: #f8fafc;
    font-size: 14px;
    line-height: 1.5;
}

.property-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.property-card-title {
    font-size: 12px;
    font-weight: bold;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 12px;
}

.property-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 0;
    border-top: 1px solid #f3f4f6;
    font-size: 14px;
}

.property-row:first-of-type {
    border-top: none;
}

.property-row span {
    color: #6b7280;
}

.property-row strong {
    color: #111827;
    font-weight: 600;
    text-align: right;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.property-action {
    width: 100%;
    height: 38px;
    margin-bottom: 12px;
    background: #14b8a6;
    color: white;
}

.property-action.secondary {
    background: #e5e7eb;
    color: #111827;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 0 auto 18px auto;
    max-width: 210mm;
}

.toolbar-primary {
    background: #14b8a6;
    color: white;
    border: none;
    border-radius: 7px;
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 600;
}

.toolbar-primary:hover {
    background: #0f766e;
}

.toolbar-divider {
    width: 1px;
    height: 26px;
    background: #d8d8d8;
    margin: 0 4px;
}

.toolbar-icon {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 6px;
    background: white;
    color: #111827;
    cursor: pointer;
    font-size: 15px;
}

.toolbar-icon:hover {
    background: #efefef;
}

.toolbar-icon.active,
.toolbar-icon[aria-pressed="true"] {
    background: #d9f1ef;
    color: #087b72;
    box-shadow:
        inset 0 0 0 1px #9ed7d2;
}

.toolbar-icon.active:hover,
.toolbar-icon[aria-pressed="true"]:hover {
    background: #cbeae7;
}

.toolbar-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.document-text-highlight-control {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
}

.document-text-highlight-trigger {
    position: relative;
}

.document-text-highlight-current {
    position: absolute;
    right: 7px;
    bottom: 4px;
    left: 7px;
    height: 3px;
    border: 1px solid rgba(20, 31, 43, .13);
    border-radius: 999px;
    pointer-events: none;
}

.document-text-highlight-trigger
[data-lucide="highlighter"] {
    transform: translateY(-1px);
}

.document-text-highlight-trigger
.document-text-highlight-current,
.document-text-highlight-trigger[data-active-highlight="yellow"]
.document-text-highlight-current {
    background: #f4d84d;
}

.document-text-highlight-trigger[data-active-highlight="green"]
.document-text-highlight-current {
    background: #62b96b;
}

.document-text-highlight-trigger[data-active-highlight="red"]
.document-text-highlight-current {
    background: #df6268;
}

.document-text-highlight-palette {
    position: absolute;
    z-index: 120;
    top: calc(100% + 7px);
    left: 50%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px;
    border: 1px solid #d8dee2;
    border-radius: 7px;
    background: #ffffff;
    box-shadow:
        0 12px 28px rgba(20, 31, 43, .16),
        0 2px 6px rgba(20, 31, 43, .08);
    transform: translateX(-50%);
}

.document-text-highlight-palette[hidden] {
    display: none;
}

.document-text-highlight-palette::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 50%;
    width: 8px;
    height: 8px;
    border-top: 1px solid #d8dee2;
    border-left: 1px solid #d8dee2;
    background: #ffffff;
    transform:
        translateX(-50%) rotate(45deg);
}

.document-text-highlight-option {
    position: relative;
    display: inline-flex;
    flex: 0 0 26px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid rgba(32, 43, 55, .16);
    border-radius: 5px;
    cursor: pointer;
    transition:
        border-color .13s ease,
        box-shadow .13s ease,
        transform .13s ease;
}

.document-text-highlight-option:hover {
    border-color: #67737d;
    transform: translateY(-1px);
}

.document-text-highlight-option.active {
    border-color: #157f76;
    box-shadow:
        0 0 0 2px rgba(20, 139, 128, .18);
}

.document-text-highlight-option.yellow {
    background: #f4d84d;
}

.document-text-highlight-option.green {
    background: #62b96b;
}

.document-text-highlight-option.red {
    background: #df6268;
}

.document-text-highlight-palette-divider {
    width: 1px;
    height: 20px;
    margin: 0 1px;
    background: #e1e5e8;
}

.document-text-highlight-option.remove {
    border-color: #ccd3d8;
    background: #f6f7f8;
    color: #5d6973;
    font-size: 21px;
    font-weight: 400;
    line-height: 1;
}

.document-text-highlight-option.remove:hover {
    border-color: #aeb8bf;
    background: #eceff1;
    color: #303a42;
}

.document-text-color-control {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
}

.document-text-color-trigger {
    position: relative;
}

.document-text-color-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    transform: translateY(-1px);
}

.document-text-color-current {
    position: absolute;
    right: 7px;
    bottom: 4px;
    left: 7px;
    height: 3px;
    border: 1px solid rgba(20, 31, 43, .13);
    border-radius: 999px;
    background: #d13b40;
    pointer-events: none;
}

.document-text-color-trigger[data-active-text-color="yellow"]
.document-text-color-current {
    background: #c89b00;
}

.document-text-color-trigger[data-active-text-color="green"]
.document-text-color-current {
    background: #218739;
}

.document-text-color-trigger[data-active-text-color="red"]
.document-text-color-current {
    background: #d13b40;
}

.document-text-color-option {
    background: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
}

.document-text-color-option.color-yellow {
    color: #c89b00;
}

.document-text-color-option.color-green {
    color: #218739;
}

.document-text-color-option.color-red {
    color: #d13b40;
}

.interview-list {
    margin-top: 24px;
}

.interview-question {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

.question-label-input {
    width: 100%;
    height: 36px;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
    padding: 0;
    font-weight: 600;
    margin-bottom: 10px;
}

.question-answer-input {
    width: 100%;
    height: 36px;
}

.interview-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.interview-section {
    padding-bottom: 80px;
}

.interview-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    color: #374151;
    margin-bottom: 22px;
}

.interview-arrow {
    color: #14b8a6;
    font-size: 13px;
}

.interview-question-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #374151;
    margin-bottom: 18px;
    padding-left: 14px;
}

.interview-handle {
    color: #9ca3af;
    font-size: 18px;
}

.interview-question-title {
    font-weight: 600;
}

.external-small-button,
.external-section-button {
    height: 36px;
    background: #d1d5db;
    color: #374151;
    font-size: 12px;
    font-weight: bold;
    border-radius: 6px;
    padding: 0 14px;
}

.external-small-button {
    margin-left: 54px;
    margin-bottom: 18px;
}

.question-type-box {
    width: 260px;
    margin-left: 54px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
}

.question-type-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.question-type-tabs button {
    height: 32px;
    border-radius: 0;
    background: #9ca3af;
    color: white;
    font-size: 11px;
    font-weight: bold;
    border-right: 1px solid #d1d5db;
}

.question-type-tabs button:last-child {
    border-right: none;
}

.external-question-input {
    width: 100%;
    height: 42px;
    border: none;
    background: white;
    border-radius: 0;
    padding: 0 10px;
}

.external-section-button {
    position: absolute;
    left: 24px;
    bottom: 24px;
}

.rendered-interview-questions {
    margin-top: 18px;
}

.interview-section-list {
    padding-bottom: 80px;
}

.interview-section-block {
    margin-bottom: 22px;
}

.interview-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.interview-toggle {
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    color: #14b8a6;
    font-size: 15px;
}

.interview-section-input {
    width: 100%;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 15px;
    padding: 4px 0;
}

.interview-section-input:focus {
    outline: none;
    border-bottom: 1px solid #14b8a6;
}

.external-section-block {
    margin-bottom: 22px;
}

.external-section-head {
    display: grid;
    grid-template-columns: 24px 1fr 34px auto;
    align-items: center;
    gap: 6px;
    background: #f3f4f6;
    padding: 8px;
    border-radius: 6px;
}

.external-section-title-input {
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 15px;
    width: 100%;
    padding: 4px;
}

.external-section-title-input:focus {
    outline: none;
}

.section-dots {
    width: 30px;
    height: 30px;
    background: #d1d5db;
    color: #374151;
    padding: 0;
}

.section-rule-button,
.section-delete-button {
    height: 30px;
    background: #9ca3af;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 0 12px;
    border-radius: 5px;
}

.section-delete-button {
    grid-column: 4;
    margin-top: 4px;
}

.section-inner {
    margin-top: 18px;
    margin-left: 38px;
}

.external-section-head {
    position: relative;
    display: grid;
    grid-template-columns: 24px 1fr 30px;
    align-items: center;
    gap: 6px;
    background: #f3f4f6;
    padding: 8px;
    border-radius: 6px;
}

.section-dots {
    width: 30px;
    height: 30px;
    background: #d1d5db;
    color: #374151;
    padding: 0;
}

.section-actions-outside {
    display: none;
    position: absolute;
    left: calc(100% + 8px);
    top: 0;
    flex-direction: column;
    gap: 6px;
}

.section-actions-outside.open {
    display: flex;
}

.section-rule-button,
.section-delete-button {
    height: 30px;
    background: #9ca3af;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 0 12px;
    border-radius: 5px;
}

.interview-question-card {
    position: relative;

    width: calc(100% + 20px);
    margin-left: -10px;

    box-sizing: border-box;

    margin-top: 14px;
    padding: 14px;

    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}


.interview-question-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.question-type-label {
    font-size: 11px;
    font-weight: 700;
    color: #0f766e;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.question-delete-button {
    width: auto;
    height: 26px;
    padding: 0 8px;
    background: transparent;
    color: #991b1b;
    font-size: 11px;
}

.question-delete-button:hover {
    background: #fee2e2;
}

.question-label-input {
    width: 100%;
    height: 38px;
    margin-bottom: 9px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-weight: 600;
}

.question-answer-input {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-weight: 400;
}

.question-label-input::placeholder,
.question-answer-input::placeholder {
    color: #9ca3af;
}

.question-type-tabs .question-type-active {
    background: #14b8a6;
}

.rendered-interview-questions {
    margin-top: 14px;
}

/* =========================================================
   QUELLSYSTEM-ÄHNLICHE TEXTFRAGE
   ========================================================= */

.external-question {
    width: 100%;
    box-sizing: border-box;
    margin: 24px 0 18px;
}

.external-question-title-row {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 16px;
}

.external-question-title {
    flex: 1;
    width: 100%;
    min-width: 0;
    min-height: 32px;
    height: auto;

    padding: 5px 4px;

    border: none;
    border-bottom: 1px solid transparent;
    border-radius: 0;

    background: transparent;
    color: #252525;

    font: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;

    resize: none;
    overflow: hidden;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.external-question-title:focus {
    outline: none;
    border-bottom-color: #14b8a6;
}

.external-question-title::placeholder {
    color: #9ca3af;
}

.external-question-title-rich:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}

.external-question-title-rich p {
    display: inline;
    margin: 0;
}

.external-question-title-rich
.document-inline-rule {
    cursor: pointer;
}

.external-question-delete {
    width: auto;
    height: 28px;
    padding: 0 7px;

    background: transparent;
    color: #991b1b;

    font-size: 11px;
    font-weight: 600;
}

.external-question-delete:hover {
    background: #fee2e2;
}

.external-question-rule {
    flex: 0 0 auto;
    width: auto;
    height: 28px;
    padding: 0 8px;
    border-radius: 3px;
    background: #a8adb2;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .035em;
}

.external-question-rule:hover,
.external-question-rule.linked {
    background: #14b8a6;
}

.external-question-series {
    flex: 0 0 auto;
    width: auto;
    height: 28px;
    padding: 0 8px;
    border-radius: 3px;
    background: #8b78bd;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .035em;
}

.external-question-series:hover,
.external-question-series.linked {
    background: #6d5aa8;
}

.external-text-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.external-text-field-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.external-text-field-label {
    width: 100%;
    min-width: 0;
    height: 44px;
    box-sizing: border-box;

    padding: 0 12px;

    border: 1px solid transparent;
    border-radius: 0;

    background: #e5e5e5;
    color: #333333;

    font-size: 13px;
    font-weight: 600;
}

.external-text-field-label:focus {
    outline: none;
    border-color: #14b8a6;
    background: #eeeeee;
}

.external-text-field-label::placeholder {
    color: #555555;
    opacity: 1;
}

.external-text-field-dots {
    width: 32px;
    height: 38px;
    padding: 0;

    border-radius: 4px;
    background: #d1d1d1;
    color: #555555;

    font-size: 20px;
    line-height: 1;
}

.external-text-field-dots:hover {
    background: #bfc0c0;
}

.text-field-actions {
    display: none;
    position: absolute;

    left: calc(100% + 8px);
    top: 0;

    z-index: 40;
    flex-direction: column;
    gap: 6px;
}

.text-field-actions.open {
    display: flex;
}

.text-field-rule-button,
.text-field-delete-button {
    min-width: 84px;
    height: 34px;
    padding: 0 12px;

    border-radius: 4px;
    background: #9ca3af;
    color: white;

    font-size: 11px;
    font-weight: 700;
}

.text-field-delete-button {
    background: #b6b6b6;
}

.text-field-rule-button:hover {
    background: #14b8a6;
}

.text-field-rule-button.linked {
    background: #14b8a6;
}

.text-field-series-button,
.text-field-series-button:hover,
.text-field-series-button.linked {
    background: #6d5aa8;
}

.section-series-button,
.section-series-button:hover,
.section-series-button.linked {
    background: #6d5aa8;
}

.text-field-delete-button:hover {
    background: #991b1b;
}

.external-add-textfield {
    width: auto;
    height: auto;

    margin-top: 15px;
    padding: 3px 0;

    border: none;
    border-radius: 0;
    background: transparent;
    color: #444444;

    font-size: 12px;
    font-weight: 700;
    text-decoration: underline;
}

.external-add-textfield:hover {
    background: transparent;
    color: #0f766e;
}

.external-question-divider {
    width: 100%;
    height: 1px;

    margin-top: 24px;
    background: #e0e0e0;
}

.section-inner {
    width: calc(100% - 8px);
    box-sizing: border-box;
    margin-top: 18px;
    margin-left: 8px;
}

.rendered-interview-questions {
    width: 100%;
    margin: 0;
}

.question-type-box {
    width: 100%;
    max-width: none;
    margin: 12px 0 18px;
}

.question-type-tabs {
    width: 100%;
}

.editor-layout {
    min-height: 0;
}

.interview-panel {
    height: calc(100vh - 90px);
    min-height: 0;
    overflow-y: auto;
    overflow-x: visible;
    padding-bottom: 90px;
}

.interview-section-list {
    min-height: max-content;
}

.properties-panel {
    height: calc(100vh - 90px);
    min-height: 0;
    overflow-y: auto;
}

.interview-panel {
    height: calc(100vh - 90px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 0;
}

.interview-section-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: visible;
    padding-bottom: 24px;
}

.interview-footer {
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 82px;
    padding: 8px 0 16px;

    background: #ffffff;
    border-top: none;
}

.external-section-button {
    position: static;
    left: auto;
    bottom: auto;

    margin: 0;
    transform: translateY(-4px);
}

.external-section-title-textarea {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    height: auto;

    box-sizing: border-box;
    padding: 4px 0;

    border: none;
    background: transparent;

    font: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;

    resize: none;
    overflow: hidden;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.external-section-title-textarea:focus {
    outline: none;
}

.external-section-head {
    align-items: flex-start;
    min-height: 44px;
    height: auto;
}

.external-section-title-textarea {
    display: block;
    min-height: 32px;
    height: auto;
    max-height: none;

    overflow: hidden;
    resize: none;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.external-section-head {
    position: relative;

    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 36px;
    align-items: start;
    gap: 8px;

    width: 100%;
    box-sizing: border-box;

    overflow: visible;
}

.interview-toggle {
    position: relative;
    z-index: 5;

    width: 24px;
    height: 32px;
    padding: 0;

    cursor: pointer;
}

.external-section-title-textarea {
    position: relative;
    z-index: 1;

    display: block;

    width: 100%;
    min-width: 0;
    min-height: 32px;
    height: auto;

    box-sizing: border-box;
    padding: 5px 2px;

    border: none;
    background: transparent;

    font: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;

    resize: none;
    overflow: hidden;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.external-section-title-textarea:focus {
    outline: none;
}

.section-menu-wrapper {
    position: relative;
    z-index: 50;

    width: 36px;
    min-width: 36px;
}

.section-dots {
    position: relative;
    z-index: 60;

    width: 36px;
    height: 36px;
    padding: 0;

    border: none;
    border-radius: 5px;

    background: #d1d1d1;
    color: #555555;

    font-size: 20px;
    line-height: 1;

    cursor: pointer;
    pointer-events: auto;
}

.section-dots:hover {
    background: #bfc0c0;
}

.section-actions-outside {
    display: none;

    position: absolute;
    top: 0;
    left: calc(100% + 8px);

    z-index: 1000;

    flex-direction: column;
    gap: 6px;

    min-width: 86px;
}

.section-actions-outside.open {
    display: flex;
}

.section-rule-button,
.section-delete-button {
    min-width: 86px;
    height: 34px;
    padding: 0 12px;

    border: none;
    border-radius: 4px;

    background: #9ca3af;
    color: #ffffff;

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;
}

.section-rule-button:hover {
    background: #14b8a6;
}

.section-delete-button:hover {
    background: #991b1b;
}

.section-menu-wrapper {
    position: relative;
    z-index: 100;
}

.section-actions-outside {
    display: none;

    position: absolute;
    top: 40px;
    right: 0;
    left: auto;

    z-index: 9999;

    flex-direction: column;
    gap: 5px;

    min-width: 90px;
    padding: 5px;

    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.section-actions-outside.open {
    display: flex;
}

.section-rule-button,
.section-delete-button {
    width: 100%;
    min-width: 80px;
    height: 32px;
    margin: 0;
    padding: 0 10px;

    border: none;
    border-radius: 4px;

    font-size: 11px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.section-rule-button {
    background: #e5e7eb;
    color: #374151;
}

.section-delete-button {
    background: #fee2e2;
    color: #991b1b;
}

.section-rule-button:hover {
    background: #14b8a6;
    color: #ffffff;
}

.section-delete-button:hover {
    background: #991b1b;
    color: #ffffff;
}

.document-placeholder {
    display: inline-block;
    padding: 1px 6px;
    margin: 0 2px;

    border-radius: 4px;

    font-size: inherit;
    font-weight: 500;
    line-height: 1.35;

    cursor: pointer;
    user-select: text;
    -webkit-user-select: text;
}

.document-placeholder.placeholder-unlinked {
    background: #fff3bf;
    border: 1px solid #ead98a;
    color: #6b5b16;
}

.document-placeholder.placeholder-selected {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.document-placeholder.is-keyboard-selected,
.document-placeholder.is-keyboard-selected:hover {
    outline: 2px solid rgba(16, 159, 148, .24);
    outline-offset: 1px;
}

.document-placeholder.placeholder-linked {
    background: #e5e7eb;
    border: 1px solid #c7cbd1;
    color: #374151;
}

.document-placeholder.placeholder-linked:hover {
    background: #d9dde3;
}

.document-inline-sequence {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.45em;
    min-height: 1.45em;
    margin: 0 2px;
    padding: 0 5px;
    border: 1px solid #9fcfca;
    border-radius: 4px;
    background: #e4f3f1;
    color: #155f59;
    font: inherit;
    font-weight: 750;
    line-height: 1.3;
    vertical-align: baseline;
    cursor: pointer;
    user-select: text;
    -webkit-user-select: text;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.document-inline-sequence:hover {
    border-color: #4da69e;
    background: #d5eeeb;
    color: #104c47;
}

.document-inline-sequence[data-inline-sequence-repeat="true"],
.document-inline-sequence.is-repeated-value {
    gap: 3px;
    border-style: dashed;
    border-color: #58a9a1;
    background: #ffffff;
    color: #155f59;
}

.document-inline-sequence[data-inline-sequence-repeat="true"]::after,
.document-inline-sequence.is-repeated-value::after {
    content: "↺";
    color: #458f88;
    font-size: .72em;
    font-weight: 800;
    line-height: 1;
}

.document-inline-sequence[data-inline-sequence-repeat="true"]:hover,
.document-inline-sequence.is-repeated-value:hover {
    border-color: #278f86;
    background: #f2f9f8;
}

.document-inline-sequence[data-inline-sequence-series-mode="fixed"],
.document-inline-sequence.is-series-fixed {
    gap: 3px;
    border-style: double;
    border-color: #478f89;
    background: #f4faf9;
}

.document-inline-sequence[data-inline-sequence-series-mode="fixed"]::after,
.document-inline-sequence.is-series-fixed::after {
    content: "=";
    color: #397a75;
    font-size: .75em;
    font-weight: 900;
    line-height: 1;
}

.document-inline-sequence[data-inline-sequence-shared-link],
.document-inline-sequence.is-shared-value {
    gap: 3px;
    border-color: #7465bd;
    background: #eeeafd;
    color: #44358f;
}

.document-inline-sequence[data-inline-sequence-shared-link]::after,
.document-inline-sequence.is-shared-value::after {
    content: "↔";
    color: #6655b3;
    font-size: .72em;
    font-weight: 850;
    line-height: 1;
}

.document-inline-sequence[data-inline-sequence-shared-series-offset="true"]::after,
.document-inline-sequence.is-shared-series-offset::after {
    content: "+";
}

.document-inline-sequence.is-editing,
.document-inline-sequence.is-keyboard-selected,
.document-inline-sequence.is-keyboard-selected:hover {
    outline: 2px solid rgba(16, 159, 148, .26);
    outline-offset: 1px;
    box-shadow: 0 0 0 1px rgba(16, 159, 148, .12);
}

/* Wertfelder sind eigenständige, manuell auszufüllende Werte. Rot markiert
   offene, Grün ausgefüllte Felder im Dokument; der Toolbar-Button verwendet
   bewusst denselben neutralen Stil wie alle anderen Werkzeuge. */
.document-value-field {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 1.45em;
    margin: 0 2px;
    padding: 0 6px;
    border: 1px solid #d7a3a8;
    border-radius: 4px;
    background: #fff2f3;
    color: #8f2530;
    font: inherit;
    font-weight: 680;
    line-height: 1.35;
    vertical-align: baseline;
    cursor: pointer;
    user-select: text;
    -webkit-user-select: text;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.document-value-field:hover {
    border-color: #bf5963;
    background: #fde7e9;
    color: #7d1f28;
}

.document-value-field.is-filled {
    border-color: #72a995;
    background: #edf8f3;
    color: #245f4d;
}

.document-value-field.is-filled:hover {
    border-color: #4c8f78;
    background: #e1f3eb;
    color: #194d3d;
}

.document-value-field[data-value-field-scope="project"]::after {
    content: "↔";
    color: #b23a45;
    font-size: .72em;
    font-weight: 850;
    line-height: 1;
}

.document-value-field.is-filled[data-value-field-scope="project"]::after {
    color: #2f7c64;
}

.document-value-field.is-keyboard-selected,
.document-value-field.is-keyboard-selected:hover {
    outline: 2px solid rgba(190, 58, 69, .25);
    outline-offset: 1px;
    box-shadow: 0 0 0 1px rgba(190, 58, 69, .1);
}

.document-value-field.is-filled.is-keyboard-selected,
.document-value-field.is-filled.is-keyboard-selected:hover {
    outline-color: rgba(47, 124, 100, .28);
    box-shadow: 0 0 0 1px rgba(47, 124, 100, .12);
}

.execution-shell
.document-value-field.preview-value-field {
    display: inline;
    min-height: 0;
    margin: 0;
    padding: .03em .24em;
    border: 1px solid #d7a3a8;
    border-radius: 4px;
    background: #fff5f5;
    color: #80232c;
    font: inherit;
    font-weight: 650;
    line-height: inherit;
    cursor: pointer;
    box-shadow: none;
}

.execution-shell
.document-value-field.preview-value-field::after {
    content: none;
}

.execution-shell
.document-value-field.preview-value-field.is-empty {
    border-color: #c73540;
    border-style: dashed;
    background: #fde8ea;
    color: #9d202b;
}

.execution-shell
.document-value-field.preview-value-field.is-filled {
    border-color: #65a58d;
    background: #e8f6ef;
    color: #205b48;
}

.execution-shell
.document-value-field.preview-value-field:hover,
.execution-shell
.document-value-field.preview-value-field:focus-visible {
    border-color: #b83843;
    background: #fbe6e8;
    color: #761b24;
    outline: 2px solid rgba(190, 58, 69, .2);
    outline-offset: 1px;
}

.execution-shell
.document-value-field.preview-value-field.is-filled:hover,
.execution-shell
.document-value-field.preview-value-field.is-filled:focus-visible {
    border-color: #42866e;
    background: #dcf0e7;
    color: #174b3b;
    outline-color: rgba(47, 124, 100, .24);
}

/* In der Ausführung bleibt die Nummer typografisch Teil des Textes.
   Die feine Markierung zeigt lediglich, dass ihr sichtbarer Wert anklickbar ist. */
.execution-shell
.document-inline-sequence.preview-inline-sequence-trigger {
    display: inline;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: .02em .2em;
    border: 1px solid #b8afe5;
    border-radius: 4px;
    background: #eeebfb;
    color: #4c3e9e;
    font: inherit;
    font-weight: 720;
    line-height: inherit;
    vertical-align: baseline;
    cursor: pointer;
    box-shadow: none;
}

.execution-shell
.document-inline-sequence.preview-inline-sequence-trigger::after {
    content: none;
}

.execution-shell
.document-inline-sequence.preview-inline-sequence-trigger:hover,
.execution-shell
.document-inline-sequence.preview-inline-sequence-trigger:focus-visible {
    border-color: #7d6fca;
    background: #e3def8;
    color: #382a89;
    outline: 2px solid rgba(103, 86, 190, .2);
    outline-offset: 1px;
    box-shadow: none;
}

.execution-shell
.document-inline-sequence.preview-inline-sequence-trigger.is-manual-value {
    border-color: #d29a48;
    background: #fff0d2;
    color: #75440f;
}

.execution-shell
.document-inline-sequence.preview-inline-sequence-trigger.is-manual-value:hover,
.execution-shell
.document-inline-sequence.preview-inline-sequence-trigger.is-manual-value:focus-visible {
    border-color: #b97824;
    background: #ffe5b6;
    color: #603507;
    outline-color: rgba(196, 126, 34, .22);
}

.execution-shell
.document-inline-sequence.preview-inline-sequence-trigger.is-shared-value,
.execution-shell
.document-inline-sequence.preview-inline-sequence-trigger.is-shared-value.is-manual-value {
    border-color: #7565c7;
    background: #e6e0fb;
    color: #38277f;
}

.execution-shell
.document-inline-sequence.preview-inline-sequence-trigger.is-shared-value:hover,
.execution-shell
.document-inline-sequence.preview-inline-sequence-trigger.is-shared-value:focus-visible {
    border-color: #5f4db8;
    background: #dcd3f8;
    color: #2f1f73;
    outline-color: rgba(95, 77, 184, .24);
}

.external-text-field-row {
    cursor: pointer;
}

.external-text-field-row:hover .external-text-field-label {
    border-color: #14b8a6;
}

.preview-placeholder-empty {
    color: #8b8b8b;
    background: #f1f1f1;
    padding: 1px 4px;
    border-radius: 3px;
}

.preview-placeholder-filled {
    color: inherit;
    background: transparent;
    padding: 0;
}

.preview-doc-element {
    cursor: default;
}

.preview-field-label {
    display: block;
    width: 100%;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

/* Vorschau kompakter darstellen */

.preview-doc-row {
    margin: 0;
    padding: 0;
}

.preview-doc-element {
    margin: 0 0 8px;
    padding: 0;
    line-height: 1.45;
    background: transparent;
}

.preview-doc-element.heading {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 700;
}

.preview-doc-element.paragraph {
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 400;
}

.preview-doc-element:hover {
    background: transparent;
}

/* Vorschau-Interview links */

.preview-field-label {
    margin-bottom: 5px;
}

.preview-field-label + .external-text-field-label {
    width: 100%;
}

.external-text-field-row {
    align-items: stretch;
}

.external-text-field-row:has(.preview-field-label) {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* =========================================================
   VORSCHAU – EIGENSTÄNDIGES LAYOUT
   ========================================================= */

.preview-shell {
    background: #f3f4f6;
}

.preview-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    height: calc(100vh - 64px);
    min-height: 0;
}

.preview-interview-panel {
    min-width: 0;
    overflow-y: auto;
    padding: 24px 20px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
}

.preview-document-area {
    min-width: 0;
    overflow: auto;
    padding: 34px;
    background: #eef1f5;
}

.preview-paper {
    width: min(210mm, 100%);
    min-height: 297mm;
    padding: 58px 64px;
}

.preview-interview-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-section {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
}

.preview-section-header {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 8px;

    width: 100%;
    height: auto;
    min-height: 48px;
    padding: 11px 12px;

    border: 0;
    border-radius: 0;
    background: #f3f4f6;
    color: #111827;

    text-align: left;
}

.preview-section-header:hover {
    background: #e9edf2;
}

.preview-section-arrow {
    color: #14b8a6;
    font-size: 15px;
    line-height: 1;
}

.preview-section-title {
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.preview-section-content {
    padding: 14px 14px 16px;
}

.preview-question {
    margin: 0 0 20px;
}

.preview-question:last-child {
    margin-bottom: 0;
}

.preview-question-title {
    margin: 0 0 10px;
    color: #111827;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
}

.preview-question-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mandate-field-status-slot:empty {
    display: none;
}

.mandate-field-status-slot {
    min-height: 13px;
    margin: 0 0 1px;
    line-height: 1;
}

.mandate-field-status {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    background: #e8f7f5;
    color: #177c73;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .075em;
    line-height: 1;
    text-transform: uppercase;
}

.mandate-field-status.is-local {
    background: #fff4df;
    color: #956119;
}

.mandate-field-status.is-mandate {
    background: #edf1f4;
    color: #59636d;
}

.preview-field-label {
    display: block;
    margin: 0;
    color: #4b5563;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
}

.preview-field-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;

    border: 1px solid #d1d5db;
    border-radius: 7px;

    background: #ffffff;
    color: #111827;

    font-size: 14px;
    font-weight: 400;
}

.preview-field-input:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.mandate-scope-overlay {
    position: fixed;
    inset: 0;
    z-index: 10040;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(21, 27, 34, .48);
    backdrop-filter: blur(2px);
}

.mandate-scope-dialog {
    width: min(560px, 100%);
    padding: 27px;
    border: 1px solid #dce2e7;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

.mandate-scope-header > span {
    display: block;
    margin-bottom: 8px;
    color: #16877c;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.mandate-scope-header h2 {
    margin: 0 0 10px;
    color: #1f2933;
    font-size: 22px;
    line-height: 1.25;
}

.mandate-scope-header p {
    margin: 0;
    color: #5e6873;
    font-size: 14px;
    line-height: 1.55;
}

.mandate-scope-header strong {
    color: #29313a;
}

.mandate-scope-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 22px;
}

.mandate-scope-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 126px;
    padding: 17px;
    border: 1px solid #d7dde2;
    border-radius: 10px;
    background: #f8fafb;
    color: #27313a;
    text-align: left;
    transition: border-color .15s ease,
        background .15s ease,
        transform .15s ease;
}

.mandate-scope-option:hover {
    border-color: #aeb8c0;
    background: #ffffff;
    transform: translateY(-1px);
}

.mandate-scope-option.is-mandate {
    border-color: #8dd5ce;
    background: #eefaf8;
}

.mandate-scope-option.is-mandate:hover {
    border-color: #3fb6ab;
    background: #e6f7f4;
}

.mandate-scope-option strong {
    margin-bottom: 8px;
    font-size: 14px;
}

.mandate-scope-option span {
    color: #66717c;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
}

.mandate-scope-note {
    margin: 16px 0 0;
    color: #78828c;
    font-size: 11px;
    line-height: 1.45;
    text-align: center;
}

@media (max-width: 640px) {
    .mandate-scope-options {
        grid-template-columns: 1fr;
    }

    .mandate-scope-option {
        min-height: 0;
    }
}

.preview-question-empty,
.preview-interview-empty {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.5;
}

.preview-document {
    color: #111827;
    font-family: Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

.preview-document-element {
    padding: 0;
    background: transparent;
    overflow-wrap: break-word;
}

.preview-document-element.heading {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
}

.preview-document-element.paragraph {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.55;
}

.preview-document-element:last-child {
    margin-bottom: 0;
}

.preview-document .document-placeholder {
    cursor: default;
    user-select: text;
}

@media (max-width: 1050px) {
    .preview-layout {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .preview-document-area {
        padding: 24px;
    }

    .preview-paper {
        padding: 44px 48px;
    }
}

/* =========================================================
   EDITOR & AUSFÜHRUNG – ZWEISPALTIGER ARBEITSBEREICH
   ========================================================= */

.builder-shell,
.execution-shell {
    grid-template-rows: 52px minmax(0, 1fr);
    background: #f4f5f7;
}

.builder-topbar,
.execution-topbar {
    position: relative;
    min-width: 0;
    padding: 0 14px;
    border-bottom: 1px solid #24262b;
    background: #34363c;
    color: #ffffff;
}

.editor-topbar-side {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.editor-topbar-left {
    justify-content: flex-start;
}

.editor-title-group {
    position: absolute;
    left: 50%;
    top: 50%;
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: 42%;
    transform: translate(-50%, -50%);
}

.builder-topbar .editor-title,
.execution-topbar .editor-title {
    overflow: hidden;
    color: #d9faf6;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .035em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.editor-mode-badge {
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: 999px;
    background: #5e646d;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.execution-mode-badge {
    background: #4fbbb0;
}

.topbar-button,
.topbar-primary {
    width: auto;
    height: 30px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.topbar-button {
    background: #5b6068;
    color: #ffffff;
}

.topbar-button:hover {
    background: #6b717a;
}

.topbar-preview-button,
.topbar-primary {
    background: #55b7c7;
    color: #ffffff;
}

.topbar-preview-button:hover,
.topbar-primary:hover {
    background: #3c9daf;
}

.topbar-primary:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.builder-shell .editor-layout {
    grid-template-columns: minmax(310px, 33%) minmax(0, 67%);
    height: calc(100vh - 52px);
    min-height: 0;
}

.builder-shell .interview-panel {
    height: auto;
    min-height: 0;
    padding: 24px 22px 0;
    border-right: 1px solid #d8dadd;
    background: #ffffff;
}

.builder-shell .interview-section-list {
    padding: 0 2px 32px;
}

.builder-shell .interview-footer {
    min-height: 68px;
    margin: 0 -22px;
    padding: 12px 22px 15px;
    border-top: 1px solid #eceeef;
    background: rgba(255, 255, 255, .98);
}

.builder-shell .external-section-block {
    margin-bottom: 26px;
}

.builder-shell .external-section-head {
    padding: 5px 3px;
    border-radius: 0;
    background: transparent;
}

.builder-shell .external-section-head:hover {
    background: #f7f8f9;
}

.builder-shell .external-question-title {
    font-weight: 600;
}

.builder-shell .section-dots,
.builder-shell .external-text-field-dots {
    border-radius: 3px;
    background: #d7d9dc;
}

.editor-document-area {
    display: grid;
    grid-template-rows: 50px minmax(0, 1fr) 66px;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: #f0f1f3;
}

.editor-document-area .editor-toolbar {
    position: relative;
    z-index: 20;
    justify-content: center;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 7px 18px;
    border: 0;
    border-bottom: 1px solid #d8dadd;
    border-radius: 0;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(17, 24, 39, .04);
}

.editor-document-area .toolbar-primary {
    height: 34px;
    padding: 0 13px;
    border-radius: 4px;
    font-size: 11px;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.editor-document-area .toolbar-icon {
    height: 32px;
    border-radius: 4px;
}

.document-canvas-scroll {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: 30px 40px 60px;
}

.editor-paper {
    width: min(210mm, 100%);
    min-height: 297mm;
    padding: 58px 64px;
    box-shadow: 0 10px 34px rgba(32, 38, 46, .12);
}

.document-footer-actions {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 28px;
    border-top: 1px solid #d8dadd;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -4px 14px rgba(17, 24, 39, .035);
}

.workspace-create-button {
    width: auto;
    height: 34px;
    padding: 0 14px;
    border: 1px solid #cdd0d4;
    border-radius: 3px;
    background: #e4e5e7;
    color: #454a52;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.workspace-create-button:hover {
    border-color: #4fb5aa;
    background: #4fb5aa;
    color: #ffffff;
}

.workspace-create-button.secondary {
    background: #f7f7f8;
}

.workspace-create-button.secondary:hover {
    background: #4fb5aa;
}

.builder-shell .doc-row {
    position: relative;
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 8px;
    padding: 3px 2px 3px 7px;
    border-left: 2px solid transparent;
}

.builder-shell .doc-row:hover {
    border-left-color: #b9deda;
}

.builder-shell .doc-row.selected {
    border-left-color: #24aa9d;
    border-radius: 2px;
    outline: 1px solid #d8dcdf;
    background: #fbfdfd;
}

/* Ausführungsmodus */

.execution-shell .preview-layout {
    grid-template-columns:
        clamp(300px, 31.5vw, 440px)
        minmax(0, 1fr);
    height: calc(100vh - 52px);
    min-height: 0;
}

.execution-shell .preview-interview-panel {
    min-width: 0;
    padding: 0;
    border-right: 1px solid #d8dadd;
    background: #ffffff;
}

.preview-panel-heading {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 24px 22px 18px;
    border-bottom: 1px solid #eceeef;
    background: rgba(255, 255, 255, .97);
}

.preview-panel-heading strong {
    color: #22262c;
    font-size: 17px;
    line-height: 1.3;
}

.preview-panel-eyebrow,
.preview-document-caption {
    color: #75808b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.execution-shell .preview-interview-list {
    display: block;
    padding: 0 18px 34px;
}

.execution-shell .preview-section {
    border: 0;
    border-bottom: 1px solid #e6e8ea;
    border-radius: 0;
    background: transparent;
}

.execution-shell .preview-section-header {
    grid-template-columns: 20px minmax(0, 1fr);
    min-height: 54px;
    padding: 12px 5px;
    background: transparent;
}

.execution-shell .preview-section-header:hover {
    background: #f6f7f8;
}

.execution-shell .preview-section-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #42aaa0;
}

.execution-shell .preview-section-arrow svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.4;
}

.execution-shell .preview-section-title {
    color: #272b31;
    font-size: 14px;
    font-weight: 750;
}

.execution-shell .preview-section-content {
    padding: 6px 5px 22px 25px;
}

.execution-shell .preview-question {
    margin-bottom: 23px;
}

.execution-shell .preview-question-title {
    margin-bottom: 11px;
    color: #20242a;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    text-align: left;
}

.execution-shell .preview-field-label {
    color: #5d646d;
    font-weight: 600;
    text-align: left;
}

.execution-shell .preview-field-input {
    height: 40px;
    border-radius: 4px;
    background: #f2f3f4;
}

.execution-shell .preview-field-input:focus {
    background: #ffffff;
}

/* =========================================================
   FRAGETYPEN: AUSWAHL, MULTIPLE UND SERIE
   ========================================================= */

.external-question-kicker {
    margin: 0 0 3px 4px;
    color: #8a919a;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .11em;
}

.external-choice-options {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.external-choice-option-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 8px 0 12px;
    background: #ededee;
    border: 1px solid transparent;
}

.external-choice-option-row:focus-within {
    border-color: #42aaa0;
    background: #f4f5f5;
}

.external-choice-control {
    width: 14px;
    height: 14px;
    border: 1.5px solid #7b838c;
    background: #ffffff;
}

.external-choice-control.single {
    border-radius: 50%;
}

.external-choice-control.multiple {
    border-radius: 2px;
}

.external-choice-option-input {
    width: 100%;
    height: 40px;
    min-width: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #30343a;
    font-size: 13px;
    font-weight: 600;
}

.external-choice-option-input:focus {
    outline: none;
}

.external-choice-option-input::placeholder {
    color: #656b73;
    opacity: 1;
}

.external-choice-delete {
    width: 26px;
    height: 26px;
    padding: 0;
    background: transparent;
    color: #7f858d;
    font-size: 19px;
    line-height: 1;
}

.external-choice-delete:hover {
    background: #fee2e2;
    color: #991b1b;
}

.external-question-help {
    margin: 9px 0 0;
    color: #777e87;
    font-size: 11px;
    line-height: 1.45;
}

.external-question-help code,
.series-link-note code {
    padding: 1px 4px;
    border-radius: 3px;
    background: #e5e7eb;
    color: #334155;
}

.external-series-card {
    display: block;
    min-height: 58px;
    padding: 10px 12px;
    border: 2px solid transparent;
    border-radius: 5px;
    background: #ededee;
}

.external-series-card.series-link-selectable,
.external-series-card.series-rule-selectable {
    cursor: pointer;
    border: 2px solid #8b78bd;
    background: #f0ebfa;
}

.external-series-card.series-link-selectable:hover,
.external-series-card.series-rule-selectable:hover,
.external-series-card.series-rule-selectable.rule-selected {
    border-color: #6d5aa8;
    background: #e5dcf6;
}

.external-series-card.linked-for-removal {
    border-color: #c94c58;
    background: #f8e3e5;
}

.external-series-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.external-series-stepper {
    display: grid;
    grid-template-columns: 28px 38px 28px;
    align-items: center;
    overflow: hidden;
    flex: 0 0 auto;
    min-width: 94px;
    height: 34px;
    border-radius: 4px;
    background: #6d5aa8;
    color: #ffffff;
    box-shadow: inset 0 0 0 1px
        rgba(255, 255, 255, .12);
}

.external-series-step,
.external-series-value,
.external-series-stepper-static {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 34px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 14px;
    font-weight: 850;
    line-height: 1;
}

.external-series-step {
    cursor: pointer;
    transition:
        background-color .14s ease,
        color .14s ease;
}

.external-series-step:hover:not(:disabled),
.external-series-step:focus-visible {
    outline: none;
    background: rgba(255, 255, 255, .2);
}

.external-series-step:disabled {
    cursor: not-allowed;
    color: rgba(255, 255, 255, .38);
}

.external-series-value {
    border-right: 1px solid
        rgba(255, 255, 255, .18);
    border-left: 1px solid
        rgba(255, 255, 255, .18);
    font-size: 13px;
}

.external-series-stepper-static {
    grid-column: 1 / -1;
    font-size: 13px;
}

.external-series-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.external-series-copy strong,
.external-series-copy span {
    display: block;
}

.external-series-copy strong {
    margin-bottom: 3px;
    color: #30343a;
    font-size: 12px;
}

.external-series-copy span {
    color: #6b7280;
    font-size: 11px;
    line-height: 1.35;
}

.external-series-rule-options {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid #cfc5e4;
}

.external-series-rule-option {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 5px 8px;
    border: 1px solid #b9acd5;
    border-radius: 4px;
    background: #ffffff;
    color: #584a7e;
    cursor: pointer;
    font-size: 9px;
    font-weight: 750;
    line-height: 1.1;
    transition:
        border-color .14s ease,
        background-color .14s ease,
        color .14s ease,
        transform .14s ease;
}

.external-series-rule-option b {
    color: inherit;
    font-size: 10px;
    font-weight: 900;
}

.external-series-rule-option:hover,
.external-series-rule-option:focus-visible {
    outline: none;
    border-color: #6d5aa8;
    background: #f7f4fc;
    transform: translateY(-1px);
}

.external-series-rule-option.selected {
    border-color: #6d5aa8;
    background: #6d5aa8;
    color: #ffffff;
    box-shadow: 0 2px 7px
        rgba(79, 62, 126, .2);
}

.document-series-badge {
    position: absolute;
    right: 36px;
    top: -17px;
    padding: 2px 6px;
    border-radius: 3px;
    background: #6d5aa8;
    color: #ffffff;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .08em;
}

.preview-choice-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-choice-option {
    position: relative;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid #d8dce1;
    border-radius: 4px;
    background: #f3f4f5;
    color: #30343a;
    cursor: pointer;
}

.preview-choice-option:hover {
    border-color: #aeb6bf;
    background: #ffffff;
}

.preview-choice-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.preview-choice-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1.5px solid #8b929a;
    background: #ffffff;
}

input[type="radio"] + .preview-choice-indicator {
    border-radius: 50%;
}

input[type="checkbox"] + .preview-choice-indicator {
    border-radius: 3px;
}

.preview-choice-option input:checked +
.preview-choice-indicator {
    border-color: #33998f;
    background: #42aaa0;
    box-shadow: inset 0 0 0 3px #ffffff;
}

.preview-choice-option input[type="checkbox"]:checked +
.preview-choice-indicator {
    box-shadow: none;
}

.preview-choice-option input[type="checkbox"]:checked +
.preview-choice-indicator::after {
    content: "✓";
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
}

.preview-choice-label {
    min-width: 0;
    font-size: 13px;
    line-height: 1.35;
}

.preview-series-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-series-field > span {
    color: #5d646d;
    font-size: 12px;
    font-weight: 600;
}

.preview-series-input {
    width: 96px;
}

.series-link-form {
    grid-template-columns: 1fr;
}

.series-link-note {
    padding: 13px 14px;
    border-radius: 6px;
    background: #f4f2fa;
    color: #575064;
    font-size: 12px;
    line-height: 1.5;
}

.series-unlink-button {
    margin-right: auto;
    color: #991b1b;
}

.execution-shell .preview-document-area {
    padding: 24px clamp(26px, 4vw, 58px) 56px;
    background: #eef0f2;
}

.preview-document-frame {
    width: min(900px, 100%);
    margin: 0 auto;
}

.preview-document-caption {
    margin: 0 0 10px 2px;
}

.execution-shell .preview-paper {
    width: min(210mm, 100%);
    padding: 58px 64px;
    box-shadow: 0 12px 38px rgba(32, 38, 46, .13);
}

@media (max-width: 980px) {
    .builder-shell .editor-layout {
        grid-template-columns: 300px minmax(0, 1fr);
    }

    .document-canvas-scroll {
        padding: 24px 24px 52px;
    }

    .editor-paper,
    .execution-shell .preview-paper {
        padding: 46px 48px;
    }

    .execution-shell .preview-layout {
        grid-template-columns: 264px minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .editor-title-group {
        display: none;
    }

    .topbar-button,
    .topbar-primary {
        padding: 0 8px;
        font-size: 9px;
    }

    .builder-shell .editor-layout,
    .execution-shell .preview-layout {
        grid-template-columns: minmax(250px, 42%) minmax(0, 58%);
    }

    .editor-document-area .editor-toolbar {
        justify-content: flex-start;
        overflow-x: auto;
    }
}

/* =========================================================
   DOKUMENTANSICHT – WORD-ÄHNLICHE SATZFLÄCHE
   ========================================================= */

.editor-paper,
.execution-shell .preview-paper {
    min-height: 297mm;
    padding: 25.4mm 22mm 25.4mm 25.4mm;
    border: 1px solid #e2e4e7;
    background: #ffffff;
    color: #202124;
    font-family: Aptos, Calibri, Arial, sans-serif;
    font-size: 11pt;
    line-height: 1.15;
}

.editor-paper #documentElements,
.execution-shell .preview-document {
    width: 100%;
    color: inherit;
    font: inherit;
    line-height: inherit;
}

.builder-shell .doc-row {
    margin: 0;
}

.builder-shell .doc-row:has(.doc-element.heading) {
    margin-top: 12pt;
    margin-bottom: 6pt;
}

.builder-shell .doc-row:first-child:has(.doc-element.heading) {
    margin-top: 0;
}

.builder-shell .doc-row:has(.doc-element.paragraph) {
    margin-bottom: 8pt;
}

.builder-shell .doc-element {
    min-height: 1.15em;
    margin: 0;
    padding: 2px 5px;
    color: #202124;
    font-family: inherit;
    font-size: 11pt;
    line-height: 1.15;
    overflow-wrap: normal;
    word-break: normal;
}

.builder-shell .doc-element.heading {
    font-size: 18pt;
    font-weight: 700;
    letter-spacing: -.012em;
    line-height: 1.2;
}

.builder-shell .doc-element.paragraph {
    font-size: 11pt;
    font-weight: 400;
    line-height: 1.15;
}

.builder-shell .doc-element:empty {
    min-height: 1.55em;
    border-color: #d7dadd;
    background: #fafbfb;
}

.builder-shell .doc-element:focus {
    caret-color: #149b8e;
}

.execution-shell .preview-document-element {
    color: #202124;
    font-family: inherit;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: auto;
}

.execution-shell .preview-document-focus {
    border-radius: 3px;
    background: rgba(20, 184, 166, 0.16);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.08);
    transition:
        background-color 180ms ease,
        box-shadow 180ms ease;
}

.execution-shell .preview-document-element.heading {
    margin: 0 0 6pt;
    font-size: 18pt;
    font-weight: 700;
    letter-spacing: -.012em;
    line-height: 1.2;
}

.execution-shell .preview-document-element.heading:not(:first-child) {
    margin-top: 12pt;
}

.execution-shell .preview-document-element.paragraph {
    margin: 0 0 8pt;
    font-size: 11pt;
    font-weight: 400;
    line-height: 1.15;
}

.editor-paper .small-hint,
.execution-shell .preview-paper .small-hint {
    margin: 0;
    padding: 8px 0;
    color: #8a9098;
    font-family: Aptos, Calibri, Arial, sans-serif;
    font-size: 10.5pt;
    line-height: 1.4;
}

@media (max-width: 980px) {
    .editor-paper,
    .execution-shell .preview-paper {
        padding: 64px 56px 72px;
    }
}

/* =========================================================
   REGELN – KONTEXTMENÜ UND DIALOG
   ========================================================= */

.builder-shell .element-menu,
.builder-shell .section-actions-outside,
.builder-shell .text-field-actions {
    min-width: 174px;
}

.builder-shell .section-rule-button,
.builder-shell .text-field-rule-button {
    white-space: nowrap;
}

.rule-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 30000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(25, 28, 33, .48);
    backdrop-filter: blur(2px);
}

.rule-dialog {
    width: min(640px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border: 1px solid #d9dcdf;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(20, 25, 32, .25);
}

.rule-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid #eceeef;
}

.rule-dialog-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #2b9e93;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.rule-dialog-header h2 {
    margin: 0;
    color: #20242a;
    font-size: 21px;
    line-height: 1.25;
}

.rule-dialog-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 4px;
    background: #f0f1f2;
    color: #555d66;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
}

.rule-dialog-close:hover {
    background: #e1e3e5;
    color: #20242a;
}

.rule-target-card {
    display: grid;
    gap: 4px;
    margin: 20px 24px 0;
    padding: 14px 16px;
    border-left: 3px solid #44ada3;
    background: #f2f7f6;
}

.rule-target-card span {
    color: #68717b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.rule-target-card strong {
    color: #252a31;
    font-size: 14px;
    line-height: 1.4;
}

.rule-target-card small {
    color: #69717b;
    font-size: 11px;
}

.rule-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    padding: 22px 24px 26px;
}

.rule-form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.rule-form-field > span {
    color: #5c6570;
    font-size: 11px;
    font-weight: 750;
}

.rule-form-field select,
.rule-form-field input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #cfd3d7;
    border-radius: 5px;
    background: #ffffff;
    color: #242930;
    font: inherit;
    font-size: 13px;
}

.rule-form-field select:focus,
.rule-form-field input:focus {
    outline: none;
    border-color: #3fa99e;
    box-shadow: 0 0 0 3px rgba(63, 169, 158, .12);
}

.rule-form-field input.invalid {
    border-color: #c94b55;
    box-shadow: 0 0 0 3px rgba(201, 75, 85, .1);
}

.rule-form-field.disabled {
    opacity: .48;
}

.rule-dialog-empty {
    margin: 20px 24px 26px;
    padding: 18px;
    border: 1px dashed #cfd3d7;
    border-radius: 6px;
    background: #f8f9fa;
    color: #646c76;
    font-size: 13px;
    line-height: 1.5;
}

.rule-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid #eceeef;
    background: #fafafa;
}

.rule-cancel-button,
.rule-save-button {
    width: auto;
    height: 36px;
    padding: 0 15px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.rule-cancel-button {
    border: 1px solid #d2d5d8;
    background: #ffffff;
    color: #4f5761;
}

.rule-save-button {
    background: #3fa99e;
    color: #ffffff;
}

.rule-save-button:hover {
    background: #258f85;
}

.rule-save-button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.rule-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 31000;
    padding: 11px 16px;
    border-radius: 5px;
    background: #293139;
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(20, 25, 32, .2);
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 640px) {
    .rule-form-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   DYNAMISCHE INLINE-FOLGEN
   ========================================================= */

.inline-sequence-dialog {
    width: min(720px, 100%);
}

.inline-sequence-dialog.inline-sequence-execution-dialog {
    width: min(460px, 100%);
}

.inline-sequence-dialog-intro {
    margin: 0;
    padding: 18px 24px 0;
    color: #606a73;
    font-size: 12px;
    line-height: 1.55;
}

.inline-sequence-dialog-content {
    display: grid;
    gap: 0;
}

.inline-sequence-dialog-section {
    padding: 20px 24px 22px;
}

.inline-sequence-dialog-section +
.inline-sequence-dialog-section {
    border-top: 1px solid #eceeef;
}

.inline-sequence-dialog-section h3 {
    margin: 0 0 12px;
    color: #30363d;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .015em;
}

.inline-sequence-section-hint {
    margin: -5px 0 12px;
    color: #778087;
    font-size: 10px;
    line-height: 1.45;
}

.inline-sequence-series-section {
    padding-top: 16px;
    padding-bottom: 16px;
    background: #fafcfc;
}

.inline-sequence-series-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.inline-sequence-shared-series-option {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #d9d3f2;
    border-radius: 6px;
    background: #f8f6ff;
    color: #44358f;
    cursor: pointer;
}

.inline-sequence-shared-series-option[hidden] {
    display: none;
}

.inline-sequence-shared-series-option.is-disabled {
    opacity: .55;
    cursor: default;
}

.inline-sequence-shared-series-option input {
    margin: 2px 0 0;
    accent-color: #6655b3;
}

.inline-sequence-shared-series-option span {
    display: grid;
    gap: 2px;
}

.inline-sequence-shared-series-option strong {
    font-size: 11px;
    font-weight: 800;
}

.inline-sequence-shared-series-option small {
    color: #71699a;
    font-size: 10px;
    line-height: 1.35;
}

.inline-sequence-series-mode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #d1d7da;
    border-radius: 6px;
    background: #ffffff;
    color: #3f484f;
    text-align: left;
}

.inline-sequence-series-mode strong {
    font-size: 11px;
    font-weight: 800;
}

.inline-sequence-series-mode small {
    color: #737d84;
    font-size: 10px;
    white-space: nowrap;
}

.inline-sequence-series-mode:hover,
.inline-sequence-series-mode:focus-visible {
    border-color: #76b9b3;
    background: #f2f8f7;
    outline: none;
}

.inline-sequence-series-mode.selected,
.inline-sequence-series-mode.selected:hover {
    border-color: #21998f;
    background: #ddf1ee;
    color: #145f59;
    box-shadow: inset 0 0 0 1px #21998f;
}

.inline-sequence-existing-list {
    display: grid;
    gap: 8px;
}

.inline-sequence-shared-section {
    background: #faf9ff;
}

.inline-sequence-shared-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.inline-sequence-shared-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 50px;
    padding: 8px 10px;
    border: 1px solid #d5cfee;
    border-radius: 6px;
    background: #ffffff;
    color: #30383d;
    text-align: left;
}

.inline-sequence-shared-option:hover,
.inline-sequence-shared-option:focus-visible {
    border-color: #7c6bc2;
    background: #f5f2ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 89, 187, .1);
}

.inline-sequence-shared-option > strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    padding: 0 7px;
    border: 1px dashed #7c6bc2;
    border-radius: 4px;
    background: #f0ecff;
    color: #48378f;
    font-size: 12px;
    font-weight: 800;
}

.inline-sequence-shared-option > span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.inline-sequence-shared-option small {
    overflow: hidden;
    color: #4e5960;
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-sequence-shared-option b {
    color: #6553ae;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.inline-sequence-existing-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    min-height: 52px;
    padding: 9px 12px 9px 14px;
    border: 1px solid #d6dddf;
    border-radius: 6px;
    background: #ffffff;
    color: #30383d;
    text-align: left;
}

.inline-sequence-existing-option:hover,
.inline-sequence-existing-option:focus-visible {
    border-color: #54aaa2;
    background: #f1f8f7;
    outline: none;
    box-shadow: 0 0 0 3px rgba(63, 169, 158, .1);
}

.inline-sequence-existing-option > span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.inline-sequence-existing-option strong {
    overflow: hidden;
    color: #283036;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-sequence-existing-option small {
    color: #747e86;
    font-size: 10px;
}

.inline-sequence-existing-option b {
    flex: none;
    color: #168b82;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.inline-sequence-repeat-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    max-height: 168px;
    overflow-y: auto;
}

.inline-sequence-repeat-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 48px;
    padding: 7px 10px;
    border: 1px solid #d6dddf;
    border-radius: 6px;
    background: #ffffff;
    color: #30383d;
    text-align: left;
}

.inline-sequence-repeat-option:hover,
.inline-sequence-repeat-option:focus-visible {
    border-color: #54aaa2;
    background: #f1f8f7;
    outline: none;
    box-shadow: 0 0 0 3px rgba(63, 169, 158, .1);
}

.inline-sequence-repeat-option > strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    padding: 0 7px;
    border: 1px dashed #58a9a1;
    border-radius: 4px;
    background: #ffffff;
    color: #155f59;
    font-size: 12px;
    font-weight: 800;
}

.inline-sequence-repeat-option > span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.inline-sequence-repeat-option small {
    overflow: hidden;
    color: #4e5960;
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-sequence-repeat-option b {
    color: #168b82;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.inline-sequence-compact-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 116px;
    gap: 12px;
}

.inline-sequence-format-heading {
    margin: 18px 0 9px;
    color: #5c6570;
    font-size: 11px;
    font-weight: 750;
}

.inline-sequence-format-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.inline-sequence-format-option {
    min-width: 0;
    height: 38px;
    padding: 0 8px;
    overflow: hidden;
    border: 1px solid #d1d7da;
    border-radius: 5px;
    background: #ffffff;
    color: #3f484f;
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-sequence-format-option:hover {
    border-color: #76b9b3;
    background: #f2f8f7;
}

.inline-sequence-format-option.selected,
.inline-sequence-format-option.selected:hover {
    border-color: #21998f;
    background: #ddf1ee;
    color: #145f59;
    box-shadow: inset 0 0 0 1px #21998f;
}

.inline-sequence-shared-editor {
    padding: 12px;
    border: 1px solid #ded9f2;
    border-radius: 6px;
    background: #faf9ff;
}

.inline-sequence-shared-name-field {
    margin-top: 10px;
}

.inline-sequence-shared-help {
    display: block;
    margin-top: 9px;
    color: #706d7b;
    font-size: 10px;
    line-height: 1.45;
}

.inline-sequence-field-help {
    display: block;
    margin-top: 5px;
    color: #778087;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.4;
}

.inline-sequence-dialog-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.inline-sequence-execution-value-field {
    width: min(230px, 100%);
}

.inline-sequence-execution-value-field small {
    color: #778087;
    font-size: 10px;
}

.inline-sequence-execution-hint {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #d8e5e3;
    border-radius: 6px;
    background: #f6faf9;
    color: #546d69;
    font-size: 10px;
    line-height: 1.45;
}

.inline-sequence-automatic-button {
    margin-right: auto;
    padding: 0;
    border: 0;
    border-bottom: 1px solid rgba(22, 139, 130, .35);
    border-radius: 0;
    background: transparent;
    color: #167f76;
    font-size: 10px;
    font-weight: 780;
}

.inline-sequence-automatic-button:hover,
.inline-sequence-automatic-button:focus-visible {
    border-bottom-color: #126b64;
    color: #126b64;
    outline: none;
}

.inline-sequence-edit-actions {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
}

.inline-sequence-delete-button {
    width: auto;
    height: 36px;
    padding: 0 13px;
    border: 1px solid #e1c7ca;
    border-radius: 4px;
    background: #ffffff;
    color: #a13e48;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.inline-sequence-delete-button:hover {
    border-color: #cf828a;
    background: #faecee;
}

/* =========================================================
   WERTFELDER
   ========================================================= */

.value-field-dialog {
    width: min(680px, 100%);
}

.value-field-dialog.value-field-execution-dialog {
    width: min(480px, 100%);
}

.value-field-dialog-intro {
    margin: 0;
    padding: 18px 24px 0;
    color: #606a73;
    font-size: 12px;
    line-height: 1.55;
}

.value-field-dialog-content {
    display: grid;
}

.value-field-dialog-section {
    padding: 20px 24px 22px;
}

.value-field-dialog-section +
.value-field-dialog-section {
    border-top: 1px solid #eceeef;
}

.value-field-dialog-section h3 {
    margin: 0 0 12px;
    color: #30363d;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .015em;
}

.value-field-existing-list {
    display: grid;
    gap: 8px;
    max-height: 190px;
    overflow-y: auto;
}

.value-field-existing-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    min-height: 52px;
    padding: 9px 12px 9px 14px;
    border: 1px solid #e0c8cb;
    border-radius: 6px;
    background: #ffffff;
    color: #30383d;
    text-align: left;
}

.value-field-existing-option:hover,
.value-field-existing-option:focus-visible {
    border-color: #c85a64;
    background: #fff7f7;
    outline: none;
    box-shadow: 0 0 0 3px rgba(190, 58, 69, .09);
}

.value-field-existing-option > span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.value-field-existing-option strong {
    overflow: hidden;
    color: #3d292b;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.value-field-existing-option small {
    color: #7a7374;
    font-size: 10px;
}

.value-field-existing-option b {
    flex: none;
    color: #aa3540;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.value-field-new-section {
    background: #fffafa;
}

.value-field-help {
    display: block;
    margin-top: 5px;
    color: #778087;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.4;
}

.value-field-scope-heading {
    margin: 18px 0 9px;
    color: #5c6570;
    font-size: 11px;
    font-weight: 750;
}

.value-field-scope-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.value-field-scope-option {
    display: grid;
    gap: 4px;
    min-height: 66px;
    padding: 10px 12px;
    border: 1px solid #d7dcdf;
    border-radius: 6px;
    background: #ffffff;
    color: #414a51;
    text-align: left;
}

.value-field-scope-option strong {
    font-size: 11px;
    font-weight: 800;
}

.value-field-scope-option small {
    color: #737d84;
    font-size: 10px;
    line-height: 1.35;
}

.value-field-scope-option:hover,
.value-field-scope-option:focus-visible {
    border-color: #ca7a82;
    background: #fff8f8;
    outline: none;
}

.value-field-scope-option.selected,
.value-field-scope-option.selected:hover {
    border-color: #bd4651;
    background: #fcebec;
    color: #7e242d;
    box-shadow: inset 0 0 0 1px #bd4651;
}

.value-field-validation {
    min-height: 16px;
    margin: 8px 0 0;
    color: #a92d38;
    font-size: 10px;
    font-weight: 650;
}

.value-field-dialog-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.value-field-execution-input {
    width: 100%;
}

.value-field-impact-note {
    margin: 14px 0 0;
    padding: 10px 12px;
    border: 1px solid #ead4d6;
    border-radius: 6px;
    background: #fff8f8;
    color: #76575a;
    font-size: 10px;
    line-height: 1.45;
}

.value-field-definition-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #ece0e1;
    border-radius: 6px;
    background: #fffafa;
    color: #6d6263;
    font-size: 10px;
}

.value-field-definition-meta strong {
    color: #95313a;
    font-size: 10px;
}

.value-field-edit-actions {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
}

.value-field-delete-button {
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid #e1c7ca;
    border-radius: 4px;
    background: #ffffff;
    color: #a13e48;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.value-field-delete-button:hover {
    border-color: #cf828a;
    background: #faecee;
}

@media (max-width: 640px) {
    .value-field-scope-grid {
        grid-template-columns: 1fr;
    }

    .value-field-edit-actions {
        grid-template-columns: 1fr 1fr;
    }

    .value-field-edit-actions > span {
        display: none;
    }
}

@media (max-width: 720px) {
    .inline-sequence-shared-list {
        grid-template-columns: 1fr;
    }

    .inline-sequence-repeat-list {
        grid-template-columns: 1fr;
    }

    .inline-sequence-format-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inline-sequence-compact-fields {
        grid-template-columns: 1fr;
    }

    .inline-sequence-start-field {
        max-width: 150px;
    }

    .inline-sequence-edit-actions {
        grid-template-columns: 1fr 1fr;
    }

    .inline-sequence-edit-actions > span {
        display: none;
    }
}

/* Textmarker sind bewusst semantische Inline-Spans. Dadurch bleiben
   Platzhalter und bedingte Texte ihre eigenständigen, verknüpften
   Elemente; die Farbe liegt lediglich um deren sichtbaren Text. */

.document-text-highlight[data-text-highlight] {
    padding: 0 .02em;
    border-radius: 1px;
    color: inherit;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.document-text-highlight[data-text-highlight="yellow"] {
    background-color: #fff176;
}

.document-text-highlight[data-text-highlight="green"] {
    background-color: #b7e4a8;
}

.document-text-highlight[data-text-highlight="red"] {
    background-color: #f4a6a6;
}

/* Schriftfarben bleiben eine von der Textmarkierung unabhängige
   Inline-Eigenschaft. Die vererbte Farbe erreicht dadurch auch
   Platzhalter und bedingte Texte, ohne deren Verknüpfung zu verändern. */

.document-text-color[data-text-color] {
    color: var(--document-text-color);
}

.document-text-color[data-text-color="yellow"] {
    --document-text-color: #c89b00;
}

.document-text-color[data-text-color="green"] {
    --document-text-color: #218739;
}

.document-text-color[data-text-color="red"] {
    --document-text-color: #d13b40;
}

.document-text-color[data-text-color]
.document-placeholder,
.document-text-color[data-text-color]
.document-inline-rule {
    color: inherit !important;
}

/* Bedingte Texte bleiben im Lesefluss ruhig. Gelb kennzeichnet eine
   noch nicht verknüpfte Auswahl. Hover, Bearbeitung und Tastaturauswahl
   verändern die semantische Füllfarbe nicht. */

.document-inline-rule {
    padding: 1px 2px;
    border-bottom: 2px solid #c79f19;
    border-radius: 2px;
    background: #f4d35e;
    color: inherit;
    cursor: pointer;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    transition:
        background-color .14s ease,
        border-color .14s ease,
        color .14s ease;
}

.document-inline-rule:hover {
    background: #f4d35e;
}

.document-inline-rule.linked {
    border-bottom-color: #118b83;
    background: #dff2ee;
    color: #213b3a;
}

.document-inline-rule.linked:hover {
    background: #dff2ee;
    color: #213b3a;
}

.document-inline-rule.pending {
    border-bottom-color: #c79f19;
    background: #f4d35e;
}

/* Verschachtelte Bedingungen erhalten rundum eine Kontur. So bleibt die
   innere Logikebene auch innerhalb der mintfarbenen Außenfläche erkennbar. */

.document-inline-rule
.document-inline-rule {
    margin: 0 1px;
    border: 1px solid #118b83;
    border-bottom-width: 2px;
}

.document-inline-rule
.document-inline-rule.linked {
    border-color: #118b83;
    background: #dff2ee;
}

.document-inline-rule
.document-inline-rule.pending {
    border-color: #c79f19;
    background: #f4d35e;
}

.document-inline-rule.is-editing,
.document-inline-rule.is-editing:hover,
.document-inline-rule.is-keyboard-selected,
.document-inline-rule.is-keyboard-selected:hover {
    outline: 2px solid rgba(16, 159, 148, .24);
    outline-offset: 1px;
}

.document-inline-rule.is-keyboard-selected {
    box-shadow: 0 0 0 1px rgba(16, 159, 148, .14);
}

/* =========================================================
   QUELLSYSTEM-ÄHNLICHE DOKUMENTHIERARCHIE
   ========================================================= */

.builder-shell .doc-row {
    position: relative;
    min-height: 34px;
    padding: 4px 132px 4px
        calc(var(--element-indent, 0px) + 25px);
    border-radius: 2px;
    background-image:
        repeating-linear-gradient(
            to right,
            transparent 0,
            transparent 29px,
            #e2e5e7 29px,
            #e2e5e7 30px
        );
    background-repeat: no-repeat;
    background-size:
        var(--element-indent, 0px) 100%;
    transition:
        background-color .15s ease,
        opacity .15s ease;
}

.builder-shell .doc-row:hover,
.builder-shell .doc-row.selected {
    background-color: #f7f8f8;
}

.builder-shell .doc-row.selected {
    outline: 1px solid #d9dcdf;
}

.builder-shell .doc-row.hidden-in-output {
    background-color: #f1f2f3;
}

.builder-shell .doc-row.hidden-in-output
.doc-element {
    color: #9a9fa5;
}

.document-heading-toggle {
    position: absolute;
    left: var(--element-indent, 0px);
    top: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    padding: 0;
    border-radius: 3px;
    background: transparent;
    color: #a4a9ae;
}

.document-heading-toggle:hover {
    background: #e5e8ea;
    color: #399f96;
}

.document-heading-toggle svg {
    width: 15px;
    height: 15px;
    stroke-width: 2.2;
}

.document-paragraph-marker {
    position: absolute;
    left: calc(var(--element-indent, 0px) + 8px);
    top: 16px;
    width: 5px;
    height: 1px;
    background: #d9dde0;
}

.builder-shell .doc-element {
    width: 100%;
    min-width: 0;
}

.builder-shell .doc-element.heading.level-1 {
    font-size: 18pt;
}

.builder-shell .doc-element.heading.level-2 {
    font-size: 15pt;
}

.builder-shell .doc-element.heading.level-3 {
    font-size: 13pt;
}

.builder-shell .doc-element.heading.level-4,
.builder-shell .doc-element.heading.level-5,
.builder-shell .doc-element.heading.level-6,
.builder-shell .doc-element.heading.level-7,
.builder-shell .doc-element.heading.level-8,
.builder-shell .doc-element.heading.level-9 {
    font-size: 11.5pt;
}

.element-inline-actions {
    position: absolute;
    right: 3px;
    top: 50%;
    z-index: 18;
    display: none;
    align-items: center;
    gap: 6px;
    transform: translateY(-50%);
}

.builder-shell .doc-row.selected
.element-inline-actions {
    display: flex;
}

.builder-shell .element-menu-button,
.element-rules-button {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 31px;
    border-radius: 3px;
    font-weight: 800;
}

.builder-shell .element-menu-button {
    width: 32px;
    padding: 0;
    background: #e2e4e5;
    color: #697078;
    font-size: 18px;
}

.builder-shell .element-menu-button.linked {
    background: #55b4ac;
    color: #ffffff;
}

.element-rules-button {
    width: auto;
    padding: 0 13px;
    background: #d9dcdf;
    color: #60676f;
    font-size: 10px;
    letter-spacing: .035em;
}

.element-rules-button.linked {
    background: #159ca8;
    color: #ffffff;
}

.element-rules-button:hover,
.element-rules-button.linked:hover {
    background: #0e8792;
    color: #ffffff;
}

.builder-shell .element-menu {
    right: 3px;
    top: calc(50% + 20px);
    z-index: 60;
    min-width: 178px;
    padding: 5px;
    border-radius: 3px;
    box-shadow: 0 9px 24px rgba(35, 40, 46, .18);
}

.builder-shell .element-menu button {
    height: 32px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .025em;
}

.builder-shell .element-menu
.active-option {
    color: #168f86;
    background: #e4f4f1;
}

/* =========================================================
   DIREKTER REGELMODUS
   ========================================================= */

.rule-composer-active {
    --rule-composer-height:
        min(330px, 43vh);
}

.rule-composer-active.multiple-rule-groups {
    --rule-composer-height:
        min(445px, 58vh);
}

.rule-composer-active .editor-layout {
    padding-bottom:
        var(--rule-composer-height);
}

.rule-composer-active .editor-toolbar,
.rule-composer-active
.document-footer-actions {
    opacity: .34;
    pointer-events: none;
}

.rule-composer-active .doc-row {
    opacity: .26;
    pointer-events: none;
}

.rule-composer-active
.doc-row.rule-target-active {
    opacity: .72;
}

.rule-composer-active
.external-question.rule-target-active,
.rule-composer-active
.external-section-block.rule-target-active,
.rule-composer-active
.external-text-field-row.rule-target-active {
    position: relative;
    z-index: 2;
    border-radius: 3px;
    box-shadow:
        0 0 0 2px
        rgba(20, 184, 166, .34);
}

.series-link-active .editor-layout {
    padding-bottom: 82px;
}

.series-link-active
.doc-row.series-target-active,
.series-link-active
.external-section-block.series-target-active,
.series-link-active
.external-question.series-target-active,
.series-link-active
.external-text-field-row.series-target-active {
    position: relative;
    z-index: 2;
    border-radius: 3px;
    box-shadow:
        0 0 0 2px
        rgba(109, 90, 168, .42);
}

.series-link-composer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10020;
    display: grid;
    grid-template-columns:
        minmax(190px, auto)
        minmax(260px, 1fr)
        auto;
    align-items: center;
    gap: 18px;
    min-height: 72px;
    padding: 12px 22px;
    border-top: 1px solid #59488f;
    background: #f0ebfa;
    box-shadow: 0 -8px 22px rgba(33, 28, 51, .12);
}

.series-link-composer > div span,
.series-link-composer > div strong {
    display: block;
}

.series-link-composer > div span {
    color: #81769c;
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.series-link-composer > div strong {
    margin-top: 2px;
    color: #332b4c;
    font-size: 12px;
}

.series-link-composer p {
    margin: 0;
    color: #5f5577;
    font-size: 11px;
}

.series-link-composer button {
    width: auto;
    min-width: 88px;
    height: 32px;
    padding: 0 12px;
    border-radius: 3px;
    background: #6d5aa8;
    color: #ffffff;
    font-size: 9px;
    font-weight: 850;
    text-transform: uppercase;
}

.series-link-composer-empty {
    color: #a1343e;
    font-size: 10px;
    font-weight: 700;
}

.element-rules-button.editing,
.element-rules-button.editing:hover {
    background: #d85d66;
    color: #ffffff;
}

.external-choice-option-row.rule-selectable {
    cursor: pointer;
    transition:
        border-color .14s ease,
        background-color .14s ease,
        box-shadow .14s ease,
        transform .14s ease;
}

.external-choice-option-row.rule-selectable:hover {
    border-color: #91b86d;
    background: #f3f7ef;
    transform: translateY(-1px);
}

.external-choice-option-row.rule-selectable:focus {
    outline: 2px solid rgba(91, 168, 34, .34);
    outline-offset: 2px;
}

.external-choice-option-row.rule-selected,
.external-choice-option-row.rule-selected:hover,
.external-choice-option-row.rule-selected:focus-within {
    border-color: #5ca90d;
    background: #75c900;
    box-shadow:
        inset 3px 0 0 #438600,
        0 3px 10px rgba(81, 139, 20, .18);
    transform: none;
}

.external-choice-option-row.rule-selected
.external-choice-option-input {
    color: #173400;
    font-weight: 750;
}

.external-choice-option-row.rule-selected
.external-choice-control {
    border-color: #244b00;
    background: #ffffff;
    box-shadow:
        inset 0 0 0 3px #75c900;
}

.external-choice-option-row.rule-selected.rule-negative,
.external-choice-option-row.rule-selected.rule-negative:hover,
.external-choice-option-row.rule-selected.rule-negative:focus-within {
    border-color: #b43b47;
    background: #d9606b;
    box-shadow:
        inset 3px 0 0 #912732,
        0 3px 10px rgba(157, 43, 54, .2);
}

.external-choice-option-row.rule-selected.rule-negative
.external-choice-option-input {
    color: #ffffff;
}

.external-choice-option-row.rule-selected.rule-negative
.external-choice-control {
    border-color: #7f1d27;
    background: #ffffff;
    box-shadow:
        inset 0 0 0 3px #d9606b;
}

.rule-composer-active
.external-choice-delete {
    visibility: hidden;
}

.rule-composer-active
.external-add-textfield,
.rule-composer-active
.external-question-delete,
.rule-composer-active
.section-actions-outside,
.rule-composer-active
.text-field-actions {
    pointer-events: none;
    opacity: .34;
}

.document-rule-composer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25000;
    display: grid;
    grid-template-rows:
        auto minmax(0, 1fr) auto;
    height:
        var(--rule-composer-height);
    border-top: 1px solid #cfd4d7;
    background: #ffffff;
    box-shadow:
        0 -16px 42px rgba(27, 34, 40, .14);
}

.document-rule-composer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 24px;
    border-bottom: 1px solid #e7e9eb;
    background: #fbfbfb;
}

.document-rule-composer-head > div:first-child {
    display: flex;
    align-items: baseline;
    gap: 9px;
    min-width: 0;
}

.document-rule-kicker {
    flex: none;
    color: #288e85;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.document-rule-composer-head strong {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: #40464d;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-rule-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.document-rule-cancel,
.document-rule-finish,
.document-rule-add-group,
.document-rule-remove {
    width: auto;
    height: 33px;
    padding: 0 13px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.document-rule-cancel {
    background: #e7e9ea;
    color: #59616a;
}

.document-rule-cancel:hover {
    background: #dadddf;
}

.document-rule-finish {
    background: #159ca8;
    color: #ffffff;
}

.document-rule-finish:hover {
    background: #0c8792;
}

.document-rule-composer-body {
    min-height: 0;
    padding: 15px 24px 12px;
    overflow-y: auto;
}

.document-rule-intro {
    margin: 0 0 7px;
    color: #343a41;
    font-size: 13px;
    line-height: 1.4;
}

.document-rule-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 16px;
    margin-bottom: 10px;
    color: #737b82;
    font-size: 9px;
    font-weight: 700;
}

.document-rule-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.document-rule-legend i {
    width: 9px;
    height: 9px;
    border-radius: 2px;
}

.document-rule-legend i.positive {
    background: #75c900;
}

.document-rule-legend i.negative {
    background: #d9606b;
}

.document-rule-legend b {
    color: #4f565d;
    font-weight: 850;
}

.document-rule-expression {
    min-height: 66px;
    padding: 11px 13px;
    border-left: 3px solid #73b735;
    background: #f1f2f2;
}

.document-rule-group {
    padding: 3px;
    border: 1px solid transparent;
    border-radius: 3px;
}

.document-rule-group.active {
    border-color: rgba(31, 151, 140, .28);
    background: rgba(255, 255, 255, .46);
}

.document-rule-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
    color: #777e85;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.document-rule-group-head button {
    width: 22px;
    height: 22px;
    padding: 0;
    background: transparent;
    color: #8c9298;
    font-size: 17px;
}

.document-rule-group-head button:hover {
    background: #f3dfe1;
    color: #aa343e;
}

.rule-expression-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.rule-expression-term {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
}

.rule-expression-condition {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    min-height: 30px;
    padding: 0;
    border-radius: 2px;
    background: transparent;
    color: #343940;
    font-size: 11px;
    line-height: 1.45;
    text-align: left;
}

.rule-expression-condition:hover {
    background: #ffffff;
    box-shadow:
        0 0 0 4px #ffffff;
}

.rule-word-when,
.rule-word-connector,
.rule-group-connector {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    min-height: 24px;
    padding: 0 7px;
    border-radius: 3px;
    color: #ffffff;
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
    text-transform: lowercase;
}

.rule-word-when {
    background: #62a817;
}

.rule-word-when.negative {
    background: #c84652;
}

.rule-word-connector,
.rule-group-connector {
    width: auto;
    border: 0;
    background: #656b71;
    cursor: pointer;
    transition:
        background-color .14s ease,
        transform .14s ease;
}

.rule-word-connector:hover,
.rule-group-connector:hover {
    background: #343a40;
    transform: translateY(-1px);
}

.rule-group-connector {
    width: fit-content;
    margin: 7px 0;
}

.rule-expression-condition.negative
.rule-expression-copy strong {
    color: #9d2f39;
}

.rule-expression-copy strong {
    color: #22272d;
    font-weight: 850;
}

.rule-condition-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    margin-left: 1px;
    border-radius: 50%;
    color: #93999e;
    font-size: 14px;
}

.rule-expression-condition:hover
.rule-condition-remove {
    background: #f0dfe0;
    color: #a4353f;
}

.document-rule-group-empty {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    color: #778087;
    font-size: 11px;
    font-style: italic;
}

.document-rule-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 43px;
    color: #5e656c;
}

.document-rule-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 31px;
    height: 31px;
    border-radius: 50%;
    background: #dfeee5;
    color: #4a8f18;
    font-size: 17px;
}

.document-rule-empty div {
    display: grid;
    gap: 2px;
}

.document-rule-empty strong {
    color: #3d444b;
    font-size: 12px;
}

.document-rule-empty span:last-child {
    color: #747b82;
    font-size: 11px;
}

.document-inline-series-panel {
    display: grid;
    grid-template-columns: minmax(220px, .9fr) minmax(260px, 1.1fr);
    gap: 16px 22px;
    align-items: start;
    margin-top: 16px;
    padding: 15px 16px;
    border: 1px solid #cfe3e0;
    border-radius: 12px;
    background: #f5faf9;
}

.document-inline-series-copy strong {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #183f3c;
    font-size: 12px;
}

.document-inline-series-copy strong span {
    padding: 2px 6px;
    border-radius: 999px;
    background: #e2efed;
    color: #5f7774;
    font-size: 9px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.document-inline-series-copy p {
    margin: 7px 0 0;
    color: #60706e;
    font-size: 11px;
    line-height: 1.45;
}

.document-inline-series-copy code {
    padding: 1px 4px;
    border-radius: 4px;
    background: #e4efed;
    color: #166f69;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 10px;
}

.document-inline-series-options {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.document-inline-series-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #cbd8d6;
    border-radius: 9px;
    background: #fff;
    color: #445552;
    font-size: 11px;
    font-weight: 700;
    text-align: left;
}

.document-inline-series-option:hover {
    border-color: #69aaa4;
    background: #edf7f5;
}

.document-inline-series-option.selected {
    border-color: #15978d;
    background: #dff2ee;
    color: #164b47;
    box-shadow: inset 0 0 0 1px #15978d;
}

.document-inline-series-radio {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    border: 2px solid #90a5a2;
    border-radius: 50%;
    background: #fff;
}

.document-inline-series-option.selected
.document-inline-series-radio {
    border: 4px solid #15978d;
}

.document-inline-series-status {
    grid-column: 2;
    color: #60706e;
    font-size: 10px;
}

.document-inline-series-status strong {
    color: #147c75;
}

.document-inline-series-empty {
    color: #7b8583;
    font-size: 11px;
}

.document-rule-composer-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 51px;
    padding: 8px 24px;
    border-top: 1px solid #e6e8e9;
    background: #fafafa;
}

.document-rule-add-group {
    background: #e0e2e3;
    color: #555d65;
}

.document-rule-add-group:hover {
    background: #d2d5d7;
}

.document-rule-count {
    margin-right: auto;
    color: #8a9096;
    font-size: 10px;
    font-weight: 700;
}

.document-rule-remove {
    background: transparent;
    color: #ae414a;
}

.document-rule-remove:hover {
    background: #f7e2e4;
}

@media (max-width: 760px) {
    .rule-composer-active {
        --rule-composer-height:
            min(390px, 55vh);
    }

    .document-rule-composer-head {
        align-items: flex-start;
        padding: 10px 14px;
    }

    .document-rule-composer-head
    > div:first-child {
        display: grid;
        gap: 2px;
    }

    .document-rule-composer-body,
    .document-rule-composer-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .document-inline-series-panel {
        grid-template-columns: 1fr;
    }

    .document-inline-series-status {
        grid-column: 1;
    }

    .document-rule-count {
        display: none;
    }
}

.document-state-badges {
    position: absolute;
    right: 3px;
    top: -14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.document-state-badge {
    padding: 2px 5px;
    border-radius: 2px;
    color: #ffffff;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: .07em;
}

.document-state-badge.series {
    background: #6d5aa8;
}

.document-state-badge.hidden {
    background: #8a9198;
}

.document-state-badge.anchor {
    background: #328da2;
}

.text-anchor-form {
    grid-template-columns: 1fr;
}

.execution-shell .preview-document-element {
    margin-left:
        var(--preview-indent, 0px);
}

.execution-shell
.preview-document-element.heading.level-2 {
    font-size: 15pt;
}

.execution-shell
.preview-document-element.heading.level-3 {
    font-size: 13pt;
}

.execution-shell
.preview-document-element.heading.level-4,
.execution-shell
.preview-document-element.heading.level-5,
.execution-shell
.preview-document-element.heading.level-6,
.execution-shell
.preview-document-element.heading.level-7,
.execution-shell
.preview-document-element.heading.level-8,
.execution-shell
.preview-document-element.heading.level-9 {
    font-size: 11.5pt;
}

/* =========================================================
   LAYOUTS & VORLAGENOPTIONEN
   ========================================================= */

.layout-workspace {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin-top: 28px;
}

.layout-library,
.layout-editor-card {
    border: 1px solid #dfe3e8;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(20, 28, 38, .04);
}

.layout-library {
    position: sticky;
    top: 24px;
    padding: 18px;
}

.layout-library .section-title {
    margin: 0 0 12px;
}

.layout-create-row {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.layout-create-row input,
.layout-field input,
.layout-field select,
.layout-name-field {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 11px;
    border: 1px solid #cfd5dc;
    border-radius: 6px;
    background: #ffffff;
    color: #18212b;
    font: inherit;
}

.layout-list {
    display: grid;
    gap: 6px;
}

.layout-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #f4f6f8;
    color: #364150;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
}

.layout-list-item:hover {
    background: #e9eef1;
}

.layout-list-item.active {
    border-color: #65c6bd;
    background: #e7f7f5;
    color: #125c57;
}

.layout-list-item small {
    color: #6f7b88;
    font-size: 9px;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.layout-editor-card {
    overflow: hidden;
}

.layout-editor-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    border-bottom: 1px solid #e4e7eb;
}

.layout-editor-heading > div {
    flex: 1;
    min-width: 0;
}

.layout-editor-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #77818d;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.layout-name-field {
    max-width: 420px;
    height: 36px;
    padding-left: 0;
    border-color: transparent;
    border-radius: 3px;
    color: #17202c;
    font-size: 19px;
    font-weight: 750;
}

.layout-name-field:hover,
.layout-name-field:focus {
    padding-left: 9px;
    border-color: #cfd5dc;
    outline: none;
}

.layout-editor-grid {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(190px, .7fr) minmax(250px, 1fr);
    gap: 0;
}

.layout-settings-group,
.layout-preview-group {
    min-width: 0;
    padding: 22px;
}

.layout-settings-group + .layout-settings-group,
.layout-preview-group {
    border-left: 1px solid #e4e7eb;
}

.layout-settings-group h2,
.layout-preview-group h2 {
    margin: 0 0 17px;
    color: #27313c;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.layout-field {
    display: grid;
    gap: 6px;
    margin-bottom: 13px;
    color: #4b5563;
    font-size: 12px;
    font-weight: 700;
}

.layout-number-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    align-items: center;
}

.layout-number-control input {
    border-radius: 6px 0 0 6px;
}

.layout-number-control small {
    display: grid;
    place-items: center;
    height: 40px;
    border: 1px solid #cfd5dc;
    border-left: 0;
    border-radius: 0 6px 6px 0;
    background: #f4f6f8;
    color: #66717e;
}

.layout-miniature-wrap {
    padding: 18px;
    border-radius: 8px;
    background: #edf0f3;
}

.layout-miniature {
    min-height: 285px;
    padding:
        var(--mini-margin-top)
        var(--mini-margin-right)
        var(--mini-margin-bottom)
        var(--mini-margin-left);
    border: 1px solid #d8dde2;
    background: #ffffff;
    color: #1c2430;
    box-shadow: 0 5px 16px rgba(17, 24, 39, .08);
    font-family: var(--mini-font);
    font-size: var(--mini-body-size);
    line-height: var(--mini-line-height);
}

.layout-miniature strong {
    display: block;
    margin-bottom: 14px;
    font-size: var(--mini-heading-size);
}

.layout-miniature p {
    margin: 0 0 10px;
}

.builder-shell .topbar-options-button.active {
    border-color: #7cd3cb;
    background: #158f87;
}

.builder-shell .topbar-options-button {
    flex: 0 0 auto;
    min-width: 72px;
    border-color: #39bdb3;
    background: #10a89e;
    color: #ffffff;
    font-weight: 800;
    letter-spacing: .035em;
}

.builder-shell .topbar-options-button:hover {
    border-color: #6ed3cb;
    background: #18b8ad;
}

.external-layout-tabs {
    display: flex;
    gap: 28px;
    margin-top: 30px;
    border-bottom: 1px solid #d9dee3;
}

.external-layout-tabs button {
    position: relative;
    padding: 11px 2px 12px;
    border: 0;
    background: transparent;
    color: #7a8490;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.external-layout-tabs button.active {
    color: #25303c;
}

.external-layout-tabs button.active::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    background: #12b8ad;
    content: "";
}

.external-layout-panel {
    margin-top: 22px;
}

.external-layout-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.external-layout-heading p {
    max-width: 760px;
    margin: 7px 0 0;
    color: #737e8b;
    font-size: 12px;
    line-height: 1.5;
}

.external-layout-list {
    display: grid;
    gap: 2px;
}

.external-layout-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 68px;
    padding: 12px 16px;
    border: 1px solid #e0e4e8;
    border-radius: 5px;
    background: #ffffff;
}

.external-layout-row-copy {
    min-width: 0;
}

.external-layout-row-copy strong,
.external-layout-row-copy small {
    display: block;
}

.external-layout-row-copy strong {
    overflow: hidden;
    color: #33404d;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.external-layout-row-copy small {
    margin-top: 5px;
    color: #89929c;
    font-size: 10px;
}

.external-layout-row-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.layout-default-badge {
    color: #148b82;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.layout-upload-launch {
    margin-top: 22px;
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 4px;
    background: #10b8ad;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.layout-upload-launch:hover {
    background: #0da399;
}

.layout-wizard-overlay {
    position: fixed;
    z-index: 120;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(22, 28, 35, .45);
}

.layout-wizard {
    width: min(940px, 100%);
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(14, 21, 28, .25);
}

.layout-wizard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    border-bottom: 1px solid #e2e6ea;
}

.layout-wizard-step {
    display: block;
    margin-bottom: 4px;
    color: #11a89e;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.layout-wizard-header h2 {
    margin: 0;
    color: #27323e;
    font-size: 20px;
}

.layout-wizard-close {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: #eef1f3;
    color: #65717d;
    font-size: 22px;
    line-height: 1;
}

.layout-wizard-body {
    padding: 24px 22px;
    overflow-y: auto;
}

.layout-wizard-navigation {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid #e2e6ea;
    background: #f8fafb;
}

.layout-wizard-navigation button {
    min-height: 46px;
    border: 0;
    border-right: 1px solid #e2e6ea;
    background: transparent;
    color: #697581;
    font: inherit;
    font-size: 11px;
    font-weight: 750;
}

.layout-wizard-navigation button:last-child {
    border-right: 0;
}

.layout-wizard-navigation button span {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-right: 6px;
    border: 1px solid #cbd3d9;
    border-radius: 50%;
    background: #ffffff;
    color: #75808b;
    font-size: 9px;
}

.layout-wizard-navigation button.active {
    background: #eefaf8;
    color: #0f756e;
}

.layout-wizard-navigation button.active span {
    border-color: #14a99f;
    background: #14a99f;
    color: #ffffff;
}

.layout-wizard-body > p {
    margin: 0 0 18px;
    color: #66717e;
    font-size: 13px;
    line-height: 1.6;
}

.layout-file-drop {
    display: grid;
    place-items: center;
    min-height: 150px;
    padding: 24px;
    border: 1px dashed #aeb9c2;
    border-radius: 6px;
    background: #f7f9fa;
    color: #30404d;
    cursor: pointer;
    text-align: center;
}

.layout-file-drop:hover {
    border-color: #19b7ac;
    background: #f0fbfa;
}

.layout-file-drop input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.layout-file-drop strong {
    color: #11a89e;
    font-size: 12px;
}

.layout-file-drop small {
    margin-top: 8px;
    color: #7b8691;
    font-size: 11px;
}

.layout-validation-warnings {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #f1cf8b;
    border-radius: 5px;
    background: #fff9ec;
    color: #76551c;
    font-size: 11px;
    line-height: 1.5;
}

.layout-validation-warnings ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.layout-validation-errors {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #e6a9a9;
    border-radius: 5px;
    background: #fff1f1;
    color: #8a2828;
    font-size: 11px;
    line-height: 1.5;
}

.layout-validation-errors ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.layout-package-audit {
    display: grid;
    gap: 9px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #dce4e8;
    border-radius: 5px;
    background: #f7fafb;
    color: #42515d;
    font-size: 11px;
}

.layout-package-capabilities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.layout-package-capabilities span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 7px;
    border: 1px solid #d4e3e4;
    border-radius: 4px;
    background: #fff;
}

.layout-package-capabilities b {
    color: #0f9f96;
}

.layout-mapping-grid {
    display: grid;
    gap: 12px;
}

.layout-mapping-summary,
.layout-mapping-import {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 14px;
    border: 1px solid #dce2e6;
    border-radius: 6px;
    background: #ffffff;
}

.layout-mapping-summary strong,
.layout-mapping-summary small {
    display: block;
}

.layout-mapping-summary strong {
    color: #34414d;
    font-size: 12px;
}

.layout-mapping-summary small {
    margin-top: 3px;
    color: #77828d;
    font-size: 10px;
}

.layout-mapping-summary > span {
    flex: 0 0 auto;
    padding: 5px 8px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .04em;
}

.layout-mapping-summary > span.valid {
    border-color: #9dd7cf;
    background: #eaf8f6;
    color: #116e67;
}

.layout-mapping-summary > span.invalid {
    border-color: #efb3b3;
    background: #fff0f0;
    color: #a02d36;
}

.layout-table-design-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 16px;
    border: 1px solid #bfe1dc;
    border-radius: 8px;
    background: linear-gradient(135deg, #f2fbf9, #fff);
}

.layout-table-design-intro strong,
.layout-table-design-intro small { display: block; }
.layout-table-design-intro strong { color: #24413e; font-size: 13px; }
.layout-table-design-intro small {
    max-width: 720px;
    margin-top: 4px;
    color: #647774;
    font-size: 10px;
    line-height: 1.5;
}
.layout-table-design-intro > span {
    padding: 6px 9px;
    border-radius: 999px;
    background: #dff4f0;
    color: #116e67;
    font-size: 9px;
    font-weight: 800;
}
.layout-table-design-grid { display: grid; gap: 12px; }
.layout-table-design-card {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 16px;
    padding: 14px;
    border: 1px solid #dce3e5;
    border-radius: 8px;
    background: #fff;
    transition: opacity .16s ease, border-color .16s ease;
}
.layout-table-design-card.enabled {
    border-color: #a9d8d2;
    box-shadow: 0 3px 12px rgba(26, 74, 70, .06);
}
.layout-table-design-card.disabled { opacity: .58; }
.layout-table-design-preview {
    align-self: start;
    display: grid;
    min-height: 92px;
    padding: 12px;
    border: 1px solid #d5dcdf;
    border-radius: 6px;
    background: #fbfcfc;
}
.layout-table-design-preview > span {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
}
.layout-table-design-preview i {
    min-height: 18px;
    border: solid #909da3;
    border-width: 1px 1px 0 0;
    background: #fff;
}
.layout-table-design-preview > span:last-child i { border-bottom-width: 1px; }
.layout-table-design-preview i:first-child { border-left-width: 1px; }
.layout-table-design-preview.gray i,
.layout-table-design-preview > span.header i { background: #e5e7e8; }
.layout-table-design-content,
.layout-table-design-content label { display: grid; gap: 5px; }
.layout-table-design-content > label > span,
.layout-table-role-grid label > span {
    color: #5d6972;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}
.layout-table-design-content input[type="text"],
.layout-table-design-content select {
    width: 100%;
    height: 34px;
    padding: 0 9px;
    border: 1px solid #ccd5da;
    border-radius: 4px;
    background: #fff;
    color: #26343c;
    font: inherit;
    font-size: 11px;
}
.layout-table-design-toggle {
    grid-template-columns: 17px 1fr;
    align-items: center;
}
.layout-table-design-toggle input {
    width: 15px;
    height: 15px;
    accent-color: #149b91;
}
.layout-table-design-toggle.subtle { margin-top: 4px; }
.layout-table-design-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 3px 0 2px;
}
.layout-table-design-meta span {
    padding: 4px 6px;
    border-radius: 3px;
    background: #eef3f4;
    color: #657078;
    font-size: 9px;
    font-weight: 700;
}
.layout-table-role-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}
@media (max-width: 900px) {
    .layout-table-design-card { grid-template-columns: 1fr; }
}

.layout-table-design-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 16px;
    border: 1px solid #bfe1dc;
    border-radius: 8px;
    background: linear-gradient(135deg, #f2fbf9, #ffffff);
}

.layout-table-design-intro strong,
.layout-table-design-intro small {
    display: block;
}

.layout-table-design-intro strong {
    color: #24413e;
    font-size: 13px;
}

.layout-table-design-intro small {
    max-width: 720px;
    margin-top: 4px;
    color: #647774;
    font-size: 10px;
    line-height: 1.5;
}

.layout-table-design-intro > span {
    padding: 6px 9px;
    border-radius: 999px;
    background: #dff4f0;
    color: #116e67;
    font-size: 9px;
    font-weight: 800;
}

.layout-table-design-grid {
    display: grid;
    gap: 12px;
}

.layout-table-design-card {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 16px;
    padding: 14px;
    border: 1px solid #dce3e5;
    border-radius: 8px;
    background: #fff;
    transition: opacity .16s ease, border-color .16s ease;
}

.layout-table-design-card.enabled {
    border-color: #a9d8d2;
    box-shadow: 0 3px 12px rgba(26, 74, 70, .06);
}

.layout-table-design-card.disabled {
    opacity: .58;
}

.layout-table-design-preview {
    align-self: start;
    display: grid;
    min-height: 92px;
    padding: 12px;
    border: 1px solid #d5dcdf;
    border-radius: 6px;
    background: #fbfcfc;
}

.layout-table-design-preview > span {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
}

.layout-table-design-preview i {
    min-height: 18px;
    border: solid #909da3;
    border-width: 1px 1px 0 0;
    background: #fff;
}

.layout-table-design-preview > span:last-child i {
    border-bottom-width: 1px;
}

.layout-table-design-preview i:first-child {
    border-left-width: 1px;
}

.layout-table-design-preview.gray i,
.layout-table-design-preview > span.header i {
    background: #e5e7e8;
}

.layout-table-design-content,
.layout-table-design-content label {
    display: grid;
    gap: 5px;
}

.layout-table-design-content > label > span,
.layout-table-role-grid label > span {
    color: #5d6972;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.layout-table-design-content input[type="text"],
.layout-table-design-content select {
    width: 100%;
    height: 34px;
    padding: 0 9px;
    border: 1px solid #ccd5da;
    border-radius: 4px;
    background: #fff;
    color: #26343c;
    font: inherit;
    font-size: 11px;
}

.layout-table-design-toggle {
    grid-template-columns: 17px 1fr;
    align-items: center;
}

.layout-table-design-toggle input {
    width: 15px;
    height: 15px;
    accent-color: #149b91;
}

.layout-table-design-toggle.subtle {
    margin-top: 4px;
}

.layout-table-design-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 3px 0 2px;
}

.layout-table-design-meta span {
    padding: 4px 6px;
    border-radius: 3px;
    background: #eef3f4;
    color: #657078;
    font-size: 9px;
    font-weight: 700;
}

.layout-table-role-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}

@media (max-width: 900px) {
    .layout-table-design-card {
        grid-template-columns: 1fr;
    }
}

.layout-mapping-import {
    background: #f4f8f8;
}

.layout-mapping-import label {
    display: grid;
    flex: 1 1 auto;
    gap: 5px;
    color: #53606c;
    font-size: 10px;
    font-weight: 750;
}

.layout-mapping-import select {
    width: 100%;
    height: 34px;
    padding: 0 9px;
    border: 1px solid #cfd7de;
    border-radius: 4px;
    background: #ffffff;
    color: #26313d;
    font: inherit;
    font-weight: 500;
}

.layout-mapping-basics,
.layout-mapping-level {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    padding: 13px;
    border: 1px solid #e1e6ea;
    border-radius: 6px;
    background: #f8fafb;
}

.layout-mapping-level {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}

.layout-mapping-level > strong {
    align-self: center;
    grid-column: 1 / -1;
    color: #34414d;
    font-size: 11px;
}

.layout-mapping-row {
    display: grid;
    gap: 5px;
    min-width: 0;
    color: #5f6b76;
    font-size: 10px;
    font-weight: 700;
}

.layout-mapping-row b {
    color: #b42318;
}

.layout-mapping-row select {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 9px;
    border: 1px solid #cfd7de;
    border-radius: 4px;
    background: #ffffff;
    color: #26313d;
    font: inherit;
    font-weight: 500;
}

.layout-numbering-choices {
    display: grid;
    gap: 9px;
}

.layout-numbering-choices button {
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #d4dbe0;
    border-radius: 5px;
    background: #ffffff;
    color: #465361;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
}

.layout-numbering-choices button.active {
    border-color: #20bcb1;
    background: #eaf9f7;
    color: #116c66;
}

.layout-linked-templates {
    margin-top: 22px;
    border: 1px solid #dce2e6;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.layout-linked-templates > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 16px;
    border-bottom: 1px solid #e1e6ea;
    background: #f8fafb;
}

.layout-linked-templates > header strong,
.layout-linked-templates > header small {
    display: block;
}

.layout-linked-templates > header strong {
    color: #263642;
    font-size: 12.5px;
}

.layout-linked-templates > header small {
    margin-top: 3px;
    color: #77828d;
    font-size: 10px;
    line-height: 1.45;
}

.layout-linked-templates-count {
    flex: 0 0 auto;
    padding: 5px 8px;
    border: 1px solid #cfe4e1;
    border-radius: 999px;
    background: #eef9f7;
    color: #147970;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .025em;
    white-space: nowrap;
}

.layout-linked-templates > div {
    display: grid;
    max-height: 230px;
    overflow-y: auto;
}

.layout-linked-templates label {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    min-height: 48px;
    padding: 0 16px;
    border-bottom: 1px solid #e7ebee;
    color: #35424e;
    font-size: 11px;
    cursor: pointer;
    transition: background .15s ease;
}

.layout-linked-templates label:hover {
    background: #f8fbfb;
}

.layout-linked-templates label:has(.layout-choice-input:checked) {
    background: #f2faf9;
}

.layout-linked-templates label:last-child {
    border-bottom: 0;
}

.layout-linked-templates label small {
    color: #87919a;
    font-size: 9px;
    font-weight: 750;
    text-transform: uppercase;
}

.layout-linked-template-copy {
    min-width: 0;
}

.layout-linked-template-copy strong {
    display: block;
    overflow: hidden;
    color: #2f3e49;
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layout-choice-input {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0;
    pointer-events: none;
}

.layout-choice-indicator {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 1.5px solid #aeb9c1;
    border-radius: 5px;
    background: #ffffff;
    transition: border-color .15s ease, background .15s ease,
        box-shadow .15s ease;
}

.layout-choice-input:focus-visible + .layout-choice-indicator {
    box-shadow: 0 0 0 3px rgba(19, 169, 157, .15);
}

.layout-choice-input:checked + .layout-choice-indicator {
    border-color: #15a89d;
    background: #15a89d;
}

.layout-choice-input:checked + .layout-choice-indicator::after {
    width: 7px;
    height: 4px;
    border-bottom: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    content: "";
    transform: translateY(-1px) rotate(-45deg);
}

.layout-linked-templates.empty {
    padding: 16px;
    color: #77828d;
    font-size: 11px;
}

.layout-wizard-field {
    display: grid;
    gap: 7px;
    color: #46525e;
    font-size: 11px;
    font-weight: 800;
}

.layout-wizard-field input,
.layout-wizard-field select {
    height: 43px;
    padding: 0 12px;
    border: 1px solid #cbd3da;
    border-radius: 5px;
    background: #fff;
    color: #26313d;
    font: inherit;
}

.layout-wizard-field small {
    color: #77828d;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.45;
}

.layout-finalize-name {
    max-width: 520px;
}

.layout-finalize-name input {
    width: 100%;
}

.layout-finalize-section {
    margin-top: 22px;
    overflow: hidden;
    border: 1px solid #dce2e6;
    border-radius: 8px;
    background: #ffffff;
}

.layout-finalize-section > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border-bottom: 1px solid #e3e8eb;
    background: #f8fafb;
}

.layout-finalize-section > header strong,
.layout-finalize-section > header small {
    display: block;
}

.layout-finalize-section > header strong {
    color: #263642;
    font-size: 12.5px;
}

.layout-finalize-section > header small {
    margin-top: 3px;
    color: #77828d;
    font-size: 10px;
    line-height: 1.45;
}

.layout-finalize-section > header > span {
    flex: 0 0 auto;
    padding: 5px 8px;
    border: 1px solid #d4e5e2;
    border-radius: 999px;
    background: #f1f8f7;
    color: #31746e;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .025em;
    white-space: nowrap;
}

.layout-finalize-anchors > p {
    margin: 0;
    padding: 0 16px 14px;
    color: #7a858e;
    font-size: 9.5px;
    line-height: 1.45;
}

.layout-anchor-detected {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    margin: 12px 16px 9px;
    padding: 11px 12px;
    border: 1px solid #cfe2df;
    border-radius: 7px;
    background: #f4faf9;
}

.layout-anchor-detected-icon {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #179f95;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
}

.layout-wizard-footer {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 15px 22px;
    border-top: 1px solid #e2e6ea;
    background: #f8f9fa;
}

.text-anchor-token-editor {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 11px;
    border: 1px solid #cfd6dc;
    border-radius: 5px;
    background: #ffffff;
}

.text-anchor-token-editor b {
    color: #10a89e;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
}

.text-anchor-token-editor input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 3px;
    border: 0;
    outline: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    font-weight: 700;
}

.text-anchor-token-editor select {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 3px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #2f3b46;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    font-weight: 700;
}

.template-options-drawer {
    position: fixed;
    z-index: 70;
    top: 48px;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(390px, 92vw);
    border-left: 1px solid #d7dde1;
    background: #f4f6f7;
    box-shadow: -10px 0 28px rgba(18, 25, 33, .11);
}

.template-options-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 66px;
    padding: 13px 18px;
    border-bottom: 1px solid #e2e6e9;
    background: #ffffff;
}

.template-options-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: #7b8994;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.template-options-header h2 {
    margin: 0;
    color: #202b35;
    font-size: 16px;
    line-height: 1.2;
}

.template-options-close {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    background: #f0f2f4;
    color: #65717c;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition:
        border-color .15s ease,
        background-color .15s ease,
        color .15s ease;
}

.template-options-close:hover {
    border-color: #d9dee2;
    background: #e8ecee;
    color: #34414c;
}

.template-options-close:focus-visible {
    outline: 2px solid rgba(22, 168, 157, .3);
    outline-offset: 2px;
}

.template-options-scroll {
    min-height: 0;
    overflow-y: auto;
    padding: 18px 16px 24px;
    scrollbar-color: #c2cbd1 transparent;
    scrollbar-width: thin;
}

.template-options-section {
    margin-bottom: 12px;
    padding: 16px;
    border: 1px solid #e0e5e8;
    border-radius: 9px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(27, 39, 49, .025);
}

.template-options-section h3,
.template-options-label {
    display: block;
    margin: 0 0 11px;
    color: #52606b;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.template-options-section textarea,
.template-options-section select {
    width: 100%;
    min-height: 42px;
    padding: 10px 11px;
    border: 1px solid #cbd3d9;
    border-radius: 7px;
    background: #ffffff;
    color: #28323e;
    font: inherit;
    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

.template-options-section textarea {
    min-height: 72px;
    resize: vertical;
}

.template-options-section textarea:hover,
.template-options-section select:hover {
    border-color: #aebbc3;
}

.template-options-section textarea:focus,
.template-options-section select:focus {
    border-color: #58bdb5;
    box-shadow: 0 0 0 3px rgba(22, 168, 157, .1);
    outline: none;
}

.template-options-help {
    display: block;
    margin-top: 8px;
    color: #74818c;
    font-size: 10.5px;
    line-height: 1.5;
}

.template-options-link {
    display: block;
    width: 100%;
    margin-top: 13px;
    padding: 12px 0 0;
    border: 0;
    border-top: 1px solid #edf0f2;
    background: transparent;
    color: #118c83;
    font-size: 11.5px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.template-options-link:hover {
    color: #0b716a;
}

.template-options-link:focus-visible {
    border-radius: 2px;
    outline: 2px solid rgba(22, 168, 157, .3);
    outline-offset: 3px;
}

.template-style-mapping-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid #edf0f2;
}

.template-style-mapping-summary strong,
.template-style-mapping-summary small {
    display: block;
}

.template-style-mapping-summary strong {
    color: #36434e;
    font-size: 13px;
    line-height: 1.35;
}

.template-style-mapping-summary small {
    margin-top: 4px;
    color: #77838d;
    font-size: 10.5px;
    line-height: 1.4;
}

.template-style-mapping-summary button,
.template-style-mapping-reset {
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid #a9d8d4;
    border-radius: 6px;
    background: #eff9f8;
    color: #11877f;
    font-size: 10.5px;
    font-weight: 800;
    cursor: pointer;
    transition:
        border-color .15s ease,
        background-color .15s ease,
        color .15s ease;
}

.template-style-mapping-summary button:hover,
.template-style-mapping-reset:hover {
    border-color: #7fc8c2;
    background: #e4f5f3;
    color: #0c756e;
}

.template-style-mapping-summary button:focus-visible,
.template-style-mapping-reset:focus-visible {
    outline: 2px solid rgba(22, 168, 157, .3);
    outline-offset: 2px;
}

.template-style-mapping-panel {
    margin-top: 13px;
    padding: 12px;
    border: 1px solid #d9e6e4;
    border-radius: 7px;
    background: #f8fbfb;
}

.template-style-mapping-panel > p {
    margin: 0 0 11px;
    color: #66727d;
    font-size: 10px;
    line-height: 1.5;
}

.template-style-mapping-levels {
    display: grid;
    gap: 10px;
}

.template-style-mapping-level,
.template-style-mapping-advanced-level {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid #e1e7e9;
    border-radius: 6px;
    background: #ffffff;
}

.template-style-mapping-level > strong,
.template-style-mapping-advanced-level > strong {
    color: #43505c;
    font-size: 10.5px;
}

.template-style-mapping-field {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
}

.template-style-mapping-field > span {
    color: #687581;
    font-size: 9.5px;
    line-height: 1.25;
}

.template-options-section .template-style-mapping-field select {
    min-height: 36px;
    padding: 7px 8px;
    font-size: 10.5px;
}

.template-style-mapping-more {
    margin-top: 10px;
    border-top: 1px solid #e1e7e9;
}

.template-style-mapping-more summary {
    padding: 10px 0 2px;
    color: #53616d;
    font-size: 10.5px;
    font-weight: 800;
    cursor: pointer;
}

.template-style-mapping-more > div {
    display: grid;
    gap: 9px;
    padding-top: 8px;
}

.template-style-mapping-more > div >
    .template-style-mapping-field {
    padding: 8px;
    border: 1px solid #e1e7e9;
    border-radius: 6px;
    background: #ffffff;
}

.template-style-mapping-reset {
    width: 100%;
    margin-top: 10px;
    border-color: #d7dde1;
    background: #ffffff;
    color: #5c6873;
}

.template-style-mapping-empty {
    margin-bottom: 0 !important;
}

.template-option-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 11px;
    padding: 13px 0;
    border-top: 1px solid #edf0f2;
    cursor: pointer;
}

.template-options-section h3 + .template-option-row {
    border-top: 0;
}

.template-option-row input {
    width: 16px;
    height: 16px;
    margin: 1px 0 0;
    accent-color: #16a89d;
}

.template-option-copy strong,
.template-option-copy small {
    display: block;
}

.template-option-copy strong {
    color: #34414c;
    font-size: 12.5px;
    line-height: 1.4;
}

.template-option-copy small {
    margin-top: 4px;
    color: #74808b;
    font-size: 10px;
    line-height: 1.5;
}

.execution-shell .preview-paper {
    padding:
        var(--layout-margin-top, 25mm)
        var(--layout-margin-right, 25mm)
        var(--layout-margin-bottom, 25mm)
        var(--layout-margin-left, 25mm);
}

.execution-shell .preview-document {
    font-family:
        var(--layout-font-family, Arial),
        sans-serif;
    font-size:
        var(
            --preview-word-font-size,
            var(--layout-body-font-size, 11pt)
        );
    line-height:
        var(--layout-line-height, 1.5);
}

.preview-outline-number {
    display: inline-block;
    min-width: 1.7em;
    margin-right: .35em;
    font-variant-numeric: tabular-nums;
    font-weight: inherit;
}

.execution-shell
.preview-document-element.heading.level-1 {
    font-size:
        var(
            --preview-word-font-size,
            var(--layout-heading-1-size, 16pt)
        );
}

.execution-shell
.preview-document-element.heading.level-2 {
    font-size:
        var(
            --preview-word-font-size,
            var(--layout-heading-2-size, 14pt)
        );
}

.execution-shell
.preview-document-element.heading.level-3,
.execution-shell
.preview-document-element.heading.level-4,
.execution-shell
.preview-document-element.heading.level-5,
.execution-shell
.preview-document-element.heading.level-6,
.execution-shell
.preview-document-element.heading.level-7,
.execution-shell
.preview-document-element.heading.level-8,
.execution-shell
.preview-document-element.heading.level-9 {
    font-size:
        var(
            --preview-word-font-size,
            var(--layout-heading-3-size, 12pt)
        );
}

/* =========================================================
   AUSFÜHRUNGSVORSCHAU – TYPOGRAFIE DES GEWÄHLTEN LAYOUTS

   Die Browseransicht bleibt bewusst fortlaufend. Sie nähert
   nur die Typografie dem Word-Export an; Kopf-/Fußzeilen und
   Seitennummern gehören weiterhin ausschließlich zum Export.
   ========================================================= */

.execution-shell.layout-typography-preview
.preview-document-element.paragraph {
    font-family: inherit;
    font-size:
        var(
            --preview-word-font-size,
            var(--layout-body-font-size, 11pt)
        );
    line-height:
        var(--layout-line-height, 1.5);
}

.execution-shell.layout-typography-preview
.preview-document-element.heading {
    margin: 0 0 6pt;
    font-family: inherit;
    font-weight: 700;
    letter-spacing: 0;
    line-height:
        var(--layout-line-height, 1.5);
}

.execution-shell.layout-typography-preview
.preview-document-element.heading:not(:first-child) {
    margin-top: 12pt;
}

.execution-shell.layout-typography-preview
.preview-document-element.heading.level-1 {
    font-size:
        var(
            --preview-word-font-size,
            var(--layout-heading-1-size, 16pt)
        );
}

.execution-shell.layout-typography-preview
.preview-document-element.heading.level-2 {
    font-size:
        var(
            --preview-word-font-size,
            var(--layout-heading-2-size, 14pt)
        );
}

.execution-shell.layout-typography-preview
.preview-document-element.heading.level-3,
.execution-shell.layout-typography-preview
.preview-document-element.heading.level-4,
.execution-shell.layout-typography-preview
.preview-document-element.heading.level-5,
.execution-shell.layout-typography-preview
.preview-document-element.heading.level-6,
.execution-shell.layout-typography-preview
.preview-document-element.heading.level-7,
.execution-shell.layout-typography-preview
.preview-document-element.heading.level-8,
.execution-shell.layout-typography-preview
.preview-document-element.heading.level-9 {
    font-size:
        var(
            --preview-word-font-size,
            var(--layout-heading-3-size, 12pt)
        );
}

/* =========================================================
   CLOUD-PERSISTENZ – STATUS UND LOKALER KONFLIKTSCHUTZ
   ========================================================= */

.lexcraft-persistence-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.lexcraft-save-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: #687581;
    font-size: 10px;
    font-weight: 680;
    line-height: 1;
    letter-spacing: .015em;
    white-space: nowrap;
}

.lexcraft-save-status::before {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #22a694;
    box-shadow: 0 0 0 3px rgba(34, 166, 148, .1);
    content: "";
}

.lexcraft-save-status[data-state="dirty"]::before {
    background: #c58a2d;
    box-shadow: 0 0 0 3px rgba(197, 138, 45, .12);
}

.lexcraft-save-status[data-state="saving"]::before {
    background: #5796b5;
    box-shadow: 0 0 0 3px rgba(87, 150, 181, .12);
    animation: lexcraft-save-pulse 1.1s ease-in-out infinite;
}

.lexcraft-save-status[data-state="error"]::before {
    background: #c94f5a;
    box-shadow: 0 0 0 3px rgba(201, 79, 90, .12);
}

@keyframes lexcraft-save-pulse {
    0%, 100% {
        opacity: .48;
        transform: scale(.82);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.workspace-account {
    gap: 14px;
}

.lexcraft-persistence-control-workspace {
    margin-right: 4px;
    padding-right: 18px;
    border-right: 1px solid rgba(255, 255, 255, .14);
}

.lexcraft-persistence-control-workspace
.lexcraft-backup-button {
    height: 30px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 7px;
    color: rgba(249, 252, 255, .92);
    background: rgba(255, 255, 255, .075);
    font-size: 10px;
    font-weight: 730;
    letter-spacing: .025em;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .045) inset;
}

.lexcraft-persistence-control-workspace
.lexcraft-backup-button:hover {
    border-color: rgba(64, 217, 199, .4);
    color: #ffffff;
    background: rgba(18, 169, 153, .18);
}

.lexcraft-persistence-control-workspace
.lexcraft-save-status {
    color: rgba(238, 246, 250, .65);
}

.lexcraft-persistence-control-editor {
    margin-right: 2px;
    padding-right: 10px;
    border-right: 1px solid rgba(255, 255, 255, .13);
}

.lexcraft-editor-storage-button {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    cursor: default;
}

.builder-shell .lexcraft-persistence-control-editor
.lexcraft-save-status,
.execution-shell .lexcraft-persistence-control-editor
.lexcraft-save-status {
    color: rgba(241, 247, 249, .7);
    font-size: 9px;
}

.lexcraft-persistence-open {
    overflow: hidden;
}

.lexcraft-persistence-dialog [hidden],
.lexcraft-persistence-conflict[hidden] {
    display: none !important;
}

.lexcraft-persistence-dialog {
    position: fixed;
    inset: 0;
    z-index: 60000;
    display: grid;
    place-items: center;
    padding: 28px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
        visibility 0s linear .2s,
        opacity .2s ease;
}

.lexcraft-persistence-dialog.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s;
}

.lexcraft-persistence-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 17, 31, .67);
    backdrop-filter: blur(7px);
}

.lexcraft-persistence-panel {
    position: relative;
    width: min(760px, 100%);
    max-height: min(760px, calc(100vh - 56px));
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 18px;
    background: #fbfcfc;
    color: #26333c;
    box-shadow:
        0 34px 90px rgba(3, 13, 25, .34),
        0 2px 8px rgba(3, 13, 25, .16);
    transform: translateY(10px) scale(.99);
    transition: transform .22s ease;
}

.lexcraft-persistence-dialog.is-open
.lexcraft-persistence-panel {
    transform: translateY(0) scale(1);
}

.lexcraft-persistence-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 27px 30px 22px;
    border-bottom: 1px solid #e3e8eb;
    background:
        linear-gradient(180deg, #ffffff, #f8fafb);
}

.lexcraft-persistence-header span {
    display: block;
    margin-bottom: 5px;
    color: #148f85;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.lexcraft-persistence-header h2 {
    margin: 0;
    color: #172a3d;
    font-size: 25px;
    font-weight: 750;
    letter-spacing: -.025em;
}

.lexcraft-persistence-close {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    padding: 0 0 2px;
    border: 1px solid #dce3e7;
    border-radius: 9px;
    color: #687680;
    background: #f5f7f8;
    font-size: 22px;
    font-weight: 350;
}

.lexcraft-persistence-close:hover {
    border-color: #becbd0;
    color: #26343c;
    background: #edf2f3;
}

.lexcraft-persistence-intro {
    margin: 0;
    padding: 23px 30px 5px;
    color: #66737d;
    font-size: 13px;
    line-height: 1.6;
}

.lexcraft-persistence-origin-warning {
    margin: 22px 30px 0;
    padding: 12px 14px;
    border: 1px solid #e5c47f;
    border-radius: 9px;
    color: #704e15;
    background: #fff8e8;
    font-size: 11px;
    line-height: 1.55;
}

.lexcraft-persistence-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 20px 30px 26px;
}

.lexcraft-persistence-card {
    display: grid;
    grid-template-columns: 31px minmax(0, 1fr);
    gap: 11px;
    min-width: 0;
    padding: 19px 18px 18px;
    border: 1px solid #dfe5e8;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 7px 24px rgba(22, 35, 45, .045);
}

.lexcraft-persistence-card-number {
    display: grid;
    width: 29px;
    height: 29px;
    place-items: center;
    border-radius: 8px;
    color: #0c8279;
    background: #e7f6f4;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .05em;
}

.lexcraft-persistence-card h3 {
    margin: 2px 0 7px;
    color: #24333d;
    font-size: 14px;
    font-weight: 750;
}

.lexcraft-persistence-card p {
    min-height: 60px;
    margin: 0 0 16px;
    color: #6a7680;
    font-size: 11px;
    line-height: 1.55;
}

.lexcraft-persistence-primary,
.lexcraft-persistence-secondary,
.lexcraft-persistence-reload {
    min-height: 36px;
    padding: 0 13px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 760;
    letter-spacing: .015em;
}

.lexcraft-persistence-primary,
.lexcraft-persistence-reload {
    border: 1px solid #0d9389;
    color: #ffffff;
    background: #119f95;
    box-shadow: 0 5px 14px rgba(17, 159, 149, .16);
}

.lexcraft-persistence-primary:hover,
.lexcraft-persistence-reload:hover {
    border-color: #087a72;
    background: #0b887f;
}

.lexcraft-persistence-secondary {
    border: 1px solid #ccd6da;
    color: #43515a;
    background: #f1f4f5;
}

.lexcraft-persistence-secondary:hover {
    border-color: #aebdc3;
    color: #24333c;
    background: #e8edef;
}

.lexcraft-persistence-primary:disabled,
.lexcraft-persistence-secondary:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.lexcraft-persistence-restore-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lexcraft-persistence-validation {
    margin-top: 11px;
    padding: 9px 10px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 650;
    line-height: 1.45;
}

.lexcraft-persistence-validation.is-valid {
    color: #176b62;
    background: #eaf7f4;
}

.lexcraft-persistence-validation.is-error {
    color: #8d3038;
    background: #fff0f1;
}

.lexcraft-persistence-message {
    margin: 0 30px 22px;
    padding: 12px 14px;
    border-radius: 9px;
    color: #44525b;
    background: #edf2f4;
    font-size: 11px;
    line-height: 1.5;
}

.lexcraft-persistence-message.is-success {
    color: #176b62;
    background: #e9f7f4;
}

.lexcraft-persistence-message.is-error {
    color: #8d3038;
    background: #fff0f1;
}

.lexcraft-persistence-message.is-info {
    color: #315e77;
    background: #eaf3f8;
}

.lexcraft-persistence-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 62px;
    padding: 12px 30px;
    border-top: 1px solid #e3e8eb;
    background: #f7f9fa;
}

.lexcraft-persistence-footer > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
    color: #7a858d;
    font-size: 10px;
}

.lexcraft-persistence-footer
.lexcraft-save-status {
    color: #47555e;
}

.lexcraft-persistence-text-button {
    min-height: 34px;
    padding: 0 7px;
    border: 0;
    color: #5b6871;
    background: transparent;
    font-size: 10px;
    font-weight: 720;
}

.lexcraft-persistence-text-button:hover {
    color: #1f302f;
    background: transparent;
}

.lexcraft-origin-notice,
.lexcraft-persistence-conflict {
    position: fixed;
    z-index: 49000;
    display: grid;
    color: #26343d;
    background: rgba(255, 255, 255, .98);
    box-shadow:
        0 18px 48px rgba(5, 18, 32, .2),
        0 2px 8px rgba(5, 18, 32, .1);
    backdrop-filter: blur(10px);
}

.lexcraft-origin-notice {
    right: 20px;
    bottom: 20px;
    grid-template-columns: 26px minmax(0, 1fr) 25px;
    gap: 10px;
    width: min(430px, calc(100vw - 40px));
    padding: 14px;
    border: 1px solid #e4c77e;
    border-radius: 11px;
}

.lexcraft-origin-notice-icon,
.lexcraft-persistence-conflict > span {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 7px;
    color: #78551a;
    background: #fff3d6;
    font-size: 11px;
    font-weight: 850;
}

.lexcraft-origin-notice strong,
.lexcraft-persistence-conflict strong {
    display: block;
    margin: 1px 0 4px;
    color: #3d382d;
    font-size: 11px;
}

.lexcraft-origin-notice p,
.lexcraft-persistence-conflict p {
    margin: 0;
    color: #70695a;
    font-size: 10px;
    line-height: 1.45;
}

.lexcraft-origin-notice-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 10px;
}

.lexcraft-origin-notice-actions button,
.lexcraft-origin-notice-actions a {
    min-height: 28px;
    font-size: 9px;
    font-weight: 750;
}

.lexcraft-origin-notice-actions button {
    padding: 0 10px;
    border: 1px solid #d6b86f;
    border-radius: 6px;
    color: #684812;
    background: #fff8e7;
}

.lexcraft-origin-notice-actions button:hover {
    border-color: #bb9646;
    background: #ffefc8;
}

.lexcraft-origin-notice-actions a {
    display: inline-flex;
    align-items: center;
    color: #6d501b;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lexcraft-origin-notice-actions a:hover {
    color: #3f2d0d;
}

.lexcraft-origin-notice > button {
    width: 25px;
    height: 25px;
    padding: 0 0 2px;
    border: 0;
    color: #817969;
    background: transparent;
    font-size: 17px;
}

.lexcraft-persistence-conflict {
    right: 22px;
    top: 22px;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
    width: min(440px, calc(100vw - 44px));
    padding: 16px;
    border: 1px solid #e4b5b9;
    border-radius: 12px;
}

.lexcraft-persistence-conflict > span {
    color: #92343c;
    background: #ffe9eb;
}

.lexcraft-persistence-conflict > div > div {
    display: flex;
    gap: 8px;
    margin-top: 11px;
}

.lexcraft-persistence-conflict button {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid #d7dfe2;
    border-radius: 6px;
    color: #42515a;
    background: #f1f4f5;
    font-size: 9px;
    font-weight: 730;
}

.lexcraft-persistence-conflict button:hover {
    border-color: #b8c5ca;
    background: #e8edef;
}

@media (max-width: 1180px) {
    .workspace-account-copy,
    .lexcraft-persistence-control-editor
    .lexcraft-save-status {
        display: none;
    }

    .lexcraft-persistence-control-workspace {
        padding-right: 12px;
    }
}

@media (max-width: 860px) {
    .lexcraft-persistence-dialog {
        padding: 18px;
    }

    .lexcraft-persistence-panel {
        max-height: calc(100vh - 36px);
    }

    .lexcraft-persistence-grid {
        grid-template-columns: 1fr;
    }

    .lexcraft-persistence-card p {
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lexcraft-persistence-dialog,
    .lexcraft-persistence-panel,
    .lexcraft-save-status[data-state="saving"]::before {
        transition: none;
        animation: none;
    }
}

/* =====================================================
   WORKSPACE-REGISTER
   Flache, redaktionelle Listen für Fälle, Vorlagen,
   Entwürfe und Layouts. Vollständig gekapselt, damit
   Editor und Ausführung unverändert bleiben.
   ===================================================== */

.workspace-register-page {
    width: min(100%, 1480px);
    min-height: 100%;
    margin: 0 auto;
    padding: 42px clamp(28px, 4.5vw, 68px) 52px;
}

.workspace-register-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 34px;
    padding-bottom: 31px;
}

.workspace-register-header > div {
    min-width: 0;
}

.workspace-register-kicker,
.workspace-register-subheading {
    display: block;
    color: var(--workspace-teal-dark);
    font-size: 10px;
    font-weight: 820;
    line-height: 1.2;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.workspace-register-kicker {
    margin-bottom: 7px;
}

.workspace-register-header h1 {
    margin: 0;
    color: var(--workspace-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(32px, 2.7vw, 38px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -.05em;
}

.workspace-register-header p {
    max-width: 690px;
    margin: 12px 0 0;
    color: var(--workspace-muted);
    font-size: 13px;
    line-height: 1.55;
}

.workspace-register-header-action {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: auto;
    height: auto;
    flex: 0 0 auto;
    padding: 9px 2px 8px;
    border: 0;
    border-bottom: 1px solid rgba(8, 124, 114, .45);
    border-radius: 0;
    color: var(--workspace-teal-dark);
    background: transparent;
    box-shadow: none;
    font-size: 13px;
    font-weight: 750;
}

.workspace-register-header-action:hover {
    border-bottom-color: #055c55;
    color: #055c55;
    background: transparent;
}

.workspace-register {
    min-width: 0;
    border-top: 1px solid var(--workspace-line);
}

.workspace-register-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 0 18px;
    border-bottom: 1px solid var(--workspace-line);
}

.workspace-register-summary span {
    color: #667386;
    font-size: 10px;
    font-weight: 820;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.workspace-register-summary strong {
    display: grid;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    place-items: center;
    border: 1px solid rgba(18, 169, 153, .24);
    border-radius: 999px;
    color: var(--workspace-teal-dark);
    background: rgba(18, 169, 153, .05);
    font-size: 11px;
    font-weight: 800;
}

.workspace-layout-summary {
    justify-content: flex-start;
    gap: 10px;
}

.workspace-layout-summary span {
    color: var(--workspace-teal-dark);
}

.workspace-layout-summary strong {
    min-width: 28px;
    height: auto;
    aspect-ratio: 1;
    padding: 0 6px;
    border-radius: 50%;
    font-variant-numeric: tabular-nums;
}

.workspace-register-columns,
.workspace-register-row {
    display: grid;
    align-items: center;
    column-gap: clamp(18px, 2.2vw, 34px);
}

.workspace-register-columns--drafts,
.workspace-register-row--drafts {
    grid-template-columns:
        minmax(250px, 1.55fr)
        minmax(95px, .48fr)
        minmax(155px, .72fr)
        minmax(195px, auto);
}

.workspace-register-columns--templates,
.workspace-register-row--templates {
    grid-template-columns:
        minmax(250px, 1.5fr)
        minmax(155px, .9fr)
        minmax(130px, .72fr)
        minmax(120px, .62fr)
        minmax(205px, auto);
}

.workspace-register-columns--cases,
.workspace-register-row--cases {
    grid-template-columns:
        minmax(230px, 1.4fr)
        minmax(210px, 1.22fr)
        minmax(90px, .46fr)
        minmax(170px, .76fr)
        minmax(205px, auto);
}

.workspace-register-columns--layouts,
.workspace-register-row--layouts {
    grid-template-columns:
        minmax(230px, 1.35fr)
        minmax(170px, 1fr)
        minmax(100px, .5fr)
        minmax(120px, .64fr)
        minmax(310px, auto);
}

.workspace-register-columns {
    min-height: 43px;
    padding: 0 18px;
    border-bottom: 1px solid var(--workspace-line);
    color: #697588;
    font-size: 10px;
    font-weight: 820;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.workspace-register-columns span:last-child {
    text-align: right;
}

.workspace-register-list {
    display: block;
    min-width: 0;
}

.workspace-register-entry,
.external-layout-row.workspace-register-entry {
    position: relative;
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--workspace-line);
    border-radius: 0;
    background: transparent;
}

.workspace-register-entry.is-recent {
    background:
        linear-gradient(
            90deg,
            rgba(18, 169, 153, .072),
            rgba(18, 169, 153, .017) 56%,
            transparent
        );
}

.workspace-register-entry.is-recent::before {
    position: absolute;
    z-index: 1;
    top: 14px;
    bottom: 14px;
    left: 0;
    width: 3px;
    border-radius: 2px;
    background: var(--workspace-teal);
    content: "";
}

.workspace-register-row {
    min-height: 94px;
    padding: 17px 18px 17px 21px;
}

.workspace-register-row--layouts {
    min-height: 98px;
}

.workspace-register-primary-cell,
.workspace-register-detail,
.workspace-register-date,
.workspace-register-status,
.workspace-register-actions {
    min-width: 0;
}

.workspace-register-primary-cell strong,
.external-layout-row-copy.workspace-register-primary-cell strong {
    overflow: hidden;
    display: -webkit-box;
    margin: 0;
    color: #17263a;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(17px, 1.5vw, 20px);
    font-weight: 500;
    line-height: 1.22;
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.workspace-register-primary-cell small,
.external-layout-row-copy.workspace-register-primary-cell small {
    display: block;
    margin: 6px 0 0;
    color: #697588;
    font-family:
        Inter,
        "SF Pro Text",
        "Segoe UI",
        Arial,
        sans-serif;
    font-size: 10px;
    font-weight: 680;
    line-height: 1.35;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.workspace-register-detail {
    overflow: hidden;
    display: -webkit-box;
    color: #4c596c;
    font-size: 12px;
    line-height: 1.45;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.workspace-register-date {
    color: #586679;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.45;
}

.workspace-register-date > span,
.workspace-register-date > small {
    display: block;
}

.workspace-register-date > small {
    margin-top: 4px;
    color: #9199a4;
    font-size: 9px;
    font-weight: 560;
    line-height: 1.35;
}

.workspace-register-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #536173;
    font-size: 11px;
    font-weight: 720;
    white-space: nowrap;
}

.workspace-register-status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #98a2ae;
    box-shadow: 0 0 0 3px rgba(152, 162, 174, .11);
}

.workspace-register-status-dot.is-open,
.workspace-register-status-dot.is-default {
    background: var(--workspace-teal);
    box-shadow: 0 0 0 3px rgba(18, 169, 153, .12);
}

.workspace-register-status-dot.is-draft {
    background: #c19045;
    box-shadow: 0 0 0 3px rgba(193, 144, 69, .12);
}

.workspace-register-status-dot.is-layout {
    background: #73849a;
    box-shadow: 0 0 0 3px rgba(115, 132, 154, .12);
}

.workspace-register-actions,
.external-layout-row-actions.workspace-register-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 5px 17px;
}

.workspace-register-action,
.workspace-register-page .workspace-register-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 7px 0 6px;
    border: 0;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    color: #536173;
    background: transparent;
    box-shadow: none;
    font-family:
        Inter,
        "SF Pro Text",
        "Segoe UI",
        Arial,
        sans-serif;
    font-size: 11px;
    font-weight: 760;
    line-height: 1.2;
    letter-spacing: .005em;
    text-transform: none;
    white-space: nowrap;
}

.workspace-register-action:hover,
.workspace-register-page .workspace-register-action:hover {
    border-bottom-color: #9da7b2;
    color: #182a40;
    background: transparent;
}

.workspace-register-action--primary,
.workspace-register-page .workspace-register-action--primary {
    border-bottom-color: rgba(8, 124, 114, .43);
    color: var(--workspace-teal-dark);
}

.workspace-register-action--primary:hover,
.workspace-register-page .workspace-register-action--primary:hover {
    border-bottom-color: #055c55;
    color: #055c55;
}

.workspace-register-action--danger,
.workspace-register-page .workspace-register-action--danger {
    color: #a85e62;
}

.workspace-register-action--danger:hover,
.workspace-register-page .workspace-register-action--danger:hover {
    border-bottom-color: rgba(168, 94, 98, .45);
    color: #8e3e43;
}

.workspace-register-page button:focus-visible,
.workspace-register-page input:focus-visible {
    outline: 3px solid rgba(18, 169, 153, .24);
    outline-offset: 3px;
}

.workspace-register-empty {
    display: flex;
    min-height: 156px;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    padding: 30px 18px;
    border-top: 1px solid var(--workspace-line);
    border-bottom: 1px solid var(--workspace-line);
    color: var(--workspace-muted);
    font-size: 13px;
    line-height: 1.5;
}

.workspace-register-empty strong {
    color: #233249;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    font-weight: 500;
}

.workspace-register-create {
    display: grid;
    grid-template-columns: minmax(190px, .6fr) minmax(360px, 1.4fr);
    align-items: center;
    gap: clamp(28px, 5vw, 80px);
    margin-bottom: 32px;
    padding: 22px 18px;
    border-top: 1px solid var(--workspace-line);
    border-bottom: 1px solid var(--workspace-line);
}

.workspace-register-create-copy span,
.workspace-template-use-copy span {
    display: block;
    color: #1d2c41;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    font-weight: 500;
}

.workspace-register-create-copy small,
.workspace-template-use-copy label {
    display: block;
    margin-top: 5px;
    color: #7d8794;
    font-size: 11px;
    line-height: 1.45;
}

.workspace-register-create-controls {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    align-items: center;
    gap: 22px;
}

.workspace-register-create-controls input,
.workspace-template-use-controls input {
    width: 100%;
    height: 44px;
    min-width: 0;
    padding: 0 13px;
    border: 1px solid #cfd6dc;
    border-radius: 4px;
    color: #1c2b40;
    background: rgba(255, 255, 255, .78);
    box-shadow: none;
    font-size: 13px;
}

.workspace-register-create-controls input::placeholder,
.workspace-template-use-controls input::placeholder {
    color: #9ba3ad;
}

.workspace-template-use-panel {
    display: grid;
    grid-template-columns: minmax(185px, .46fr) minmax(430px, 1.54fr);
    align-items: center;
    gap: clamp(24px, 4vw, 58px);
    padding: 22px 20px 23px 24px;
    border-top: 1px solid rgba(18, 169, 153, .17);
    background:
        linear-gradient(
            90deg,
            rgba(18, 169, 153, .085),
            rgba(255, 255, 255, .42)
        );
}

.workspace-template-use-controls {
    display: grid;
    grid-template-columns: minmax(230px, 1fr) auto auto;
    align-items: center;
    gap: 18px;
}

.workspace-register-page--layouts .external-layout-tabs {
    gap: 32px;
    margin: 0 0 24px;
    border-bottom-color: var(--workspace-line);
}

.workspace-register-page--layouts .external-layout-tabs button {
    height: auto;
    padding: 10px 1px 12px;
    border-radius: 0;
    color: #87909b;
    background: transparent;
    font-size: 10px;
    letter-spacing: .14em;
}

.workspace-register-page--layouts .external-layout-tabs button.active {
    color: var(--workspace-navy);
}

.workspace-register-page--layouts .external-layout-tabs button.active::after {
    height: 2px;
    background: var(--workspace-teal);
}

.workspace-layout-panel {
    margin-top: 0;
}

.workspace-register-page--layouts .external-layout-heading {
    margin-bottom: 19px;
}

.workspace-register-page--layouts .external-layout-heading p {
    max-width: 800px;
    margin-top: 8px;
    color: var(--workspace-muted);
    font-size: 12px;
}

.workspace-layout-register .external-layout-list {
    gap: 0;
}

.workspace-register-page--layouts .layout-default-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    color: var(--workspace-teal-dark);
    font-size: 9px;
    letter-spacing: .08em;
}

.workspace-register-page--layouts .layout-upload-launch {
    margin-top: 23px;
    padding: 8px 0 7px;
    border-radius: 0;
    color: var(--workspace-teal-dark);
    background: transparent;
    font-size: 11px;
    letter-spacing: .01em;
    text-transform: none;
}

@media (max-width: 1180px) {
    .workspace-register-columns {
        display: none;
    }

    .workspace-register-row--drafts,
    .workspace-register-row--templates,
    .workspace-register-row--cases,
    .workspace-register-row--layouts {
        grid-template-columns: minmax(0, 1.3fr) minmax(230px, .7fr);
        align-items: start;
        gap: 17px 34px;
        padding-top: 22px;
        padding-bottom: 22px;
    }

    .workspace-register-row > [data-label]::before {
        display: block;
        margin-bottom: 5px;
        color: #98a0aa;
        font-size: 8px;
        font-weight: 820;
        letter-spacing: .13em;
        text-transform: uppercase;
        content: attr(data-label);
    }

    .workspace-register-actions,
    .external-layout-row-actions.workspace-register-actions {
        align-self: end;
        justify-content: flex-start;
    }

    .workspace-register-row--layouts .workspace-register-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 800px) {
    .workspace-register-page {
        padding: 30px 20px 38px;
    }

    .workspace-register-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
        padding-bottom: 26px;
    }

    .workspace-register-header h1 {
        font-size: 32px;
    }

    .workspace-register-create,
    .workspace-template-use-panel {
        grid-template-columns: 1fr;
        gap: 17px;
    }

    .workspace-template-use-controls {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .workspace-template-use-controls input {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .workspace-register-row--drafts,
    .workspace-register-row--templates,
    .workspace-register-row--cases,
    .workspace-register-row--layouts {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .workspace-register-row--layouts .workspace-register-actions {
        grid-column: auto;
    }

    .workspace-register-actions,
    .external-layout-row-actions.workspace-register-actions {
        justify-content: flex-start;
    }

    .workspace-register-create-controls,
    .workspace-template-use-controls {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .workspace-template-use-controls input {
        grid-column: auto;
    }

    .workspace-register-create-controls .workspace-register-action,
    .workspace-template-use-controls .workspace-register-action {
        justify-self: start;
    }
}

/* =========================================================
   PROJEKT-EXPLORER UND PROJEKTZUORDNUNG
   ========================================================= */

.workspace-template-project-context {
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 9px;
    margin: -9px 0 28px;
    padding: 0 16px;
    border: 1px solid rgba(18, 169, 153, .18);
    border-radius: 5px;
    color: #677486;
    background: rgba(18, 169, 153, .045);
    font-size: 11px;
}

.workspace-template-project-context strong {
    color: #173047;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 14px;
    font-weight: 500;
}

.workspace-template-project-context button {
    width: auto;
    min-height: 0;
    margin-left: auto;
    padding: 6px 0;
    border: 0;
    border-bottom: 1px solid rgba(8, 124, 114, .32);
    border-radius: 0;
    color: var(--workspace-teal-dark);
    background: transparent;
    box-shadow: none;
    font-size: 10px;
    font-weight: 740;
}

.workspace-template-use-panel {
    grid-template-columns: minmax(180px, .36fr) minmax(0, 1.64fr);
    align-items: start;
    gap: clamp(24px, 4vw, 58px);
    padding: 25px 20px 26px 24px;
}

.workspace-template-use-copy small {
    display: block;
    max-width: 210px;
    margin-top: 6px;
    color: #74808e;
    font-size: 10px;
    line-height: 1.5;
}

.workspace-template-use-form {
    display: grid;
    grid-template-columns: minmax(260px, 620px);
    gap: 17px 18px;
}

.workspace-template-use-field {
    display: block;
    min-width: 0;
}

.workspace-template-use-field[hidden] {
    display: none;
}

.workspace-template-use-field > span,
.workspace-template-use-field > label {
    display: block;
    margin-bottom: 7px;
    color: #667386;
    font-size: 9px;
    font-weight: 790;
    letter-spacing: .085em;
    text-transform: uppercase;
}

.workspace-template-use-field > small {
    display: block;
    margin-top: 7px;
    color: #7a8591;
    font-size: 9px;
    line-height: 1.45;
}

.workspace-project-combobox {
    position: relative;
}

.workspace-project-combobox > input {
    padding-right: 46px;
}

.workspace-project-combobox-toggle {
    position: absolute;
    z-index: 2;
    top: 1px;
    right: 1px;
    display: grid;
    width: 41px;
    height: 41px;
    min-width: 41px;
    place-items: center;
    padding: 0;
    border: 0;
    border-left: 1px solid rgba(203, 213, 220, .72);
    border-radius: 0 4px 4px 0;
    color: #536273;
    background: rgba(247, 249, 249, .94);
    box-shadow: none;
    font-size: 15px;
    line-height: 1;
}

.workspace-project-combobox-toggle:hover,
.workspace-project-combobox-toggle:focus-visible {
    color: var(--workspace-teal-dark);
    background: #eef7f5;
}

.workspace-project-combobox-options {
    position: absolute;
    z-index: 180;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    display: grid;
    max-height: 245px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #cbd5dc;
    border-radius: 6px;
    color: #1e3348;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(7, 26, 45, .18);
}

.workspace-project-combobox-options[hidden] {
    display: none;
}

.workspace-project-combobox-options > button {
    display: grid;
    width: 100%;
    min-height: 48px;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border: 0;
    border-radius: 4px;
    color: #203449;
    background: #ffffff;
    box-shadow: none;
    text-align: left;
}

.workspace-project-combobox-options > button:hover,
.workspace-project-combobox-options > button:focus-visible {
    color: #16364a;
    background: #eef8f6;
}

.workspace-project-combobox-options > button[hidden] {
    display: none;
}

.workspace-project-combobox-options strong,
.workspace-project-combobox-options small {
    display: block;
}

.workspace-project-combobox-options strong {
    overflow: hidden;
    color: inherit;
    font-family: inherit;
    font-size: 11px;
    font-weight: 720;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-project-combobox-options small {
    margin-top: 2px;
    color: #7b8794;
    font-size: 8px;
    font-weight: 650;
}

.workspace-project-combobox-folder {
    position: relative;
    display: block;
    width: 22px;
    height: 16px;
    border: 1px solid rgba(8, 124, 114, .34);
    border-radius: 3px;
    background: rgba(18, 169, 153, .08);
}

.workspace-project-combobox-folder::before {
    position: absolute;
    top: -4px;
    left: 2px;
    width: 9px;
    height: 4px;
    border: 1px solid rgba(8, 124, 114, .34);
    border-bottom: 0;
    border-radius: 2px 2px 0 0;
    background: rgba(18, 169, 153, .08);
    content: "";
}

.workspace-project-combobox-empty {
    padding: 12px 11px;
    color: #6d7a88;
    font-size: 10px;
    line-height: 1.5;
}

.workspace-project-combobox-empty[hidden] {
    display: none;
}

.workspace-template-use-field input,
.workspace-template-use-field select {
    width: 100%;
    height: 43px;
    min-width: 0;
    padding: 0 12px;
    border: 1px solid #cbd5dc;
    border-radius: 4px;
    color: #172b40;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 1px 2px rgba(11, 31, 52, .025);
    font-family: inherit;
    font-size: 12px;
}

.workspace-template-use-field select {
    padding-right: 34px;
}

.workspace-template-use-field input:focus,
.workspace-template-use-field select:focus {
    border-color: rgba(8, 124, 114, .7);
    outline: 3px solid rgba(18, 169, 153, .11);
    outline-offset: 1px;
}

.workspace-template-use-actions {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    gap: 21px;
    padding-top: 2px;
}

.workspace-project-explorer {
    overflow: visible;
    border-top: 1px solid var(--workspace-line);
    border-bottom: 1px solid var(--workspace-line);
    background: rgba(255, 255, 255, .22);
}

.workspace-project-explorer-summary {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border-bottom: 1px solid var(--workspace-line);
}

.workspace-project-explorer-summary > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.workspace-project-explorer-summary span,
.workspace-project-toolbar > span {
    color: #667386;
    font-size: 10px;
    font-weight: 820;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.workspace-project-explorer-summary strong {
    display: grid;
    min-width: 25px;
    height: 25px;
    padding: 0 7px;
    place-items: center;
    border: 1px solid rgba(18, 169, 153, .22);
    border-radius: 999px;
    color: var(--workspace-teal-dark);
    background: rgba(18, 169, 153, .05);
    font-size: 10px;
}

.workspace-project-explorer-summary > small {
    color: #89929d;
    font-size: 10px;
    font-weight: 620;
}

.workspace-project {
    position: relative;
    border-bottom: 1px solid var(--workspace-line);
}

.workspace-project:last-child {
    border-bottom: 0;
}

.workspace-project.is-recent::before {
    position: absolute;
    z-index: 2;
    top: 14px;
    bottom: 14px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--workspace-teal);
    content: "";
}

.workspace-project-heading {
    display: grid;
    min-height: 88px;
    grid-template-columns: 16px 28px minmax(0, 1fr) minmax(155px, auto);
    align-items: center;
    gap: 13px;
    padding: 15px 19px 15px 22px;
    cursor: pointer;
    list-style: none;
    background: rgba(255, 255, 255, .32);
    transition: background .16s ease;
}

.workspace-project-heading::-webkit-details-marker {
    display: none;
}

.workspace-project-heading:hover {
    background: rgba(18, 169, 153, .035);
}

.workspace-project[open] > .workspace-project-heading {
    border-bottom: 1px solid rgba(209, 217, 223, .78);
    background: rgba(18, 169, 153, .04);
}

.workspace-project-chevron {
    color: #83909d;
    font-size: 22px;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform .16s ease;
}

.workspace-project[open] .workspace-project-chevron {
    transform: rotate(90deg);
}

.workspace-project-folder {
    position: relative;
    display: block;
    width: 27px;
    height: 19px;
    border: 1px solid rgba(8, 124, 114, .35);
    border-radius: 3px;
    background: rgba(18, 169, 153, .08);
}

.workspace-project-folder::before {
    position: absolute;
    top: -5px;
    left: 2px;
    width: 11px;
    height: 5px;
    border: 1px solid rgba(8, 124, 114, .35);
    border-bottom: 0;
    border-radius: 3px 3px 0 0;
    background: rgba(18, 169, 153, .08);
    content: "";
}

.workspace-project-title {
    min-width: 0;
}

.workspace-project-title > strong {
    overflow: hidden;
    display: block;
    color: #17283d;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(18px, 1.65vw, 22px);
    font-weight: 500;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-project-title > small {
    display: block;
    margin-top: 5px;
    color: #788492;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.workspace-project-updated {
    text-align: right;
}

.workspace-project-updated small,
.workspace-project-updated strong {
    display: block;
}

.workspace-project-updated small {
    color: #979fa9;
    font-size: 8px;
    font-weight: 780;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.workspace-project-updated strong {
    margin-top: 5px;
    color: #59687a;
    font-size: 10px;
    font-weight: 680;
}

.workspace-project-content {
    padding: 0 20px 16px 59px;
    background: rgba(248, 249, 247, .5);
}

.workspace-project-toolbar {
    display: flex;
    min-height: 49px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--workspace-line);
}

.workspace-project-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.workspace-project-toolbar button {
    display: inline-flex;
    width: auto;
    min-height: 0;
    align-items: center;
    gap: 7px;
    margin-right: -8px;
    padding: 7px 8px;
    border: 0;
    border-radius: 4px;
    color: var(--workspace-teal-dark);
    background: transparent;
    box-shadow: none;
    font-size: 10px;
    font-weight: 760;
}

.workspace-project-toolbar-actions > button {
    margin-right: 0;
}

.workspace-project-toolbar-actions > button:last-child {
    margin-right: -8px;
}

.workspace-project-toolbar .workspace-project-delete-button {
    color: #8d4545;
}

.workspace-project-toolbar button:hover,
.workspace-project-toolbar button:focus-visible {
    color: #066d65;
    background: rgba(18, 169, 153, .075);
}

.workspace-project-toolbar .workspace-project-delete-button:hover,
.workspace-project-toolbar .workspace-project-delete-button:focus-visible {
    color: #7a3030;
    background: rgba(150, 58, 58, .075);
}

.workspace-project-document {
    display: grid;
    min-height: 82px;
    grid-template-columns: 25px minmax(250px, 1.35fr) minmax(85px, .42fr) minmax(165px, .66fr) minmax(195px, auto);
    align-items: center;
    gap: clamp(15px, 2vw, 30px);
    padding: 14px 0;
    border-bottom: 1px solid rgba(213, 220, 225, .82);
}

.workspace-project-document:last-child {
    border-bottom: 0;
}

.workspace-project-document.is-latest {
    background: linear-gradient(90deg, rgba(18, 169, 153, .04), transparent 72%);
}

.workspace-project-document-icon {
    position: relative;
    width: 19px;
    height: 24px;
    border: 1px solid #9eabb7;
    border-radius: 2px;
    background: rgba(255, 255, 255, .76);
}

.workspace-project-document-icon::before,
.workspace-project-document-icon::after {
    position: absolute;
    left: 4px;
    width: 9px;
    height: 1px;
    background: #aeb8c1;
    content: "";
}

.workspace-project-document-icon::before {
    top: 8px;
}

.workspace-project-document-icon::after {
    top: 13px;
}

.workspace-project-document-name {
    min-width: 0;
}

.workspace-project-document-name > strong {
    overflow: hidden;
    display: block;
    color: #223247;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-project-document-name > small {
    overflow: hidden;
    display: block;
    margin-top: 6px;
    color: #7b8693;
    font-size: 9px;
    font-weight: 650;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-project-empty .workspace-register-action {
    align-self: flex-start;
    margin-top: 9px;
}

.workspace-project-document-empty {
    display: flex;
    min-height: 112px;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 20px 0;
    color: #718091;
}

.workspace-project-document-empty strong {
    color: #294156;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    font-weight: 500;
}

.workspace-project-document-empty span {
    max-width: 480px;
    font-size: 10px;
    line-height: 1.55;
}

@media (max-width: 1060px) {
    .workspace-template-use-panel {
        grid-template-columns: 1fr;
        gap: 17px;
    }

    .workspace-template-use-copy small {
        max-width: none;
    }

    .workspace-project-document {
        grid-template-columns: 24px minmax(0, 1fr) minmax(165px, .58fr);
        align-items: start;
        gap: 13px 22px;
        padding: 18px 0;
    }

    .workspace-project-document .workspace-register-status {
        grid-column: 2;
    }

    .workspace-project-document .workspace-register-date {
        grid-column: 3;
        grid-row: 1 / span 2;
    }

    .workspace-project-document .workspace-register-actions {
        grid-column: 2 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .workspace-template-use-form {
        grid-template-columns: 1fr;
    }

    .workspace-template-use-actions {
        grid-column: auto;
    }

    .workspace-template-project-context {
        align-items: flex-start;
        flex-wrap: wrap;
        padding-top: 11px;
        padding-bottom: 11px;
    }

    .workspace-template-project-context button {
        width: 100%;
        margin-left: 0;
        text-align: left;
    }

    .workspace-project-heading {
        min-height: 82px;
        grid-template-columns: 14px 25px minmax(0, 1fr);
        gap: 11px;
        padding-right: 14px;
    }

    .workspace-project-updated {
        display: none;
    }

    .workspace-project-content {
        padding: 0 18px 14px 53px;
    }

    .workspace-project-document {
        grid-template-columns: 22px minmax(0, 1fr);
    }

    .workspace-project-document .workspace-register-status,
    .workspace-project-document .workspace-register-date,
    .workspace-project-document .workspace-register-actions {
        grid-column: 2;
        grid-row: auto;
    }
}

@media (max-width: 520px) {
    .workspace-project-content {
        padding-left: 20px;
    }

    .workspace-project-toolbar {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 2px;
        padding: 9px 0;
    }

    .workspace-project-document {
        grid-template-columns: 1fr;
    }

    .workspace-project-document-icon {
        display: none;
    }

    .workspace-project-document .workspace-register-status,
    .workspace-project-document .workspace-register-date,
    .workspace-project-document .workspace-register-actions {
        grid-column: 1;
    }
}

/* =========================================================
   ZUGRIFF, TEAMS UND KANZLEIVERWALTUNG
   ========================================================= */

.workspace-access-badge {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    margin: -4px 7px -4px 0;
    padding: 0 8px;
    border: 1px solid #d8dfe4;
    border-radius: 999px;
    color: #5d6977;
    background: rgba(255, 255, 255, .68);
    font-size: 8px;
    font-weight: 820;
    letter-spacing: .065em;
    vertical-align: middle;
}

.workspace-access-badge.is-firm {
    border-color: rgba(18, 169, 153, .28);
    color: #08776e;
    background: rgba(18, 169, 153, .08);
}

.workspace-access-badge.is-team {
    border-color: rgba(62, 114, 157, .25);
    color: #3b6382;
    background: rgba(62, 114, 157, .07);
}

.workspace-access-badge.is-people {
    border-color: rgba(110, 92, 158, .23);
    color: #65558d;
    background: rgba(110, 92, 158, .07);
}

.workspace-access-badge.is-private {
    border-color: rgba(108, 119, 132, .2);
    color: #697482;
    background: rgba(108, 119, 132, .055);
}

.workspace-resource-menu-host,
.administration-menu-host {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.workspace-resource-menu-trigger,
.administration-menu-trigger {
    display: grid;
    width: 32px;
    height: 32px;
    min-width: 32px;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #697588;
    background: transparent;
    box-shadow: none;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .08em;
}

.workspace-resource-menu-trigger:hover,
.workspace-resource-menu-trigger[aria-expanded="true"],
.administration-menu-trigger:hover,
.administration-menu-trigger[aria-expanded="true"] {
    border-color: #d8dfe4;
    color: #173047;
    background: #f4f7f7;
}

.workspace-resource-menu[hidden],
.administration-menu[hidden] {
    display: none;
}

.workspace-resource-menu,
.administration-menu {
    position: absolute;
    z-index: 90;
    right: 0;
    top: calc(100% + 6px);
    display: grid;
    width: max-content;
    min-width: 178px;
    overflow: hidden;
    padding: 6px;
    border: 1px solid #d7dfe3;
    border-radius: 9px;
    color: #26384c;
    background: #ffffff;
    box-shadow: 0 15px 42px rgba(7, 26, 45, .17);
}

.workspace-register-entry:last-child .workspace-resource-menu,
.workspace-project:last-child
    .workspace-project-document:last-child
    .workspace-resource-menu,
.administration-member-row:last-child .administration-menu {
    top: auto;
    bottom: calc(100% + 6px);
}

.workspace-project-document:has(
    .workspace-resource-menu:not([hidden])
) {
    position: relative;
    z-index: 100;
}

.workspace-resource-menu button,
.administration-menu button {
    display: flex;
    width: 100%;
    min-height: 36px;
    align-items: center;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    color: #34465a;
    background: transparent;
    box-shadow: none;
    font-size: 10px;
    font-weight: 680;
    text-align: left;
    white-space: nowrap;
}

.workspace-resource-menu button:hover,
.administration-menu button:hover {
    color: #08766d;
    background: #eef8f6;
}

.workspace-resource-menu button.is-danger {
    color: #9c4e55;
}

.workspace-resource-menu button.is-danger:hover {
    color: #8c333d;
    background: #fff1f2;
}

.access-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 31000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(3, 18, 34, .55);
    backdrop-filter: blur(5px);
}

.access-dialog {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(700px, 100%);
    max-height: calc(100vh - 48px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 15px;
    color: #14243a;
    background: #ffffff;
    box-shadow: 0 30px 90px rgba(3, 18, 34, .36);
}

.access-dialog > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid #e2e7ea;
    background: linear-gradient(135deg, #f2faf8, #f8fafb);
}

.access-dialog > header > div {
    min-width: 0;
}

.access-dialog > header span {
    color: #0a8a7e;
    font-size: 9px;
    font-weight: 820;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.access-dialog > header h2 {
    margin: 5px 0 0;
    color: #14243a;
    font-size: 22px;
    font-weight: 740;
    letter-spacing: -.025em;
}

.access-dialog > header p {
    overflow: hidden;
    margin: 6px 0 0;
    color: #6a7684;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.access-dialog-close {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    padding: 0;
    border: 1px solid #dce3e6;
    border-radius: 8px;
    color: #6b7784;
    background: #ffffff;
    font-size: 20px;
    line-height: 1;
}

.access-dialog form {
    display: grid;
    gap: 0;
    overflow-y: auto;
}

.access-dialog fieldset {
    min-width: 0;
    margin: 0;
    padding: 20px 24px;
    border: 0;
    border-bottom: 1px solid #e7ebed;
}

.access-dialog legend {
    margin: 0 0 12px;
    padding: 0;
    color: #415266;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.access-scope-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.access-scope-options > label {
    position: relative;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    min-height: 88px;
    padding: 14px;
    border: 1px solid #dce3e6;
    border-radius: 10px;
    background: #fbfcfc;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.access-scope-options > label:has(input:checked) {
    border-color: rgba(18, 169, 153, .46);
    background: rgba(18, 169, 153, .055);
    box-shadow: 0 0 0 2px rgba(18, 169, 153, .065);
}

.access-scope-options input,
.access-choice-list input,
.access-permission-row input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.access-option-indicator {
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border: 1.5px solid #aab5bd;
    border-radius: 50%;
    background: #ffffff;
}

.access-scope-card input:checked + .access-option-indicator {
    border-color: #0f9f92;
    background: #0f9f92;
    box-shadow: inset 0 0 0 4px #ffffff;
}

.access-scope-card input:focus-visible + .access-option-indicator,
.access-choice-card input:focus-visible ~ .access-choice-indicator,
.access-permission-row input:focus-visible + .access-choice-indicator {
    outline: 2px solid rgba(18, 169, 153, .28);
    outline-offset: 2px;
}

.access-option-copy,
.access-option-copy strong,
.access-option-copy small {
    display: block;
    min-width: 0;
}

.access-option-copy strong {
    color: #26394d;
    font-size: 11px;
}

.access-option-copy small {
    margin-top: 3px;
    color: #7a8591;
    font-size: 9px;
    font-weight: 560;
    line-height: 1.4;
}

.access-choice-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.access-choice-list label {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22px;
    min-width: 0;
    min-height: 54px;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    border: 1px solid #e0e5e8;
    border-radius: 9px;
    color: #3f5063;
    background: #fbfcfc;
    font-size: 10px;
    font-weight: 650;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease;
}

.access-choice-list label:has(input:checked) {
    border-color: rgba(18, 169, 153, .35);
    color: #176d66;
    background: rgba(18, 169, 153, .05);
}

.access-choice-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.access-choice-copy strong,
.access-choice-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.access-choice-copy strong {
    color: #34485a;
    font-size: 10px;
}

.access-choice-copy small {
    color: #89939d;
    font-size: 8px;
    font-weight: 560;
}

.access-choice-indicator {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border: 1px solid #d5dfe0;
    border-radius: 6px;
    color: transparent;
    background: #f0f4f4;
    font-size: 10px;
    font-weight: 850;
}

.access-choice-card:has(input:checked) .access-choice-indicator,
.access-permission-row label:has(input:checked) .access-choice-indicator {
    border-color: #0f9f92;
    color: #ffffff;
    background: #0f9f92;
}

.access-person-choice {
    grid-template-columns: 30px minmax(0, 1fr) 22px !important;
}

.access-person-avatar {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid rgba(18, 169, 153, .2);
    border-radius: 50%;
    color: #14786f;
    background: rgba(18, 169, 153, .06);
    font-size: 8px;
    font-weight: 800;
}

.access-field-help,
.access-empty-note {
    margin: -3px 0 12px;
    color: #7a8591;
    font-size: 10px;
    line-height: 1.5;
}

.access-empty-note {
    margin-bottom: 0;
}

.access-permission-list {
    display: grid;
    gap: 7px;
}

.access-permission-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 145px;
    align-items: center;
    gap: 16px;
    min-height: 43px;
    padding: 5px 6px 5px 11px;
    border: 1px solid #e0e5e8;
    border-radius: 7px;
    background: #fafbfb;
}

.access-permission-row label {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
    color: #405165;
    font-size: 10px;
    font-weight: 660;
}

.access-permission-row label .access-choice-indicator {
    flex: 0 0 20px;
}

.access-permission-row label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.access-permission-row select,
.administration-page select,
.administration-dialog select,
.administration-dialog input {
    min-height: 34px;
    padding: 0 9px;
    border: 1px solid #d4dce1;
    border-radius: 6px;
    color: #34465a;
    background: #ffffff;
    font: inherit;
    font-size: 10px;
}

.access-permission-row select:disabled {
    color: #98a1aa;
    background: #f1f4f4;
    cursor: not-allowed;
}

.access-dialog-status {
    min-height: 17px;
    margin: 14px 24px 0;
    color: #687584;
    font-size: 10px;
    font-weight: 620;
    line-height: 1.45;
}

.access-dialog-status[data-state="error"],
.administration-team-create p[data-state="error"] {
    color: #a43d49;
}

.access-dialog footer {
    position: sticky;
    z-index: 2;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 14px 24px 22px;
    border-top: 1px solid #e7ebed;
    background: rgba(255, 255, 255, .97);
}

.access-dialog footer button {
    min-height: 38px;
    padding: 0 15px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 730;
}

.access-dialog-cancel {
    border: 1px solid #d4dce0;
    color: #526170;
    background: #ffffff;
}

.access-dialog-save {
    border: 1px solid #0c8f83;
    color: #ffffff;
    background: #0f9f92;
}

.access-dialog-save:hover {
    border-color: #087a70;
    background: #0b8b80;
}

.access-dialog-save:disabled {
    opacity: .58;
    cursor: wait;
}

.administration-page {
    width: 100%;
    min-height: 100%;
    padding: clamp(38px, 5vw, 64px) clamp(34px, 5.7vw, 88px) 58px;
    color: var(--workspace-ink);
    background:
        linear-gradient(180deg, rgba(18, 169, 153, .025), transparent 210px),
        var(--workspace-canvas);
}

.administration-header-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.administration-permission-summary {
    display: grid;
    gap: 3px;
    padding-right: 24px;
    border-right: 1px solid var(--workspace-line);
    text-align: right;
}

.administration-permission-summary span {
    color: #8b949f;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.administration-permission-summary strong {
    color: #365064;
    font-size: 10px;
    font-weight: 720;
}

.administration-firm-switcher {
    display: grid;
    grid-template-columns: minmax(180px, .55fr) minmax(230px, .8fr) minmax(260px, 1.2fr);
    align-items: center;
    gap: 24px;
    margin: 2px 0 28px;
    padding: 17px 20px;
    border: 1px solid #dfe6e6;
    border-radius: 12px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 7px 24px rgba(28, 52, 67, .035);
}

.administration-workspace-heading,
.administration-workspace-fixed,
.administration-workspace-select {
    display: grid;
    gap: 4px;
}

.administration-workspace-heading span,
.administration-workspace-fixed span,
.administration-workspace-select > span {
    color: #697588;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.administration-workspace-heading strong,
.administration-workspace-fixed strong {
    overflow: hidden;
    color: #21384d;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.administration-workspace-fixed {
    padding: 7px 12px;
    border-left: 2px solid rgba(18, 169, 153, .4);
}

.administration-workspace-select select {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border-color: #cfdada;
    background: #ffffff;
}

.administration-firm-switcher small {
    color: #8a939d;
    font-size: 9px;
    line-height: 1.55;
}

.administration-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, .78fr);
    align-items: start;
    gap: 24px;
}

.administration-grid--platform {
    grid-template-columns: minmax(0, 1fr);
}

.administration-panel {
    min-width: 0;
    overflow: visible;
    border: 1px solid #dfe5e6;
    border-radius: 14px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 10px 32px rgba(28, 52, 67, .045);
}

.administration-panel > header {
    display: flex;
    min-height: 88px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--workspace-line);
}

.administration-panel > header span,
.administration-panel > header h2 {
    display: block;
}

.administration-panel > header span {
    margin-bottom: 4px;
    color: #788391;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.administration-panel > header h2 {
    margin: 0;
    color: #1e3046;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    font-weight: 500;
}

.administration-panel > header p {
    margin: 5px 0 0;
    color: #89939e;
    font-size: 9px;
    line-height: 1.45;
}

.administration-panel > header > strong {
    display: grid;
    min-width: 27px;
    height: 27px;
    place-items: center;
    border: 1px solid rgba(18, 169, 153, .24);
    border-radius: 999px;
    color: #087c72;
    background: rgba(18, 169, 153, .05);
    font-size: 10px;
}

.administration-member-columns {
    display: grid;
    grid-template-columns: 38px minmax(170px, 1.25fr) minmax(115px, .65fr) minmax(130px, .8fr) 32px;
    gap: 14px;
    padding: 9px 10px 8px 16px;
    border-bottom: 1px solid var(--workspace-line);
    color: #98a0aa;
    background: rgba(244, 247, 247, .7);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.administration-member-columns span:first-child {
    grid-column: 1 / 3;
}

.administration-member-columns span:nth-child(2) {
    grid-column: 3;
}

.administration-member-columns span:nth-child(3) {
    grid-column: 4;
}

.administration-member-columns span:nth-child(4) {
    grid-column: 5;
    text-align: center;
}

.administration-member-row {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(170px, 1.25fr) minmax(115px, .65fr) minmax(130px, .8fr) 32px;
    align-items: center;
    gap: 14px;
    min-height: 76px;
    padding: 11px 10px 11px 16px;
    border-bottom: 1px solid var(--workspace-line);
    transition: background .16s ease;
}

.administration-member-row:hover {
    background: rgba(18, 169, 153, .025);
}

.administration-member-row:last-child {
    border-bottom: 0;
}

.administration-member-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(18, 169, 153, .22);
    border-radius: 50%;
    color: #08766d;
    background: rgba(18, 169, 153, .07);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .05em;
}

.administration-member-copy,
.administration-member-role {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.administration-member-copy strong,
.administration-member-copy span,
.administration-member-role strong,
.administration-member-role span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.administration-member-copy strong {
    color: #24364b;
    font-size: 11px;
}

.administration-member-copy span,
.administration-member-role span {
    color: #87919d;
    font-size: 9px;
}

.administration-member-role strong {
    color: #536174;
    font-size: 10px;
}

.administration-member-teams {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.administration-member-teams span {
    padding: 4px 7px;
    border: 1px solid rgba(62, 114, 157, .18);
    border-radius: 999px;
    color: #42677f;
    background: rgba(62, 114, 157, .05);
    font-size: 8px;
    font-weight: 700;
}

.administration-member-teams small {
    color: #9aa2ab;
    font-size: 9px;
}

.administration-team-create {
    display: grid;
    gap: 7px;
    padding: 17px 18px 16px;
    border-bottom: 1px solid var(--workspace-line);
    background: rgba(247, 250, 249, .72);
}

.administration-team-create > label {
    color: #697588;
    font-size: 9px;
    font-weight: 760;
}

.administration-team-create > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.administration-team-create input {
    width: 100%;
    min-height: 39px;
    padding: 0 10px;
    border: 1px solid #d3dbe0;
    border-radius: 6px;
    color: #293b4f;
    background: #ffffff;
    font: inherit;
    font-size: 10px;
}

.administration-team-create button {
    padding: 0 12px;
    border: 1px solid #198f84;
    border-radius: 6px;
    color: #ffffff;
    background: #149b8e;
    font-size: 9px;
    font-weight: 740;
    transition: background .16s ease, border-color .16s ease;
}

.administration-team-create button:hover {
    border-color: #087d73;
    background: #0d8d82;
}

.administration-team-create button:disabled {
    opacity: .58;
    cursor: wait;
}

.administration-team-create p {
    min-height: 14px;
    margin: 0;
    color: #7b8692;
    font-size: 9px;
}

.administration-team-list article {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    min-height: 61px;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    border-bottom: 1px solid var(--workspace-line);
}

.administration-team-list article:last-child {
    border-bottom: 0;
}

.administration-team-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.administration-team-count {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid rgba(18, 169, 153, .2);
    border-radius: 9px;
    color: #177b72;
    background: rgba(18, 169, 153, .055);
    font-size: 9px;
    font-weight: 800;
}

.administration-team-list strong {
    color: #304256;
    font-size: 10px;
}

.administration-team-list span {
    color: #89939e;
    font-size: 9px;
}

.administration-team-delete {
    padding: 5px 0;
    border: 0;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    color: #a35a60;
    background: transparent;
    font-size: 9px;
    font-weight: 690;
}

.administration-team-list button:hover {
    border-bottom-color: rgba(163, 90, 96, .45);
}

.administration-empty {
    margin: 0;
    padding: 24px 16px;
    color: #8a939d;
    font-size: 10px;
}

.administration-empty--teams {
    display: grid;
    gap: 5px;
}

.administration-empty--teams strong {
    color: #4d5c6d;
    font-size: 10px;
}

.administration-empty--teams span {
    color: #8a939d;
    font-size: 9px;
    line-height: 1.5;
}

.administration-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
    padding: 0;
}

.administration-form-grid label {
    display: grid;
    gap: 6px;
}

.administration-form-grid label > span {
    color: #4b5c70;
    font-size: 9px;
    font-weight: 740;
}

.administration-form-grid input,
.administration-form-grid select {
    width: 100%;
    min-height: 40px;
}

.administration-dialog-subject {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px 24px;
    border-bottom: 1px solid #e7ebed;
    background: #f8faf9;
}

.administration-dialog-subject > div {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.administration-dialog-subject strong,
.administration-dialog-subject span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.administration-dialog-subject strong {
    color: #2c4053;
    font-size: 10px;
}

.administration-dialog-subject > div span,
.administration-dialog-subject small {
    color: #89939e;
    font-size: 9px;
}

.administration-dialog-subject small {
    padding: 4px 7px;
    border: 1px solid #dce4e4;
    border-radius: 999px;
    background: #ffffff;
    font-weight: 700;
}

.administration-dialog-section {
    display: grid;
    gap: 15px;
    padding: 18px 24px 20px;
    border-bottom: 1px solid #e7ebed;
}

.administration-dialog-section > header {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
}

.administration-dialog-section > header > span {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid rgba(18, 169, 153, .22);
    border-radius: 7px;
    color: #168177;
    background: rgba(18, 169, 153, .05);
    font-size: 8px;
    font-weight: 800;
}

.administration-dialog-section h3,
.administration-dialog-section p {
    margin: 0;
}

.administration-dialog-section h3 {
    color: #2d4053;
    font-size: 11px;
}

.administration-dialog-section p {
    margin-top: 3px;
    color: #89939e;
    font-size: 9px;
    line-height: 1.45;
}

.administration-team-choice-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.administration-team-choice {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22px;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 8px 9px;
    border: 1px solid #dfe5e7;
    border-radius: 8px;
    color: #415366;
    background: #fbfcfc;
    cursor: pointer;
}

.administration-team-choice:has(input:checked) {
    border-color: rgba(18, 169, 153, .42);
    background: rgba(18, 169, 153, .045);
    box-shadow: 0 0 0 2px rgba(18, 169, 153, .045);
}

.administration-team-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.administration-team-choice:focus-within {
    outline: 2px solid rgba(18, 169, 153, .2);
    outline-offset: 2px;
}

.administration-team-choice-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.administration-team-choice-copy strong,
.administration-team-choice-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.administration-team-choice-copy strong {
    font-size: 10px;
}

.administration-team-choice-copy small {
    color: #8b949e;
    font-size: 8px;
}

.administration-team-choice-check {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    color: transparent;
    background: #eef2f2;
    font-size: 10px;
    font-weight: 800;
}

.administration-team-choice:has(input:checked) .administration-team-choice-check {
    color: #ffffff;
    background: #119c90;
}

@media (max-width: 1000px) {
    .administration-grid {
        grid-template-columns: 1fr;
    }

    .administration-firm-switcher {
        grid-template-columns: 130px minmax(220px, 1fr);
    }

    .administration-firm-switcher small {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .access-choice-list,
    .access-scope-options,
    .administration-team-choice-list,
    .administration-form-grid {
        grid-template-columns: 1fr;
    }

    .access-permission-row {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .administration-page {
        padding: 30px 20px 40px;
    }

    .administration-firm-switcher,
    .administration-member-row {
        grid-template-columns: 1fr;
    }

    .administration-header-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .administration-permission-summary {
        padding: 0 0 10px;
        border-right: 0;
        border-bottom: 1px solid var(--workspace-line);
        text-align: left;
    }

    .administration-member-columns {
        display: none;
    }

    .administration-member-avatar {
        display: none;
    }

    .administration-menu-host {
        position: absolute;
        top: 10px;
        right: 10px;
    }
}

/* =========================================================
   PRÜFUNG VOR DEM WORD-EXPORT
   ========================================================= */

.export-validation-overlay {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(20, 27, 38, .54);
    backdrop-filter: blur(3px);
}

.export-validation-dialog {
    width: min(720px, calc(100vw - 40px));
    max-height: min(780px, calc(100vh - 56px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dce2e8;
    border-radius: 16px;
    box-shadow:
        0 26px 70px rgba(15, 23, 42, .24),
        0 4px 14px rgba(15, 23, 42, .1);
    color: #1f2937;
}

.export-validation-header {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 34px;
    gap: 14px;
    align-items: start;
    padding: 24px 26px 20px;
    border-bottom: 1px solid #e7ebef;
}

.export-validation-header-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: #078b89;
    background: #e7f7f5;
    border-radius: 12px;
}

.export-validation-header-icon svg {
    width: 22px;
    height: 22px;
}

.export-validation-header > div:nth-child(2) > span {
    display: block;
    margin: 1px 0 4px;
    color: #078b89;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.export-validation-header h2 {
    margin: 0;
    font-size: 21px;
    line-height: 1.25;
    letter-spacing: -.015em;
}

.export-validation-header p {
    margin: 6px 0 0;
    color: #667085;
    font-size: 13px;
    line-height: 1.45;
}

.export-validation-close {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #667085;
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 25px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
}

.export-validation-close:hover {
    color: #1f2937;
    background: #f2f4f7;
}

.export-validation-body {
    overflow-y: auto;
    padding: 22px 26px 24px;
}

.export-file-name:has(+ section) {
    margin-bottom: 24px;
}

.export-file-name label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
}

.export-file-name-control {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
}

.export-file-name-control:focus-within {
    border-color: #079d99;
    box-shadow: 0 0 0 3px rgba(7, 157, 153, .12);
}

.export-file-name-control input {
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    border: 0;
    outline: none;
    font: inherit;
    color: #1f2937;
    background: #fff;
}

.export-file-name-control span {
    padding: 0 12px;
    color: #667085;
    font-size: 14px;
}

.export-file-name p {
    margin: 7px 0 0;
    color: #667085;
    font-size: 12px;
    line-height: 1.45;
}

.export-validation-section + .export-validation-section {
    margin-top: 24px;
}

.export-validation-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
}

.export-validation-section-heading h3 {
    margin: 0;
    font-size: 15px;
    line-height: 1.35;
}

.export-validation-section-heading p {
    margin: 4px 0 0;
    color: #667085;
    font-size: 12px;
    line-height: 1.45;
}

.export-validation-section-heading > span {
    min-width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    padding: 0 8px;
    color: #475467;
    background: #f2f4f7;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.export-validation-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.export-validation-issue {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 13px 14px;
    background: #fafbfc;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
}

.export-validation-issue strong {
    display: block;
    color: #26313f;
    font-size: 13px;
    line-height: 1.4;
}

.export-validation-issue small {
    display: block;
    margin-top: 2px;
    color: #7a8493;
    font-size: 11px;
    line-height: 1.4;
}

.export-validation-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 8px;
    color: #496174;
    background: #e9eef2;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
    white-space: nowrap;
}

.export-validation-type-badge.is-attention {
    color: #8a5310;
    background: #fff0d9;
}

.export-validation-multiple-issue {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 11px;
}

.export-validation-issue-heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.export-validation-selected-values {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-left: 2px;
}

.export-validation-selected-values span {
    padding: 5px 8px;
    color: #245c5b;
    background: #e6f5f3;
    border: 1px solid #cce9e5;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

.export-validation-confirmation {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 11px;
    color: #344054;
    background: #fff;
    border: 1px solid #d9dee5;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.export-validation-confirmation:hover {
    border-color: #92cfca;
}

.export-validation-confirmation input {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin: 0;
    accent-color: #079d99;
}

.export-validation-confirmation-note {
    display: none;
    margin: 9px 0 0;
    color: #9a5b0b;
    font-size: 11px;
    font-weight: 700;
}

.export-validation-confirmation-note.is-visible {
    display: block;
}

.export-validation-info {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    margin-top: 22px;
    padding: 13px 14px;
    color: #41556a;
    background: #f1f7f8;
    border: 1px solid #d9e9eb;
    border-radius: 10px;
}

.export-validation-info svg {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    color: #078b89;
}

.export-validation-info p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

.export-validation-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 17px 26px;
    background: #fafbfc;
    border-top: 1px solid #e7ebef;
}

.export-validation-secondary,
.export-validation-primary {
    min-height: 40px;
    padding: 0 17px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.export-validation-secondary {
    color: #475467;
    background: #fff;
    border: 1px solid #d0d5dd;
}

.export-validation-secondary:hover {
    background: #f5f6f7;
}

.export-validation-primary {
    color: #fff;
    background: #079d99;
    border: 1px solid #079d99;
}

.export-validation-primary:hover:not(:disabled) {
    background: #078b89;
    border-color: #078b89;
}

.export-validation-primary:disabled {
    color: #98a2b3;
    background: #e7eaee;
    border-color: #e7eaee;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .export-validation-overlay {
        align-items: flex-end;
        padding: 12px;
    }

    .export-validation-dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
    }

    .export-validation-header,
    .export-validation-body,
    .export-validation-footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .export-validation-footer {
        flex-direction: column-reverse;
    }

    .export-validation-secondary,
    .export-validation-primary {
        width: 100%;
    }
}

/* =========================================================
   FUNKTIONSTOKENS UND PROFESSIONELLE EDITOR-OBERFLÄCHE
   ========================================================= */

.lexcraft-function-token {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin: 0 2px;
    padding: 1px 6px;
    overflow: hidden;
    border: 1px solid #9fd4cd;
    border-radius: 4px;
    background: #e6f5f3;
    color: #176b64;
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Consolas,
        monospace;
    font-size: .78em;
    font-weight: 650;
    line-height: 1.45;
    vertical-align: .08em;
    white-space: nowrap;
    text-overflow: ellipsis;
    user-select: all;
}

.lexcraft-function-token.function-calculate {
    border-color: #b5d6a7;
    background: #edf7e9;
    color: #356a29;
}

.lexcraft-function-token.function-pagebreak,
.lexcraft-function-token.function-restartnumbering {
    border-color: #c9bee7;
    background: #f1eef9;
    color: #59488a;
}

.lexcraft-function-token.function-customstyle,
.lexcraft-function-token.function-tableborders {
    border-color: #cbd3da;
    background: #f1f4f6;
    color: #485664;
}

.lexcraft-function-token.function-url {
    border-color: #b7d0e9;
    background: #eef5fb;
    color: #2a5f91;
}

.lexcraft-small-caps {
    font-variant-caps: small-caps;
    letter-spacing: .045em;
}

.lexcraft-generated-link {
    color: #176b94;
    text-decoration: underline;
    text-decoration-thickness: .06em;
    text-underline-offset: .14em;
}

.builder-shell .external-section-block {
    margin: 0 0 10px;
    overflow: visible;
    border: 1px solid #dce2e6;
    border-radius: 7px;
    background: #ffffff;
    box-shadow:
        0 1px 1px rgba(31, 41, 55, .03),
        0 4px 14px rgba(31, 41, 55, .035);
}

.builder-shell .external-section-head {
    min-height: 44px;
    padding: 7px 44px 7px 13px;
    border-radius: 7px 7px 0 0;
    background: #f8f9fa;
}

.builder-shell
.external-section-block:not(.open)
.external-section-head {
    border-radius: 7px;
}

.builder-shell .external-section-head:hover {
    background: #f4f7f7;
}

.builder-shell .external-section-title-textarea {
    color: #27313a;
    font-size: 12px;
    font-weight: 720;
    line-height: 1.35;
}

.builder-shell .external-question {
    margin: 0 11px 9px;
    padding: 10px 11px;
    border: 1px solid #e2e6e9;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: none;
}

.builder-shell .external-question:hover {
    border-color: #ccd5d9;
}

.builder-shell .external-question-kicker {
    color: #7d878f;
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .11em;
}

.builder-shell .external-question-title {
    color: #2a3239;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.38;
}

.external-text-field-row,
.external-choice-option-row {
    min-height: 38px;
    border: 1px solid #e0e5e8;
    border-radius: 5px;
    background: #fafbfb;
    transition:
        border-color .14s ease,
        background .14s ease,
        box-shadow .14s ease;
}

.external-text-field-row:hover,
.external-choice-option-row:hover,
.external-text-field-row:focus-within,
.external-choice-option-row:focus-within {
    border-color: #b9cecb;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(20, 139, 128, .07);
}

.external-field-badge,
.external-option-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    height: 20px;
    margin-right: 5px;
    padding: 0 6px;
    border: 1px solid #cbd7d5;
    border-radius: 999px;
    background: #edf5f4;
    color: #3f6965;
    font-size: 7.5px;
    font-weight: 800;
    letter-spacing: .055em;
    white-space: nowrap;
}

.external-option-badge.default {
    border-color: #d8c68c;
    background: #fbf6e4;
    color: #79651d;
}

.external-field-badge.date {
    border-color: #bdcde3;
    background: #eef3f9;
    color: #426386;
}

.external-field-badge.publication {
    margin-left: auto;
    border-color: #d8c8c8;
    background: #f8eeee;
    color: #8b4a4a;
}

.builder-shell .doc-row {
    min-height: 38px;
    margin: 0 8px 2px;
    padding-top: 5px;
    padding-bottom: 5px;
    border: 1px solid transparent;
    border-radius: 5px;
    background-color: transparent;
    transition:
        border-color .13s ease,
        background-color .13s ease,
        box-shadow .13s ease;
}

.builder-shell .doc-row:hover {
    border-color: #e1e6e8;
    background-color: #fafbfb;
}

.builder-shell .doc-row.selected {
    border-color: #80bdb6;
    background-color: #f6fbfa;
    box-shadow:
        inset 0 0 0 1px #80bdb6,
        0 0 0 2px rgba(23, 130, 119, .075);
}

.builder-shell .doc-row.has-page-break {
    margin-top: 16px;
}

.builder-shell .doc-row.has-page-break::before {
    content: "SEITENUMBRUCH";
    position: absolute;
    right: 6px;
    top: -14px;
    color: #82759f;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .09em;
}

.builder-shell .doc-row.has-page-break::after {
    content: none;
}

.builder-shell .element-menu-button,
.builder-shell .element-rules-button,
.builder-shell .external-text-field-dots {
    border-radius: 4px;
    box-shadow: none;
}

.builder-shell .element-rules-button {
    min-width: 54px;
    height: 26px;
    padding: 0 8px;
    border: 1px solid #d7dddf;
    background: #f4f6f7;
    color: #58636c;
    font-size: 8px;
    font-weight: 780;
    letter-spacing: .04em;
}

.builder-shell .element-rules-button.linked,
.builder-shell .element-rules-button:hover {
    border-color: #168f83;
    background: #168f83;
    color: #ffffff;
}

.document-state-badge.page-break,
.document-state-badge.numbering {
    border-color: #c9bee7;
    background: #f1eef9;
    color: #59488a;
}

.document-state-badge.custom-style {
    max-width: 130px;
    overflow: hidden;
    border-color: #cbd3da;
    background: #f1f4f6;
    color: #485664;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.execution-shell
.preview-document-element.has-page-break {
    break-before: page;
    page-break-before: always;
}

.execution-shell
.preview-document-element.has-page-break::before {
    content: none;
}

@media print {
    .execution-shell
    .preview-document-element.has-page-break::before {
        content: none;
    }
}

.execution-shell .preview-document {
    font-family:
        var(--layout-font-family, Arial),
        sans-serif;
    font-size:
        var(
            --preview-word-font-size,
            var(--layout-body-font-size, 11pt)
        );
    line-height:
        var(--layout-line-height, 1.5);
}

.execution-shell.highlight-dynamic-content
.document-placeholder,
.execution-shell.highlight-dynamic-content
.inline-rule-token.linked {
    background: #3cc9c2;
    color: #102e2c;
}

@media (max-width: 1120px) {
    .layout-editor-grid {
        grid-template-columns: 1fr 1fr;
    }

    .layout-preview-group {
        grid-column: 1 / -1;
        border-top: 1px solid #e4e7eb;
        border-left: 0;
    }
}

@media (max-width: 820px) {
    .layout-workspace,
    .layout-editor-grid {
        grid-template-columns: 1fr;
    }

    .layout-library {
        position: static;
    }

    .layout-settings-group + .layout-settings-group,
    .layout-preview-group {
        grid-column: auto;
        border-top: 1px solid #e4e7eb;
        border-left: 0;
    }
}

/* =========================================================
   EDITOR-FINISH – KOMPAKTE, RUHIGE BEARBEITUNGSANSICHT
   Betrifft bewusst nicht Vorschau oder Word-Ausgabe.
   ========================================================= */

.builder-shell {
    grid-template-rows:
        48px minmax(0, 1fr);
    background: #f3f4f5;
}

.builder-shell .builder-topbar {
    padding-inline: 14px;
    border-bottom-color: #292c31;
    background: #303238;
}

.builder-shell .editor-title {
    font-size: 10.5px;
    letter-spacing: .055em;
}

.builder-shell .editor-mode-badge {
    padding: 3px 7px;
    font-size: 8px;
}

.builder-shell .topbar-button,
.builder-shell .topbar-primary {
    height: 28px;
    padding-inline: 10px;
    border-radius: 3px;
    font-size: 9px;
}

.builder-shell .editor-layout {
    grid-template-columns:
        clamp(300px, 31.5vw, 440px)
        minmax(0, 1fr);
    height: calc(100vh - 48px);
}

.builder-shell .interview-panel {
    padding: 20px 22px 0;
    border-right-color: #dde0e2;
    background: #fdfdfd;
}

.builder-shell .interview-section-list {
    padding: 0 1px 24px;
}

.builder-shell .external-section-block {
    margin-bottom: 20px;
}

.builder-shell .external-section-head {
    min-height: 38px;
    grid-template-columns:
        20px minmax(0, 1fr) 32px;
    gap: 7px;
    padding: 2px 1px 5px;
}

.builder-shell .interview-toggle {
    width: 20px;
    height: 29px;
    color: #54aca3;
    font-size: 12px;
}

.builder-shell
.external-section-title-textarea {
    min-height: 29px;
    padding: 5px 1px;
    color: #22272c;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.35;
}

.builder-shell .section-menu-wrapper {
    width: 32px;
    min-width: 32px;
}

.builder-shell .section-dots {
    width: 32px;
    height: 32px;
    border-radius: 3px;
    background: #e1e3e5;
    color: #71777e;
    font-size: 17px;
}

.builder-shell .section-dots:hover {
    background: #d5d8da;
    color: #444a50;
}

.builder-shell .section-inner {
    width: calc(100% - 4px);
    margin-top: 11px;
    margin-left: 4px;
}

.builder-shell .external-question {
    margin: 16px 0 13px;
}

.builder-shell .external-question-kicker {
    margin: 0 0 2px 3px;
    color: #959ba1;
    font-size: 7.5px;
    letter-spacing: .12em;
}

.builder-shell
.external-question-title-row {
    margin-bottom: 11px;
}

.builder-shell .external-question-title {
    min-height: 29px;
    padding: 3px;
    color: #292e33;
    font-size: 13.5px;
    font-weight: 650;
    line-height: 1.35;
}

.builder-shell .external-question-delete {
    height: 25px;
    padding-inline: 5px;
    color: #9a9fa5;
    font-size: 9px;
    opacity: .6;
}

.builder-shell .external-question-rule {
    height: 25px;
    margin-top: 1px;
    padding-inline: 7px;
}

.builder-shell .external-question-series {
    height: 25px;
    margin-top: 1px;
    padding-inline: 7px;
}

.builder-shell
.external-question-delete:hover {
    color: #9f2e38;
    opacity: 1;
}

.builder-shell .external-choice-options {
    gap: 7px;
}

.builder-shell
.external-choice-option-row {
    grid-template-columns:
        16px minmax(0, 1fr) 24px;
    gap: 8px;
    min-height: 37px;
    padding: 0 6px 0 11px;
    border-color: #eceeef;
    background: #f0f1f2;
}

.builder-shell
.external-choice-option-row:hover {
    border-color: #d9dddf;
    background: #f4f5f5;
}

.builder-shell .external-choice-control {
    width: 12px;
    height: 12px;
    border-color: #8a9096;
}

.builder-shell
.external-choice-option-input {
    height: 35px;
    color: #3b4046;
    font-size: 11.5px;
    font-weight: 600;
}

.builder-shell .external-choice-delete {
    width: 23px;
    height: 23px;
    color: #a2a7ac;
    font-size: 16px;
    opacity: .45;
}

.builder-shell
.external-choice-option-row:hover
.external-choice-delete {
    opacity: 1;
}

.builder-shell .external-add-textfield {
    margin-top: 10px;
    color: #656b71;
    font-size: 10px;
    text-underline-offset: 2px;
}

.builder-shell .external-question-help {
    margin-top: 7px;
    color: #8b9197;
    font-size: 9.5px;
}

.builder-shell .external-question-divider {
    margin-top: 17px;
    background: #e8eaec;
}

.builder-shell .external-small-button,
.builder-shell .external-section-button {
    height: 31px;
    padding-inline: 12px;
    border-radius: 3px;
    background: #e1e3e5;
    color: #555c63;
    font-size: 9.5px;
    letter-spacing: .015em;
}

.builder-shell .external-small-button:hover,
.builder-shell .external-section-button:hover {
    background: #d5d8da;
    color: #30363c;
}

.builder-shell .external-small-button {
    margin-left: 50px;
    margin-bottom: 14px;
}

.builder-shell .interview-footer {
    min-height: 56px;
    margin: 0 -22px;
    padding: 8px 22px 10px;
    border-top: 1px solid #eff0f1;
}

.builder-shell .external-section-button {
    transform: none;
}

.builder-shell .editor-document-area {
    grid-template-rows:
        44px minmax(0, 1fr) 54px;
    background: #f1f2f3;
}

.builder-shell
.editor-document-area .editor-toolbar {
    min-height: 44px;
    padding: 5px 16px;
    border-bottom-color: #e0e2e4;
    box-shadow: 0 2px 7px
        rgba(20, 26, 32, .025);
}

.builder-shell
.editor-document-area .toolbar-primary {
    height: 30px;
    padding-inline: 12px;
    border-radius: 3px;
    font-size: 9.5px;
}

.builder-shell
.editor-document-area .toolbar-icon {
    width: 30px;
    height: 30px;
    border-radius: 3px;
    color: #4e555c;
}

.builder-shell
.editor-document-area .toolbar-icon.active,
.builder-shell
.editor-document-area
.toolbar-icon[aria-pressed="true"] {
    background: #d9f1ef;
    color: #087b72;
    box-shadow:
        inset 0 0 0 1px #9ed7d2;
}

.builder-shell .toolbar-divider {
    height: 20px;
    background: #e3e5e7;
}

.builder-shell .document-canvas-scroll {
    padding: 22px 32px 42px;
}

.builder-shell .editor-paper {
    min-height: 297mm;
    padding: 48px 56px 72px;
    border-color: #e4e6e8;
    box-shadow:
        0 8px 26px rgba(32, 38, 46, .085);
}

.builder-shell
.doc-row:has(.doc-element.heading) {
    margin-top: 8pt;
    margin-bottom: 4pt;
}

.builder-shell
.doc-row:first-child:has(.doc-element.heading) {
    margin-top: 0;
}

.builder-shell
.doc-row:has(.doc-element.paragraph) {
    margin-bottom: 6pt;
}

.builder-shell .doc-row {
    min-height: 30px;
    padding:
        3px 116px 3px
        calc(var(--element-indent, 0px) + 23px);
    border-left: 2px solid transparent;
    border-radius: 2px;
    background-size:
        var(--element-indent, 0px) 100%;
}

.builder-shell .doc-row:hover {
    border-left-color: #c4dfdc;
    background-color: #fafbfb;
}

.builder-shell .doc-row.selected {
    border-left-color: #56aaa2;
    outline: none;
    background-color: #f7f9f9;
    box-shadow:
        inset 0 0 0 1px #e1e5e5;
}

.builder-shell .document-heading-toggle {
    top: 5px;
    width: 19px;
    height: 19px;
    color: #b0b5b9;
}

.builder-shell
.document-heading-toggle svg {
    width: 13px;
    height: 13px;
}

.builder-shell .document-paragraph-marker {
    left:
        calc(var(--element-indent, 0px) + 7px);
    top: 14px;
    background: #e0e3e5;
}

.builder-shell .doc-element {
    min-height: 1.1em;
    padding: 2px 4px;
}

.builder-shell .doc-element.heading {
    font-weight: 650;
    letter-spacing: -.008em;
    line-height: 1.22;
}

.builder-shell
.doc-element.heading.level-1 {
    font-size: 14pt;
}

.builder-shell
.doc-element.heading.level-2 {
    font-size: 12.5pt;
}

.builder-shell
.doc-element.heading.level-3 {
    font-size: 11.5pt;
}

.builder-shell
.doc-element.heading.level-4,
.builder-shell
.doc-element.heading.level-5,
.builder-shell
.doc-element.heading.level-6,
.builder-shell
.doc-element.heading.level-7,
.builder-shell
.doc-element.heading.level-8,
.builder-shell
.doc-element.heading.level-9 {
    font-size: 11pt;
}

.builder-shell .doc-element.paragraph {
    font-size: 10.75pt;
    line-height: 1.2;
}

.builder-shell .element-inline-actions {
    right: 3px;
    gap: 5px;
}

.builder-shell .element-menu-button,
.builder-shell .element-rules-button {
    height: 27px;
    border-radius: 3px;
}

.builder-shell .element-menu-button {
    width: 28px;
    background: #e6e8e9;
    color: #7a8086;
    font-size: 16px;
}

.builder-shell .element-rules-button {
    padding-inline: 11px;
    background: #e1e3e5;
    color: #6b7177;
    font-size: 8.5px;
    letter-spacing: .05em;
}

.builder-shell .document-footer-actions {
    gap: 8px;
    padding: 8px 26px;
    border-top-color: #e0e2e4;
    box-shadow:
        0 -3px 12px rgba(20, 26, 32, .025);
}

.builder-shell .workspace-create-button {
    height: 31px;
    padding-inline: 12px;
    border-color: #d7dadd;
    background: #e8e9ea;
    color: #555c63;
    font-size: 9px;
}

.builder-shell
.workspace-create-button.secondary {
    background: #f8f8f8;
}

.builder-shell
.external-choice-option-row.rule-selected,
.builder-shell
.external-choice-option-row.rule-selected:hover,
.builder-shell
.external-choice-option-row.rule-selected:focus-within {
    border-color: #5ca90d;
    background: #75c900;
    box-shadow:
        inset 3px 0 0 #438600,
        0 3px 10px rgba(81, 139, 20, .18);
}

.builder-shell
.external-choice-option-row.rule-selected
.external-choice-option-input {
    color: #173400;
    font-weight: 750;
}

.builder-shell
.external-choice-option-row.rule-selected
.external-choice-control {
    border-color: #244b00;
    background: #ffffff;
    box-shadow:
        inset 0 0 0 3px #75c900;
}

.builder-shell
.external-choice-option-row.rule-selected.rule-negative,
.builder-shell
.external-choice-option-row.rule-selected.rule-negative:hover,
.builder-shell
.external-choice-option-row.rule-selected.rule-negative:focus-within {
    border-color: #b43b47;
    background: #d9606b;
    box-shadow:
        inset 3px 0 0 #912732,
        0 3px 10px rgba(157, 43, 54, .2);
}

.builder-shell
.external-choice-option-row.rule-selected.rule-negative
.external-choice-option-input {
    color: #ffffff;
}

.builder-shell
.external-choice-option-row.rule-selected.rule-negative
.external-choice-control {
    border-color: #7f1d27;
    background: #ffffff;
    box-shadow:
        inset 0 0 0 3px #d9606b;
}

.builder-shell .element-rules-button.editing,
.builder-shell .element-rules-button.editing:hover {
    background: #d85d66;
    color: #ffffff;
}

@media (max-width: 900px) {
    .builder-shell .editor-layout {
        grid-template-columns:
            minmax(280px, 36%)
            minmax(0, 1fr);
    }

    .builder-shell .document-canvas-scroll {
        padding-inline: 18px;
    }

    .builder-shell .editor-paper {
        padding-inline: 38px;
    }
}

/* =========================================================
   QUELLSYSTEM-DOKUMENTFLÄCHE IM BEARBEITUNGSMODUS
   Überschriften und Absätze sind Strukturzeilen statt
   einer verkleinerten Word-Seite.
   ========================================================= */

.builder-shell .editor-document-area,
.builder-shell .document-canvas-scroll {
    background: #ffffff;
}

.builder-shell .document-canvas-scroll {
    padding: 0;
}

.builder-shell .editor-paper {
    width: 100%;
    max-width: none;
    min-height: 100%;
    margin: 0;
    padding: 27px 34px 80px 46px;
    border: 0;
    background: #ffffff;
    box-shadow: none;
}

.builder-shell
.editor-paper #documentElements {
    width: 100%;
    max-width: none;
}

.builder-shell
.doc-row:has(.doc-element.heading) {
    margin: 2px 0;
}

.builder-shell
.doc-row:first-child:has(.doc-element.heading) {
    margin-top: 0;
}

.builder-shell
.doc-row:has(.doc-element.paragraph) {
    margin: 0 0 9px;
}

.builder-shell .doc-row {
    min-height: 34px;
    padding:
        5px 116px 5px
        calc(var(--element-indent, 0px) + 24px);
    border: 0;
    border-radius: 1px;
    background-image:
        repeating-linear-gradient(
            to right,
            transparent 0,
            transparent 30px,
            #e5e7e8 30px,
            #e5e7e8 31px
        );
    background-color: transparent;
}

.builder-shell .doc-row:hover {
    border: 0;
    background-color: #fafafa;
}

.builder-shell .doc-row.selected {
    border: 0;
    outline: 0;
    background-color: #f3f4f4;
    box-shadow: none;
}

.builder-shell .document-heading-toggle {
    left: var(--element-indent, 0px);
    top: 7px;
    width: 20px;
    height: 20px;
    color: #b2b6b9;
}

.builder-shell
.document-heading-toggle:hover {
    background: transparent;
    color: #4da79f;
}

.builder-shell .document-paragraph-marker {
    left:
        calc(var(--element-indent, 0px) + 8px);
    top: 15px;
    width: 4px;
    background: #dfe2e4;
}

.builder-shell .doc-element {
    min-height: 22px;
    padding: 1px 3px;
    color: #303438;
    font-family:
        Arial, Helvetica, sans-serif;
}

.builder-shell .doc-element.heading {
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.35;
}

.builder-shell
.doc-element.heading.level-1 {
    font-size: 16px;
}

.builder-shell
.doc-element.heading.level-2 {
    font-size: 15px;
}

.builder-shell
.doc-element.heading.level-3 {
    font-size: 14.5px;
}

.builder-shell
.doc-element.heading.level-4,
.builder-shell
.doc-element.heading.level-5,
.builder-shell
.doc-element.heading.level-6,
.builder-shell
.doc-element.heading.level-7,
.builder-shell
.doc-element.heading.level-8,
.builder-shell
.doc-element.heading.level-9 {
    font-size: 14px;
}

.builder-shell .doc-element.paragraph {
    min-height: 23px;
    color: #3a3e42;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
}

.builder-shell .doc-element:empty {
    min-height: 25px;
    background: #fafafa;
}

.builder-shell
.doc-row.selected .doc-element:empty {
    background: transparent;
}

.builder-shell .element-inline-actions {
    right: 4px;
}

.builder-shell .element-menu-button,
.builder-shell .element-rules-button {
    height: 26px;
}

.builder-shell .element-menu-button {
    width: 27px;
    background: #e4e6e7;
    color: #777d82;
}

.builder-shell .element-rules-button {
    padding-inline: 10px;
    background: #dfe1e2;
    color: #62686e;
}

.builder-shell .document-footer-actions {
    background: #ffffff;
}

@media (max-width: 900px) {
    .builder-shell .editor-paper {
        padding:
            24px 24px 72px 30px;
    }
}

/* Vorschau: dieselbe kompakte Überschriftenhierarchie wie im Editor. */

.execution-shell
.preview-document-element.heading {
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.35;
}

.execution-shell
.preview-document-element.heading:not(:first-child) {
    margin-top: 10px;
}

.execution-shell
.preview-document-element.heading.level-1 {
    font-size: 16px;
}

.execution-shell
.preview-document-element.heading.level-2 {
    font-size: 15px;
}

.execution-shell
.preview-document-element.heading.level-3 {
    font-size: 14.5px;
}

.execution-shell
.preview-document-element.heading.level-4,
.execution-shell
.preview-document-element.heading.level-5,
.execution-shell
.preview-document-element.heading.level-6,
.execution-shell
.preview-document-element.heading.level-7,
.execution-shell
.preview-document-element.heading.level-8,
.execution-shell
.preview-document-element.heading.level-9 {
    font-size: 14px;
}

/* Absätze folgen direkt und ohne Strich auf ihre Ebenenlinie. */

.builder-shell
.doc-row:has(.doc-element.paragraph) {
    min-height: 26px;
    margin: 0 0 4px;
    padding:
        2px 116px 2px
        calc(var(--element-indent, 0px) + 11px);
}

.builder-shell .document-paragraph-marker {
    display: none;
}

.builder-shell .doc-element.paragraph {
    min-height: 20px;
    padding-block: 0;
    line-height: 1.45;
}

/* Symmetrische Auswahlfläche: Text wird nicht durch die
   rechts eingeblendeten Aktionsbuttons nach links verschoben. */

.builder-shell .doc-row {
    display: block;
    align-items: center;
    padding-right:
        calc(var(--element-indent, 0px) + 24px);
    border-radius: 3px;
}

.builder-shell
.doc-row:has(.doc-element.paragraph) {
    padding-top: 3px;
    padding-right:
        calc(var(--element-indent, 0px) + 11px);
    padding-bottom: 3px;
}

.builder-shell .doc-row.selected {
    background-color: #f5f7f7;
    box-shadow:
        inset 0 0 0 1px #dce3e2;
}

.builder-shell .doc-element {
    box-sizing: border-box;
}

.builder-shell
.doc-row.selected
.doc-element[data-alignment="left"],
.builder-shell
.doc-row.selected
.doc-element[data-alignment="right"] {
    padding-right: 104px;
}

/* Toolbar-Icons geometrisch statt über die Text-Baseline
   zentrieren. So sitzt auch die aktive grüne Fläche sauber. */

.builder-shell
.editor-document-area .toolbar-icon {
    display: inline-flex;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 30px;
    height: 30px;
    padding: 0;
    line-height: 1;
}

.builder-shell
.editor-document-area .toolbar-icon svg {
    display: block;
    flex: 0 0 auto;
    margin: 0;
    vertical-align: middle;
}

.builder-shell
.editor-document-area .toolbar-icon > b,
.builder-shell
.editor-document-area .toolbar-icon > i,
.builder-shell
.editor-document-area .toolbar-icon > u {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    min-height: 18px;
    line-height: 18px;
}

/* Der Absatz bleibt kompakt, seine Auswahlfläche erhält aber
   denselben 4-px-Innenraum um die Aktionen wie eine Überschrift. */

.builder-shell
.doc-row:has(.doc-element.paragraph).selected {
    isolation: isolate;
    background-color: transparent;
    box-shadow: none;
}

.builder-shell
.doc-row:has(.doc-element.paragraph).selected::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -4px;
    right: 0;
    bottom: -4px;
    left: 0;
    border: 1px solid #dce3e2;
    border-radius: 3px;
    background: #f5f7f7;
    pointer-events: none;
}

/* Lesbarere Absätze, weiterhin sichtbar kleiner als Überschriften. */

.builder-shell .doc-element.paragraph {
    font-size: 14px;
}

/* Leere Dokumentzeilen bleiben in der Vorschau als echte
   vertikale Abstände erhalten. */

.execution-shell
.preview-document-element:empty::before {
    content: "\00a0";
}

.execution-shell
.preview-document-element.paragraph:empty {
    min-height: 1.45em;
}

.execution-shell
.preview-document-element.heading:empty {
    min-height: 1.35em;
}

/* =========================================================
   INLINE-TABELLEN IM DOKUMENT
   ========================================================= */

.builder-shell
.editor-document-area
.toolbar-table-button {
    margin-left: auto;
}

.builder-shell .lexcraft-inline-table-wrap {
    display: block;
    position: relative;
    box-sizing: border-box;
    width: 100%;
    min-width: 240px;
    max-width: 100%;
    margin: 4px auto;
    padding: 6px 7px 6px 0;
    overflow: auto;
    resize: horizontal;
    border: 1px solid transparent;
    border-radius: 3px;
}

.builder-shell
.lexcraft-inline-table-wrap::before,
.builder-shell
.lexcraft-inline-table-wrap::after {
    content: "";
    position: absolute;
    z-index: 2;
    right: 7px;
    left: 0;
    height: 6px;
    cursor: text;
}

.builder-shell
.lexcraft-inline-table-wrap::before {
    top: 0;
}

.builder-shell
.lexcraft-inline-table-wrap::after {
    bottom: 0;
}

.builder-shell
.lexcraft-table-boundary-line,
.builder-shell
.lexcraft-table-content-line {
    min-height: 1.35em;
    margin: 0;
    outline: none;
}

.execution-shell
.lexcraft-table-content-line {
    display: block;
    min-height: 1.45em;
}

.builder-shell
.lexcraft-inline-table-wrap:hover,
.builder-shell
.lexcraft-inline-table-wrap:focus-within {
    border-color: #b8cfcc;
    background: #fbfdfd;
}

.lexcraft-inline-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #ffffff;
}

.lexcraft-inline-table td,
.lexcraft-inline-table th {
    position: relative;
    min-width: 72px;
    height: 38px;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #9fa8ad;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.lexcraft-inline-table
tr[data-table-row-height-explicit="true"] > td,
.lexcraft-inline-table
tr[data-table-row-height-explicit="true"] > th,
.lexcraft-inline-table
tr[data-table-row-resizing="true"] > td,
.lexcraft-inline-table
tr[data-table-row-resizing="true"] > th {
    vertical-align: middle;
}

.builder-shell
.lexcraft-inline-table
td:not([data-lexcraft-custom-style])::before,
.builder-shell
.lexcraft-inline-table
th:not([data-lexcraft-custom-style])::before {
    content: "";
    position: absolute;
    z-index: 4;
    right: 0;
    bottom: -5px;
    left: 0;
    height: 10px;
    cursor: row-resize;
}

.builder-shell
.lexcraft-inline-table
td:not(:last-child)::after,
.builder-shell
.lexcraft-inline-table
th:not(:last-child)::after {
    content: "";
    position: absolute;
    z-index: 3;
    top: 0;
    right: -5px;
    bottom: 0;
    width: 10px;
    cursor: col-resize;
}

body.resizing-table-column,
body.resizing-table-column * {
    cursor: col-resize !important;
    user-select: none !important;
}

body.resizing-table-row,
body.resizing-table-row * {
    cursor: row-resize !important;
    user-select: none !important;
}

.builder-shell
.lexcraft-inline-table
td[contenteditable="true"] {
    cursor: text;
}

.builder-shell
.lexcraft-inline-table
[data-lexcraft-custom-style]::before {
    content:
        "::customstyle["
        attr(data-lexcraft-custom-style)
        "]";
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin: 0 5px 2px 0;
    padding: 1px 6px;
    overflow: hidden;
    border: 1px solid #cbd3da;
    border-radius: 4px;
    background: #f1f4f6;
    color: #485664;
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Consolas,
        monospace;
    font-size: .78em;
    font-weight: 650;
    line-height: 1.45;
    vertical-align: .08em;
    white-space: nowrap;
    text-overflow: ellipsis;
    pointer-events: none;
    user-select: none;
}

.builder-shell
.lexcraft-inline-table
td[contenteditable="true"]:focus,
.builder-shell
.lexcraft-inline-table
[data-table-active-cell] {
    outline: 2px solid #139b8e;
    outline-offset: -2px;
    background: #f0faf8;
}

.document-table-controls {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    width: 100%;
    margin: 3px 0 7px;
    padding: 5px 6px;
    box-sizing: border-box;
    border: 1px solid #e0e5e5;
    border-radius: 4px;
    background: #f7f9f9;
}

.document-table-design-panel {
    display: grid;
    grid-template-columns: minmax(190px, .72fr) minmax(260px, 1.25fr) auto;
    flex: 1 1 100%;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 9px;
    box-sizing: border-box;
    border: 1px solid #cfe1df;
    border-radius: 5px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(32, 53, 57, .04);
}

.document-table-design-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: #28383c;
}

.document-table-design-heading > span:last-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.document-table-design-heading b {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
}

.document-table-design-heading small {
    overflow: hidden;
    color: #718085;
    font-size: 9px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-table-design-icon {
    display: inline-grid;
    flex: 0 0 28px;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: #e7f6f4;
    color: #0a847a;
}

.document-table-design-icon svg {
    width: 15px;
    height: 15px;
    stroke-width: 1.8;
}

.document-table-design-status {
    justify-self: end;
    padding: 5px 7px;
    border-radius: 999px;
    background: #f1f3f4;
    color: #6d777b;
    font-size: 9px;
    font-weight: 750;
    line-height: 1.2;
    white-space: nowrap;
}

.document-table-design-status.assigned {
    background: #def3ef;
    color: #08786f;
}

.document-table-design-status.unresolved {
    background: #fff2cf;
    color: #866318;
}

.document-table-auto-design {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 9px;
    border: 1px solid #cfe5e2;
    border-radius: 4px;
    background: #eff9f7;
    color: #237f76;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.document-table-auto-design svg {
    width: 14px;
    height: 14px;
    stroke-width: 1.9;
}

.document-table-tone-controls {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    height: 30px;
    padding: 0 3px 0 8px;
    border: 1px solid #d7dfdf;
    border-radius: 4px;
    background: #ffffff;
    color: #657176;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.document-table-tone-controls > span {
    margin-right: 6px;
}

.document-table-tone-controls button {
    height: 24px;
    padding: 0 7px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: #536065;
    font: inherit;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}

.document-table-tone-controls button:hover {
    background: #eef5f4;
}

.document-table-tone-controls button.active {
    background: #dff2ef;
    color: #087b72;
}

.document-table-divider-controls {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    height: 30px;
    padding: 0 3px 0 8px;
    border: 1px solid #d7dfdf;
    border-radius: 4px;
    background: #ffffff;
    color: #657176;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.document-table-divider-controls > span {
    margin-right: 6px;
}

.document-table-divider-controls select {
    height: 24px;
    max-width: 145px;
    padding: 0 22px 0 7px;
    border: 0;
    border-radius: 3px;
    outline: 0;
    background-color: #eef5f4;
    color: #087b72;
    font: inherit;
    font-size: 9px;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}

.document-table-divider-controls select:focus-visible {
    box-shadow: 0 0 0 2px rgba(19, 155, 142, .25);
}

.builder-shell
.lexcraft-inline-table[data-table-tone="gray"] td,
.builder-shell
.lexcraft-inline-table[data-table-tone="gray"] th {
    background: #f2f2f2;
}

.builder-shell
.lexcraft-inline-table[data-table-tone="dark-gray"] td,
.builder-shell
.lexcraft-inline-table[data-table-tone="dark-gray"] th {
    background: #d9d9d9;
}

.builder-shell
.lexcraft-inline-table[data-table-tone="white"] td,
.builder-shell
.lexcraft-inline-table[data-table-tone="white"] th {
    background: #ffffff;
}

.document-table-profile-field {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: #5c666b;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.document-table-profile-list {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.document-table-profile-assignment {
    display: flex;
    flex: 1 1 280px;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.document-table-profile-field select {
    flex: 1 1 auto;
    min-width: 220px;
    height: 34px;
    padding: 0 28px 0 9px;
    border: 1px solid #cfd8d8;
    border-radius: 4px;
    background: #ffffff;
    color: #26363a;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}

.document-table-profile-field select.unassigned {
    border-color: #55aaa3;
    background: #f4fbfa;
    color: #167a72;
}

.document-table-profile-field select.assigned {
    border-color: #89bbb6;
    box-shadow: inset 3px 0 0 #139b8e;
}

.document-table-profile-field select:focus {
    border-color: #36a99f;
    outline: 2px solid rgba(19, 155, 142, .14);
    outline-offset: 1px;
}

.document-table-profile-reset {
    flex: 0 0 auto;
    height: 30px;
    padding: 0 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #6d777b;
    font-size: 9px;
    font-weight: 750;
    cursor: pointer;
}

.document-table-profile-reset:hover {
    background: #f0f3f3;
    color: #344247;
}

.document-table-profile-row-height {
    position: relative;
    display: inline-flex;
    flex: 1 1 100%;
    align-items: center;
    gap: 6px;
    min-height: 20px;
    padding: 0 2px;
    color: #667378;
    font-size: 9px;
    font-weight: 650;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
}

.document-table-profile-row-height input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.document-table-profile-row-height-switch {
    position: relative;
    display: inline-block;
    flex: 0 0 24px;
    width: 24px;
    height: 13px;
    border: 1px solid #bfc9c9;
    border-radius: 999px;
    background: #e7ebeb;
    transition: border-color .14s ease, background .14s ease;
}

.document-table-profile-row-height-switch::after {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(25, 46, 49, .2);
    content: "";
    transition: transform .14s ease;
}

.document-table-profile-row-height input:checked +
.document-table-profile-row-height-switch {
    border-color: #279c92;
    background: #36aaa0;
}

.document-table-profile-row-height input:checked +
.document-table-profile-row-height-switch::after {
    transform: translateX(11px);
}

.document-table-profile-row-height input:focus-visible +
.document-table-profile-row-height-switch {
    outline: 2px solid rgba(19, 155, 142, .22);
    outline-offset: 2px;
}

.document-table-profile-row-height.disabled {
    color: #98a1a4;
    cursor: not-allowed;
}

.document-table-profile-row-height input:disabled +
.document-table-profile-row-height-switch {
    border-color: #d8dddd;
    background: #f0f2f2;
    box-shadow: none;
}

.document-table-profile-row-height input:disabled +
.document-table-profile-row-height-switch::after {
    background: #cfd5d5;
    box-shadow: none;
}

.document-table-control-divider {
    align-self: stretch;
    width: 1px;
    margin: 1px 3px;
    background: #dce3e3;
}

.doc-row.selected
.document-table-controls {
    display: flex;
}

.document-table-action {
    display: inline-flex;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #d3dada;
    border-radius: 3px;
    background: #ffffff;
    color: #3f494f;
    cursor: pointer;
}

.document-table-action:hover {
    border-color: #8bc8c1;
    background: #eaf7f5;
    color: #087b72;
}

.document-table-action.danger:hover {
    border-color: #e4aaaa;
    background: #fff1f1;
    color: #a33030;
}

.document-table-action.delete-table {
    border-color: #d99a9a;
    background: #fff0f0;
    color: #a62f2f;
}

.document-table-action.delete-table:hover {
    border-color: #b94d4d;
    background: #f8dede;
    color: #821f1f;
}

.document-table-action-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.document-table-action-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.7;
}

.document-table-action-icon b {
    position: absolute;
    right: -5px;
    bottom: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #ffffff;
    color: currentColor;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.document-table-resize-hint {
    margin-left: auto;
    color: #788186;
    font-size: 10px;
    white-space: nowrap;
}

@media (max-width: 1180px) {
    .document-table-design-panel {
        grid-template-columns: 1fr;
    }

    .document-table-design-status {
        justify-self: start;
    }

    .document-table-profile-field {
        flex: 1 1 100%;
    }

    .document-table-control-divider {
        display: none;
    }
}

.execution-shell
.preview-empty-line {
    display: block;
    min-height: 1.45em;
}

.execution-shell
[data-lexcraft-control-line="tableborders"] {
    display: none;
}

.execution-shell
.preview-document-element.paragraph:has(
    .lexcraft-inline-table-wrap
) {
    margin-bottom: 8pt;
}

.execution-shell
.lexcraft-inline-table-wrap {
    box-sizing: border-box;
    max-width: 100%;
    margin: 6pt 0;
    overflow-x: auto;
    resize: none;
}

.execution-shell
.lexcraft-inline-table td,
.execution-shell
.lexcraft-inline-table th {
    min-width: 55pt;
    height: 26pt;
    padding: 5pt 7pt;
    border-color: #6f777b;
    background: #ffffff;
}

.execution-shell
.lexcraft-inline-table[data-table-tone="dark-gray"] td,
.execution-shell
.lexcraft-inline-table[data-table-tone="dark-gray"] th {
    background: #d9d9d9;
}

/* ::tableborders[none] blendet ausschließlich die sichtbaren Linien aus.
   Zellgeometrie, Abstände, Ausrichtung und Inhalte bleiben unverändert. */
.execution-shell
.lexcraft-inline-table-wrap[data-table-border-mode="none"]
.lexcraft-inline-table td,
.execution-shell
.lexcraft-inline-table-wrap[data-table-border-mode="none"]
.lexcraft-inline-table th,
.execution-shell
.lexcraft-inline-table[data-table-border-mode="none"] td,
.execution-shell
.lexcraft-inline-table[data-table-border-mode="none"] th {
    border-color: transparent;
}

/* Zeilenbefehle steuern ausschließlich die angegebene waagerechte
   Zellkante. Die gegenüberliegende Kante und alle senkrechten Linien
   behalten unverändert das Tabellen- bzw. Auto-Muster. */
.lexcraft-inline-table
tr[data-table-border-top="none"] > td,
.lexcraft-inline-table
tr[data-table-border-top="none"] > th {
    border-top-style: none !important;
}

.lexcraft-inline-table
tr[data-table-border-bottom="none"] > td,
.lexcraft-inline-table
tr[data-table-border-bottom="none"] > th {
    border-bottom-style: none !important;
}

/* Positionierungsraster stammen aus dem Word-Layout und ordnen etwa
   Empfänger- und Absenderblöcke an. Im Editor bleibt ihre Struktur sichtbar;
   in der Ausführung erscheinen weder Hilfslinien noch technische Flächen. */
.execution-shell
.lexcraft-inline-table-wrap[data-table-purpose="positioning"] {
    overflow: visible;
}

.execution-shell
.lexcraft-inline-table-wrap[data-table-purpose="positioning"]
.lexcraft-inline-table,
.execution-shell
.lexcraft-inline-table[data-table-purpose="positioning"] {
    background: transparent;
}

.execution-shell
.lexcraft-inline-table-wrap[data-table-purpose="positioning"]
.lexcraft-inline-table td,
.execution-shell
.lexcraft-inline-table-wrap[data-table-purpose="positioning"]
.lexcraft-inline-table th,
.execution-shell
.lexcraft-inline-table[data-table-purpose="positioning"] td,
.execution-shell
.lexcraft-inline-table[data-table-purpose="positioning"] th {
    border-color: transparent;
    background: transparent;
}

.layout-preview-anchor-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px;
    padding: 12px 16px 9px;
}

.layout-preview-anchor-picker > label {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 8px 12px;
    border: 1px solid #d5dfdf;
    border-radius: 7px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease,
        box-shadow .15s ease;
}

.layout-preview-anchor-picker > label:hover {
    border-color: #b8d8d4;
}

.layout-preview-anchor-picker > label:has(.layout-choice-input:checked) {
    border-color: #8fd1ca;
    background: #f0faf8;
    box-shadow: 0 0 0 2px rgba(19, 169, 157, .055);
}

.layout-anchor-choice-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.layout-anchor-choice-copy strong {
    color: #263844;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
}

.layout-anchor-choice-copy small {
    color: #7b8790;
    font-size: 9px;
    font-weight: 600;
}

/* Absatzaktionen bleiben auch bei einer hohen Tabelle an
   derselben oberen Position wie bei einem normalen Absatz. */

.builder-shell
.doc-row:has(.lexcraft-inline-table-wrap)
.element-inline-actions {
    top: 3px;
    transform: none;
}

.builder-shell
.doc-row:has(.lexcraft-inline-table-wrap)
.element-menu {
    top: 35px;
}

/* Textfeld-Labels verwenden dasselbe kompakte Menü wie
   Interviewabschnitte. */

.builder-shell
.external-text-field-row
.text-field-actions {
    top: 40px;
    right: 0;
    left: auto;
    z-index: 10050;
}

.builder-shell
.external-text-field-row
.text-field-rule-button,
.builder-shell
.external-text-field-row
.text-field-delete-button {
    width: 100%;
    min-width: 112px;
    height: 32px;
    margin: 0;
    padding: 0 10px;
    text-align: left;
}

/* =========================================================
   EDITOR-KONTEXTMENÜ: KLARE EBENE UND WENIGER VISUELLE LAST
   ========================================================= */

.builder-shell
.editor-paper #documentElements {
    position: relative;
    overflow: visible;
}

.builder-shell .doc-row {
    z-index: 0;
    overflow: visible;
}

.builder-shell
.doc-row:has(.element-menu.open) {
    z-index: 20000;
    isolation: isolate;
}

.builder-shell .element-menu.open {
    z-index: 20010;
}

/* =========================================================
   INTERVIEW-AKTIONSMENÜS – EINHEITLICH UND RUHIG
   Diese abschließenden Regeln ersetzen die historisch
   gewachsenen, voneinander abweichenden Drei-Punkte-Stile.
   ========================================================= */

.builder-shell .external-section-head,
.builder-shell .external-text-field-row {
    overflow: visible;
}

.builder-shell
.external-section-head:has(
    .section-actions-outside.open
),
.builder-shell
.external-text-field-row:has(
    .text-field-actions.open
) {
    z-index: 12000;
    isolation: isolate;
}

.builder-shell .section-dots,
.builder-shell .external-text-field-dots {
    display: inline-grid;
    place-items: center;
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0 0 2px;
    border: 1px solid #d9dee2;
    border-radius: 5px;
    background: #f5f7f8;
    color: #66717b;
    box-shadow: none;
    font-family: Arial, sans-serif;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
}

.builder-shell .section-dots:hover,
.builder-shell .section-dots:focus-visible,
.builder-shell .external-text-field-dots:hover,
.builder-shell .external-text-field-dots:focus-visible {
    border-color: #aeb8bf;
    outline: none;
    background: #e9edef;
    color: #303940;
}

.builder-shell .section-actions-outside,
.builder-shell .text-field-actions,
.builder-shell
.external-text-field-row
.text-field-actions {
    top: 34px;
    right: 0;
    left: auto;
    z-index: 12010;
    min-width: 168px;
    gap: 2px;
    padding: 6px;
    border: 1px solid #dce1e4;
    border-radius: 7px;
    background: #ffffff;
    box-shadow:
        0 12px 30px rgba(26, 35, 42, .14),
        0 2px 6px rgba(26, 35, 42, .07);
}

.builder-shell .section-rule-button,
.builder-shell .section-delete-button,
.builder-shell .text-field-rule-button,
.builder-shell .text-field-delete-button,
.builder-shell
.external-text-field-row
.text-field-rule-button,
.builder-shell
.external-text-field-row
.text-field-delete-button {
    width: 100%;
    min-width: 0;
    height: 32px;
    margin: 0;
    padding: 0 10px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #3d4852;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .025em;
    text-align: left;
}

.builder-shell .section-rule-button:hover,
.builder-shell .text-field-rule-button:hover {
    background: #eaf8f6;
    color: #0d756d;
}

.builder-shell .section-rule-button.linked,
.builder-shell .text-field-rule-button.linked {
    color: #0b8177;
}

.builder-shell .section-delete-button,
.builder-shell .text-field-delete-button {
    color: #a43a43;
}

.builder-shell .section-delete-button:hover,
.builder-shell .text-field-delete-button:hover {
    background: #fff0f1;
    color: #922c35;
}

/* =========================================================
   INTERVIEW-TEXTFELDER – EINE SAUBERE, FESTE ZEILE
   Label, Status-Badges und Aktionsmenü bleiben unabhängig
   vom Feldtyp auf derselben vertikalen Achse.
   ========================================================= */

.builder-shell .external-text-field-row {
    grid-template-columns: minmax(0, 1fr) 36px;
    align-items: center;
    gap: 0;
    min-height: 46px;
    border: 1px solid #dfe4e7;
    border-radius: 6px;
    background: #f4f5f6;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
    transition:
        border-color .14s ease,
        background-color .14s ease,
        box-shadow .14s ease;
}

.builder-shell .external-text-field-row:hover,
.builder-shell .external-text-field-row:focus-within {
    border-color: #afc7c4;
    background: #f7f9f9;
    box-shadow:
        0 0 0 2px rgba(20, 139, 128, .07),
        inset 0 1px 0 rgba(255, 255, 255, .7);
}

.builder-shell .external-text-field-main {
    position: relative;
    display: flex;
    align-items: center;
    align-self: stretch;
    min-width: 0;
    border-right: 1px solid #e1e5e7;
}

.builder-shell .external-text-field-label {
    height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 5px 0 0 5px;
    outline: none;
    background: transparent;
    color: #30383e;
}

.builder-shell
.external-text-field-main:has(
    .external-text-field-badges
)
.external-text-field-label {
    padding-right: 92px;
}

.builder-shell .external-text-field-label:focus {
    border: 0;
    outline: none;
    background: rgba(255, 255, 255, .42);
}

.builder-shell .external-text-field-badges {
    position: absolute;
    right: 8px;
    top: 50%;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: calc(100% - 24px);
    transform: translateY(-50%);
    pointer-events: none;
}

.builder-shell
.external-text-field-badges
.external-field-badge {
    height: 18px;
    margin: 0;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 7px;
    line-height: 18px;
}

.builder-shell .external-text-field-dots {
    justify-self: center;
    align-self: center;
    width: 28px;
    min-width: 28px;
    height: 28px;
    padding: 0 0 2px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: #65717a;
    font-size: 17px;
}

.builder-shell .external-text-field-dots:hover,
.builder-shell .external-text-field-dots:focus-visible {
    border-color: #d3dadd;
    background: #e7ebed;
    color: #263139;
}

.builder-shell
.external-text-field-row
.text-field-actions {
    top: 48px;
    right: 0;
}

.builder-shell .document-state-badges {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity .12s ease,
        visibility .12s ease;
}

.builder-shell
.doc-row:hover
.document-state-badges,
.builder-shell
.doc-row.selected
.document-state-badges,
.builder-shell
.doc-row:has(.element-menu.open)
.document-state-badges {
    visibility: visible;
    opacity: 1;
}

/* Layoutwerte haben in der Ausführung Vorrang vor den
   allgemeinen Vorschaugrößen weiter oben. */

.execution-shell
.preview-document-element.heading.level-1 {
    font-size:
        var(
            --preview-word-font-size,
            var(--layout-heading-1-size, 16pt)
        );
}

.execution-shell
.preview-document-element.heading.level-2 {
    font-size:
        var(
            --preview-word-font-size,
            var(--layout-heading-2-size, 14pt)
        );
}

.execution-shell
.preview-document-element.heading.level-3,
.execution-shell
.preview-document-element.heading.level-4,
.execution-shell
.preview-document-element.heading.level-5,
.execution-shell
.preview-document-element.heading.level-6,
.execution-shell
.preview-document-element.heading.level-7,
.execution-shell
.preview-document-element.heading.level-8,
.execution-shell
.preview-document-element.heading.level-9 {
    font-size:
        var(
            --preview-word-font-size,
            var(--layout-heading-3-size, 12pt)
        );
}
.case-template-update-notice {
    margin: 16px;
    padding: 16px;
    border: 1px solid #d5aa48;
    border-radius: 8px;
    background: #fff8e8;
    color: #43371d;
    font-size: 14px;
    overflow-wrap: anywhere;
}
.case-template-update-notice p { margin: 8px 0; }
.case-template-update-notice summary { cursor: pointer; }
.case-template-update-notice ul { padding-left: 20px; }
.case-template-preserved-answer { margin-top: 12px; }

.case-template-update-card {
    margin: 20px 18px;
    padding: 22px;
    border: 1px solid #cfe4e1;
    border-radius: 14px;
    background: linear-gradient(140deg, #f4faf9, #fff 75%);
    box-shadow: 0 4px 16px rgba(6, 24, 47, .035);
    color: #173042;
    font-size: 14px;
    line-height: 1.6;
}
.case-template-update-card-heading { display: flex; align-items: center; gap: 13px; }
.case-template-update-icon { display: grid; place-items: center; flex: 0 0 42px; height: 46px; border-radius: 10px; background: #e3f3f0; color: #11877d; }
.case-template-update-eyebrow { display: block; color: #16877f; font-size: 10px; font-weight: 700; letter-spacing: .11em; }
.case-template-update-card h3 { margin: 3px 0 0; color: #092137; font-size: 18px; line-height: 1.3; font-weight: 650; }
.case-template-update-card p { margin: 16px 0; color: #526371; }
.case-template-update-retention { display: flex; gap: 8px; color: #24685f; font-size: 13px; }
.case-template-update-retention span { font-weight: 700; }
.case-template-update-action { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; margin-top: 19px; padding: 12px 15px; border: 1px solid #11877d; border-radius: 8px; background: #11877d; color: #fff; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; transition: background .15s ease; }
.case-template-update-action:hover { background: #096c64; }
.case-template-update-action:focus-visible { outline: 3px solid #7ed2c7; outline-offset: 3px; }
.case-template-update-card .case-template-update-caption { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: #6b7a85; }
@media (max-width: 420px) { .case-template-update-card { margin: 12px; padding: 17px; } .case-template-update-card h3 { font-size: 17px; } }

/* Organisation: team navigation, scoped roles and account lifecycle. */
.hierarchy-page { max-width: 1800px; margin-inline: auto; }
.hierarchy-firm-switcher { grid-template-columns: 44px minmax(140px,1fr) minmax(200px,.8fr) auto auto; gap:20px; padding:20px 22px; margin-bottom:18px; }
.hierarchy-firm-monogram { display:grid; place-items:center; width:44px; height:44px; border-radius:12px; background:#e6f2ef; color:#137d70; font:600 17px Georgia,serif; border:1px solid #d1e8e1; }
.hierarchy-quota { padding-left:22px; border-left:1px solid #e2e8e8; display:grid; gap:4px; }
.hierarchy-quota>span { font-size:8px; text-transform:uppercase; letter-spacing:.09em; color:#7e8a95; font-weight:700; }
.hierarchy-quota strong { font-size:21px; font-weight:500; color:#263d4c; }
.hierarchy-quota small { font-size:11px; color:#7a8994; font-weight:400; }
.hierarchy-text-button { border:0; background:transparent; padding:7px 0; color:#188577; cursor:pointer; font-size:10px; font-weight:650; line-height:1.5; text-align:left; }
.hierarchy-text-button:hover { color:#095b53; text-decoration:underline; text-underline-offset:3px; }
.hierarchy-text-button.is-danger { color:#a34a42; }
.hierarchy-overview { display:grid; grid-template-columns:auto auto auto minmax(160px,1fr); align-items:center; gap:28px; padding:4px 3px 26px; }
.hierarchy-overview>div,.hierarchy-overview>button { display:flex; gap:9px; align-items:center; color:#647580; font-size:10px; white-space:nowrap; }
.hierarchy-overview>button { border:0; background:none; padding:0; cursor:pointer; }
.hierarchy-overview>button:disabled { cursor:default; }
.hierarchy-overview strong { font-size:18px; font-weight:550; color:#2b4452; }
.hierarchy-overview i { font-size:13px; color:#8b999e; font-style:normal; }
.hierarchy-stat-icon { color:#12877b; background:#e8f2ef; width:25px; height:25px; border-radius:8px; display:grid; place-items:center; font-size:15px; }
.hierarchy-stat-icon.is-amber { color:#ac823b; background:#f4efe4; }
.hierarchy-overview>p { margin:0; font-size:9px; color:#7c8c95; line-height:1.7; text-align:right; }
.hierarchy-workspace { display:grid; grid-template-columns:225px minmax(0,1fr); align-items:start; gap:26px; }
.hierarchy-workspace.is-platform { grid-template-columns:minmax(0,1fr); }
.hierarchy-team-sidebar { min-width:0; padding-top:3px; }
.hierarchy-team-sidebar>header { display:flex; justify-content:space-between; align-items:center; padding:8px 10px 19px; }
.hierarchy-team-sidebar>header span { display:block; font-size:8px; font-weight:800; text-transform:uppercase; letter-spacing:.1em; color:#81909a; margin-bottom:5px; }
.hierarchy-team-sidebar h2 { margin:0; color:#263e50; font:500 22px Georgia,serif; }
.hierarchy-add-team { border:1px solid #d9e3e1; border-radius:8px; width:28px; height:28px; background:#fff; color:#128778; font-size:19px; cursor:pointer; }
.hierarchy-add-team:hover { border-color:#61b1a5; background:#f0f8f5; }
.hierarchy-team-nav { display:flex; align-items:center; gap:9px; min-height:45px; width:100%; border:1px solid transparent; border-radius:9px; background:transparent; text-align:left; color:#627480; padding:10px; margin:3px 0; cursor:pointer; font-size:11px; transition:background .15s; }
.hierarchy-team-nav:hover { background:rgba(255,255,255,.65); }
.hierarchy-team-nav.is-selected { color:#107567; background:#e8f3ef; border-color:#d9ebe5; font-weight:650; }
.hierarchy-team-nav>span:not(.hierarchy-team-nav-icon) { flex:1; overflow-wrap:anywhere; }
.hierarchy-team-nav small { color:#8a989f; font-size:9px; font-weight:500; }
.hierarchy-team-nav-icon { display:grid; place-items:center; width:27px; height:27px; flex-shrink:0; border:1px solid #e0e7e5; border-radius:7px; font:11px Georgia,serif; background:rgba(255,255,255,.6); }
.hierarchy-team-nav--unassigned { border-top:1px solid #e3e9e7; border-radius:0 0 9px 9px; margin-top:15px; padding-top:15px; font-size:10px; }
.hierarchy-sidebar-note { margin:28px 10px 0; border-top:1px solid #e1e8e5; padding-top:18px; }
.hierarchy-sidebar-note strong { color:#6b7e86; font-size:10px; font-weight:600; }
.hierarchy-sidebar-note p,.hierarchy-sidebar-empty { font-size:10px; color:#8a999f; line-height:1.75; margin:7px 0 0; }
.hierarchy-sidebar-empty { padding:8px 11px; }
.hierarchy-member-panel { overflow:hidden; box-shadow:0 6px 28px rgba(30,59,66,.025); }
.hierarchy-member-panel>header { padding:22px; min-height:99px; }
.hierarchy-member-panel>header h2 { font-size:24px; }
.hierarchy-member-panel>header p { font-size:10px; }
.hierarchy-panel-actions { display:flex; align-items:center; gap:14px; }
.hierarchy-panel-actions>strong { color:#178477; font-size:11px; background:#edf6f2; border:1px solid #deede7; border-radius:30px; padding:4px 9px; font-weight:500; }
.hierarchy-member-toolbar { display:flex; align-items:center; gap:12px; padding:15px 22px; border-bottom:1px solid #e8eeec; background:#fff; }
.hierarchy-search { display:flex; align-items:center; gap:7px; flex:1; }
.hierarchy-search>span { color:#8c9ca3; font-size:24px; line-height:1; }
.hierarchy-search>input { border:0; outline:0; border-radius:0; padding:4px; background:transparent; color:#354d59; min-width:0; width:100%; font-size:11px; box-shadow:none; }
.hierarchy-search>input:focus-visible { outline:2px solid #8fcabd; outline-offset:3px; border-radius:3px; }
.hierarchy-member-toolbar>select { font-size:10px; border:1px solid #e1e8e6; color:#657b83; background:#fbfcfc; padding:7px 10px; min-height:30px; }
.hierarchy-member-panel .administration-member-columns { grid-template-columns:34px minmax(130px,1.2fr) minmax(106px,.65fr) minmax(120px,1fr) 30px; gap:12px; padding:12px 20px; font-size:8px; }
.hierarchy-member-panel .administration-member-row { grid-template-columns:34px minmax(130px,1.2fr) minmax(106px,.65fr) minmax(120px,1fr) 30px; gap:12px; padding:18px 20px; min-height:91px; }
.hierarchy-member-panel .administration-member-row[hidden] { display:none; }
.hierarchy-member-panel .administration-member-copy strong { font-size:11px; }
.hierarchy-member-panel .administration-member-copy span { font-size:9px; }
.hierarchy-member-panel .administration-member-role strong { font-size:10px; }
.hierarchy-member-panel .administration-member-teams span { font-size:8px; padding:4px 7px; color:#61797b; background:#f1f5f4; border:1px solid #e3ebe7; }
.hierarchy-status { display:flex; align-items:center; gap:4px; }
.hierarchy-status:before { content:""; width:4px; height:4px; border-radius:50%; background:#95a7af; }
.hierarchy-status.is-active:before { background:#43a086; }
.hierarchy-status.is-invited:before { background:#caa45b; }
.hierarchy-status.is-suspended:before { background:#b88a86; }
.hierarchy-member-teams .hierarchy-unassigned,.hierarchy-member-panel .administration-member-teams .hierarchy-unassigned { font-size:9px; color:#9c803f; line-height:1.5; white-space:normal; }
.hierarchy-member-panel .administration-menu { right:0; }
.hierarchy-panel-footer { display:flex; justify-content:space-between; gap:12px; border-top:1px solid #e7eeeb; padding:14px 22px; font-size:8px; color:#8d9ca3; background:#fafcfb; }
.hierarchy-member-empty { padding:40px 20px 44px; text-align:center; display:grid; gap:9px; justify-items:center; }
.hierarchy-member-empty[hidden] { display:none; }
.hierarchy-member-empty>span { display:grid; place-items:center; width:45px; height:45px; font-size:25px; color:#71a398; background:#f0f7f3; border-radius:14px; margin-bottom:5px; }
.hierarchy-member-empty strong { font-size:13px; font-weight:500; color:#415e69; }
.hierarchy-member-empty p { max-width:340px; margin:0; line-height:1.7; font-size:10px; color:#879ba2; }
.hierarchy-dialog { width:min(670px,calc(100vw - 36px)); }
.hierarchy-dialog header h2 { font-family:Georgia,serif; font-weight:500; }
.hierarchy-dialog .administration-form-grid input,.hierarchy-dialog .administration-form-grid select,.hierarchy-dialog textarea,.hierarchy-confirm-input input,.hierarchy-confirm-input select { min-height:39px; border:1px solid #dbe5e1; border-radius:7px; background:#fff; color:#35525c; padding:9px 11px; font-size:11px; font-family:inherit; width:100%; }
.hierarchy-dialog textarea { resize:vertical; min-height:80px; font-family:inherit; font-size:11px; }
.hierarchy-dialog .administration-form-grid label>span { margin-bottom:7px; }
.hierarchy-dialog .administration-form-grid label>span small { color:#9aabae; font-weight:400; margin-left:6px; }
.hierarchy-full-width { grid-column:1/-1; }
.hierarchy-team-choices { grid-template-columns:1fr; }
.hierarchy-team-choice-row { display:grid; grid-template-columns:minmax(0,1fr); align-items:center; gap:10px; }
.hierarchy-team-choice-row .administration-team-choice { min-height:58px; }
.hierarchy-inline-note { font-size:10px; line-height:1.6; color:#8b9d9f; margin-top:13px; }
.hierarchy-account-actions { margin:0 24px 22px; padding:18px 0 0; border-top:1px solid #e8eeeb; display:flex; gap:6px 18px; flex-wrap:wrap; }
.hierarchy-account-actions>strong { flex:0 0 100%; font-size:11px; color:#6f838a; font-weight:600; }
.hierarchy-account-actions>p { flex:0 0 100%; font-size:10px; line-height:1.6; color:#8b9b9f; margin:0 0 3px; }
.hierarchy-access-note { background:#f1f7f4; border:1px solid #e4eee7; border-radius:9px; margin:0 24px 21px; padding:14px 16px; }
.hierarchy-access-note strong { color:#4a7367; font-size:11px; font-weight:600; }
.hierarchy-access-note p { color:#7a938a; font-size:10px; line-height:1.6; margin:5px 0 0; }
.hierarchy-template-scopes { grid-template-columns:repeat(2,minmax(0,1fr)); }
.hierarchy-danger-button { background:#a9584e!important; border-color:#a04f46!important; }
.hierarchy-danger-button:hover { background:#93483f!important; }
.hierarchy-confirm-body>p { color:#6f8188; font-size:11px; line-height:1.8; }
.hierarchy-delete-impact { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-bottom:18px; }
.hierarchy-delete-impact>div { display:grid; gap:7px; border:1px solid #eedfdb; background:#faf5f3; padding:16px 12px; border-radius:9px; color:#9c5b50; }
.hierarchy-delete-impact strong { font-size:25px; font-weight:500; }
.hierarchy-delete-impact span { font-size:9px; line-height:1.5; }
.hierarchy-delete-impact .is-preserved { border-color:#deebe3; background:#f0f7f2; color:#477d65; }
.hierarchy-confirm-input { display:grid; gap:8px; margin-top:18px; font-size:10px; color:#617983; }
.hierarchy-page button:focus-visible,.hierarchy-dialog button:focus-visible { outline:2px solid #5eb19e; outline-offset:3px; }
@media(max-width:1250px) {
    .hierarchy-firm-switcher { grid-template-columns:44px minmax(150px,1fr) minmax(160px,.8fr) auto; }
    .hierarchy-firm-switcher>.hierarchy-text-button { grid-column:2/-1; justify-self:end; }
    .hierarchy-workspace { grid-template-columns:190px minmax(0,1fr); gap:18px; }
    .hierarchy-overview { gap:18px; }
    .hierarchy-overview>p { display:none; }
    .hierarchy-member-panel .administration-member-columns,.hierarchy-member-panel .administration-member-row { grid-template-columns:30px minmax(125px,1fr) 100px minmax(110px,.8fr) 24px; padding-inline:15px; gap:8px; }
}
@media(max-width:980px) {
    .hierarchy-page { padding-inline:28px; }
    .hierarchy-workspace { grid-template-columns:1fr; }
    .hierarchy-team-sidebar { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
    .hierarchy-team-sidebar>header { padding:0 12px 0 0; gap:15px; }
    .hierarchy-team-sidebar>header span,.hierarchy-sidebar-note { display:none; }
    .hierarchy-team-sidebar h2 { font-size:18px; }
    .hierarchy-team-nav { width:auto; margin:0; padding:8px 12px; min-height:36px; }
    .hierarchy-team-nav-icon { display:none; }
    .hierarchy-team-nav--unassigned { border-top:0; border-radius:9px; }
}
@media(max-width:680px) {
    .hierarchy-page { padding:25px 17px 40px; }
    .hierarchy-firm-switcher { grid-template-columns:38px minmax(0,1fr); gap:12px; padding:16px; }
    .hierarchy-firm-switcher .administration-workspace-select { grid-column:1/-1; }
    .hierarchy-quota { padding-left:0; border:0; grid-column:1/-1; }
    .hierarchy-firm-switcher>.hierarchy-text-button { grid-column:1/-1; justify-self:start; }
    .hierarchy-overview { grid-template-columns:repeat(2,1fr); gap:16px; padding-bottom:22px; }
    .hierarchy-overview>button { grid-column:1/-1; }
    .hierarchy-member-panel .administration-member-columns { display:none; }
    .hierarchy-member-panel .administration-member-row { grid-template-columns:34px minmax(0,1fr) 30px; gap:8px 10px; padding:15px; }
    .hierarchy-member-panel .administration-member-avatar { grid-column:1; grid-row:1; }
    .hierarchy-member-panel .administration-member-copy { grid-column:2; grid-row:1; }
    .hierarchy-member-panel .administration-member-role { grid-column:2; grid-row:2; display:flex; align-items:center; gap:9px; }
    .hierarchy-member-panel .administration-member-teams { grid-column:2; grid-row:3; }
    .hierarchy-member-panel .administration-menu-host { grid-column:3; grid-row:1; }
    .hierarchy-member-toolbar { padding:12px 14px; }
    .hierarchy-member-panel>header { padding:17px; flex-wrap:wrap; gap:12px; }
    .hierarchy-panel-footer { padding:12px 15px; }
    .hierarchy-panel-footer>span:last-child { display:none; }
    .hierarchy-team-choice-row { grid-template-columns:1fr; gap:5px; margin-bottom:8px; }
    .hierarchy-template-scopes,.hierarchy-delete-impact { grid-template-columns:1fr; }
}

.hierarchy-remove-member { display:grid; place-items:center; width:26px; height:26px; border:1px solid #e0e7e4; border-radius:7px; color:#8c9b9e; background:#fff; font-size:17px; cursor:pointer; }
.hierarchy-remove-member:hover { color:#a34a42; border-color:#dec8c2; background:#fbf6f3; }

.hierarchy-management-navigation { display:flex; align-items:center; gap:5px; width:fit-content; max-width:100%; padding:4px; margin:0 0 25px; border:1px solid #e0e8e4; border-radius:10px; background:#edf2ef; }
.hierarchy-management-navigation button { border:1px solid transparent; border-radius:7px; background:transparent; color:#758a90; padding:10px 17px; font-family:inherit; font-size:10px; font-weight:600; cursor:pointer; }
.hierarchy-management-navigation button[aria-pressed="true"] { color:#137c6b; background:#fff; border-color:#dae7e0; box-shadow:0 2px 5px #173e3010; }
.hierarchy-directory-intro { display:flex; align-items:center; gap:16px; padding:10px 0 24px; }
.hierarchy-directory-intro>div { flex:1; }
.hierarchy-directory-intro>div>span { display:block; color:#84958f; font-size:8px; text-transform:uppercase; letter-spacing:.11em; font-weight:700; margin-bottom:6px; }
.hierarchy-directory-intro h2 { font:500 27px Georgia,serif; color:#284350; margin:0; }
.hierarchy-directory-intro p { color:#81939a; font-size:10px; line-height:1.6; margin:7px 0 0; }
.hierarchy-account-overview { display:flex; flex-wrap:wrap; gap:28px; padding-bottom:25px; }
.hierarchy-account-panel .administration-member-columns,.hierarchy-account-panel .administration-member-row { grid-template-columns:34px minmax(160px,1.1fr) minmax(130px,.7fr) minmax(160px,1fr) 30px; }
.hierarchy-account-panel .hierarchy-account-companies { align-items:flex-start; }
.hierarchy-own-account { display:inline-block; margin-left:7px; font-size:8px; font-weight:400; color:#719187; }
.hierarchy-account-companies .hierarchy-departed-note { width:100%; color:#94a09f; font-size:9px; line-height:1.6; margin-top:3px; }
.hierarchy-account-open { width:28px; height:28px; border:1px solid #dbe6e0; border-radius:8px; color:#789b91; background:#fff; cursor:pointer; font-size:15px; }
.hierarchy-account-open:hover { border-color:#a8cabc; color:#168372; background:#f1f8f4; }
.hierarchy-status.is-deactivated:before,.hierarchy-status.is-deleting:before { background:#b88a86; }
.hierarchy-status.is-deleted:before { background:#aab3b5; }
.hierarchy-account-row[data-status="deleted"] .administration-member-avatar { background:#f0f3f2; color:#91a09c; }
.hierarchy-account-memberships { display:grid; gap:9px; }
.hierarchy-account-memberships>div { display:flex; justify-content:space-between; align-items:center; gap:15px; padding:12px 14px; border:1px solid #e3ebe6; border-radius:8px; background:#fafcfb; }
.hierarchy-account-memberships strong { font-size:11px; font-weight:500; color:#49645e; }
.hierarchy-account-memberships span,.hierarchy-account-memberships>p { font-size:10px; color:#81978e; line-height:1.6; }
@media(max-width:980px) { .hierarchy-account-panel .hierarchy-member-toolbar { flex-wrap:wrap; } .hierarchy-account-panel .hierarchy-search { flex-basis:100%; } }
@media(max-width:680px) {
    .hierarchy-management-navigation { width:100%; }
    .hierarchy-management-navigation button { flex:1; padding:10px 7px; }
    .hierarchy-directory-intro { gap:11px; flex-wrap:wrap; }
    .hierarchy-directory-intro h2 { font-size:23px; }
    .hierarchy-account-overview { gap:15px; }
    .hierarchy-account-panel .administration-member-row { grid-template-columns:34px minmax(0,1fr) 30px; }
    .hierarchy-account-panel .administration-member-role { flex-wrap:wrap; }
    .hierarchy-account-memberships>div { align-items:flex-start; flex-direction:column; gap:5px; }
}

/* Professional designation stays distinct from the access role. */
.hierarchy-field-help { display:block; margin-top:7px; color:#74898e; font-size:10px; line-height:1.5; font-weight:400; }
.hierarchy-dialog input[readonly] { background:#f4f7f6; color:#61777e; }
.hierarchy-member-panel .administration-member-copy .hierarchy-member-designation { color:#35746d; margin-top:3px; white-space:normal; overflow-wrap:anywhere; }

/* Keep template review usable even for large, older conflict records. */
.case-template-update-notice { line-height:1.5; }
.case-template-update-notice>strong { display:block; font-size:14px; }
.case-template-review-details>summary { padding:8px 0; font-weight:600; }
.case-template-review-scroll { max-height:320px; max-height:min(40vh, 320px); overflow:auto; overscroll-behavior:contain; padding-right:8px; }
.case-template-review-scroll:focus-visible { outline:2px solid #99732b; outline-offset:2px; }
.case-template-review-scroll>ul { list-style:none; padding:0; margin:0; }
.case-template-review-scroll>ul>li { padding:14px 0; border-top:1px solid #e7d9b9; }
.case-template-review-comparison { margin-top:10px; padding:10px 12px; border:1px solid #e7d9b9; border-radius:6px; background:#fffdf7; }
.case-template-review-comparison>strong { font-size:12px; }
.case-template-review-comparison p { white-space:pre-wrap; }
.case-template-update-notice .topbar-button { color:#fff; background:#716027; border-color:#716027; }

/* Informational only: existing project documents retain their current state. */
.case-template-version-hint {
    margin:16px 20px;
    color:#526c78;
    font-size:12px;
    line-height:1.5;
}

/* Gemeinsame Leseansicht für Vorschau und Verwendung. Word-Styles liefern
   Absatz-/Textformatierung; Schriftgröße und fette Überschriften bleiben fest. */
.execution-shell.lexcraft-reading-preview .preview-document {
    font-family: Arial, sans-serif;
    font-size: 11pt;
    line-height: 1.5;
}

.execution-shell.lexcraft-reading-preview .preview-document-element {
    margin: 0 0 8pt;
    font-family: inherit;
    font-size: 11pt !important;
    line-height: 1.5;
    letter-spacing: normal;
    overflow-wrap: anywhere;
}

.execution-shell.lexcraft-reading-preview .preview-document-element * {
    font-size: inherit !important;
}

.execution-shell.lexcraft-reading-preview .preview-document-element.heading {
    margin: 12pt 0 6pt;
    font-weight: 700 !important;
}

.execution-shell.lexcraft-reading-preview .preview-document-element.heading * {
    font-weight: 700 !important;
}

.execution-shell.lexcraft-reading-preview .preview-document-element.heading:first-child {
    margin-top: 0;
}

.execution-shell.lexcraft-reading-preview .preview-document-element.has-outline-number {
    display: grid;
    margin-left: calc(var(--preview-text-indent, 0pt) - 3.25em);
    grid-template-columns: var(--preview-number-column, 2.75em) minmax(0, 1fr);
    column-gap: var(--preview-number-gap, .5em);
    align-items: baseline;
    text-indent: 0;
}

.execution-shell.lexcraft-reading-preview .preview-outline-number {
    min-width: 0;
    margin: 0;
    text-align: var(--preview-number-align, left);
    justify-self: stretch;
    max-width: calc(100% - .25em);
    white-space: normal;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
    text-transform: none;
    font-variant-caps: normal;
}

.execution-shell.lexcraft-reading-preview .preview-element-content {
    display: block;
    min-width: 0;
}

.execution-shell.lexcraft-reading-preview .has-outline-number::before {
    grid-column: 1 / -1;
}
