/* ============================================================
   Potree Standalone Viewer – Custom Styles
   shadcn/ui Design Tokens (Weg A – Vanilla CSS)
   ============================================================ */

/* ── Custom Fonts ───────────────────────────────────────────── */
@font-face {
    font-family: "PP Mori";
    src: url("PPMoriSquare-Regular.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "PP Mori";
    src: url("PPMoriSquare-Italic.woff2") format("woff2");
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "PP Mori";
    src: url("PPMoriSquare-Bold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Sohne Mono";
    src: url("SohneMono-Buch.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
    /* Zinc dark palette (shadcn "New York" / dark) */
    --background: 240 10% 5%; /* #0c0c12 */
    --card: 240 6% 10%; /* #181820 */
    --card-elevated: 240 6% 13%; /* #1f1f28 */
    --border: 240 4% 19%; /* #2c2c3a */
    --input: 240 4% 16%; /* #252533 */
    --muted: 240 4% 22%; /* #333342 */
    --muted-fg: 240 5% 56%; /* #858599 */
    --foreground: 0 0% 92%; /* #ebebeb */
    --foreground-dim: 240 5% 70%; /* #aaabbb */
    --primary: 221 83% 63%; /* #4a8fe8 */
    --primary-fg: 0 0% 98%; /* #fafafa */
    --destructive: 0 72% 50%; /* #e63232 */
    --ring: 221 83% 63%; /* #4a8fe8 */
    --accent-orange: 25 100% 55%; /* #ff8c00 */

    --radius-sm: 0.25rem; /* 0.25em  */
    --radius: 0.375rem; /* 0.375em  */
    --radius-md: 0.5rem; /* 0.5em  */
    --radius-lg: 0.5rem; /* 0.75em */

    --font-sans:
        "PP Mori", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
    --font-mono:
        "Sohne Mono", "SF Mono", "Fira Code", "JetBrains Mono", monospace;

    --shadow-sm: 0 0.0625em 0.1875em hsl(240 15% 2% / 0.5);
    --shadow-md:
        0 0.25em 0.75em hsl(240 15% 2% / 0.5),
        0 0.125em 0.25em hsl(240 15% 2% / 0.3);
    --shadow-lg:
        0 0.5em 2em hsl(240 15% 2% / 0.65),
        0 0.125em 0.5em hsl(240 15% 2% / 0.4);

    --transition: 0.15s ease;
}

html {
    font-size: 16px; /* em anchor — alle em-Werte basieren auf diesem Root-Wert */
}

/* ── Reset ─────────────────────────────────────────────────── */
html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-size: clamp(1.0625rem, 0.7813rem + 0.375vw, 1.25rem);
    -webkit-font-smoothing: antialiased;
}

/* ── Potree Container ───────────────────────────────────────── */
.potree_container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transition:
        left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#potree_render_area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* React root — base positioning (left/right/width aus CSS, damit doc-panel-active override greift) */
#react-root {
    left: 0;
    right: 0;
    width: 100%;
    transition:
        left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ══════════════════════════════════════════════════════════════
   DOC-PANEL-ACTIVE: Alle UI-Elemente nach rechts schieben
   ══════════════════════════════════════════════════════════════ */
:root {
    --doc-panel-w: 26.25em; /* = .doc-panel width (32.3077em × font-size 0.8125) */
}

/* Potree canvas + render area */
body.doc-panel-active .potree_container {
    left: var(--doc-panel-w);
    width: calc(100% - var(--doc-panel-w));
}

/* React overlay root (Annotations, DocumentEditor etc.) */
body.doc-panel-active #react-root {
    left: var(--doc-panel-w);
    width: calc(100% - var(--doc-panel-w));
}

/* App header (hamburger + title, top-left) */
body.doc-panel-active #app-header {
    left: calc(var(--doc-panel-w) + 1.25em);
}

/* Loading indicator (top-left, below header) */
body.doc-panel-active #loading-indicator {
    left: calc(var(--doc-panel-w) + 1.25em);
}

/* Bottom dock (centered horizontally) */
body.doc-panel-active #bottom-dock {
    left: calc(var(--doc-panel-w) + (100% - var(--doc-panel-w)) / 2);
}

/* Status bar (top floating, centered within remaining canvas) */
body.doc-panel-active #status-bar {
    left: calc(var(--doc-panel-w) + (100% - var(--doc-panel-w)) * 0.2);
    width: calc((100% - var(--doc-panel-w)) * 0.6);
}

/* Nav cube overlay (inside potree_render_area — already shifts with .potree_container) */

/* DIN panels: Input Card bleibt rechts, kein Shift nötig */
/* DIN Report Panel: überlagert doc-panel → z-index regelt das */

/* ── Quick Buttons (Potree) ─────────────────────────────────── */
/*
 * #potree_quick_buttons lebt in #potree_render_area (z-index: 1, eigener
 * Stacking-Context). Die Status-Bar hat z-index: 10000 im Root-Context und
 * malt deshalb ÜBER alles in #potree_render_area, unabhängig vom lokalen
 * z-index. bottom: 12px würde den Button hinter der 26px-hohen Status-Bar
 * verstecken → bottom: 34px schiebt ihn sicher darüber.
 */
#potree_quick_buttons {
    top: auto !important;
    bottom: 2.125em !important; /* 1.625em Status-Bar + 0.5em Luft */
    left: 0.75em !important;
}

/* ── Loading Indicator ──────────────────────────────────────── */

/* #btn-din-form — old dark-theme styles removed; now styled via .top-action-btn */

#loading-indicator {
    font-size: 0.75em;
    font-family: var(--font-sans);
    color: hsl(var(--muted-fg));
    letter-spacing: 0.04em;
    animation: pulse 1.4s ease-in-out infinite;
}

#loading-indicator.hidden {
    display: none;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.35;
    }
    50% {
        opacity: 1;
    }
}

/* ============================================================
   SCHNITT- & GRUNDRISS-SYSTEM
   ============================================================ */

/* ── Achslinien-Beschriftung (Bubble) ────────────────────── */
.axis-bubble {
    position: absolute;
    top: 0;
    left: 0;
    width: 2em;
    height: 2em;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875em;
    font-weight: 700;
    font-family: var(--font-mono);
    color: hsl(167 52% 85%);
    background: hsl(167 52% 18% / 0.92);
    border: 0.1364em solid hsl(167 52% 45%);
    box-shadow: var(--shadow-sm);
    pointer-events: auto;
    cursor: context-menu;
    user-select: none;
    white-space: nowrap;
    transition: opacity 0.08s linear;
}

.axis-bubble:hover {
    border-color: hsl(167 52% 65%);
    background: hsl(167 52% 22% / 0.95);
}

/* ── Section Labels im 3D-Raum ──────────────────────────────── */
.section-label {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    display: flex;
    align-items: center;
    gap: 0.3125em;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
}

.section-marker {
    width: 0.5em;
    height: 0.5em;
    border-radius: 50%;
    background: hsl(var(--primary));
    border: 0.0938em solid hsl(0 0% 98%);
    flex-shrink: 0;
    transition: background var(--transition);
    box-shadow: 0 0 0 0.125em hsl(var(--primary) / 0.25);
}

.section-name {
    font-size: 0.6875em;
    font-family: var(--font-sans);
    font-weight: 600;
    color: hsl(var(--primary-fg));
    background: hsl(var(--primary) / 0.88);
    padding: 0.1818em 0.7273em;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    letter-spacing: 0.025em;
    transition: background var(--transition);
    min-width: 2.1818em;
    outline: none;
    box-shadow: var(--shadow-sm);
}

.section-name.editing {
    background: hsl(var(--card));
    border: 0.0625em solid hsl(var(--accent-orange));
    color: hsl(var(--foreground));
    cursor: text;
    border-radius: var(--radius-sm);
}

.section-label.active .section-marker {
    background: hsl(var(--accent-orange));
    box-shadow: 0 0 0 0.125em hsl(var(--accent-orange) / 0.3);
}
.section-label.active .section-name {
    background: hsl(var(--accent-orange) / 0.88);
}

/* ── Vorschau-Dot ───────────────────────────────────────────── */
.section-preview-dot {
    position: absolute;
    width: 0.625em;
    height: 0.625em;
    border-radius: 50%;
    background: hsl(var(--accent-orange));
    border: 0.125em solid hsl(0 0% 98%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10001;
    box-shadow: 0 0 0 0.1875em hsl(var(--accent-orange) / 0.25);
}

/* ── Grundriss-Labels ───────────────────────────────────────── */
.floorplan-label {
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        font-size 0.3s ease;
    gap: 0; /* kein gap nötig ohne marker-dot */
}
.floorplan-label .section-name {
    background: hsl(var(--accent-orange) / 0.88);
    font-size: 0.75em;
    font-weight: 700;
    padding: 0.2em 0.6em;
    letter-spacing: 0.04em;
    transition:
        opacity 0.3s ease,
        font-size 0.3s ease;
}
.floorplan-label.active .section-name {
    background: hsl(20 100% 50% / 0.92);
}

/* Geschosslinien-Labels in der Schnittansicht */
.section-geschoss-label {
    cursor: pointer;
    pointer-events: all;
    transition: none; /* kein Nachziehen */
}
.section-geschoss-label .section-name {
    font-family: var(--font-mono); /* Monospace */
    border-radius: 0; /* keine abgerundeten Ecken */
    transition: none;
    letter-spacing: 0.06em;
    padding: 0.15em 0.5em;
    font-size: 0.6875em;
    font-weight: 600;
}
.section-geschoss-label:hover .section-name {
    background: hsl(20 100% 50% / 1);
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.4);
}

/* ── Semantic Zoom Transitions ────────────────────────────────── */
.section-label {
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

/* ── Hint-Overlay ───────────────────────────────────────────── */
#section-hint {
    position: absolute;
    bottom: 6.8333em;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.75em;
    font-family: var(--font-sans);
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 0.5833em 1.3333em;
    border-radius: 0.8333em;
    border: none;
    pointer-events: none;
    z-index: 10600;
    display: none;
    backdrop-filter: blur(0.6667em);
    -webkit-backdrop-filter: blur(0.6667em);
    box-shadow: 0 0.1667em 0.8333em rgba(0, 0, 0, 0.12);
    white-space: nowrap;
}

/* Toast-Benachrichtigung (Speichern-Feedback) */
.save-toast {
    position: fixed;
    top: 3em;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5em 1.5em;
    border-radius: var(--radius);
    font-size: 0.75em;
    font-family: var(--font-sans);
    font-weight: 500;
    pointer-events: none;
    z-index: 20001;
    transition: opacity 0.4s ease;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
}
.save-toast-success {
    background: hsl(142 50% 18% / 0.97);
    color: hsl(142 60% 72%);
    border: 0.0625em solid hsl(142 45% 32% / 0.6);
}
.save-toast-error {
    background: hsl(0 50% 18% / 0.97);
    color: hsl(0 80% 72%);
    border: 0.0625em solid hsl(0 55% 40% / 0.6);
}
.save-toast-info {
    background: hsl(221 40% 16% / 0.97);
    color: hsl(221 80% 72%);
    border: 0.0625em solid hsl(221 55% 38% / 0.6);
}

/* ============================================================
   VOLUME TRANSFORM DIALOG
   (shadcn Card / Dialog Ästhetik)
   ============================================================ */

#volume-transform-dialog {
    position: fixed;
    z-index: 20000;
    background: hsl(var(--card) / 0.97);
    border: 0.0769em solid hsl(var(--border));
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 23.0769em;
    font-family: var(--font-sans);
    font-size: 0.8125em;
    color: hsl(var(--foreground));
    overflow: hidden;
    backdrop-filter: blur(0.9231em);
    -webkit-backdrop-filter: blur(0.9231em);
}

/* ── Dialog Header ──────────────────────────────────────────── */
.vtd-header {
    background: hsl(var(--card-elevated) / 0.98);
    padding: 0.7619em 1.1429em;
    font-size: 0.8077em;
    font-weight: 600;
    color: hsl(var(--muted-fg));
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 0.0952em solid hsl(var(--border));
    user-select: none;
    -webkit-user-select: none;
}

/* ── Section ────────────────────────────────────────────────── */
.vtd-section {
    padding: 0.6154em 0.9231em 0.4615em;
    border-bottom: 0.0769em solid hsl(var(--border) / 0.6);
}

.vtd-section:last-of-type {
    border-bottom: none;
}

/* ── Label (shadcn <Label>) ─────────────────────────────────── */
.vtd-label {
    font-size: 0.7692em;
    font-weight: 600;
    color: hsl(var(--muted-fg));
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 0.5em;
}

/* ── Row ────────────────────────────────────────────────────── */
.vtd-row {
    display: flex;
    gap: 0.4615em;
    flex-wrap: nowrap;
}

.vtd-row label {
    display: flex;
    align-items: center;
    gap: 0.4545em;
    font-size: 0.8462em;
    font-weight: 500;
    color: hsl(var(--muted-fg));
    flex: 1;
    white-space: nowrap;
}

.vtd-row label.vtd-active {
    color: hsl(var(--primary));
}

/* ── Input (shadcn <Input>) ─────────────────────────────────── */
.vtd-row input[type="number"] {
    width: 100%;
    height: 2.3333em;
    padding: 0 0.5em;
    font-size: 0.9231em;
    font-family: var(--font-mono);
    background: hsl(var(--input));
    color: hsl(var(--foreground));
    border: 0.0833em solid hsl(var(--border));
    border-radius: var(--radius-sm);
    outline: none;
    transition:
        border-color var(--transition),
        box-shadow var(--transition);
    -moz-appearance: textfield;
}

.vtd-row input[type="number"]::-webkit-outer-spin-button,
.vtd-row input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.vtd-row input[type="number"]:hover {
    border-color: hsl(var(--muted-fg) / 0.4);
}

.vtd-row input[type="number"]:focus {
    border-color: hsl(var(--ring));
    box-shadow:
        0 0 0 0.1538em hsl(var(--background)),
        0 0 0 0.3077em hsl(var(--ring) / 0.3);
    color: hsl(var(--foreground));
    background: hsl(var(--input));
}

.vtd-row label.vtd-active input[type="number"] {
    border-color: hsl(var(--primary) / 0.45);
    background: hsl(var(--primary) / 0.07);
    color: hsl(var(--foreground));
}

.vtd-row label.vtd-active input[type="number"]:focus {
    border-color: hsl(var(--ring));
    box-shadow:
        0 0 0 0.1538em hsl(var(--background)),
        0 0 0 0.3077em hsl(var(--ring) / 0.35);
}

/* Gesperrte Positions-Felder bei aktivem Anchor */
.vtd-pos-locked input {
    opacity: 0.3;
    pointer-events: none;
}

/* ── Buttons (shadcn <Button>) ──────────────────────────────── */
.vtd-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.4615em;
    padding: 0.6154em 0.9231em 0.7692em;
    background: hsl(var(--card-elevated) / 0.5);
    border-top: 0.0769em solid hsl(var(--border) / 0.5);
}

.vtd-buttons button {
    height: 2.3333em;
    padding: 0 1.1667em;
    font-size: 0.9231em;
    font-weight: 500;
    font-family: var(--font-sans);
    letter-spacing: 0.01em;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 0.0833em solid transparent;
    transition:
        background var(--transition),
        color var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

/* Ghost / Outline */
#vtd-cancel {
    background: transparent;
    color: hsl(var(--muted-fg));
    border-color: hsl(var(--border));
}

#vtd-cancel:hover {
    background: hsl(var(--muted) / 0.5);
    color: hsl(var(--foreground));
    border-color: hsl(var(--muted-fg) / 0.4);
}

/* Primary */
#vtd-apply {
    background: hsl(var(--primary));
    color: hsl(var(--primary-fg));
    border-color: hsl(var(--primary));
}

#vtd-apply:hover {
    background: hsl(221 83% 70%);
    border-color: hsl(221 83% 70%);
}

/* Save */
.vtd-save-btn {
    display: flex;
    align-items: center;
    gap: 0.3846em;
    background: hsl(var(--card-elevated));
    color: hsl(var(--foreground));
    border-color: hsl(var(--border));
    margin-right: auto; /* schiebt sich nach links, Apply/Cancel rechts */
}

.vtd-save-btn:hover {
    background: hsl(142 71% 20%);
    color: hsl(142 71% 75%);
    border-color: hsl(142 71% 35%);
}

#vtd-apply:focus-visible,
#vtd-cancel:focus-visible,
.vtd-save-btn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 0.1538em hsl(var(--background)),
        0 0 0 0.3077em hsl(var(--ring) / 0.4);
}

/* ── Anchor / Fixpunkt Selector ─────────────────────────────── */
.vtd-anchor-wrap {
    display: flex;
    align-items: center;
    gap: 0.7692em;
    padding-bottom: 0.1538em;
}

/* XZ-Block: Spalte mit Label oben, mittlere Zeile, Label unten */
.vtd-anchor-xz {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2308em;
}

/* Mittlere Zeile: seitliche Labels + Raster */
.vtd-axis-middle {
    display: flex;
    align-items: center;
    gap: 0.3846em;
}

/* Achsbezeichner oben/unten */
.vtd-axis-top,
.vtd-axis-bottom {
    font-size: 0.6923em;
    font-family: var(--font-mono);
    color: hsl(var(--muted-fg) / 0.6);
    letter-spacing: 0.03em;
    text-align: center;
    line-height: 1;
}

/* Achsbezeichner links/rechts */
.vtd-axis-side {
    font-size: 0.6923em;
    font-family: var(--font-mono);
    color: hsl(var(--muted-fg) / 0.6);
    letter-spacing: 0.03em;
    width: 1.7778em;
    text-align: center;
    line-height: 1;
    flex-shrink: 0;
}

/* 9-Punkt-Raster */
.vtd-dot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1.3846em);
    grid-template-rows: repeat(3, 1.3846em);
    gap: 0.2308em;
    background: hsl(var(--input));
    border: 0.0769em solid hsl(var(--border));
    border-radius: var(--radius-sm);
    padding: 0.3077em;
    position: relative;
}

/* Kreuz-Hilfslinien */
.vtd-dot-grid::before,
.vtd-dot-grid::after {
    content: "";
    position: absolute;
    background: hsl(var(--muted-fg) / 0.12);
    pointer-events: none;
}
.vtd-dot-grid::before {
    width: 0.0769em;
    top: 0.3077em;
    bottom: 0.3077em;
    left: calc(50% - 0.0385em);
}
.vtd-dot-grid::after {
    height: 0.0769em;
    left: 0.3077em;
    right: 0.3077em;
    top: calc(50% - 0.0385em);
}

/* Dot-Buttons */
.vtd-anc {
    width: 1.3846em;
    height: 1.3846em;
    border-radius: 50%;
    background: hsl(var(--muted) / 0.6);
    border: 0.1154em solid hsl(var(--border));
    cursor: pointer;
    padding: 0;
    transition:
        background var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
    position: relative;
    z-index: 1;
}

.vtd-anc:hover {
    background: hsl(var(--muted));
    border-color: hsl(var(--muted-fg) / 0.5);
}

.vtd-anc.vtd-anc-active {
    background: hsl(var(--primary));
    border-color: hsl(var(--primary));
    box-shadow:
        0 0 0 0.1538em hsl(var(--background)),
        0 0 0 0.3077em hsl(var(--ring) / 0.4);
}

/* Y-Achse Buttons */
.vtd-anchor-y {
    display: flex;
    flex-direction: column;
    gap: 0.2308em;
}

.vtd-anc-y {
    width: 3.1111em;
    height: 3.1111em;
    font-size: 0.6923em;
    font-family: var(--font-mono);
    font-weight: 700;
    background: hsl(var(--input));
    color: hsl(var(--muted-fg));
    border: 0.1111em solid hsl(var(--border));
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
    transition:
        background var(--transition),
        color var(--transition),
        border-color var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
}

.vtd-anc-y:hover {
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
    border-color: hsl(var(--muted-fg) / 0.4);
}

.vtd-anc-y.vtd-anc-active {
    background: hsl(var(--primary));
    color: hsl(var(--primary-fg));
    border-color: hsl(var(--primary));
    box-shadow:
        0 0 0 0.1538em hsl(var(--background)),
        0 0 0 0.3077em hsl(var(--ring) / 0.35);
}

/* ============================================================
   STATUS BAR (bottom strip)
   ============================================================ */

#status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2.3636em;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 1.0909em;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: hsl(var(--card) / 0.94);
    backdrop-filter: blur(0.5455em);
    -webkit-backdrop-filter: blur(0.5455em);
    border-top: 0.0909em solid hsl(var(--border));
    font-family: var(--font-mono);
    font-size: 0.6875em;
    color: hsl(var(--foreground-dim));
    user-select: none;
    top: 1em;
    opacity: 1;
    background: none;
    color: #888;
    transition:
        opacity 0.2s ease,
        left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    bottom: unset;
    border: none;
    width: 60%;
    left: 20%;
    backdrop-filter: none;
}

#sb-camera,
#sb-cursor {
    display: flex;
    align-items: center;
    gap: 0;
}

.sb-label {
    font-family: var(--font-sans);
    font-size: 0.9091em;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: hsl(var(--muted-fg));
    margin-right: 0.5em;
}

.sb-axis {
    color: hsl(var(--muted-fg));
    font-size: 0.9091em;
    margin-left: 0.9em; /* großer Abstand: Zahl → Achse */
    margin-right: 0.15em; /* kleiner Abstand: Achse → Zahl */
}

/* ersten Achsen-Buchstaben direkt an das Label anschließen */
.sb-axis:first-of-type {
    margin-left: 0;
}

.sb-val {
    min-width: 3.25em;
    color: hsl(var(--foreground-dim));
    font-size: 1em;
    margin-right: 1em;
    text-align: right;
}

.sb-divider {
    width: 0.0909em;
    height: 1.0909em;
    background: hsl(var(--border));
    margin: 0 0.9091em;
    flex-shrink: 0;
}

.sb-spacer {
    flex: 1;
    visibility: hidden;
}

#sb-pts,
#sb-fps {
    color: #555;
    font-size: 1em;
    white-space: nowrap;
}

#status-bar > div {
    background: rgba(245, 245, 245, 0.75);
    backdrop-filter: blur(0.25em);
    padding: 0.5em 1.5em;
    border-radius: 0.35em;
    align-items: baseline;
}

#status-bar .sb-divider {
    background: transparent;
    visibility: hidden;
}

div#sb-pts + div {
    width: 0;
    padding: 0;
}

/* ============================================================
   CLOUD INFO PANEL
   ============================================================ */

/* ---- Cloud Info – inline in der Command Palette ---- */

/* ── Zwei-Spalten-Header: Punktwolke + Git ──────────────────────────────────── */
.cmd-info-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5em;
    padding: 0.5em 0.5em 0.125em;
}

.cmd-cloud-info {
    padding: 0.625em 0.625em 0.625em;
    background: hsl(var(--card-elevated) / 0.6);
    border-radius: var(--radius);
    border: 0.0625em solid hsl(var(--border));
    min-width: 0;
    min-height: 5.75em; /* Karte etwas höher als Standard */
    display: flex;
    flex-direction: column;
}

.cmd-cloud-info {
}

.cmd-cloud-info-clickable {
    cursor: pointer;
    transition:
        background var(--transition),
        border-color var(--transition);
}
.cmd-cloud-info-clickable:hover {
    background: hsl(var(--muted) / 0.7);
    border-color: hsl(var(--primary) / 0.35);
}

.cmd-cloud-info-actions {
    display: flex;
    align-items: center;
    gap: 0.75em;
    margin-top: auto; /* an Unterkante drücken */
    padding-top: 0.5em;
}
.cmd-cloud-info-expand {
    display: flex;
    align-items: center;
    gap: 0.381em;
    font-size: 0.6562em;
    font-weight: 500;
    font-family: var(--font-sans);
    color: hsl(var(--primary));
    letter-spacing: 0.01em;
}
.cmd-cloud-info-expand svg {
    width: 0.625em;
    height: 0.625em;
    color: hsl(var(--primary));
    transform: rotate(-90deg);
}
.cmd-cloud-action-link {
    cursor: pointer;
    opacity: 0.85;
    transition: opacity var(--transition);
}
.cmd-cloud-action-link:hover {
    opacity: 1;
}
.cmd-cloud-switch-link {
    color: hsl(var(--accent-orange) / 0.9);
}
.cmd-cloud-switch-link svg {
    color: hsl(var(--accent-orange) / 0.9);
}

/* ── Punktwolken-Karte (inline in Info-Columns) ─────────────────────────────── */
.cmd-cloud-switch-card {
    padding: 0.5em 0.5em 0.5em;
    overflow-y: auto;
}
.cmd-cloud-switch-card-header {
    font-size: 0.68em;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: hsl(var(--muted-fg));
    margin-bottom: 0.4em;
    padding: 0 0.25em;
}
.cmd-cloud-switch-list-inline {
    gap: 0.25em;
}
.cmd-cloud-switch-list-inline .cmd-cloud-switch-row {
    padding: 0.35em 0.5em;
}

/* ── Cloud-Switcher-Ansicht ─────────────────────────────────────────────────── */
.cmd-cloud-switch-list {
    display: flex;
    flex-direction: column;
    gap: 0.375em;
}
.cmd-cloud-switch-row {
    padding: 0.5em 0.625em;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card-elevated) / 0.5);
    cursor: pointer;
    transition:
        background var(--transition),
        border-color var(--transition);
}
.cmd-cloud-switch-row:not(.cmd-cloud-switch-active):hover {
    background: hsl(var(--muted) / 0.7);
    border-color: hsl(var(--primary) / 0.4);
}
.cmd-cloud-switch-active {
    border-color: hsl(var(--accent-orange) / 0.5);
    background: hsl(var(--accent-orange) / 0.08);
    cursor: default;
}
.cmd-cloud-switch-name {
    font-size: 0.75em;
    font-weight: 500; /* inaktiv: medium */
    font-family: var(--font-sans);
    color: hsl(var(--foreground));
    display: flex;
    align-items: center;
    gap: 0.5em;
    line-height: 1.4;
}
.cmd-cloud-switch-active .cmd-cloud-switch-name {
    font-weight: 600; /* aktiv: semibold */
}
.cmd-cloud-switch-badge {
    font-size: 10px; /* absolut — entkoppelt vom em-Kontext des Namens */
    font-weight: 500;
    font-family: var(--font-sans);
    padding: 0.15em 0.5em;
    border-radius: 99px;
    background: hsl(var(--accent-orange) / 0.18);
    color: hsl(25 100% 65%);
    letter-spacing: 0.03em;
    line-height: 1.6;
}
.cmd-cloud-switch-meta {
    font-size: 0.6875em; /* 11px — lesbar ohne zu dominieren */
    font-family: var(--font-mono);
    color: hsl(var(--muted-fg));
    margin-top: 0.25em;
    letter-spacing: 0.01em;
}
.cmd-cloud-switch-hint {
    font-size: 0.6875em; /* 11px — konsistent mit meta */
    font-family: var(--font-sans);
    font-weight: 500;
    color: hsl(var(--primary));
    margin-top: 0.3em;
    opacity: 0.75;
    letter-spacing: 0.01em;
}
.cmd-cloud-switch-row:not(.cmd-cloud-switch-active):hover
    .cmd-cloud-switch-hint {
    opacity: 1;
}

/* Checkbox-Toggle-Rows im Projekt-Modus */
.cmd-cloud-toggle-row {
    display: flex !important;
    align-items: center;
    gap: 8px;
}
.cmd-cloud-checkbox {
    width: 14px;
    height: 14px;
    accent-color: hsl(var(--primary));
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}
.cmd-project-switch-row .cmd-cloud-switch-name {
    font-weight: 600;
}

.cmd-cloud-info-row1 {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5em;
    margin-bottom: 0.1875em;
}

.cmd-cloud-info-name {
    font-size: 0.8125em;
    font-weight: 600;
    font-family: var(--font-sans);
    color: hsl(var(--foreground));
}

.cmd-cloud-info-pts {
    font-size: 0.6875em;
    font-family: var(--font-mono);
    color: hsl(var(--muted-fg));
    white-space: nowrap;
}

.cmd-cloud-info-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.6875em;
    font-family: var(--font-mono);
    color: hsl(var(--muted-fg));
    margin-bottom: 0.5em;
    line-height: 1.5;
}

.cmd-cloud-info-meta-crs {
    /* CRS-Code links — kann leer sein */
}

.cmd-cloud-info-meta-sp {
    /* Ø-Abstand rechts */
    margin-left: auto;
}

/* ── Projekt-Wolken-Liste in der Info-Karte ─────────────────────────────── */
.cmd-proj-cloud-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 6px 0 2px;
}
.cmd-proj-cloud-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6875em;
    font-family: var(--font-sans);
    line-height: 1.5;
}
.cmd-proj-cloud-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cmd-proj-cloud-name {
    font-weight: 500;
    color: hsl(var(--foreground));
}
.cmd-proj-cloud-pts {
    margin-left: auto;
    font-family: var(--font-mono);
    color: hsl(var(--muted-fg));
    font-size: 0.9em;
}

/* ── Pip-Matrix in der Cloud-Karte ───────────────────────────────────────── */
.cmd-cloud-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0.5em;
}

.cmd-pip-row {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 14px;
}

/* Label */
.cmd-pip-lbl {
    font-size: 0.625em;
    font-weight: 500;
    font-family: var(--font-sans);
    color: hsl(var(--muted-fg));
    width: 74px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Pip-Spur: 8 Quadrate nebeneinander */
.cmd-pip-track {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
}

.cmd-pip {
    width: 6px;
    height: 6px;
    border-radius: 1.5px;
    background: hsl(var(--border));
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.cmd-pip-on {
    background: hsl(var(--primary));
}

/* Zahlenwert */
.cmd-pip-val {
    font-size: 0.6875em;
    font-weight: 600;
    font-family: var(--font-mono);
    color: hsl(var(--foreground));
    width: 14px;
    text-align: right;
    flex-shrink: 0;
}

.cmd-cloud-info-attrs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1875em;
}

/* Chips – gleiche Varianten wie vorher, jetzt über Palette zugänglich */
.cip-chip {
    font-size: 0.625em;
    font-weight: 600;
    font-family: var(--font-sans);
    letter-spacing: 0.04em;
    padding: 0.2em 0.7em;
    border-radius: 99.9em;
    border: 0.1em solid;
    white-space: nowrap;
}

.cip-chip-geo {
    color: hsl(var(--muted-fg));
    background: hsl(var(--muted) / 0.5);
    border-color: hsl(var(--border));
}

.cip-chip-color {
    color: hsl(221 83% 75%);
    background: hsl(221 83% 63% / 0.12);
    border-color: hsl(221 83% 63% / 0.3);
}

.cip-chip-intensity {
    color: hsl(35 95% 68%);
    background: hsl(35 95% 55% / 0.12);
    border-color: hsl(35 95% 55% / 0.3);
}

.cip-chip-class {
    color: hsl(142 70% 55%);
    background: hsl(142 70% 40% / 0.12);
    border-color: hsl(142 70% 40% / 0.3);
}

.cip-chip-scan {
    color: hsl(280 60% 70%);
    background: hsl(280 60% 50% / 0.12);
    border-color: hsl(280 60% 50% / 0.3);
}

/* ============================================================
   COMMAND PALETTE – DATENSATZ-DETAILANSICHT
   ============================================================ */

/* Wrapper – füllt den scrollbaren List-Bereich */
.cmd-detail-wrap {
    padding: 0.125em 0.125em 0.5em;
}

/* Zurück-Button */
.cmd-detail-back {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.5em 0.6667em;
    margin-bottom: 0.3333em;
    font-size: 0.75em;
    font-weight: 500;
    font-family: var(--font-sans);
    color: hsl(var(--muted-fg));
    border-radius: var(--radius);
    cursor: pointer;
    transition:
        background var(--transition),
        color var(--transition);
    user-select: none;
}
.cmd-detail-back:hover {
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
}
.cmd-detail-back svg {
    width: 0.75em;
    height: 0.75em;
    flex-shrink: 0;
}

/* Hero-Bereich */
.cmd-detail-hero {
    display: flex;
    align-items: center;
    gap: 0.625em;
    padding: 0.5em 0.625em 0.625em;
    margin-bottom: 0.25em;
    background: hsl(var(--card-elevated) / 0.5);
    border: 0.0625em solid hsl(var(--border));
    border-radius: var(--radius);
}
.cmd-detail-hero-icon {
    flex-shrink: 0;
    width: 2.125em;
    height: 2.125em;
    display: flex;
    align-items: center;
    justify-content: center;
    background: hsl(var(--primary) / 0.1);
    border: 0.0625em solid hsl(var(--primary) / 0.25);
    border-radius: var(--radius);
    color: hsl(var(--primary));
}
.cmd-detail-hero-icon svg {
    width: 1.125em;
    height: 1.125em;
}
.cmd-detail-hero-name {
    font-size: 0.875em;
    font-weight: 600;
    font-family: var(--font-sans);
    color: hsl(var(--foreground));
    line-height: 1.3;
}
.cmd-detail-hero-sub {
    font-size: 0.6875em;
    font-family: var(--font-sans);
    font-weight: 400;
    color: hsl(var(--muted-fg));
    margin-top: 0.25em;
    letter-spacing: 0.01em;
}

/* Abschnitt */
.cmd-detail-section {
    margin-top: 0.375em;
}
.cmd-detail-section-title {
    padding: 0.6em 1em 0.3em;
    font-size: 0.625em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: hsl(var(--muted-fg));
    font-family: var(--font-sans);
    user-select: none;
}

/* Key-Value-Grid */
.cmd-detail-kv {
    padding: 0 0.25em;
}
.cmd-detail-row {
    display: flex;
    align-items: baseline;
    gap: 0.5em;
    padding: 0.1875em 0.375em;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.cmd-detail-row:hover {
    background: hsl(var(--muted) / 0.5);
}
.cmd-dk {
    flex-shrink: 0;
    width: 12.8696em;
    font-size: 0.7188em;
    font-weight: 500;
    font-family: var(--font-sans);
    color: hsl(var(--muted-fg));
}
.cmd-dv {
    flex: 1;
    font-size: 0.7188em;
    font-family: var(--font-sans);
    color: hsl(var(--foreground));
    word-break: break-all;
}
.cmd-dv-mono {
    font-family: var(--font-mono);
    font-size: 0.6875em;
}

/* Attribut-Tabelle */
.cmd-detail-attr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.6875em;
    font-family: var(--font-sans);
    margin-top: 0.1818em;
}
.cmd-detail-attr-table thead th {
    padding: 0.4em 0.8em 0.3em;
    text-align: left;
    font-size: 0.625em;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: hsl(var(--muted-fg));
    border-bottom: 0.1em solid hsl(var(--border));
}
.cmd-detail-attr-table tbody td {
    padding: 0.25em 0.5em;
    color: hsl(var(--foreground));
    border-bottom: 0.0625em solid hsl(var(--border) / 0.4);
    vertical-align: middle;
}
.cmd-detail-attr-table tbody tr:last-child td {
    border-bottom: none;
}
.cmd-detail-attr-table tbody tr:hover td {
    background: hsl(var(--muted) / 0.4);
}
.cmd-detail-range {
    color: hsl(var(--muted-fg));
    font-size: 0.6562em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 15.2381em;
}

/* ============================================================
   NAVIGATIONCUBE – HTML-Label-Overlay
   ============================================================ */

#nav-cube-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9500;
}

.nav-cube-label {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 0.6875em;
    font-weight: 700;
    font-family: var(--font-sans);
    color: #000;
    line-height: 1;
    pointer-events: none;
    letter-spacing: 0.02em;
    transition: opacity 0.08s linear;
}

/* ============================================================
   COMMAND PALETTE (Spotlight-Style)
   ============================================================ */

#cmd-palette-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40000;
    background: hsl(240 15% 2% / 0.55);
    backdrop-filter: blur(0.25em);
    -webkit-backdrop-filter: blur(0.25em);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 14vh;
    animation: cmd-backdrop-in 0.1s ease;
}

#cmd-palette-backdrop.cmd-hidden {
    display: none;
}

@keyframes cmd-backdrop-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#cmd-palette {
    width: 35em;
    max-width: calc(100vw - 3em);
    background: hsl(var(--card) / 0.97);
    border: 0.0625em solid hsl(var(--border));
    border-radius: var(--radius-lg);
    box-shadow:
        var(--shadow-lg),
        0 0 0 0.0625em hsl(var(--border) / 0.4);
    overflow: hidden;
    animation: cmd-palette-in 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cmd-palette-in {
    from {
        opacity: 0;
        transform: translateY(-0.625em) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---- Input row ---- */
#cmd-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.625em;
    padding: 0.8125em 1em;
    border-bottom: 0.0625em solid hsl(var(--border));
}

#cmd-input-wrap > svg {
    flex-shrink: 0;
    width: 1em;
    height: 1em;
    color: hsl(var(--muted-fg));
}

#cmd-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: hsl(var(--foreground));
    font-size: 0.875em;
    font-family: var(--font-sans);
    font-weight: 400;
    caret-color: hsl(var(--primary));
}

#cmd-input::placeholder {
    color: hsl(var(--muted-fg));
}

.cmd-badge {
    flex-shrink: 0;
    font-size: 0.625em;
    font-family: var(--font-mono);
    color: hsl(var(--muted-fg));
    background: hsl(var(--muted));
    border: 0.1em solid hsl(var(--border));
    border-radius: var(--radius-sm);
    padding: 0.2em 0.7em;
    line-height: 1.6;
    white-space: nowrap;
}

/* ---- List area ---- */
#cmd-list-wrap {
    max-height: 24.375em;
    overflow-y: auto;
    padding: 0.375em 0.375em 0.5em;
    scroll-behavior: smooth;
}

#cmd-list-wrap::-webkit-scrollbar {
    width: 0.25em;
}
#cmd-list-wrap::-webkit-scrollbar-track {
    background: transparent;
}
#cmd-list-wrap::-webkit-scrollbar-thumb {
    background: hsl(var(--border));
    border-radius: 0.125em;
}

/* ---- Group label ---- */
.cmd-group-label {
    padding: 0.7619em 0.9524em 0.2857em;
    font-size: 0.6562em;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: hsl(var(--muted-fg));
    font-family: var(--font-sans);
    user-select: none;
}

/* ---- Separator between groups ---- */
.cmd-separator {
    height: 0.0625em;
    background: hsl(var(--border));
    margin: 0.375em 0.25em;
}

/* ---- Command item ---- */
.cmd-item {
    display: flex;
    align-items: center;
    gap: 0.6875em;
    padding: 0.4375em 0.625em;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
    user-select: none;
}

.cmd-item:hover,
.cmd-item.cmd-item-active {
    background: hsl(var(--muted));
}

.cmd-item-icon {
    flex-shrink: 0;
    width: 1.875em;
    height: 1.875em;
    display: flex;
    align-items: center;
    justify-content: center;
    background: hsl(var(--card-elevated));
    border: 0.0625em solid hsl(var(--border));
    border-radius: var(--radius-sm);
    color: hsl(var(--foreground-dim));
}

.cmd-item-icon svg {
    width: 0.875em;
    height: 0.875em;
}

.cmd-item-text {
    flex: 1;
    min-width: 0;
}

.cmd-item-title {
    font-size: 0.8125em;
    font-weight: 500;
    font-family: var(--font-sans);
    color: hsl(var(--foreground));
    line-height: 1.3;
}

.cmd-item-desc {
    font-size: 0.6875em;
    font-weight: 400;
    font-family: var(--font-sans);
    color: hsl(var(--muted-fg));
    margin-top: 0.0909em;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmd-item-shortcut {
    flex-shrink: 0;
    font-size: 0.625em;
    font-family: var(--font-mono);
    color: hsl(var(--muted-fg));
    background: hsl(var(--muted));
    border: 0.1em solid hsl(var(--border));
    border-radius: var(--radius-sm);
    padding: 0.2em 0.6em;
    line-height: 1.6;
}

/* ---- Empty state ---- */
#cmd-empty {
    text-align: center;
    padding: 2.7692em 1.2308em;
    color: hsl(var(--muted-fg));
    font-size: 0.8125em;
    font-family: var(--font-sans);
}

/* ============================================================
   DEV-VIEWER OVERLAY (Strukturgraph)
   ============================================================ */
#dev-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: hsl(0 0% 0% / 0.6);
    backdrop-filter: blur(6px);
    padding: 2em;
    animation: doc-overlay-in 0.2s ease;
}
#dev-viewer-overlay.dev-viewer-hidden {
    display: none;
}
#dev-viewer-panel {
    width: 100%;
    max-width: 90em;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: hsl(var(--card));
    border: 0.0625em solid hsl(var(--border));
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 8px 40px hsl(0 0% 0% / 0.4);
}
#dev-viewer-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 0.5em 0.75em;
    border-bottom: 0.0625em solid hsl(var(--border));
    flex-shrink: 0;
}
#dev-viewer-content {
    flex: 1;
    min-height: 0;
}
#dev-viewer-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ============================================================
   OBJEKT-KONTEXTMENÜ (Rechtsklick auf Schnitt / Grundriss / Achse)
   ============================================================ */

.obj-ctx {
    position: fixed;
    z-index: 50000;
    min-width: 10.5em;
    background: hsl(var(--card) / 0.98);
    border: 0.0625em solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.25em;
    font-family: var(--font-sans);
    backdrop-filter: blur(0.625em);
    -webkit-backdrop-filter: blur(0.625em);
    animation: ctx-in 0.08s ease;
    user-select: none;
}

@keyframes ctx-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.obj-ctx-item {
    display: flex;
    align-items: center;
    gap: 0.72em;
    padding: 0.48em 0.8em;
    font-size: 0.7812em;
    font-weight: 500;
    color: hsl(var(--foreground));
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}

.obj-ctx-item:hover {
    background: hsl(var(--muted));
}

.obj-ctx-item svg {
    width: 0.8125em;
    height: 0.8125em;
    flex-shrink: 0;
    color: hsl(var(--muted-fg));
}

.obj-ctx-sep {
    height: 0.0625em;
    background: hsl(var(--border));
    margin: 0.1875em 0;
}

.obj-ctx-item.obj-ctx-danger {
    color: hsl(var(--destructive));
}

.obj-ctx-item.obj-ctx-danger svg {
    color: hsl(var(--destructive) / 0.75);
}

.obj-ctx-item.obj-ctx-danger:hover {
    background: hsl(var(--destructive) / 0.1);
}

/* Ebenen/Labels permanent ausgeblendet (überschreibt inline display vom Render-Loop) */
.layer-hidden {
    display: none !important;
}
.clip-hidden {
    display: none !important;
}

/* Deaktivierter Menüeintrag (kein Punkt geladen o. ä.) */
.obj-ctx-item.obj-ctx-disabled {
    opacity: 0.38;
    pointer-events: none;
    cursor: default;
}

/* Sekundärer/gedimmter Menüeintrag */
.obj-ctx-item.obj-ctx-muted {
    color: hsl(var(--muted-fg));
}

.obj-ctx-item.obj-ctx-muted svg {
    color: hsl(var(--muted-fg) / 0.65);
}

.obj-ctx-item.obj-ctx-destructive {
    color: hsl(var(--destructive));
}

.obj-ctx-item.obj-ctx-destructive svg {
    color: hsl(var(--destructive) / 0.8);
}

/* ============================================================
   OBJEKT-POSITIONS-DIALOG (Lage / Höhe anpassen)
   ============================================================ */

.obj-pos-dlg {
    position: fixed;
    z-index: 45000;
    min-width: 20.7692em;
    background: hsl(var(--card) / 0.98);
    border: 0.0769em solid hsl(var(--border));
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-family: var(--font-sans);
    font-size: 0.8125em;
    color: hsl(var(--foreground));
    overflow: hidden;
    backdrop-filter: blur(0.9231em);
    -webkit-backdrop-filter: blur(0.9231em);
    animation: cmd-palette-in 0.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.opd-header {
    background: hsl(var(--card-elevated) / 0.98);
    padding: 0.7619em 0.9524em 0.7619em 1.1429em;
    font-size: 0.8077em;
    font-weight: 600;
    color: hsl(var(--muted-fg));
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 0.0952em solid hsl(var(--border));
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7619em;
}

.opd-close {
    width: 1.5385em;
    height: 1.5385em;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: hsl(var(--muted-fg));
    background: transparent;
    border: none;
    transition:
        background var(--transition),
        color var(--transition);
    padding: 0;
}

.opd-close svg {
    width: 0.9231em;
    height: 0.9231em;
}

.opd-close:hover {
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
}

.opd-body {
    padding: 0.7692em 0.9231em 0.6154em;
    display: flex;
    flex-direction: column;
    gap: 0.4615em;
}

.opd-group-label {
    font-size: 0.7308em;
    font-weight: 600;
    color: hsl(var(--muted-fg) / 0.7);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding-bottom: 0.3158em;
    border-bottom: 0.1053em solid hsl(var(--border) / 0.5);
    margin-top: 0.4211em;
    margin-bottom: 0.2105em;
}

.opd-group-label:first-child {
    margin-top: 0;
}

.opd-row {
    display: flex;
    align-items: center;
    gap: 0.4615em;
}

.opd-axis-lbl {
    font-size: 0.7692em;
    font-weight: 600;
    font-family: var(--font-mono);
    color: hsl(var(--muted-fg));
    min-width: 1.4em;
    text-align: center;
    flex-shrink: 0;
}

.opd-input {
    flex: 1;
    height: 2.2609em;
    padding: 0 0.5217em;
    font-size: 0.8846em;
    font-family: var(--font-mono);
    background: hsl(var(--input));
    color: hsl(var(--foreground));
    border: 0.087em solid hsl(var(--border));
    border-radius: var(--radius-sm);
    outline: none;
    transition:
        border-color var(--transition),
        box-shadow var(--transition);
    -moz-appearance: textfield;
}

.opd-input::-webkit-outer-spin-button,
.opd-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.opd-input:hover {
    border-color: hsl(var(--muted-fg) / 0.4);
}

.opd-input:focus {
    border-color: hsl(var(--ring));
    box-shadow:
        0 0 0 0.1538em hsl(var(--background)),
        0 0 0 0.3077em hsl(var(--ring) / 0.3);
}

.opd-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.4615em;
    padding: 0.6154em 0.9231em 0.7692em;
    background: hsl(var(--card-elevated) / 0.5);
    border-top: 0.0769em solid hsl(var(--border) / 0.5);
}

.opd-btn {
    height: 2.1667em;
    padding: 0 1em;
    font-size: 0.9231em;
    font-weight: 500;
    font-family: var(--font-sans);
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 0.0833em solid transparent;
    transition:
        background var(--transition),
        color var(--transition),
        border-color var(--transition);
}

.opd-btn-cancel {
    background: transparent;
    color: hsl(var(--muted-fg));
    border-color: hsl(var(--border));
}

.opd-btn-cancel:hover {
    background: hsl(var(--muted) / 0.5);
    color: hsl(var(--foreground));
}

.opd-btn-apply {
    background: hsl(var(--primary));
    color: hsl(var(--primary-fg));
    border-color: hsl(var(--primary));
}

.opd-btn-apply:hover {
    background: hsl(221 83% 70%);
    border-color: hsl(221 83% 70%);
}

/* ============================================================
   DRAG-EDIT HANDLES + EDIT-BAR
   ============================================================ */

.drag-handle-pt {
    position: absolute;
    top: 0;
    left: 0;
    width: 0.875em;
    height: 0.875em;
    border-radius: 50%;
    border: 0.1562em solid hsl(0 0% 98% / 0.9);
    box-shadow:
        0 0 0 0.125em hsl(240 15% 2% / 0.35),
        var(--shadow-sm);
    transform: translate(-50%, -50%);
    cursor: grab;
    z-index: 10002;
    pointer-events: auto;
    transition:
        width 0.1s ease,
        height 0.1s ease,
        box-shadow 0.1s ease,
        opacity 0.08s linear;
    user-select: none;
}

.drag-handle-pt:hover {
    width: 1.125em;
    height: 1.125em;
    box-shadow:
        0 0 0 0.1875em hsl(240 15% 2% / 0.3),
        0 0 0 0.375em hsl(var(--ring) / 0.2),
        var(--shadow-sm);
}

.drag-handle-pt.dragging {
    cursor: grabbing;
    width: 1.25em;
    height: 1.25em;
    box-shadow:
        0 0 0 0.1875em hsl(240 15% 2% / 0.3),
        0 0 0 0.4375em hsl(var(--ring) / 0.3),
        var(--shadow-md);
    transition: none;
}

/* Farbcodierung nach Typ */
.drag-handle-pt[data-role="section-start"],
.drag-handle-pt[data-role="section-end"] {
    background: hsl(var(--primary));
}

.drag-handle-pt[data-role="axis-start"],
.drag-handle-pt[data-role="axis-end"] {
    background: hsl(167 52% 45%);
    border-color: hsl(167 52% 80% / 0.9);
}

.drag-handle-pt[data-role="floorplan-z"] {
    background: hsl(var(--accent-orange));
    width: 1em;
    height: 1em;
}

/* Verbindungslinie zwischen den zwei Handles (section / axis) */
.drag-handle-line {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10001;
    overflow: visible;
}

/* Edit-Mode-Leiste (oben zentriert) */
.obj-edit-bar {
    position: fixed;
    top: 0.75em;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10004;
    display: flex;
    align-items: center;
    gap: 0.5em;
    background: hsl(var(--card) / 0.97);
    border: 0.0625em solid hsl(var(--accent-orange) / 0.5);
    border-radius: var(--radius);
    padding: 0.3125em 0.5em 0.3125em 0.75em;
    box-shadow:
        var(--shadow-md),
        0 0 0 0.0625em hsl(var(--accent-orange) / 0.12);
    backdrop-filter: blur(0.625em);
    -webkit-backdrop-filter: blur(0.625em);
    font-family: var(--font-sans);
    white-space: nowrap;
    animation: ctx-in 0.1s ease;
}

.obj-edit-bar-icon {
    flex-shrink: 0;
    color: hsl(var(--accent-orange));
    display: flex;
    align-items: center;
}

.obj-edit-bar-icon svg {
    width: 0.8125em;
    height: 0.8125em;
}

.obj-edit-bar-label {
    font-size: 0.75em;
    font-weight: 400;
    color: hsl(var(--muted-fg));
}

.obj-edit-bar-name {
    font-size: 0.75em;
    font-weight: 600;
    color: hsl(var(--foreground));
    max-width: 16.6667em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.obj-edit-bar-sep {
    width: 0.0625em;
    height: 0.875em;
    background: hsl(var(--border));
    flex-shrink: 0;
    margin: 0 0.125em;
}

.obj-edit-bar-coords {
    height: 2.2609em;
    padding: 0 0.8696em;
    font-size: 0.7188em;
    font-weight: 500;
    font-family: var(--font-sans);
    background: transparent;
    color: hsl(var(--muted-fg));
    border: 0.087em solid hsl(var(--border));
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition:
        background var(--transition),
        color var(--transition);
}

.obj-edit-bar-coords:hover {
    background: hsl(var(--muted) / 0.5);
    color: hsl(var(--foreground));
}

.obj-edit-bar-done {
    height: 2.1667em;
    padding: 0 1em;
    font-size: 0.75em;
    font-weight: 600;
    font-family: var(--font-sans);
    background: hsl(var(--primary));
    color: hsl(var(--primary-fg));
    border: 0.0833em solid hsl(var(--primary));
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}

.obj-edit-bar-done:hover {
    background: hsl(221 83% 70%);
    border-color: hsl(221 83% 70%);
}

/* ============================================================
   DIN CO₂-BERECHNUNGSPANEL — 3-Panel-Architektur
   ============================================================ */

/* ── 1. INPUT CARD (bottom-right, compact) ──────────────────── */
.din-ic {
    position: fixed;
    bottom: 1.5em;
    right: 1em;
    width: 27.3333em;
    z-index: 10500;
    background: #f0f0f0;
    backdrop-filter: blur(0.8333em);
    -webkit-backdrop-filter: blur(0.8333em);
    border-radius: var(--radius-lg);
    font-family: var(--font-sans);
    font-size: 0.75em;
    color: #ebebeb;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}
.din-ic-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.din-ic-closed {
    opacity: 0;
    transform: translateY(1.6667em);
    pointer-events: none;
}

.din-ic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8333em 1.1667em;
    border-bottom: 0.1em solid #e3e3e3;
    cursor: grab;
    user-select: none;
}
.din-ic-header:active {
    cursor: grabbing;
}
.din-ic-title {
    font-size: 1.1667em;
    font-weight: 600;
    color: #555;
}
.din-ic-close {
    width: 1.8333em;
    height: 1.8333em;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #898994;
    padding: 0;
    border-radius: 0.3333em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--transition),
        color var(--transition);
}
.din-ic-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ebebeb;
}
.din-ic-close svg {
    width: 0.8333em;
    height: 0.8333em;
}

.din-ic-body {
    padding: 1em 1.1667em 1.1667em;
}

.din-ic-section-title {
    display: none;
    font-size: 1em;
    letter-spacing: 0.015em;
    text-transform: none;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    color: #27272b;
    border-bottom: 0.1em solid #e3e3e3;
    margin-top: 1.5em;
}

.din-ic-row {
    margin-bottom: 0.6316em;
}
.din-ic-row-half {
    max-width: calc(50% - 0.1667em);
}
.din-ic-row-4col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0.3333em;
    margin-bottom: 0.5em;
}
.din-ic-field {
    display: flex;
    flex-direction: column;
    gap: 0.1667em;
}

.din-ic-label {
    font-size: 0.95em;
    font-weight: normal;
    font-family: var(--font-mono);
    color: #8b8a96;
    display: flex;
    margin-bottom: 0.75em;
}

.din-ic-input,
.din-ic-select {
    -webkit-appearance: none;
    height: 2.5455em;
    padding: 0 0.7273em;
    color: #2a2a2e;
    background: #e7e7e7;
    border-radius: 0.3636em;
    font-family: var(--font-mono);
    font-size: 0.9167em;
    outline: none;
    transition:
        border-color var(--transition),
        box-shadow var(--transition);
    width: 100%;
    box-sizing: border-box;
    border: none;
}
.din-ic-select {
    font-family: var(--font-sans);
    font-size: 0.9167em;
}
.din-ic-input:focus,
.din-ic-select:focus {
    border-color: transparent;
    box-shadow: none;
}

.din-ic-calc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4615em;
    margin-top: 0.9231em;
    width: 100%;
    height: 2.6154em;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 0.4615em;
    font-family: var(--font-sans);
    font-size: 1.0833em;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition:
        background var(--transition),
        opacity var(--transition);
}
.din-ic-calc-btn svg {
    stroke: #fff;
}
.din-ic-calc-btn:hover {
    background: #111;
}
.din-ic-calc-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.din-ic-error {
    background: rgba(230, 50, 50, 0.12);
    border: 0.0909em solid rgba(230, 50, 50, 0.35);
    color: #db7070;
    border-radius: 0.3636em;
    padding: 0.7273em 0.9091em;
    font-size: 0.9167em;
    margin-top: 0.7273em;
}

/* ── Measure-Hint (links neben IC) — Dock style ─────── */
.din-measure-hint {
    position: fixed;
    z-index: 10501;
    opacity: 0;
    pointer-events: none;
    transform: translateX(0.5em);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}
.din-measure-hint-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}
.din-mh-pill {
    display: flex;
    align-items: center;
    gap: 0;
    background: hsl(var(--card) / 0.94);
    backdrop-filter: blur(0.5em);
    -webkit-backdrop-filter: blur(0.5em);
    border: 0.0625em solid hsl(var(--border));
    border-radius: 0.75em;
    padding: 0.1875em;
    box-shadow: var(--shadow-md);
}
.din-mh-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125em;
    width: 2.75em;
    height: 2.625em;
    background: transparent;
    border: none;
    border-radius: 0.5625em;
    color: hsl(var(--muted-fg));
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}
.din-mh-btn span {
    font-family: var(--font-sans);
    font-size: 0.5625em;
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1;
    white-space: nowrap;
}
.din-mh-btn:hover {
    background: hsl(var(--card-elevated));
    color: hsl(var(--foreground));
}
.din-mh-btn svg {
    flex-shrink: 0;
}

/* ── 2. REPORT PANEL (left, light theme) ────────────────────── */
.din-rp {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 32.3077em;
    z-index: 10500;
    background: #f0f0f0;
    color: #1a1a1a;
    font-family: var(--font-sans);
    font-size: 0.8125em;
    display: flex;
    flex-direction: column;
    box-shadow: 0.3077em 0 1.8462em rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.din-rp-open {
    transform: translateX(0);
}
.din-rp-closed {
    transform: translateX(-100%);
}

.din-rp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.3846em 1.5385em;
    border-bottom: 0.0769em solid #e0e0e0;
    flex-shrink: 0;
}
.din-rp-header-text {
    display: flex;
    flex-direction: column;
    gap: 0.1538em;
    min-width: 0;
}
.din-rp-title {
    font-size: 1.23em;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.01em;
}
.din-rp-subtitle {
    font-size: 0.8462em;
    color: #888;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.din-rp-close {
    width: 2.1538em;
    height: 2.1538em;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #888;
    padding: 0;
    border-radius: 0.3077em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--transition),
        color var(--transition);
}
.din-rp-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}
.din-rp-close svg {
    width: 0.9231em;
    height: 0.9231em;
}

.din-rp-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.2308em 1.5385em 1.8462em;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}
.din-rp-body::-webkit-scrollbar {
    width: 0.3846em;
}
.din-rp-body::-webkit-scrollbar-track {
    background: transparent;
}
.din-rp-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 0.2308em;
}

.din-rp-section {
    margin-bottom: 1.5385em;
}
.din-rp-section-title {
    font-size: 0.8462em;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: #1a1a1a;
    margin-bottom: 0.9091em;
    padding-bottom: 0.5455em;
    border-bottom: 0.0909em solid #e0e0e0;
    margin: 1em 0 2em;
}

/* ── Ergebnis-Bereich (dunklerer Hintergrund) ── */
.din-rp-results {
    background: #f0f0f0;
    margin: 0 -1.5385em;
    padding: 1.3846em 1.5385em 0.1538em;
    border-top: 0.0769em solid #ddd;
}
.din-rp-results .din-rp-section-title {
    color: #444;
    border-bottom-color: #d0d0d0;
}

/* ── Report: Editable Input Form ─── */
.din-rp-form {
    display: flex;
    flex-direction: column;
    gap: 0.6154em;
}
.din-rp-form-row {
    display: flex;
    align-items: center;
    gap: 0.6154em;
}
.din-rp-form-row-4col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0.6154em;
}
.din-rp-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.1538em;
}
.din-rp-form-label {
    font-size: 0.8462em;
    font-weight: 500;
    color: #888;
    white-space: nowrap;
    min-width: 7.2727em;
    flex-shrink: 0;
}
.din-rp-form-row-4col .din-rp-form-label {
    min-width: unset;
}
.din-rp-form-input,
.din-rp-form-select {
    flex: 1;
    -webkit-appearance: none;
    height: 2.5455em;
    padding: 0 0.7273em;
    color: #2a2a2e;
    background: #e7e7e7;
    border-radius: 0.3636em;
    font-family: var(--font-mono);
    font-size: 0.9167em;
    outline: none;
    transition:
        border-color var(--transition),
        box-shadow var(--transition);
    width: 100%;
    box-sizing: border-box;
    border: none;
}

.din-rp-form-input {
    padding: 0.75em 0.7273em;
}
.din-rp-form-input:focus,
.din-rp-form-select:focus {
    outline: none;
    border-color: #4a8fe8;
    box-shadow: 0 0 0 0.1667em rgba(74, 143, 232, 0.15);
}

/* ── Report: Collapsible sections ── */
.din-rp-collapsible {
    border: 0.0769em solid #e0e0e0;
    border-radius: 0.4615em;
    margin-bottom: 0.9231em;
    overflow: hidden;
    background: #fff;
}
.din-rp-collapsible-summary {
    display: flex;
    align-items: center;
    gap: 0.4615em;
    height: 2.7692em;
    padding: 0 0.9231em;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: #1a1a1a;
    user-select: none;
    list-style: none;
    transition: background var(--transition);
}
.din-rp-collapsible-summary::-webkit-details-marker {
    display: none;
}
.din-rp-collapsible-summary:hover {
    background: rgba(0, 0, 0, 0.03);
}

.din-rp-chevron {
    width: 0.7692em;
    height: 0.7692em;
    flex-shrink: 0;
    transition: transform 0.15s ease;
    color: #888;
}
.din-rp-collapsible[open] .din-rp-chevron {
    transform: rotate(180deg);
}

.din-rp-collapsible-body {
    padding: 0.9231em;
    border-top: 0.0769em solid #e0e0e0;
}

.din-rp-form-row.din-rp-form-row-4col {
    margin-top: 1em;
}

/* (Geometrie uses din-table layout like Bauteil-Breakdown) */

/* ── Report: Actions row (Recalc + Downloads) ───── */
.din-rp-actions {
    display: flex;
    gap: 0.4615em;
    align-items: stretch;
}
.din-rp-recalc-btn,
.din-rp-dl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4615em;
    height: 3.0615em;
    border-radius: 0.4615em;
    font-family: var(--font-sans);
    font-size: 0.8462em;
    font-weight: 600;
    cursor: pointer;
    transition:
        background var(--transition),
        border-color var(--transition);
    white-space: nowrap;
    box-sizing: border-box;
}
.din-rp-recalc-btn {
    flex: 1;
    background: #333;
    color: #fff;
    border: none;
    padding: 0 0.7692em;
}
.din-rp-recalc-btn svg {
    stroke: #fff;
}
.din-rp-recalc-btn:hover {
    background: #111;
}
.din-rp-dl-btn {
    padding: 0 0.7692em;
    background: #f0f0f0;
    color: #444;
    border: 0.0769em solid #d0d0d0;
}
.din-rp-dl-btn:hover {
    background: #e4e4e4;
    border-color: #bbb;
}

.din-rp-download-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    font-size: 0.9231em;
    color: #4a8fe8;
    text-decoration: none;
    cursor: pointer;
}
.din-rp-download-link:hover {
    text-decoration: underline;
}

/* ── 2b. PDF-VIEWER PANEL (right side) ──────────────────────── */
.din-pdf {
    position: fixed;
    left: 32.23077em;
    top: 0;
    bottom: 0;
    width: 55em;
    background: #f8f8f8;
    color: #1a1a1a;
    font-family: var(--font-sans);
    font-size: 0.8125em;
    z-index: 10499;
    display: flex;
    flex-direction: column;
    box-shadow: 0.3077em 0 1.8462em rgba(0, 0, 0, 0.12);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.din-pdf-open {
    transform: translateX(0);
}
.din-pdf-closed {
    transform: translateX(-300%);
}

.din-pdf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.3846em 1.5385em;
    border-bottom: 0.0769em solid #e0e0e0;
    flex-shrink: 0;
}
.din-pdf-header-text {
    display: flex;
    flex-direction: column;
    gap: 0.1538em;
    min-width: 0;
}
.din-pdf-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.01em;
}
.din-pdf-subtitle {
    font-size: 0.8em;
    color: #888;
    font-weight: 400;
}
.din-pdf-close {
    width: 2.1538em;
    height: 2.1538em;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #888;
    padding: 0;
    border-radius: 0.3077em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--transition),
        color var(--transition);
}
.din-pdf-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}
.din-pdf-close svg {
    width: 0.9231em;
    height: 0.9231em;
}

.din-pdf-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
    background: #eee;
}
.din-pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.din-pdf-resize {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    bottom: 0;
    cursor: ew-resize;
    background: transparent;
    z-index: 1;
    transition: background 0.15s;
}
.din-pdf-resize:hover,
.din-pdf-resize.active {
    background: hsl(221 83% 63% / 0.4);
}

/* ── 3. CHAT WINDOW (centered, draggable) ───────────────────── */
.din-cw {
    position: fixed;
    bottom: 15%;
    right: 15%;
    width: 35.3333em;
    height: 40em;
    min-height: 25em;
    z-index: 10600;
    background: hsl(var(--card) / 0.94);
    backdrop-filter: blur(0.8333em);
    -webkit-backdrop-filter: blur(0.8333em);
    border: 0.0833em solid hsl(var(--border));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-family: var(--font-sans);
    font-size: 0.75em;
    color: #ebebeb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}
.din-cw-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.din-cw-closed {
    opacity: 0;
    transform: translateY(1.6667em);
    pointer-events: none;
}
.din-cw-minimized {
    height: auto !important;
    min-height: unset !important;
    top: auto !important;
    bottom: 1.3333em !important;
    right: 25.8333em !important;
    left: auto !important;
    transform: none !important;
    width: 21.6667em;
}
.din-cw-minimized .din-cw-body {
    display: none;
}

.din-cw-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9154em 1.25em;
    border-bottom: 0.0769em solid hsl(var(--border));
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
    background: hsl(var(--card-elevated));
}
.din-cw-titlebar:active {
    cursor: grabbing;
}

.din-cw-title {
    font-size: 1.25em;
    font-weight: 600;
    color: #ebebeb;
}
.din-cw-buttons {
    display: flex;
    gap: 0.3333em;
}
.din-cw-minimize,
.din-cw-close {
    width: 1.8333em;
    height: 1.8333em;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #898994;
    padding: 0;
    border-radius: 0.3333em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--transition),
        color var(--transition);
}
.din-cw-minimize:hover,
.din-cw-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ebebeb;
}
.din-cw-minimize svg,
.din-cw-close svg {
    width: 0.8333em;
    height: 0.8333em;
}

.din-cw-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.din-cw-body #din-chat-mount {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── SHARED: Bauteil/Layer styles (used in report panel) ────── */
.din-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5em;
    margin-bottom: 0.5em;
}
.din-field {
    display: flex;
    flex-direction: column;
    gap: 0.2308em;
}

.din-label {
    font-size: 0.7692em;
    font-weight: 400;
    color: #898994;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.din-input,
.din-select {
    height: 2.1538em;
    padding: 0 0.6154em;
    background: #27272a;
    border: 0.0769em solid #2f2f32;
    border-radius: 0.3077em;
    color: #ebebeb;
    font-family: var(--font-mono);
    font-size: 0.8462em;
    outline: none;
    transition:
        border-color var(--transition),
        box-shadow var(--transition);
    width: 100%;
    box-sizing: border-box;
}
.din-select {
    font-family: var(--font-sans);
    font-size: 0.8462em;
}
.din-input:focus,
.din-select:focus {
    border-color: hsl(var(--ring));
    box-shadow:
        0 0 0 0.1538em rgba(24, 24, 27, 1),
        0 0 0 0.3077em hsl(var(--ring) / 0.3);
}

/* Report panel overrides for shared form elements */
.din-rp .din-input,
.din-rp .din-select {
    background: #fff;
    border-color: #ddd;
    color: #1a1a1a;
}
.din-rp .din-input:focus,
.din-rp .din-select:focus {
    border-color: #4a8fe8;
    box-shadow:
        0 0 0 0.1538em #f8f8f8,
        0 0 0 0.3077em rgba(74, 143, 232, 0.3);
}
.din-rp .din-label {
    color: #666;
}

/* ── Bauteil-Accordion ───────────── */
.din-bauteil {
    border: 0.0769em solid #2f2f32;
    border-radius: 0.3077em;
    margin-bottom: 0.3846em;
    background: rgba(11, 11, 14, 0.5);
    overflow: hidden;
}
.din-rp .din-bauteil {
    border-color: #e0e0e0;
    background: #fff;
}

.din-bauteil-summary {
    display: flex;
    align-items: center;
    gap: 0.5em;
    height: 2.5em;
    padding: 0 0.8333em;
    cursor: pointer;
    font-size: 0.9231em;
    font-weight: 400;
    color: #afafb6;
    user-select: none;
    list-style: none;
    transition: background var(--transition);
}
.din-bauteil-summary::-webkit-details-marker {
    display: none;
}
.din-bauteil-summary:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #ebebeb;
}
.din-bauteil[open] > .din-bauteil-summary {
    color: #ebebeb;
}

.din-rp .din-bauteil-summary {
    color: #555;
}
.din-rp .din-bauteil-summary:hover {
    background: rgba(0, 0, 0, 0.03);
    color: #1a1a1a;
}
.din-rp .din-bauteil[open] > .din-bauteil-summary {
    color: #1a1a1a;
}

.din-chevron {
    width: 0.7692em;
    height: 0.7692em;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.din-bauteil[open] .din-chevron {
    transform: rotate(180deg);
}

.din-bauteil-body {
    padding: 0.7692em 0.7692em 0.9231em;
    border-top: 0.0769em solid #2f2f32;
    background: rgba(24, 24, 27, 0.6);
}
.din-rp .din-bauteil-body {
    border-top-color: #e0e0e0;
    background: #fafafa;
}

/* ── Layer-Rows ──────────────────── */
.din-layers-label {
    font-size: 0.7692em;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #898994;
    margin: 0.6154em 0 0.4615em;
}
.din-rp .din-layers-label {
    color: #666;
}

.din-layer-row {
    display: grid;
    grid-template-columns: 1fr 6.1538em 1.6923em;
    gap: 0.3846em;
    align-items: center;
    margin-bottom: 0.3077em;
}

.din-remove-layer {
    width: 1.375em;
    height: 1.375em;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #898994;
    padding: 0.25em;
    border-radius: 0.25em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--transition),
        color var(--transition);
}
.din-remove-layer:hover {
    background: rgba(230, 50, 50, 0.15);
    color: #e63232;
}
.din-remove-layer svg {
    width: 0.625em;
    height: 0.625em;
}

.din-add-layer {
    margin-top: 0.4615em;
    padding: 0.3846em 0.7692em;
    border: 0.0769em dashed #2f2f32;
    background: transparent;
    border-radius: 0.3077em;
    color: #898994;
    font-size: 0.8462em;
    cursor: pointer;
    width: 100%;
    transition:
        border-color var(--transition),
        color var(--transition),
        background var(--transition);
}
.din-add-layer:hover {
    border-color: rgba(74, 143, 232, 0.5);
    color: #4a8fe8;
    background: rgba(74, 143, 232, 0.05);
}
.din-rp .din-add-layer {
    border-color: #ccc;
    color: #888;
}
.din-rp .din-add-layer:hover {
    border-color: #4a8fe8;
    color: #4a8fe8;
    background: rgba(74, 143, 232, 0.05);
}

/* ── SHARED: KPI-Kacheln ─────────── */
.din-kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4615em;
    margin-bottom: 0.3077em;
}
.din-kpi {
    border-radius: 0.4615em;
    padding: 0.7692em 0.7692em 0.6154em;
    border: 0.0769em solid;
    height: 4.1538em;
    box-sizing: border-box;
}
.din-kpi-val {
    font-size: 1.3846em;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1.1;
}
.din-kpi-label {
    font-size: 0.6923em;
    font-weight: 400;
    color: #898994;
    margin-top: 0.3333em;
    letter-spacing: 0.03em;
}

.din-kpi-speicher {
    background: #303136;
}
.din-kpi-speicher .din-kpi-val {
    color: #70db97;
}

.din-kpi-rest {
    background: #303136;
}
.din-kpi-rest .din-kpi-val {
    color: #85b3e0;
}

.din-kpi-verrot {
    background: #303136;
}
.din-kpi-verrot .din-kpi-val {
    color: #edb25e;
}

.din-kpi-neubau {
    background: #303136;
}
.din-kpi-neubau .din-kpi-val {
    color: #db7070;
}

/* ── SHARED: Breakdown-Tabelle ───── */
.din-table-wrap {
    overflow-x: auto;
}
.din-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9231em;
}
.din-table th {
    font-size: 0.7692em;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #898994;
    height: 1.8462em;
    padding: 0 0.4615em;
    text-align: right;
    border-bottom: 0.0769em solid #2f2f32;
}

.din-table th:first-child {
    text-align: left;
}

.din-table td {
    height: 2.1538em;
    padding: 0 0.4615em;
    border-bottom: 0.0769em solid rgba(47, 47, 50, 0.5);
    color: #afafb6;
}
.din-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}
.din-table td.din-num {
    font-family: var(--font-sans);
    text-align: right;
    color: #ebebeb;
}

/* Report panel table overrides */
.din-rp .din-table th {
    color: #666;
    border-bottom-color: #ddd;
    padding-bottom: 0.25em;
}
.din-rp .din-table td {
    color: #444;
    border-bottom-color: #eee;
}
.din-rp .din-table tbody tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}
.din-rp .din-table td.din-num {
    color: #1a1a1a;
}

/* ── SHARED: Fehler / Loading ────── */
.din-error {
    background: rgba(230, 50, 50, 0.12);
    border: 0.0769em solid rgba(230, 50, 50, 0.35);
    color: #db7070;
    border-radius: 0.3077em;
    padding: 0.6154em 0.7692em;
    font-size: 0.8462em;
    margin-top: 0.6154em;
}
.din-loading {
    display: flex;
    align-items: center;
    gap: 0.6154em;
    color: #898994;
    font-size: 0.9231em;
    padding: 0.9231em 0;
}
@keyframes din-spin {
    to {
        transform: rotate(360deg);
    }
}
.din-spin {
    animation: din-spin 0.9s linear infinite;
}

/* ── Messwerkzeug-Toolbar ────────────────────────────────────────────────── */
#measure-toolbar {
    position: absolute;
    bottom: 2.25em; /* knapp über dem Status-Bar */
    left: 0.75em;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.25em;
    background: hsl(var(--card) / 0.92);
    backdrop-filter: blur(0.5em);
    -webkit-backdrop-filter: blur(0.5em);
    border: 0.0625em solid hsl(var(--border));
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 0.25em 0.375em;
    pointer-events: auto;
}

.measure-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4348em;
    height: 2.4348em;
    padding: 0 0.7826em 0 0.6087em;
    background: transparent;
    border: 0.087em solid transparent;
    border-radius: var(--radius-sm);
    color: hsl(var(--foreground-dim));
    font-size: 0.7188em;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    white-space: nowrap;
    transition:
        background var(--transition),
        color var(--transition),
        border-color var(--transition);
    opacity: 0.85;
}
.measure-btn:hover {
    background: hsl(var(--muted) / 0.6);
    color: hsl(var(--foreground));
    opacity: 1;
}
.measure-btn.active {
    background: hsl(var(--accent-orange) / 0.15);
    color: hsl(25 100% 68%);
    border-color: hsl(var(--accent-orange) / 0.55);
    opacity: 1;
}
.measure-btn.active:hover {
    background: hsl(var(--accent-orange) / 0.22);
}
/* Erster-Punkt-gesetzt Indikator (horizontale Messung) */
.measure-btn.measure-btn-first-pt {
    background: hsl(var(--primary) / 0.18);
    border-color: hsl(var(--primary) / 0.55);
    color: hsl(var(--primary));
    opacity: 1;
}

/* Löschen-Schaltfläche – nur Icon, keine Text */
.measure-btn-clear {
    padding: 0 0.6087em;
    color: hsl(var(--muted-fg));
}
.measure-btn-clear:hover {
    color: hsl(var(--destructive));
    background: hsl(var(--destructive) / 0.1);
}

.measure-divider {
    width: 0.0625em;
    height: 1.125em;
    background: hsl(var(--border));
    margin: 0 0.125em;
    flex-shrink: 0;
}

/* ── Mess-Labels (3D-Beschriftungen) ───────────────────────────────────── */
.measure-label {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: auto;
    z-index: 10002;
    font-family: var(--font-mono);
    font-size: 0.6875em;
    font-weight: 600;
    white-space: nowrap;
    padding: 0.1818em 0.6364em;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    line-height: 1.5;
    letter-spacing: 0.02em;
    transition: opacity 0.12s ease;
}

/* Höhenkote – orange */
.measure-label-elev {
    background: hsl(25 100% 12% / 0.88);
    color: hsl(25 100% 72%);
    border: 0.0909em solid hsl(var(--accent-orange) / 0.45);
}

/* Horizontale Messung – blau */
.measure-label-horiz {
    background: hsl(221 50% 12% / 0.88);
    color: hsl(221 83% 78%);
    border: 0.0909em solid hsl(var(--primary) / 0.45);
}

/* Vertikale Messung (Höhe) – grün */
.measure-label-vert {
    background: hsl(142 60% 8% / 0.88);
    color: hsl(142 70% 65%);
    border: 0.0909em solid hsl(142 70% 45% / 0.45);
}

/* Freie Messung (3D) – lila */
.measure-label-free {
    background: hsl(270 50% 12% / 0.88);
    color: hsl(270 80% 75%);
    border: 0.0909em solid hsl(270 80% 60% / 0.45);
}

/* Horizontale Fläche – cyan/teal */
.measure-label-area-h {
    background: hsl(180 50% 10% / 0.88);
    color: hsl(180 80% 65%);
    border: 0.0909em solid hsl(180 70% 45% / 0.45);
}

/* Vertikale Fläche (3D) – gold/gelb */
.measure-label-area-v {
    background: hsl(45 60% 10% / 0.88);
    color: hsl(45 90% 65%);
    border: 0.0909em solid hsl(45 80% 50% / 0.45);
}

/* ═══════════════════════════════════════════════════════════════
   NEW UI v2 – Screenshot-Style (light gray inactive / black active)
   ═══════════════════════════════════════════════════════════════ */

/* ── App Header ─────────────────────────────────────────────── */
#app-header {
    position: absolute;
    top: 1.25em;
    left: 1.25em;
    z-index: 10500;
    display: flex;
    align-items: center;
    gap: 0.75em;
    pointer-events: auto;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#btn-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5em;
    height: 1.5em;
    background: transparent;
    border: none;
    padding: 0;
    color: #111;
    cursor: pointer;
    border-radius: 0.25em;
    transition: color 0.12s ease;
    flex-shrink: 0;
}
#btn-hamburger:hover {
    color: #555;
}

#app-title {
    font-family: var(--font-sans);
    font-size: 0.9375em;
    font-weight: 600;
    color: #111;
    letter-spacing: -0.015em;
    white-space: nowrap;
    line-height: 1;
}

#loading-indicator {
    position: absolute;
    top: 4.6667em;
    left: 2em;
    z-index: 10500;
    display: flex;
    align-items: center;
    gap: 0.6667em;
    font-family: var(--font-sans);
    font-size: 0.75em;
    color: #666;
    pointer-events: none;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#loading-indicator.hidden {
    display: none;
}
@keyframes ui-spin {
    to {
        transform: rotate(360deg);
    }
}
.loading-spin {
    animation: ui-spin 0.9s linear infinite;
    color: #999;
}

/* ── Bottom Dock wrapper ────────────────────────────────────── */
#bottom-dock {
    position: absolute;
    bottom: 1.5em;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10400;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
    pointer-events: auto;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Main dock pill ─────────────────────────────────────────── */
#dock-pill {
    display: flex;
    align-items: center;
    background: red;
    border-radius: var(--radius-lg);
    padding: 0.25em;
    gap: 0.125em;
    box-shadow: 0 0.0625em 0.5em rgba(0, 0, 0, 0.08);
}

/* view tabs */
#view-tabs {
    display: flex;
    align-items: center;
    gap: 0.125em;
}

.view-tab {
    height: 2.6667em;
    padding: 0 1.6185em; /* ~21.8px — Figma spec */
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    color: #999;
    font-family: var(--font-sans);
    font-size: 0.8438em;
    font-weight: 400; /* Regular — Figma spec */
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
    white-space: nowrap;
    letter-spacing: -0.01em;
}
.view-tab:hover {
    color: #666;
}
.view-tab.active {
    background: #333;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0.0741em 0.2963em rgba(0, 0, 0, 0.18); /* 0 1px 4px — corrected for own fs=13.5 */
}

/* separator between tabs and grid icon */
.dock-sep {
    width: 0.0625em;
    height: 1.125em;
    background: rgba(0, 0, 0, 0.1);
    margin: 0 0.1875em 0 0.25em; /* left: 4px, right: 3px — Figma: 6px / 5px total incl. gap */
    flex-shrink: 0;
}

/* Grid / toolbox toggle button */
.dock-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3em; /* 38px — Figma spec */
    height: 3em; /* 36px — same as tab height */
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: #aaa;
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease;
    flex-shrink: 0;
}
.dock-icon-btn:hover {
    color: #666;
}
.dock-icon-btn.active {
    background: #333;
    color: #fff;
}

/* ── Toolbox panel (expands above dock) ─────────────────────── */
#toolbox-panel {
    display: flex;
    align-items: flex-end;
    gap: 0.5em;
    /* animation */
    overflow: hidden;
    max-height: 8em;
    opacity: 1;
    transform: translateY(0);
    transition:
        max-height 0.22s ease,
        opacity 0.18s ease,
        transform 0.18s ease;
}
#toolbox-panel.toolbox-hidden {
    max-height: 0;
    opacity: 0;
    transform: translateY(0.375em);
    pointer-events: none;
}

/* each group inside toolbox */
.tbx-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3125em; /* 5px — Figma: label ↔ pill gap */
}
.tbx-label {
    font-family: var(--font-sans);
    font-size: 0.625em; /* 10px — Figma spec */
    font-weight: 400; /* Regular — Figma spec */
    letter-spacing: 0.05em; /* 0.5px — corrected: 0.5/10=0.05 (em relative to own fs) */
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.32);
    white-space: nowrap;
    line-height: 1;
}
.tbx-pills {
    display: flex;
    align-items: center;
    gap: 0;
    background: #e8e8e8;
    border-radius: var(--radius-md);
    padding: 0.1875em; /* 3px — Figma spec */
    box-shadow: 0 0.0625em 0.375em rgba(0, 0, 0, 0.07);
}
.tbx-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125em; /* 2px — Figma: icon ↔ label spacing */
    width: 2.75em; /* 44px — Figma spec */
    height: 2.625em; /* 42px — Figma spec */
    background: transparent;
    border: none;
    border-radius: 0.5625em; /* 9px */
    color: #999;
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}
.tbx-btn span {
    font-family: var(--font-sans);
    font-size: 0.5625em; /* 9px — Figma spec */
    font-weight: 400; /* Regular — Figma spec */
    letter-spacing: 0.01em; /* tracking-[0.09px] / 9px */
    line-height: 1;
    white-space: nowrap;
}
.tbx-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #555;
}
/* active measure tool — filled dark */
.tbx-btn.active {
    background: #333;
    color: #fff;
}
.tbx-btn.active:hover {
    background: #444;
}
/* first-point set (horizontal) — subtle blue accent */
.tbx-btn.measure-btn-first-pt {
    background: #3b82f6;
    color: #fff;
}
/* danger (clear/trash) */
.tbx-btn-danger:hover {
    background: rgba(220, 50, 50, 0.12) !important;
    color: #d33 !important;
}
/* separator inside pills */
.tbx-sep {
    width: 0.0625em;
    height: 1.125em;
    background: rgba(0, 0, 0, 0.1);
    margin: 0 0.125em;
    flex-shrink: 0;
}

/* ── Hide old/superseded elements ───────────────────────────── */
#measure-toolbar {
    display: none !important;
}
#tools-dock {
    display: none !important;
}

/* ── Status bar: minimal, semi-transparent on white bg ──────── */

#status-bar:hover {
    opacity: 1;
}
#status-bar .sb-label,
#status-bar .sb-axis {
    color: #555;
}
#status-bar .sb-val {
    color: #666;
}
#status-bar .sb-divider {
    background: rgba(0, 0, 0, 0.08);
}

/* ── Cloud-Menu (Hamburger Dropdown) ────────────────────────── */
#cloud-menu {
    position: absolute;
    top: 3.25em;
    left: 1.25em;
    z-index: 10600;
    display: flex;
    flex-direction: column;
    min-width: 11.25em;
    background: #f3f3f3;
    border: 0.0625em solid rgba(0, 0, 0, 0.08);
    border-radius: 0.75em;
    padding: 0.25em;
    box-shadow:
        0 0.25em 1.25em rgba(0, 0, 0, 0.12),
        0 0.0625em 0.25em rgba(0, 0, 0, 0.06);
    animation: cloud-menu-in 0.12s ease;
}

@keyframes cloud-menu-in {
    from {
        opacity: 0;
        transform: translateY(-0.25em);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cloud-menu-item {
    display: block;
    width: 100%;
    padding: 0.6923em 1.0769em;
    background: transparent;
    border: none;
    border-radius: 0.6154em;
    text-align: left;
    font-family: var(--font-sans);
    font-size: 0.8125em;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition:
        background 0.12s ease,
        color 0.12s ease;
}
.cloud-menu-item:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #222;
}
.cloud-menu-item.active {
    background: #333;
    color: #fff;
    font-weight: 600;
}
.cloud-menu-item.active:hover {
    background: #444;
}

/* ── CO₂ Button (top-right, standalone) ─────────────────────── */
.top-action-btn {
    position: absolute;
    top: 1.6667em;
    right: 1.6667em;
    z-index: 10500;
    display: flex;
    align-items: center;
    gap: 0.6667em;
    height: 2.8333em;
    padding: 0 1.1667em 0 0.8333em;
    background: #e8e8e8;
    border: 0.0833em solid rgba(0, 0, 0, 0.06);
    border-radius: 0.8333em;
    color: #666;
    font-family: var(--font-sans);
    font-size: 0.75em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 0.0833em 0.6667em rgba(0, 0, 0, 0.07);
    transition:
        background 0.15s ease,
        color 0.15s ease;
    pointer-events: auto;
}
.top-action-btn:hover {
    background: #ddd;
    color: #333;
}
.top-action-btn:active {
    background: #ccc;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DIN-CHATBOT  (.dc-*)
   ═══════════════════════════════════════════════════════════════════════════ */

.din-chat-section {
    margin-top: 1.8462em;
    padding-top: 1.8462em;
    border-top: 0.0769em solid #2f2f32;
}
/* When chatbot is inside the chat window, remove borders/margins */
.din-cw .dc-wrap {
    border: none;
    border-radius: 0;
    background: transparent;
}
.din-cw .dc-hdr {
    display: none;
} /* titlebar is in the window itself */

.dc-wrap {
    font-size: 0.75em;
    background: #131720;
    border: 0.0833em solid #242940;
    border-radius: 0.6667em;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Header — einzeilig, kompakt */
.dc-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6667em 1em;
    background: #0d1020;
    border-bottom: 0.0833em solid #242940;
    flex-shrink: 0;
}
.dc-title {
    font-size: 0.9167em;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffffff;
}
.dc-session-dot {
    width: 0.5em;
    height: 0.5em;
    border-radius: 50%;
    background: #34c78a;
    box-shadow: 0 0 0.4167em #34c78a;
    animation: dc-pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

/* Nachrichten */
.dc-msgs {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.8333em 0.8333em 0.3333em;
    display: flex;
    flex-direction: column;
    gap: 0.6667em;
    scrollbar-width: thin;
    scrollbar-color: #242940 transparent;
}
.dc-row {
    display: flex;
}
.dc-u-row {
    justify-content: flex-end;
}
.dc-b-row {
    justify-content: flex-start;
}

.dc-bubble {
    max-width: 100%;
    padding: 0.5833em 0.8333em;
    display: flex;
    flex-direction: column;
    gap: 0.3333em;
    animation: dc-msg-in 0.18s ease-out;
}
.dc-u-bub {
    background: #364b60;
    border: 0.0833em solid #2a4060;
    border-radius: 0.8333em 0.8333em 0.1667em 0.8333em;
}
.dc-b-bub {
    background: #303136;
    border: none;
    border-radius: 0.8333em 0.8333em 0.8333em 0.1667em;
}
.dc-btext {
    font-size: 1.35em;
    line-height: 1.4;
    color: #e8eaf0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Formular-Trigger */
.dc-form-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.4em 0.9em;
    background: rgba(212, 146, 42, 0.1);
    border: 0.1em solid rgba(212, 146, 42, 0.22);
    border-radius: 0.5em;
    color: #d4922a;
    font-size: 0.8333em;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
    align-self: flex-start;
    font-family: var(--font-sans);
}
.dc-form-btn:hover {
    background: rgba(212, 146, 42, 0.2);
}

/* Follow-Up Question Buttons */
.dc-followups {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75em;
    margin-top: 1.5em;
    margin-bottom: 1em;
}
.dc-followup-btn {
    display: inline-block;
    padding: 0.381em 0.9524em;
    background: rgba(74, 143, 232, 0.1);
    border: none;
    border-radius: 1.1429em;
    color: #85b3e0;
    font-size: 1.35em;
    font-weight: 500;
    cursor: pointer;
    transition:
        background var(--transition),
        border-color var(--transition);
    font-family: var(--font-sans);
    text-align: left;
    line-height: 1.35;
}
.dc-followup-btn:hover {
    background: rgba(74, 143, 232, 0.2);
    border-color: rgba(74, 143, 232, 0.45);
}

/* Topic-Chips (initiale Themenauswahl) */
.dc-topics {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    margin-top: 1.25em;
}
.dc-topic-btn {
    display: block;
    width: 100%;
    padding: 0.55em 1em;
    background: hsl(var(--card-elevated));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    color: hsl(var(--foreground));
    font-size: 1.25em;
    font-weight: 500;
    cursor: pointer;
    transition:
        background var(--transition),
        border-color var(--transition);
    font-family: var(--font-sans);
    text-align: left;
    line-height: 1.35;
}
.dc-topic-btn:hover {
    background: hsl(var(--primary) / 0.12);
    border-color: hsl(var(--primary) / 0.45);
    color: hsl(var(--primary));
}

/* Bullet-Liste in Bot-Antworten */
.dc-bullets {
    margin: 0.75em 0 0.25em 0;
    padding-left: 1.4em;
    display: flex;
    flex-direction: column;
    gap: 0.35em;
}
.dc-bullets li {
    font-size: inherit;
    line-height: 1.45;
    color: hsl(var(--foreground-dim));
}

/* Follow-Up Sentence */
.dc-follow-sentence {
    margin: 0.85em 0 0 0;
    font-style: italic;
    color: hsl(var(--muted-fg));
    font-size: inherit;
    line-height: 1.45;
}

/* Typing-Dots */
.dc-typing {
    flex-direction: row !important;
    gap: 0.4167em !important;
    padding: 0.8333em 1em !important;
    align-items: center;
}
.dc-tdot {
    width: 0.4167em;
    height: 0.4167em;
    border-radius: 50%;
    background: #d4922a;
    display: inline-block;
    animation: dc-dot-bounce 1.2s ease-in-out infinite;
}

/* Footer / Input */
.dc-ftr {
    border-top: 0.0833em solid #242940;
    padding: 0.6667em 0.8333em;
    flex-shrink: 0;
    background: #131720;
}
.dc-input-row {
    display: flex;
    gap: 0.5833em;
    align-items: flex-end;
}
.dc-textarea {
    flex: 1;
    background: #0f1117;
    border: none;
    border-radius: 0.5em;
    color: #e8eaf0;
    font-family: var(--font-sans);
    font-size: 1.35em;
    line-height: 1.5;
    padding: 0.5833em 0.75em;
    resize: none;
    outline: none;
    transition:
        border-color var(--transition),
        box-shadow var(--transition);
    min-height: 3em;
}
.dc-textarea:focus {
    box-shadow: 0 0 0 0.1667em rgba(212, 146, 42, 0.12);
}
.dc-textarea::placeholder {
    color: #92949b;
}
.dc-textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dc-send-btn {
    width: 3em;
    height: 3em;
    border-radius: 0.5em;
    background: #e8e8e8;
    border: none;
    color: #0c0e14;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        background var(--transition),
        transform 0.1s;
    flex-shrink: 0;
}
.dc-send-btn:hover:not(.dc-send-dis) {
    background: #e8e8e8;
    transform: scale(1.05);
}
.dc-send-dis {
    background: rgba(212, 146, 42, 0.15) !important;
    color: #7b82a0 !important;
    cursor: not-allowed !important;
}

/* Spinner */
.dc-spin {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 0.1667em solid rgba(12, 14, 20, 0.3);
    border-top-color: #0c0e14;
    border-radius: 50%;
    animation: dc-spin-anim 0.7s linear infinite;
}

/* Animationen */
@keyframes dc-msg-in {
    from {
        opacity: 0;
        transform: translateY(0.25em);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@keyframes dc-dot-bounce {
    0%,
    80%,
    100% {
        transform: scale(0.7);
        opacity: 0.4;
    }
    40% {
        transform: scale(1.1);
        opacity: 1;
    }
}
@keyframes dc-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.35;
    }
}
@keyframes dc-spin-anim {
    to {
        transform: rotate(360deg);
    }
}

/* ── Agent in Content Panel ────────────────────────────────── */
/* dc-wrap base is 0.75em (=12px at 16px root). All sizes below
   are relative to that 12px base and match Reports / Notes panels:
     Panel title:      0.75em  = 12px  → dc-wrap 1em
     Panel meta/date:  0.625em = 10px  → dc-wrap 0.8333em
     Sort chips:       0.6875em= 11px  → dc-wrap 0.9167em
     Tiny tag:         0.5625em=  9px  → dc-wrap 0.75em              */

#agent-panel-mount .dc-wrap {
    background: #ffffff;
    border: none;
    border-radius: 0;
    font-family: var(--font-sans);
}

/* Header — same as panel sub-headers (padding 0.625em 0.875em at 16px root) */
#agent-panel-mount .dc-hdr {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.8333em 1.1667em;       /* 10/12, 14/12 */
}
#agent-panel-mount .dc-title {
    color: #111827;
    font-size: 0.9167em;              /* 11px — matches sort-chip size */
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}
#agent-panel-mount .dc-doc-badge {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    font-size: 0.8333em;              /* 10px — matches meta */
    border-radius: 3px;
    padding: 1px 6px;
}
#agent-panel-mount .dc-session-dot {
    background: #10b981;
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.4);
}

/* Messages area — same horizontal padding as list rows (0.875em at 16px = 1.1667em at 12px) */
#agent-panel-mount .dc-msgs {
    padding: 1em 1.1667em 0.5em;
    gap: 0.6667em;
    scrollbar-color: #d1d5db transparent;
}

/* Bubbles */
#agent-panel-mount .dc-bubble {
    padding: 0.5833em 0.75em;
    gap: 0.25em;
}
#agent-panel-mount .dc-b-bub {
    background: #f3f4f6;
    border: none;
    border-radius: 6px 6px 6px 2px;
    color: #111827;
}
#agent-panel-mount .dc-u-bub {
    background: #111827;
    border: none;
    border-radius: 6px 6px 2px 6px;
    color: #ffffff;
}

/* Text — 1em = 12px, same as panel list titles (0.75em at 16px root) */
#agent-panel-mount .dc-btext {
    color: inherit;
    font-size: 1em;                   /* 12px */
    line-height: 1.5;
}
#agent-panel-mount .dc-btime {
    color: #9ca3af;
    font-size: 0.8333em;              /* 10px — matches meta */
}

/* Bullets & follow-up sentence */
#agent-panel-mount .dc-bullets {
    color: #374151;
    font-size: 1em;                   /* 12px */
}
#agent-panel-mount .dc-bullets li {
    color: #374151;
}
#agent-panel-mount .dc-follow-sentence {
    color: #6b7280;
    font-size: 1em;                   /* 12px */
}

/* Follow-up buttons — pill/chip style matching sort chips */
#agent-panel-mount .dc-followups {
    gap: 0.4167em;
    margin-top: 0.6667em;
    margin-bottom: 0.3333em;
}
#agent-panel-mount .dc-followup-btn {
    background: #ffffff;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.9167em;              /* 11px — matches sort chips */
    padding: 2px 8px;
    font-family: var(--font-sans);
}
#agent-panel-mount .dc-followup-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
}

/* Document picker — matching list row style */
#agent-panel-mount .dc-topics {
    gap: 0.25em;
    margin-top: 0.6667em;
}
#agent-panel-mount .dc-topic-btn {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    color: #111827;
    font-size: 1em;                   /* 12px — same as list titles */
    padding: 6px 10px;
    font-family: var(--font-sans);
}
#agent-panel-mount .dc-topic-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
}

/* Footer / Input — same padding as panel sections */
#agent-panel-mount .dc-ftr {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 0.6667em 1.1667em;       /* 8/12, 14/12 */
}
#agent-panel-mount .dc-input-row {
    gap: 0.4167em;
}
#agent-panel-mount .dc-textarea {
    background: #f5f5f7;
    color: #111827;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 1em;                   /* 12px — matches panel inputs */
    padding: 5px 8px;
    min-height: 2.5em;
    line-height: 1.5;
    font-family: var(--font-sans);
}
#agent-panel-mount .dc-textarea:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
    border-color: #3b82f6;
}
#agent-panel-mount .dc-textarea::placeholder {
    color: #9ca3af;
}
#agent-panel-mount .dc-textarea:disabled {
    background: #f9fafb;
    opacity: 0.6;
}

/* Send button */
#agent-panel-mount .dc-send-btn {
    background: #111827;
    color: #ffffff;
    border-radius: 4px;
    width: 2.5em;
    height: 2.5em;
}
#agent-panel-mount .dc-send-btn:hover:not(.dc-send-dis) {
    background: #1f2937;
}
#agent-panel-mount .dc-send-dis {
    background: #f3f4f6 !important;
    color: #9ca3af !important;
}

/* Typing indicator */
#agent-panel-mount .dc-typing {
    padding: 0.5833em 0.75em !important;
}
#agent-panel-mount .dc-tdot {
    background: #9ca3af;
}

/* Spinner */
#agent-panel-mount .dc-spin {
    border-color: rgba(17, 24, 39, 0.15);
    border-top-color: #111827;
}

/* Form trigger button */
#agent-panel-mount .dc-form-btn {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.22);
    color: #2563eb;
    font-size: 0.9167em;              /* 11px */
    border-radius: 4px;
}
#agent-panel-mount .dc-form-btn:hover {
    background: rgba(59, 130, 246, 0.14);
}

/* ══════════════════════════════════════════════════════════════
   Ökobilanz FAB (bottom-right)
   ══════════════════════════════════════════════════════════════ */
/* ── Clip-Box Face Editor ──────────────────────────────────── */

/* Maß-Label während Drag (bottom-center des Canvas) */
.cbe-dim-label {
    display: none; /* Nicht mehr sichtbar – Anzeige läuft über #sb-camera */
}

/* Drag-Info-Span: im Normalzustand versteckt */
#sb-camera .sb-drag-info {
    display: none;
}

/* Status-Bar: Drag-Modus — sb-camera wird dunkel, Kamera-XYZ ausgeblendet */
#sb-camera.sb-camera--drag {
    background: hsl(var(--card) / 0.97) !important;
    border: 1px solid hsl(var(--border)) !important;
    box-shadow: var(--shadow-sm) !important;
}
/* Kamera-Werte ausblenden, Drag-Info einblenden */
#sb-camera.sb-camera--drag > :not(.sb-drag-info) {
    display: none !important;
}
#sb-camera.sb-camera--drag .sb-drag-info {
    display: contents;
}
#sb-camera.sb-camera--drag #sb-drag-val {
    color: hsl(var(--foreground)) !important;
    font-weight: 400;
    min-width: 5em;
}

.oeko-fab {
    position: fixed;
    bottom: 2.3333em;
    right: 1.3333em;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.6667em;
    padding: 0 1.1667em;
    background: #e8e8e8;
    border: none;
    border-radius: var(--radius-lg);
    color: #666;
    font-family: var(--font-sans);
    font-size: 0.75em;
    font-weight: 500;
    cursor: pointer;
    transition:
        background var(--transition),
        color var(--transition),
        border-color var(--transition);
}
.oeko-fab:hover {
    background: #dcdcdc;
    color: #444;
}

/* ── Element-Inspektor ───────────────────────────────────────────────────────
   Aktiv via body.inspect-mode (Toggle: Taste "?")
   ─────────────────────────────────────────────────────────────────────────── */

/* CI-Blau für den Element-Inspektor */
:root {
    --inspect-ci: #4242f5;
    --inspect-ci-55: #4242f5cc; /* ~55% alpha */
    --inspect-ci-12: #4242f51f; /* ~12% alpha */
}

/* Blauer 5px-Rahmen um den gesamten Viewport */
body.inspect-mode::before {
    content: "";
    position: fixed;
    inset: 0;
    border: 5px solid var(--inspect-ci);
    z-index: 2147483647;
    pointer-events: none;
    box-sizing: border-box;
    animation: inspect-pulse 2s ease-in-out infinite;
}

@keyframes inspect-pulse {
    0%,
    100% {
        border-color: var(--inspect-ci);
    }
    50% {
        border-color: var(--inspect-ci-55);
    }
}

/* Subtiler CI-Outline auf dem aktuell gehovertem Element */
body.inspect-mode *:not(#inspect-tooltip):not(#inspect-tooltip *):hover {
    outline: 1.5px solid var(--inspect-ci-55) !important;
    outline-offset: 1px;
}

/* ── Tooltip ──────────────────────────────────────────────────── */
#inspect-tooltip {
    position: fixed;
    z-index: 2147483646;
    pointer-events: none;
    display: none;
    flex-direction: column;
    gap: 0.3em;
    min-width: 180px;
    max-width: 320px;
    background: hsl(var(--card) / 0.97);
    border: 1px solid var(--inspect-ci-55);
    border-radius: var(--radius-md);
    padding: 0.55em 0.8em;
    box-shadow:
        var(--shadow-md),
        0 0 0 1px var(--inspect-ci-12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-family: var(--font-sans);
}

#inspect-tooltip.isp-visible {
    display: flex;
}

.isp-name {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--inspect-ci);
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.isp-desc {
    font-size: 0.67rem;
    color: hsl(var(--foreground-dim));
    line-height: 1.45;
}

/* ══════════════════════════════════════════════════════════════
   DOCUMENT PANEL — din-rp style (light, left-side, full-height)
   ══════════════════════════════════════════════════════════════ */

.doc-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 32.3077em;
    z-index: 10500;
    background: #ffffff;
    color: #1a1a1a;
    font-family: var(--font-sans);
    font-size: 0.8125em;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    border-right: 1px solid #e0e0e0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.doc-panel-open {
    transform: translateX(0);
    pointer-events: auto;
}
.doc-panel-closed {
    transform: translateX(-100%);
    pointer-events: none;
}

/* ── Header ── */
.doc-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.3846em 1.5385em;
    border-bottom: 0.0769em solid #e0e0e0;
    flex-shrink: 0;
    flex-direction: column;
    gap: 1em;
}
.doc-panel-header-text {
    display: flex;
    flex-direction: row;
    gap: 0.1538em;
    min-width: 0;
    flex: 1;
}
.doc-panel-title {
    font-size: 1.23em;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.01em;
    border: none;
    background: none;
    outline: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    width: 100%;
}
.doc-panel-title::placeholder {
    color: #bbb;
}
.doc-panel-title:focus {
    color: #000;
}
.doc-panel-subtitle {
    font-size: 0.8462em;
    color: #888;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: none;
}
.doc-panel-close {
    width: 3em;
    height: 3em;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #888;
    padding: 0;
    border-radius: 0.3077em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--transition),
        color var(--transition);
    flex-shrink: 0;
    position: absolute;
    top: 1em;
    right: 1em;
}
.doc-panel-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}
.doc-panel-close svg {
    width: 40%;
    height: 40%;
}

/* ── Header buttons row ── */
.doc-panel-header-actions {
    display: flex;
    align-items: center;
    gap: 0.4615em;
    flex-shrink: 0;
    width: 100%;
}

/* ── Cursor Navigation (prev/next) ── */
.doc-panel-cursor-nav {
    display: flex;
    align-items: center;
    gap: 0.0769em;
    background: #e8e8e8;
    border-radius: var(--radius);
    padding: 0.1538em;
}
.doc-panel-cursor-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.6923em;
    height: 1.6923em;
    border: none;
    background: transparent;
    color: #666;
    border-radius: 0.2308em;
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}
.doc-panel-cursor-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1a1a1a;
}
.doc-panel-cursor-label {
    font-size: 0.7692em;
    font-weight: 600;
    color: #888;
    min-width: 1.8em;
    text-align: center;
    user-select: none;
}

/* ── Nav Highlight animation ── */
.doc-panel-nav-highlight {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 0.2308em;
    animation: doc-panel-highlight-pulse 1.2s ease-out;
}
@keyframes doc-panel-highlight-pulse {
    0% {
        outline-color: rgba(37, 99, 235, 0.9);
    }
    100% {
        outline-color: rgba(37, 99, 235, 0);
    }
}

/* ── Toolbar (editor formatting bar) ── */
.doc-panel-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1538em;
    padding: 0.4615em 0.9231em;
    border-bottom: 0.0769em solid #e0e0e0;
    background: #e8e8e8;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}
.doc-panel-toolbar-btn {
    padding: 0.2308em 0.4615em;
    min-width: 1.6923em;
    height: 1.6923em;
    border-radius: 0.3077em;
    border: 0.0769em solid transparent;
    background: transparent;
    color: #555;
    font-size: 0.9231em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
    font-family: var(--font-sans);
}
.doc-panel-toolbar-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}
.doc-panel-toolbar-btn.is-active {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1a1a1a;
}
.doc-panel-toolbar-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}
.doc-panel-toolbar-divider {
    width: 0.0769em;
    height: 1.2308em;
    background: rgba(0, 0, 0, 0.12);
    margin: 0 0.1538em;
    flex-shrink: 0;
}
.doc-panel-toolbar-select {
    padding: 0.1538em 0.3846em;
    border-radius: 0.3077em;
    border: 0.0769em solid rgba(0, 0, 0, 0.12);
    background: #fff;
    color: #555;
    font-size: 0.8462em;
    cursor: pointer;
    outline: none;
    font-family: var(--font-sans);
    height: 1.6923em;
}

/* ── Scroll-Nav hint bar ── */
.doc-panel-scroll-hint {
    padding: 0.4615em 1.2308em;
    background: rgba(74, 143, 232, 0.08);
    border-bottom: 0.0769em solid rgba(74, 143, 232, 0.15);
    font-size: 0.8077em;
    color: #2563eb;
    display: none;
    align-items: center;
    flex-shrink: 0;
}

/* ── Body (scrollable content) ── */
.doc-panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.2308em 1.5385em 1.8462em;
    background: #ffffff;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}
.doc-panel-body::-webkit-scrollbar {
    width: 0.3846em;
}
.doc-panel-body::-webkit-scrollbar-track {
    background: transparent;
}
.doc-panel-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 0.2308em;
}

/* ── Editor typography (inside body) ── */
.doc-panel-body .tiptap {
    outline: none;
}
.doc-panel-body .tiptap h1 {
    font-size: 1.6923em;
    font-weight: 800;
    margin: 1.5385em 0 0.7692em;
    color: #1a1a1a;
}
.doc-panel-body .tiptap h2 {
    font-size: 1.3077em;
    font-weight: 700;
    margin: 1.2308em 0 0.6154em;
    color: #1a1a1a;
}
.doc-panel-body .tiptap h3 {
    font-size: 1.0769em;
    font-weight: 600;
    margin: 0.9231em 0 0.4615em;
    color: #333;
}
.doc-panel-body .tiptap p {
    margin: 0 0 0.7692em;
    font-size: 1.0385em;
    line-height: 1.7;
    color: #1a1a1a;
}
.doc-panel-body .tiptap ul,
.doc-panel-body .tiptap ol {
    padding-left: 1.5385em;
    margin: 0 0 0.7692em;
}
.doc-panel-body .tiptap li {
    margin-bottom: 0.3077em;
    line-height: 1.6;
}
.doc-panel-body .tiptap blockquote {
    border-left: 0.2308em solid #ddd;
    margin: 0.7692em 0;
    padding: 0.4615em 1.0769em;
    color: #555;
    font-style: italic;
}
.doc-panel-body .tiptap pre {
    background: #f5f5f5;
    border: 0.0769em solid #e0e0e0;
    border-radius: 0.3846em;
    padding: 0.7692em 0.9231em;
    font-family: var(--font-mono);
    font-size: 0.9231em;
    overflow-x: auto;
    margin: 0.7692em 0;
}
.doc-panel-body .tiptap code {
    background: #f0f0f0;
    border-radius: 0.2308em;
    padding: 0.1154em 0.3077em;
    font-family: var(--font-mono);
    font-size: 0.9231em;
}
.doc-panel-body .tiptap img {
    max-width: 100%;
    height: auto;
    border-radius: 0.3077em;
    margin: 0.7692em 0;
}
.doc-panel-body .tiptap p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    color: #bbb;
    position: absolute;
    pointer-events: none;
    font-style: italic;
}

/* ── Annotation links inside editor ── */
.doc-panel-body [data-type="annotation-link"] {
    background: rgba(74, 143, 232, 0.1);
    border: 0.0769em solid rgba(74, 143, 232, 0.25);
    border-radius: 0.2308em;
    padding: 0.0769em 0.3846em;
    color: #2563eb;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s ease;
}
.doc-panel-body [data-type="annotation-link"]:hover {
    background: rgba(74, 143, 232, 0.18);
    border-color: rgba(74, 143, 232, 0.4);
}
.doc-panel-body [data-type="annotation-link"].is-active,
.doc-panel-body [data-type="view-snapshot"].is-active {
    outline: 0.1538em solid #3b82f6;
    outline-offset: 0.1538em;
    background: rgba(74, 143, 232, 0.14);
    border-color: rgba(74, 143, 232, 0.5);
    box-shadow: 0 0 0.6154em rgba(59, 130, 246, 0.2);
}

/* ── Linked annotations footer ── */
.doc-panel-footer {
    padding: 0.6154em 1.2308em;
    border-top: 0.0769em solid #e0e0e0;
    flex-shrink: 0;
    background: #f0f0f0;
}
.doc-panel-footer-label {
    font-size: 0.7308em;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 0.3846em;
}
.doc-panel-footer-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3077em;
}
.doc-panel-footer-chip {
    padding: 0.1538em 0.6154em;
    border-radius: 0.3077em;
    border: 0.0769em solid rgba(74, 143, 232, 0.25);
    background: rgba(74, 143, 232, 0.08);
    color: #2563eb;
    font-size: 0.7692em;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all var(--transition);
}
.doc-panel-footer-chip:hover {
    background: rgba(74, 143, 232, 0.15);
    border-color: rgba(74, 143, 232, 0.4);
}

/* ── Action buttons (din-rp style) ── */
.doc-panel-actions {
    display: flex;
    gap: 0.4615em;
    padding: 0.7692em 1.5385em;
    border-top: 0.0769em solid #e0e0e0;
    flex-shrink: 0;
    background: #f0f0f0;
}
.doc-panel-btn-primary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4615em;
    height: 2.7692em;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 0.4615em;
    font-family: var(--font-sans);
    font-size: 0.8462em;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
    white-space: nowrap;
}
.doc-panel-btn-primary:hover {
    background: #111;
}
.doc-panel-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4615em;
    height: 2.7692em;
    padding: 0.5077em 0.6154em 0.3077em 0.6154em !important;
    background: #f0f0f0;
    color: #444;
    border: 0.0769em solid #d0d0d0;
    border-radius: 0.4615em;
    font-family: var(--font-sans);
    font-size: 0.85em !important;
    font-weight: 600;
    cursor: pointer;
    transition:
        background var(--transition),
        border-color var(--transition);
    white-space: nowrap;
}
.doc-panel-btn-secondary:hover {
    background: #e4e4e4;
    border-color: #bbb;
}

/* ── Scroll-Nav toggle (in header) ── */
.doc-panel-toggle-btn {
    padding: 0.3808em 0.6154em 0.2608em 0.6154em;
    border-radius: 0.3077em;
    border: 0.0769em solid #d0d0d0;
    background: transparent;
    color: #888;
    font-size: 1.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3077em;
    transition: all var(--transition);
    font-family: var(--font-sans);
    font-weight: 500;
    white-space: nowrap;
}
.doc-panel-toggle-btn.is-active {
    background: rgba(74, 143, 232, 0.1);
    border-color: rgba(74, 143, 232, 0.3);
    color: #2563eb;
}
.doc-panel-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* ── Inline input (link/youtube) ── */
.doc-panel-inline-input {
    display: flex;
    gap: 0.3077em;
    width: 100%;
    padding: 0.3077em 0;
    margin-top: 0.1538em;
}
.doc-panel-inline-input input {
    flex: 1;
    padding: 0.3077em 0.6154em;
    border-radius: 0.3077em;
    border: 0.0769em solid rgba(74, 143, 232, 0.3);
    background: #fff;
    color: #1a1a1a;
    font-size: 0.8462em;
    outline: none;
    font-family: var(--font-sans);
}
.doc-panel-inline-input input:focus {
    border-color: #4a8fe8;
    box-shadow: 0 0 0 0.1538em rgba(74, 143, 232, 0.12);
}
.doc-panel-inline-input button {
    padding: 0.3077em 0.6154em;
    border-radius: 0.3077em;
    font-size: 0.8462em;
    cursor: pointer;
    font-family: var(--font-sans);
}
.doc-panel-inline-input .confirm-btn {
    border: 0.0769em solid rgba(74, 143, 232, 0.3);
    background: rgba(74, 143, 232, 0.1);
    color: #2563eb;
}
.doc-panel-inline-input .cancel-btn {
    border: 0.0769em solid rgba(0, 0, 0, 0.12);
    background: none;
    color: #888;
}

/* ── Annotation picker dropdown ── */
.doc-panel-annotation-picker {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    width: 21.5385em;
    background: #fff;
    border: 0.0769em solid #e0e0e0;
    border-radius: 0.4615em;
    box-shadow: 0 0.3077em 0.9231em rgba(0, 0, 0, 0.1);
    max-height: 16.9231em;
    overflow-y: auto;
    font-family: var(--font-sans);
}
.doc-panel-annotation-picker-header {
    padding: 0.6154em 0.7692em;
    font-size: 0.7692em;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #888;
    border-bottom: 0.0769em solid #e0e0e0;
}
.doc-panel-annotation-picker-item {
    padding: 0.6154em 0.7692em;
    cursor: pointer;
    font-size: 0.9231em;
    color: #1a1a1a;
    border-bottom: 0.0769em solid rgba(0, 0, 0, 0.04);
    transition: background var(--transition);
}
.doc-panel-annotation-picker-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

/* ── Document list (sidebar integration) ── */
/* ── Dokumente-Liste (px-Werte, identisch mit AnnotationList) ── */
.doc-panel-list-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.doc-panel-list-count {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6b7280;
    flex: 1;
}
.doc-panel-list-new-btn {
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid rgba(59, 130, 246, 0.22);
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}
.doc-panel-list-new-btn:hover {
    background: rgba(59, 130, 246, 0.14);
}

.doc-panel-list-item {
    display: flex;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    align-items: flex-start;
    transition: background 0.15s ease;
}
.doc-panel-list-item:hover {
    background: rgba(0, 0, 0, 0.025);
}
.doc-panel-list-item:hover .doc-panel-list-delete {
    opacity: 1;
}

.doc-panel-list-icon {
    color: #9ca3af;
    flex-shrink: 0;
    margin-top: 2px;
}
.doc-panel-list-icon svg {
    width: 14px;
    height: 14px;
}

.doc-panel-list-item-body {
    flex: 1;
    min-width: 0;
}
.doc-panel-list-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}
.doc-panel-list-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 0;
}
.doc-panel-list-item-date {
    font-size: 11px;
    color: #9ca3af;
}
.doc-panel-list-badge {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(59, 130, 246, 0.07);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.18);
}
.doc-panel-list-delete {
    padding: 2px 6px;
    border-radius: 4px;
    border: none;
    background: none;
    color: #9ca3af;
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.doc-panel-list-delete:hover {
    color: #dc2626;
}

.doc-panel-list-empty {
    padding: 24px 14px;
    text-align: center;
    color: #6b7280;
    font-size: 12px;
}

/* ── New doc form (inline) ── */
.doc-panel-new-form {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.doc-panel-new-form input {
    flex: 1;
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    background: #f5f5f7;
    color: #111827;
    font-size: 12px;
    outline: none;
    font-family: inherit;
}
.doc-panel-new-form input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

/* ── Audit Dialog (Light Theme, floating, draggable — wie Annotation Editor) ── */
.audit-dialog {
    position: fixed;
    /* Oben rechts, 1/3 der verbleibenden Viewer-Breite als Abstand zum rechten Fensterrand */
    right: calc((100vw - var(--shell-offset, 0px)) / 3);
    top: 1.5em;
    width: 26.25em;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75em;
    box-shadow: 0 0.75em 2.5em rgba(0,0,0,0.12), 0 0.25em 0.75em rgba(0,0,0,0.06);
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    color: #111827;
    z-index: 20000;
    pointer-events: auto;
    overflow: hidden;
}

/* ── Embedded mode: audit dialog inside ContentPanel ───────── */
/* ── Embedded mode: audit dialog inside ContentPanel ───────── */
/* Base: 16px (panel root) → all em values relative to this  */
.audit-dialog.audit-dialog--embedded {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    max-height: none;
    height: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: auto;
    background: transparent;
    font-size: 16px;  /* anchor to panel root */
}
.audit-dialog--embedded .audit-header {
    display: none; /* ContentPanel hat bereits einen Header */
}
.audit-dialog--embedded .audit-body {
    padding: 0.625em 0.75em 0.75em;
    flex: 1;
    overflow-y: auto;
    gap: 0.5em;
}
.audit-dialog--embedded .audit-footer {
    border-top: 1px solid #e5e7eb;
    padding: 0.5em 0.75em;
}
/* Labels: 10px (0.625em of 16px) — uppercase, muted */
.audit-dialog--embedded .audit-lbl {
    font-size: 0.625em;   /* 10px */
    gap: 0.2em;
}
/* Inputs/selects/textareas: 12px (0.75em of 16px) — matches panel body text */
.audit-dialog--embedded .audit-inp {
    font-size: 0.75em;    /* 12px */
    padding: 0.5em 0.625em;
    border-radius: 0.375em;
}
/* Row-3 grid: tighter gap */
.audit-dialog--embedded .audit-row3 {
    gap: 0.375em;
}
/* Buttons: 11px (0.6875em of 16px) — matches chip size */
.audit-dialog--embedded .audit-btn {
    font-size: 0.6875em;  /* 11px */
    padding: 0.45em 1em;
    border-radius: 0.375em;
}

.audit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625em 1em;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
    flex-shrink: 0;
    cursor: grab;
    user-select: none;
}
.audit-header:active { cursor: grabbing; }

.audit-title {
    font-size: 0.9375em;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.375em;
    letter-spacing: -0.01em;
}

.audit-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2em;
    height: 2em;
    border-radius: 0.375em;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 1em;
    cursor: pointer;
    flex-shrink: 0;
}
.audit-close:hover { background: #f3f4f6; color: #111827; }

.audit-body {
    flex: 1;
    overflow-y: auto;
    padding: 1em 1.25em;
    display: flex;
    flex-direction: column;
    gap: 0.625em;
}

.audit-lbl {
    display: flex;
    flex-direction: column;
    gap: 0.1875em;
    font-size: 0.625em;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.audit-inp {
    width: 100%;
    padding: 0.625em 0.75em;
    font-size: 0.8125em;
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    color: #111827;
    background: #f3f4f6;
    border: none;
    border-radius: 0.5em;
    outline: none;
    box-sizing: border-box;
    transition: background 0.15s ease;
}
.audit-inp:focus { background: #eef0f2; }

.audit-num { font-family: var(--font-mono, "SF Mono", "Fira Code", monospace); }

.audit-select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M3 5L6 8L9 5' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.625em center;
    background-size: 0.75em;
    padding-right: 1.75em;
}

.audit-ta {
    resize: vertical;
    min-height: 2.5em;
    line-height: 1.5;
}

.audit-row3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5em;
}

.audit-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5em;
    padding: 0.75em 1.25em 1em;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.audit-btn {
    padding: 0.5em 1.25em;
    font-size: 0.8125em;
    font-weight: 500;
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    border-radius: 0.5em;
    cursor: pointer;
    transition: all 0.15s ease;
}

.audit-btn-cancel {
    background: #ffffff;
    color: #111827;
    border: 1px solid #e5e7eb;
}
.audit-btn-cancel:hover { background: #f9fafb; }

.audit-btn-save {
    background: #111827;
    color: #ffffff;
    border: none;
    font-weight: 600;
}
.audit-btn-save:hover { background: #1f2937; }

/* ── Audit Paperless-Doc-Verknüpfung (aligned with AnnotationEditor) ── */
.audit-doc-section {
    position: relative;
}
.audit-btn-link-doc {
    display: flex;
    align-items: center;
    gap: 0.375em;
    width: 100%;
    background: #fafafa;
    border: 1.5px dashed #e5e7eb;
    border-radius: 0.375em;
    padding: 0.5em 0.75em;
    font-size: 0.6875em;
    color: #9ca3af;
    cursor: pointer;
    text-align: center;
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    transition: border-color 0.15s, color 0.15s;
}
.audit-btn-link-doc:hover { border-color: #3b82f6; color: #3b82f6; }

.audit-linked-docs {
    display: flex;
    flex-direction: column;
    gap: 0.375em;
    margin: 0.25em 0;
}
.audit-doc-empty {
    font-size: 0.6875em;
    color: #9ca3af;
    font-style: italic;
}

.audit-doc-card {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.375em 0.5em;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 0.375em;
    min-height: 2em;
}
.audit-doc-card--view { background: #ffffff; }
.audit-doc-card--clickable { transition: border-color 0.15s, background 0.15s; }
.audit-doc-card--clickable:hover { border-color: #3b82f6; background: #f0f7ff; }

.audit-doc-thumb {
    width: 2em;
    height: 2em;
    object-fit: cover;
    border-radius: 0.25em;
    flex-shrink: 0;
    background: #e5e7eb;
}
.audit-doc-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.audit-doc-title {
    font-size: 0.75em;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.audit-doc-filename {
    font-size: 0.625em;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.audit-doc-open,
.audit-doc-unlink {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5em;
    height: 1.5em;
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    border-radius: 0.25em;
    line-height: 1;
    transition: color 0.15s;
}
.audit-doc-open:hover { color: #111827; }
.audit-doc-unlink:hover { color: #ef4444; }

/* Picker dropdown — opens ABOVE the button (like AnnotationEditor) */
.audit-doc-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 0.25em;
    max-height: 18em;
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    border-radius: 0.5em;
    background: #ffffff;
    box-shadow: 0 0.75em 2.5em rgba(0,0,0,0.12), 0 0.25em 0.75em rgba(0,0,0,0.06);
    overflow: hidden;
    z-index: 20;
}
.audit-doc-picker-search {
    padding: 0.5em;
    border-bottom: 1px solid #e5e7eb;
}
.audit-doc-picker-search .audit-inp {
    border: 1px solid #e5e7eb;
    border-radius: 0.375em;
    background: #f9fafb;
    font-size: 0.75em;
    transition: border-color 0.15s;
}
.audit-doc-picker-search .audit-inp:focus {
    border-color: #3b82f6;
    background: #f9fafb;
}
.audit-doc-picker-list {
    max-height: 14em;
    overflow-y: auto;
    flex: 1;
}
.audit-doc-picker-item {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.5em 0.625em;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    text-align: left;
    transition: background 0.1s;
}
.audit-doc-picker-item:hover { background: #f3f4f6; }
.audit-doc-picker-item.is-linked {
    opacity: 0.5;
    cursor: default;
    background: #f3f4f6;
}
.audit-doc-thumb-sm {
    width: 1.75em;
    height: 1.75em;
    object-fit: cover;
    border-radius: 0.1875em;
    flex-shrink: 0;
    background: #e5e7eb;
}
.audit-doc-picker-info {
    flex: 1;
    min-width: 0;
}
.audit-doc-picker-title {
    font-size: 0.75em;
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.audit-doc-picker-date {
    font-size: 0.5625em;
    color: #9ca3af;
}
.audit-doc-picker-linked-badge {
    font-size: 0.625em;
    color: #9ca3af;
}
.audit-doc-picker-empty {
    padding: 1em;
    text-align: center;
    font-size: 0.6875em;
    color: #9ca3af;
}

/* ── Audit Label (3D-Overlay, LOD-aware) ──────────────────────────────── */
.audit-label {
    position: absolute;
    top: 0; left: 0;
    z-index: 10000;
    display: inline-flex;
    align-items: center;
    gap: 0.3125em;
    padding: 0.25em 0.625em 0.25em 0.5em;
    font-family: var(--font-sans);
    color: hsl(var(--foreground));
    background: hsl(var(--card) / 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid hsl(var(--accent-orange) / 0.35);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
    box-shadow: var(--shadow-sm);
    transition: opacity 0.2s ease, transform 0.15s ease, background 0.15s ease;
    transform-origin: center bottom;
}
.audit-label:hover {
    background: hsl(var(--accent-orange) / 0.14);
    border-color: hsl(var(--accent-orange) / 0.6);
}

.audit-label-icon {
    display: flex;
    align-items: center;
    color: hsl(var(--accent-orange));
    opacity: 0.8;
}

.audit-label-content {
    display: flex;
    flex-direction: column;
    gap: 0.0625em;
}

.audit-label-title {
    font-size: 0.6875em;
    font-weight: 600;
    font-family: var(--font-sans);
    letter-spacing: 0.01em;
    line-height: 1.25;
}

.audit-label-detail {
    font-size: 0.5625em;
    font-weight: 400;
    color: hsl(var(--muted-fg));
    letter-spacing: 0.01em;
    line-height: 1.25;
}

/* Potential-Dot (Ampel) */
.audit-label-dot {
    width: 0.375em;
    height: 0.375em;
    border-radius: 50%;
    flex-shrink: 0;
}
.audit-label-dot-yes   { background: #10b981; box-shadow: 0 0 0.25em #10b98166; }
.audit-label-dot-no    { background: #ef4444; box-shadow: 0 0 0.25em #ef444466; }
.audit-label-dot-maybe { background: #f59e0b; box-shadow: 0 0 0.25em #f59e0b66; }

/* ── Audit View (Read-Only Detail-Ansicht) ─────────────────────────────── */
.audit-view-body {
    gap: 0 !important;
    padding: 0 !important;
}

.audit-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2em;
    height: 2em;
    border-radius: 0.375em;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.audit-back-btn:hover {
    background: #f3f4f6;
    color: #111827;
    border-color: #d1d5db;
}

.audit-view-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75em;
    padding: 0.5em 1.25em;
    border-bottom: 1px solid #f3f4f6;
}
.audit-view-row:last-child { border-bottom: none; }

.audit-view-row-dim { opacity: 0.5; }

.audit-view-key {
    font-size: 0.6875em;
    font-weight: 500;
    color: #6b7280;
    flex-shrink: 0;
    white-space: nowrap;
}

.audit-view-val {
    font-size: 0.75em;
    font-weight: 500;
    color: #111827;
    text-align: right;
    word-break: break-word;
}

.audit-view-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2em;
    height: 2em;
    border-radius: 0.375em;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
}
.audit-view-action:hover {
    background: #f9fafb;
    color: #111827;
}

.doc-panel-cursor-dropdown {
    right: unset;
    left: 0;
}

/* ── WASD Mode Badge ──────────────────────────────────────────────────────── */
/* Sits inside #bottom-dock, right of #dock-pill via absolute positioning */
.wasd-mode-badge {
    position: absolute;
    left: calc(100% + 0.5em);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    z-index: 1;
    padding: 0.45em 0.75em;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #ffffff;
    background: #1a1a1a;
    border-radius: 12px;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.4s ease;
}
.wasd-mode-badge--orbit {
    background: #2563eb;
}

/* ── ClipBox Corner Indicator ─────────────────────────────────────────────── */
.clipbox-corner-indicator {
    position: fixed;
    display: none;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-left: -1rem;
    margin-top: -1rem;
    border-radius: 50%;
    background: hsl(0 0% 100% / 0.92);
    border: 1.5px solid #d1d5db;
    color: #374151;
    cursor: pointer;
    pointer-events: auto;
    z-index: 10010;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    animation: cbi-pop-in 0.15s ease both;
}
.clipbox-corner-indicator:hover {
    transform: scale(1.15);
    background: #eff6ff;
    border-color: #3b82f6;
    color: #2563eb;
}
.clipbox-corner-indicator--active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #ffffff;
}
.clipbox-corner-indicator--active:hover {
    background: #374151;
    border-color: #374151;
    color: #ffffff;
}
@keyframes cbi-pop-in {
    from { opacity: 0; transform: scale(0.6); }
    to   { opacity: 1; transform: scale(1); }
}
