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

/* ── Custom Fonts ───────────────────────────────────────────── */
@font-face {
    font-family: "PP Mori";
    src: url("/assets/PPMoriSquare-Regular.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "PP Mori";
    src: url("/assets/PPMoriSquare-Italic.woff2") format("woff2");
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "PP Mori";
    src: url("/assets/PPMoriSquare-Bold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Sohne Mono";
    src: url("/assets/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: LEGACY — Ersetzt durch AppShell (shell-panel-open).
   AppShell entfernt body.doc-panel-active aktiv. Regeln deaktiviert.
   ══════════════════════════════════════════════════════════════ */
:root {
    --doc-panel-w: 30em; /* noch von .doc-panel CSS verwendet */
}

/* 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 */

/* ══════════════════════════════════════════════════════════════
   APP SHELL — Neues 3-Spalten-Layout
   NavRail (56px) | ContentPanel (400px) | MainArea (rest)
   ══════════════════════════════════════════════════════════════ */
:root {
    --nav-rail-w: 60px;              /* Sidebar collapsed */
    --sidebar-expanded-w: 280px;     /* Sidebar expanded */
    --content-panel-w: 400px;
    --shell-offset: var(--nav-rail-w);  /* default: nur Sidebar collapsed */
}

/* Nav-rail bleibt immer schmal — Labels nur als Hover-Tooltip */
body.shell-sidebar-expanded {
    --nav-rail-w: 60px;
}

/* When content panel is open, shift everything */
body.shell-panel-open {
    --shell-offset: calc(var(--nav-rail-w) + var(--content-panel-w));
}

/* Widen content panel when DocumentEditor is inline-active (+1/3) */
body.shell-editor-active {
    --content-panel-w: 533px;
}

/* Always shift potree by nav-rail (minimum), and by content-panel when open */
.potree_container {
    left: var(--shell-offset) !important;
    width: calc(100% - var(--shell-offset)) !important;
}

#react-root {
    left: 0 !important;
    width: 100% !important;
}

/* Hide potree + annotation markers when viewing docs or whiteboard */
body.shell-viewer-hidden .potree_container,
body.shell-viewer-hidden #bottom-dock,
body.shell-viewer-hidden .annotation-layer {
    display: none !important;
}

/* Potree maximieren wenn Viewer-Overlay aktiv (Scene/Audit aus Whiteboard) */
body.shell-viewer-overlay .potree_container {
    left: var(--nav-rail-w) !important;
    width: calc(100% - var(--nav-rail-w)) !important;
    z-index: 10060;
}
/* React-root ueber Potree heben, damit Overlay-Buttons sichtbar bleiben */
body.shell-viewer-overlay #react-root {
    z-index: 10070 !important;
}

/* Dock-Pill im Viewer-Overlay: Ansichts-Tabs ausblenden,
   Toolbox + Toggle bleiben, mittig auf Potree-Area */
body.shell-viewer-overlay #view-tabs,
body.shell-viewer-overlay .dock-sep {
    display: none !important;
}

body.shell-viewer-overlay #bottom-dock {
    left: calc(var(--nav-rail-w) + (100% - var(--nav-rail-w)) / 2) !important;
}

/* Annotation-Overlay: Marker-Layer ueber Potree + Whiteboard-Overlay heben */
body.shell-annotation-overlay .annotation-layer {
    z-index: 30001 !important;
    pointer-events: auto;
}

/* Shift header, loading, bottom-dock accordingly */
body.shell-panel-open #app-header,
body.shell-panel-open #loading-indicator {
    left: calc(var(--shell-offset) + 1.25em);
}

body.shell-panel-open #bottom-dock {
    left: calc(var(--shell-offset) + (100% - var(--shell-offset)) / 2);
}
body.shell-panel-open #status-bar {
    left: calc(var(--shell-offset) + 9em);
    opacity: 0;
    pointer-events: none;
}

body.shell-panel-open #brand-logo {
    left: calc(var(--shell-offset) + 1em);
}

/* When only nav-rail (no panel open), still shift */
body:not(.shell-panel-open) #app-header,
body:not(.shell-panel-open) #loading-indicator {
    left: calc(var(--nav-rail-w) + 1.25em);
}

body:not(.shell-panel-open) #bottom-dock {
    left: calc(var(--nav-rail-w) + (100% - var(--nav-rail-w)) / 2);
}

body:not(.shell-panel-open) #brand-logo {
    left: calc(var(--nav-rail-w) + 1em);
}

/* ── Project Title Bar (top-left, next to sidebar) ──────────── */
.project-title-bar {
    position: fixed;
    top: 0.75em;
    left: calc(var(--nav-rail-w) + 1em);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.4em;
    font-family: var(--font-sans);
    font-size: 0.8125em;
    color: #666;
    user-select: none;
    pointer-events: auto;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.shell-panel-open .project-title-bar {
    left: calc(var(--shell-offset) + 1em);
}

body.shell-viewer-hidden .project-title-bar {
    display: none;
}

.project-title-bar__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.286em;
    height: 2.286em;
    border: none;
    background: rgba(245, 245, 245, 0.75);
    backdrop-filter: blur(0.25em);
    border-radius: 0.35em;
    color: #777;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.project-title-bar__back:hover {
    background: rgba(235, 235, 235, 0.9);
    color: #000;
}

.project-title-bar__name {
    font-weight: 500;
    color: #555;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 14em;
}

/* ══════════════════════════════════════════════════════════════
   DEV MODE — Layout-Overrides (müssen hier stehen weil src/style.css
   nach public/style.css geladen wird und !important-Regeln hat)
   ══════════════════════════════════════════════════════════════ */
body.dev-mode {
    --nav-rail-w: 0px;
    --content-panel-w: 0px;
    --shell-offset: 0px;
}

/* ── Dev Mode Header ──────────────────────────────────────────── */
#dev-mode-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    display: none; /* shown via body.dev-mode */
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    background: rgba(15, 15, 18, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 11000;
    font-family: var(--font-mono, 'Sohne Mono', monospace);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    overflow: visible;
    white-space: nowrap;
}
body.dev-mode #dev-mode-header {
    display: flex;
}

.dev-hdr-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.dev-hdr-back:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.dev-hdr-title {
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dev-hdr-desc {
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

.dev-hdr-status {
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
.dev-hdr-status--wip {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}
.dev-hdr-status--done {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}
.dev-hdr-status--archived {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.4);
}

.dev-hdr-spacer {
    flex: 1;
    min-width: 4px;
}

.dev-hdr-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.65);
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.dev-hdr-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}
.dev-hdr-btn--highlight {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.1);
    color: rgba(165, 180, 252, 0.9);
}
.dev-hdr-btn--highlight:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
}

.dev-hdr-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

.dev-hdr-fps {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    color: #34d399;
}

/* ── Cloud / Rooms / Layer Dropdown ───────────────────────────── */
.dev-hdr-cloud-switcher {
    position: relative;
    flex-shrink: 0;
}

.dev-cloud-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 220px;
    max-height: 400px;
    overflow-y: auto;
    padding: 6px;
    background: rgba(25, 25, 30, 0.96);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 11100;
    font-size: 11px;
}
.dev-cloud-dropdown.open {
    display: block;
}

.dev-cloud-dropdown button,
.dev-cloud-dropdown .dev-dd-item {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 5px 8px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s;
}
.dev-cloud-dropdown button:hover,
.dev-cloud-dropdown .dev-dd-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dev-cloud-dropdown .dev-dd-active {
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.1);
}

.dev-cloud-dropdown .dev-dd-section {
    padding: 4px 8px;
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dev-cloud-dropdown .dev-dd-divider {
    height: 1px;
    margin: 4px 0;
    background: rgba(255, 255, 255, 0.06);
}

/* Per-cloud settings inside dropdown */
.dev-cloud-dropdown .dev-dd-settings {
    padding: 6px 8px;
    font-size: 10px;
}
.dev-cloud-dropdown .dev-dd-settings label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 2px 0;
    color: rgba(255, 255, 255, 0.5);
}
.dev-cloud-dropdown .dev-dd-settings input[type="range"] {
    width: 80px;
    accent-color: #6366f1;
}
.dev-cloud-dropdown .dev-dd-settings select {
    padding: 2px 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    color: #fff;
    font-size: 10px;
    font-family: inherit;
}

/* Rooms dropdown (wider) */
.dev-rooms-dropdown {
    min-width: 300px;
    max-height: 500px;
}

/* ── Dev Log Sidebar ──────────────────────────────────────────── */
/* Log-Sidebar entfernt — Logging nur noch via Browser-Konsole */

/* ── Dev Dashboard Overlay ────────────────────────────────────── */
/* ── Dev Dashboard (harmoniert mit Command Palette) ──────── */
#dev-dashboard-overlay {
    position: fixed;
    inset: 0;
    background: hsl(var(--background) / 0.7);
    backdrop-filter: blur(12px);
    z-index: 12000;
    display: none;
    overflow-y: auto;
    padding: 48px 24px;
}
#dev-dashboard-overlay.open {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    animation: cmd-backdrop-in 0.15s ease-out;
}

.dev-dash {
    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);
}
.dev-dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8125em 1em;
    border-bottom: 0.0625em solid hsl(var(--border));
}
.dev-dash h2 {
    font-size: 0.875em;
    font-weight: 500;
    color: hsl(var(--foreground));
    margin: 0;
    font-family: var(--font-sans);
}
.dev-dash-sub {
    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;
    margin: 0;
}
.dev-dash-close {
    width: 1.75em;
    height: 1.75em;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: hsl(var(--muted-fg));
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.dev-dash-close:hover {
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
}

.dev-dash-cards {
    display: flex;
    flex-direction: column;
    padding: 0.375em 0.375em 0.5em;
    max-height: 24.375em;
    overflow-y: auto;
}
.dev-dash-cards::-webkit-scrollbar {
    width: 0.25em;
}
.dev-dash-cards::-webkit-scrollbar-track {
    background: transparent;
}
.dev-dash-cards::-webkit-scrollbar-thumb {
    background: hsl(var(--border));
    border-radius: 0.125em;
}
.dev-dash-card {
    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;
}
.dev-dash-card:hover {
    background: hsl(var(--muted));
}
.dev-dash-card-body {
    flex: 1;
    min-width: 0;
}
.dev-dash-card-hdr {
    display: flex;
    align-items: center;
    gap: 0.5em;
}
.dev-dash-card-title {
    font-size: 0.8125em;
    font-weight: 500;
    color: hsl(var(--foreground));
    font-family: var(--font-sans);
    line-height: 1.3;
}
.dev-dash-card p {
    font-size: 0.6875em;
    font-weight: 400;
    color: hsl(var(--muted-fg));
    font-family: var(--font-sans);
    line-height: 1.3;
    margin: 0.0909em 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dev-dash-card-tags {
    display: none;
}
.dev-dash-card-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;
}

/* ── Viewer Settings Panel (Shift+<) ─────────────────────────────── */
.vsp {
    position: fixed;
    top: 50px;
    right: 16px;
    width: 280px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: rgba(20, 20, 25, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 11200;
    font-family: var(--font-mono, 'Sohne Mono', monospace);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
}
.vsp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: grab;
    user-select: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.vsp-header:active { cursor: grabbing; }
.vsp-title {
    font-weight: 600;
    font-size: 12px;
    color: #fff;
}
.vsp-close {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    cursor: pointer;
}
.vsp-close:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.vsp-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.vsp-tab {
    flex: 1;
    padding: 6px 4px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.35);
    font: inherit;
    font-size: 10px;
    cursor: pointer;
    text-align: center;
    transition: color 0.15s, background 0.15s;
}
.vsp-tab:hover { color: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.03); }
.vsp-tab--active {
    color: #fff;
    background: rgba(99, 102, 241, 0.15);
    box-shadow: inset 0 -2px 0 rgba(99, 102, 241, 0.7);
}
.vsp-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.vsp-body::-webkit-scrollbar { width: 4px; }
.vsp-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
.vsp-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.vsp-row label {
    flex-shrink: 0;
    min-width: 70px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}
.vsp-row input[type="range"] {
    flex: 1;
    height: 3px;
    accent-color: #6366f1;
}
.vsp-row input[type="checkbox"] {
    accent-color: #6366f1;
}
.vsp-row select {
    flex: 1;
    padding: 3px 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font: inherit;
    font-size: 10px;
}
.vsp-row input[type="color"] {
    width: 32px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    padding: 0;
}
.vsp-val {
    min-width: 38px;
    text-align: right;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    font-variant-numeric: tabular-nums;
}
.vsp-num {
    flex: 1;
    width: 60px;
    padding: 3px 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font: inherit;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}
.vsp-section-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 4px;
    padding-bottom: 2px;
}
.vsp-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 6px 0;
}
.vsp-empty {
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    padding: 20px 0;
}
/* ── Color Swatches (per-cloud) ── */
.vsp-color-row {
    padding: 2px 0 4px;
}
.vsp-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.vsp-swatch {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s;
}
.vsp-swatch:hover {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.4);
}
.vsp-color-native {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 0;
    cursor: pointer;
    background: transparent;
}
/* ── Cloud Accordion ── */
.vsp-cloud {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 2px;
}
.vsp-cloud-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.12s;
}
.vsp-cloud-header:hover { background: rgba(255, 255, 255, 0.05); }
.vsp-cloud-name {
    flex: 1;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vsp-chevron {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.3);
    transition: transform 0.15s;
}
.vsp-eye {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.vsp-eye:hover { color: #fff; }
.vsp-cloud-body {
    padding: 6px 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ── Registration Panel ───────────────────────────────────────── */
.reg-panel {
    position: fixed;
    top: 50px;
    left: 16px;
    width: 260px;
    padding: 12px;
    background: rgba(20, 20, 25, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 11200;
    font-family: var(--font-mono, 'Sohne Mono', monospace);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reg-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    user-select: none;
}
.reg-panel-header:active {
    cursor: grabbing;
}
.reg-panel-title {
    font-weight: 600;
    font-size: 12px;
    color: #fff;
}
.reg-panel-close {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 12px;
}
.reg-panel-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.reg-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.reg-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    gap: 6px;
}
.reg-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.reg-select {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-family: inherit;
    font-size: 10px;
}

.reg-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
}

.reg-mode-btns {
    display: flex;
    gap: 4px;
}
.reg-mode-btn {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.6);
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}
.reg-mode-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}
.reg-mode-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
}
.reg-hint {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.3);
}

.reg-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.reg-axis-label {
    font-size: 10px;
    font-weight: 600;
    width: 12px;
    text-align: center;
}
.reg-input {
    flex: 1;
    padding: 3px 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-family: inherit;
    font-size: 10px;
    text-align: right;
}

.reg-actions {
    flex-direction: row;
    gap: 6px;
}
.reg-btn {
    flex: 1;
    padding: 6px 10px;
    border: none;
    border-radius: 5px;
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
    transition: background 0.15s;
}
.reg-btn--reset {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
}
.reg-btn--reset:hover {
    background: rgba(255, 255, 255, 0.12);
}
.reg-btn--confirm {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}
.reg-btn--confirm:hover {
    background: rgba(52, 211, 153, 0.35);
}

/* ── Dev Rooms Table ──────────────────────────────────────────── */
.dev-rooms-table-overlay {
    position: fixed;
    top: 36px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 14, 0.9);
    backdrop-filter: blur(12px);
    z-index: 11300;
    overflow-y: auto;
    padding: 16px;
    display: none;
}
.dev-rooms-table-overlay.open {
    display: block;
}
.dev-rooms-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono, 'Sohne Mono', monospace);
    font-size: 11px;
}
.dev-rooms-table th {
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    background: rgba(15, 15, 20, 0.95);
}
.dev-rooms-table td {
    padding: 5px 8px;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.dev-rooms-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* ── Cloud Dropdown Items ─────────────────────────────────────── */
.dev-cloud-item {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 5px 8px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s;
}
.dev-cloud-item:hover { background: rgba(255, 255, 255, 0.08); }
.dev-cloud-item.active { color: #a5b4fc; background: rgba(99, 102, 241, 0.1); }

.dev-cloud-item-wrap {
    display: flex;
    flex-direction: column;
}
.dev-cloud-item-row {
    display: flex;
    align-items: center;
}
.dev-cloud-item-row .dev-cloud-item { flex: 1; }

.dev-cloud-sub { padding-left: 22px; }
.dev-cloud-cb { font-size: 12px; flex-shrink: 0; width: 14px; }
.dev-cloud-dot {
    width: 7px; height: 7px; border-radius: 50%;
    flex-shrink: 0; display: inline-block;
}
.dev-cloud-check {
    margin-left: auto; color: #4ade80; font-size: 11px; flex-shrink: 0;
}
.dev-cloud-section {
    padding: 6px 8px 2px;
    font-size: 9px; font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.dev-cloud-gear {
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px;
    border: none; border-radius: 4px;
    background: transparent; color: rgba(255, 255, 255, 0.3);
    cursor: pointer; flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}
.dev-cloud-gear:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }

/* Accordion (expandable settings) */
.dev-cloud-accordion {
    display: flex; align-items: center; gap: 6px;
    width: 100%; padding: 6px 8px;
    border: none; border-radius: 5px;
    background: transparent; color: rgba(255, 255, 255, 0.5);
    font-size: 10px; font-family: inherit; cursor: pointer;
    transition: background 0.12s;
}
.dev-cloud-accordion:hover { background: rgba(255,255,255,0.06); }
.dev-cloud-accordion-chevron {
    transition: transform 0.2s; flex-shrink: 0;
}
.dev-cloud-accordion-body {
    display: none; padding: 4px 6px 8px;
}
.dev-cloud-accordion-body.open { display: block; }

/* Per-cloud settings */
.dev-pc-settings { display: flex; flex-direction: column; gap: 4px; }
.dev-cloud-setting {
    display: flex; flex-direction: column; gap: 2px;
}
.dev-cloud-setting-label {
    font-size: 9px; color: rgba(255, 255, 255, 0.4);
}
.dev-cloud-setting-row {
    display: flex; align-items: center; gap: 6px;
}
.dev-cloud-range {
    flex: 1; height: 3px; accent-color: #6366f1; cursor: pointer;
}
.dev-cloud-setting-val {
    min-width: 34px; text-align: right;
    font-size: 10px; color: rgba(255, 255, 255, 0.5);
    font-variant-numeric: tabular-nums;
}
.dev-cloud-select {
    width: 100%; padding: 3px 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff; font-size: 10px; font-family: inherit;
}

/* Color swatches */
.dev-cloud-color-row {
    display: flex; padding: 4px 0;
}
.dev-cloud-color-swatches {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.dev-cloud-swatch {
    width: 18px; height: 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px; cursor: pointer;
    transition: border-color 0.12s, transform 0.12s;
}
.dev-cloud-swatch:hover { transform: scale(1.15); }
.dev-cloud-swatch.active { border-color: #a5b4fc; box-shadow: 0 0 4px rgba(99,102,241,0.4); }
.dev-cloud-swatch-picker {
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.4);
    font-size: 12px; position: relative; overflow: hidden;
}
.dev-cloud-color-native {
    position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

/* ── Geo-Anchor Panel ─────────────────────────────────────────── */
.dev-geo-panel {
    padding: 6px 8px; display: flex; flex-direction: column; gap: 4px;
}
.dev-geo-row {
    display: flex; align-items: center; gap: 6px;
}
.dev-geo-label {
    font-size: 9px; color: rgba(255,255,255,0.4); min-width: 30px;
}
.dev-geo-input {
    flex: 1; padding: 3px 6px;
    border: 1px solid rgba(255,255,255,0.1); border-radius: 4px;
    background: rgba(255,255,255,0.04); color: #fff;
    font-size: 10px; font-family: inherit; text-align: right;
}
.dev-geo-slider {
    flex: 1; accent-color: #6366f1; cursor: pointer;
}
.dev-geo-num {
    min-width: 34px; text-align: right;
    font-size: 10px; color: rgba(255,255,255,0.5);
    font-variant-numeric: tabular-nums;
}
.dev-geo-unit {
    font-size: 9px; color: rgba(255,255,255,0.3);
}
.dev-geo-btn {
    padding: 4px 10px;
    border: 1px solid rgba(99,102,241,0.3); border-radius: 4px;
    background: rgba(99,102,241,0.1); color: #a5b4fc;
    font-size: 10px; font-family: inherit; cursor: pointer;
}
.dev-geo-btn:hover { background: rgba(99,102,241,0.2); }
.dev-geo-info {
    font-size: 9px; color: rgba(255,255,255,0.3); line-height: 1.4;
}

/* ── WMS Layer Filters ────────────────────────────────────────── */
.dev-layer-wrap { display: flex; flex-direction: column; gap: 2px; }
.dev-layer-row {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 8px;
}
.dev-layer-filters {
    display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 8px;
}
.dev-layer-filter-btn {
    padding: 2px 8px; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px; background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.5); font-size: 9px;
    font-family: inherit; cursor: pointer;
}
.dev-layer-filter-btn:hover { background: rgba(255,255,255,0.08); }
.dev-layer-filter-btn.active {
    background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.3);
    color: #a5b4fc;
}
.dev-filter-row {
    display: flex; align-items: center; gap: 6px; padding: 2px 8px;
}
.dev-filter-label {
    font-size: 9px; color: rgba(255,255,255,0.4); min-width: 50px;
}
.dev-filter-slider { flex: 1; accent-color: #6366f1; }
.dev-filter-val {
    min-width: 30px; text-align: right;
    font-size: 10px; color: rgba(255,255,255,0.5);
    font-variant-numeric: tabular-nums;
}
.dev-filter-toggle {
    padding: 2px 8px; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px; background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.5); font-size: 9px;
    font-family: inherit; cursor: pointer;
}
.dev-filter-toggle.active {
    background: rgba(52,211,153,0.15); border-color: rgba(52,211,153,0.3);
    color: #34d399;
}

/* ── Rooms Dropdown ───────────────────────────────────────────── */
.rooms-empty {
    padding: 16px 12px; text-align: center;
    color: rgba(255,255,255,0.35);
}
.rooms-empty-icon {
    font-size: 22px; margin-bottom: 6px; opacity: 0.5;
}
.rooms-empty-text { font-size: 11px; }

.rooms-actions-bar {
    display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 6px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.rooms-action-btn {
    display: flex; align-items: center; gap: 3px;
    padding: 3px 8px; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px; background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.6); font-size: 10px;
    font-family: inherit; cursor: pointer;
    transition: background 0.12s;
}
.rooms-action-btn:hover { background: rgba(255,255,255,0.08); }
.rooms-action-btn--primary {
    border-color: rgba(99,102,241,0.3); background: rgba(99,102,241,0.1);
    color: #a5b4fc;
}
.rooms-action-btn--primary:hover { background: rgba(99,102,241,0.2); }
.rooms-action-btn--warn {
    border-color: rgba(251,191,36,0.3); background: rgba(251,191,36,0.08);
    color: #fbbf24;
}
.rooms-action-btn--warn:hover { background: rgba(251,191,36,0.18); }
.rooms-action-btn--cyan {
    border-color: rgba(34,211,238,0.3); background: rgba(34,211,238,0.08);
    color: #22d3ee;
}
.rooms-action-btn--cyan:hover { background: rgba(34,211,238,0.18); }

.rooms-opacity-row {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.rooms-opacity-label {
    font-size: 9px; color: rgba(255,255,255,0.4);
}
.rooms-opacity-slider { flex: 1; accent-color: #6366f1; }
.rooms-opacity-value {
    min-width: 30px; text-align: right;
    font-size: 10px; color: rgba(255,255,255,0.5);
    font-variant-numeric: tabular-nums;
}

.rooms-summary {
    padding: 5px 8px; font-size: 10px;
    color: rgba(255,255,255,0.4);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.rooms-item {
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.rooms-item--active { background: rgba(99,102,241,0.06); }
.rooms-item--isolated { background: rgba(251,191,36,0.06); }

.rooms-item-header {
    display: flex; align-items: center; gap: 4px;
    padding: 5px 8px; cursor: pointer;
    transition: background 0.12s;
}
.rooms-item-header:hover { background: rgba(255,255,255,0.04); }

.rooms-item-id {
    font-size: 10px; font-weight: 600;
    color: rgba(255,255,255,0.7); min-width: 30px;
}
.rooms-item-name {
    flex: 1; padding: 1px 4px;
    border: 1px solid transparent; border-radius: 3px;
    background: transparent; color: rgba(255,255,255,0.65);
    font-size: 10px; font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.rooms-item-name:focus {
    border-color: rgba(99,102,241,0.4);
    background: rgba(255,255,255,0.04);
    outline: none;
}
.rooms-item-area, .rooms-item-vol {
    font-size: 9px; color: rgba(255,255,255,0.35);
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rooms-item-edit, .rooms-item-isolate {
    display: flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border: none; border-radius: 3px;
    background: transparent; color: rgba(255,255,255,0.3);
    cursor: pointer; flex-shrink: 0; font-size: 11px;
}
.rooms-item-edit:hover, .rooms-item-isolate:hover {
    background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7);
}
.rooms-item-chevron {
    color: rgba(255,255,255,0.25);
    transition: transform 0.2s; flex-shrink: 0;
}

.rooms-detail {
    display: none; padding: 4px 8px 8px 36px;
    flex-direction: column; gap: 4px;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.rooms-detail--open { display: flex; }
.rooms-detail-row {
    display: flex; align-items: center; gap: 6px;
    font-size: 10px; color: rgba(255,255,255,0.55);
}
.rooms-detail-unit { font-size: 9px; color: rgba(255,255,255,0.3); }

.rooms-floor-select {
    padding: 2px 6px; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px; background: rgba(255,255,255,0.04);
    color: #fff; font-size: 10px; font-family: inherit;
}
.rooms-height-input, .rooms-zbasis-input {
    width: 60px; padding: 2px 6px; text-align: right;
    border: 1px solid rgba(255,255,255,0.1); border-radius: 4px;
    background: rgba(255,255,255,0.04); color: #fff;
    font-size: 10px; font-family: inherit;
}

.rooms-walls-hdr {
    font-size: 9px; color: rgba(255,255,255,0.3);
    padding-top: 4px; font-weight: 600;
}
.rooms-wall-item {
    display: flex; align-items: center; gap: 8px;
    padding: 1px 0; font-size: 10px;
}
.rooms-wall-id { color: rgba(255,255,255,0.5); min-width: 24px; }
.rooms-wall-len { color: rgba(255,255,255,0.4); }
.rooms-wall-area { color: rgba(255,255,255,0.4); }

/* ── Volume Info Badge (Detail-Card bei aktivem Raum) ──────────── */
.vol-info-badge {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10005;
    min-width: 140px;
    background: hsl(215 30% 12%);
    border: 1px solid hsl(215 50% 35%);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: var(--font-mono, 'Sohne Mono', monospace);
    font-size: 11px;
    color: #e4e4e7;
    box-shadow: 0 4px 20px rgba(0,0,0,.5);
    pointer-events: none;
}
.vol-info-id {
    font-weight: 700;
    font-size: 13px;
    color: hsl(215 80% 65%);
    margin-bottom: 5px;
    text-align: center;
    letter-spacing: 0.5px;
}
.vol-info-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 0;
    border-bottom: 1px solid hsla(215 50% 30% / 0.25);
}
.vol-info-row:last-child { border-bottom: none; }
.vol-info-row span:first-child { color: hsl(215 30% 60%); }
.vol-info-row span:last-child { color: #e4e4e7; font-variant-numeric: tabular-nums; }
.vol-info-walls {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid hsla(215 50% 35% / 0.4);
}
.vol-info-wall-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 1px 0;
    font-size: 10px;
}
.vol-info-wall-row span:first-child { color: rgba(255,255,255,0.45); }
.vol-info-wall-row span:last-child { color: rgba(255,255,255,0.55); font-variant-numeric: tabular-nums; }

/* ── Kompaktes Raum-Label (inaktiv) ──────────────────────── */
.vol-info-label {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10004;
    display: flex;
    align-items: center;
    gap: 6px;
    background: hsla(215 30% 12% / 0.80);
    border: 1px solid hsla(215 50% 35% / 0.5);
    border-radius: 4px;
    padding: 3px 8px;
    font-family: var(--font-mono, 'Sohne Mono', monospace);
    font-size: 11px;
    color: #e4e4e7;
    pointer-events: none;
    white-space: nowrap;
}
.vol-label-id { font-weight: 600; color: hsl(215 80% 65%); }
.vol-label-area { color: rgba(255,255,255,0.55); font-variant-numeric: tabular-nums; }

/* ── Kubatur-Varianten ──────────────────────────────────── */
.vol-info-badge--building { border-color: hsl(25 80% 45%); }
.vol-info-badge--building .vol-info-id { color: hsl(25 90% 65%); }
.vol-info-label--building { border-color: hsla(25 80% 45% / 0.5); }
.vol-info-label--building .vol-label-id { color: hsl(25 90% 65%); }

@keyframes vol-badge-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Rooms Table Panel (rtbl-*) ───────────────────────────────── */
.rooms-table-panel {
    position: fixed; top: 36px; left: 0; right: 0; bottom: 0;
    background: rgba(12, 12, 16, 0.95);
    backdrop-filter: blur(16px);
    z-index: 11300; display: flex; flex-direction: column;
    font-family: var(--font-mono, 'Sohne Mono', monospace);
    font-size: 11px; color: rgba(255,255,255,0.8);
}

.rtbl-header {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.rtbl-tabs { display: flex; gap: 4px; }
.rtbl-tab {
    display: flex; align-items: center; gap: 4px;
    padding: 5px 12px; border: none; border-radius: 5px;
    background: transparent; color: rgba(255,255,255,0.45);
    font-family: inherit; font-size: 11px; cursor: pointer;
}
.rtbl-tab:hover { background: rgba(255,255,255,0.06); }
.rtbl-tab--active {
    background: rgba(99,102,241,0.15); color: #a5b4fc;
}
.rtbl-tab-count {
    padding: 0 5px; border-radius: 8px;
    background: rgba(255,255,255,0.08); font-size: 9px;
}
.rtbl-close-btn {
    margin-left: auto; width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 5px;
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5);
    cursor: pointer; font-size: 13px;
}
.rtbl-close-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

.rtbl-scroll {
    flex: 1; overflow: auto; padding: 0 12px 12px;
}
.rtbl-scroll::-webkit-scrollbar { width: 5px; }
.rtbl-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.rtbl-table {
    width: 100%; border-collapse: collapse;
}
.rtbl-table th {
    padding: 6px 8px; text-align: left; font-weight: 600;
    font-size: 9px; color: rgba(255,255,255,0.4);
    text-transform: uppercase; letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky; top: 0;
    background: rgba(12, 12, 16, 0.98);
    white-space: nowrap;
}
.rtbl-empty {
    padding: 24px; text-align: center;
    color: rgba(255,255,255,0.3); font-size: 12px;
}
.rtbl-footer {
    padding: 6px 12px; border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 10px; color: rgba(255,255,255,0.35);
    flex-shrink: 0;
}

/* Table column widths */
.rtbl-th-cb { width: 28px; }
.rtbl-th-id { width: 50px; }
.rtbl-th-name { min-width: 120px; }
.rtbl-th-notes { min-width: 100px; }
.rtbl-th-usage { width: 100px; }
.rtbl-th-floor { width: 80px; }
.rtbl-th-vol { width: 70px; text-align: right; }
.rtbl-th-area { width: 70px; text-align: right; }
.rtbl-th-height { width: 60px; text-align: right; }
.rtbl-th-zbasis { width: 60px; text-align: right; }

/* Floor groups */
.rtbl-group { margin-top: 2px; }
.rtbl-group-hdr {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 8px; cursor: pointer;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.12s;
}
.rtbl-group-hdr:hover { background: rgba(255,255,255,0.05); }
.rtbl-group-cb { accent-color: #6366f1; }
.rtbl-group-label {
    font-size: 11px; font-weight: 600;
    color: rgba(255,255,255,0.65);
}
.rtbl-group-count {
    font-size: 9px; color: rgba(255,255,255,0.35);
    padding: 0 5px; border-radius: 8px;
    background: rgba(255,255,255,0.06);
}
.rtbl-group-area {
    margin-left: auto; font-size: 10px;
    color: rgba(255,255,255,0.35);
    font-variant-numeric: tabular-nums;
}

/* Table rows */
.rtbl-row {
    display: table-row;
}
.rtbl-row:hover td { background: rgba(255,255,255,0.02); }
.rtbl-row--sel td { background: rgba(99,102,241,0.06); }

.rtbl-table td {
    padding: 4px 8px; border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
}
.rtbl-row-cb { accent-color: #6366f1; }

.rtbl-cell-id {
    font-size: 10px; font-weight: 600;
    color: rgba(255,255,255,0.5); cursor: pointer;
}
.rtbl-cell-id--cyan { color: #22d3ee; }
.rtbl-cell-num {
    text-align: right; font-variant-numeric: tabular-nums;
    font-size: 10px; color: rgba(255,255,255,0.55);
}

/* Editable cells */
.rtbl-edit {
    width: 100%; padding: 2px 5px;
    border: 1px solid transparent; border-radius: 3px;
    background: transparent; color: rgba(255,255,255,0.7);
    font-size: 10px; font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.rtbl-edit:focus {
    border-color: rgba(99,102,241,0.4);
    background: rgba(255,255,255,0.04);
    outline: none;
}
.rtbl-edit-name { min-width: 100px; }
.rtbl-edit-notes { min-width: 80px; }
.rtbl-edit-usage, .rtbl-edit-floor {
    padding: 2px 4px;
    border: 1px solid rgba(255,255,255,0.08); border-radius: 3px;
    background: rgba(255,255,255,0.04); color: #fff;
    font-size: 10px; font-family: inherit;
}
.rtbl-edit-num {
    width: 55px; text-align: right;
    padding: 2px 5px;
    border: 1px solid rgba(255,255,255,0.08); border-radius: 3px;
    background: rgba(255,255,255,0.04); color: #fff;
    font-size: 10px; font-family: inherit;
}
.rtbl-edit-height, .rtbl-edit-zbasis { width: 50px; }

/* Bulk action bar */
.rtbl-bulk-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
    padding: 6px 12px;
    background: rgba(99,102,241,0.08);
    border-bottom: 1px solid rgba(99,102,241,0.15);
}
.rtbl-bulk-count {
    font-size: 10px; color: #a5b4fc; font-weight: 600;
    margin-right: 4px;
}
.rtbl-bulk-num {
    width: 55px; padding: 3px 6px; text-align: right;
    border: 1px solid rgba(255,255,255,0.12); border-radius: 4px;
    background: rgba(255,255,255,0.06); color: #fff;
    font-size: 10px; font-family: inherit;
}
.rtbl-bulk-floor {
    padding: 3px 6px;
    border: 1px solid rgba(255,255,255,0.12); border-radius: 4px;
    background: rgba(255,255,255,0.06); color: #fff;
    font-size: 10px; font-family: inherit;
}
.rtbl-bulk-apply {
    padding: 3px 10px; border: none; border-radius: 4px;
    background: rgba(99,102,241,0.25); color: #a5b4fc;
    font-size: 10px; font-family: inherit; cursor: pointer;
}
.rtbl-bulk-apply:hover { background: rgba(99,102,241,0.4); }
.rtbl-bulk-delete {
    padding: 3px 10px; border: none; border-radius: 4px;
    background: rgba(239,68,68,0.15); color: #f87171;
    font-size: 10px; font-family: inherit; cursor: pointer;
}
.rtbl-bulk-delete:hover { background: rgba(239,68,68,0.3); }
.rtbl-bulk-isolate {
    padding: 3px 10px; border: none; border-radius: 4px;
    background: rgba(251,191,36,0.12); color: #fbbf24;
    font-size: 10px; font-family: inherit; cursor: pointer;
}
.rtbl-bulk-isolate:hover { background: rgba(251,191,36,0.25); }
.rtbl-bulk-clear {
    padding: 3px 10px; border: none; border-radius: 4px;
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5);
    font-size: 10px; font-family: inherit; cursor: pointer;
}
.rtbl-bulk-clear:hover { background: rgba(255,255,255,0.12); }

/* Hide React sidebar + content panel in dev mode */
body.dev-mode .sidebar {
    display: none !important;
}
body.dev-mode .nav-rail {
    display: none !important;
}
body.dev-mode .content-panel {
    display: none !important;
}
body.dev-mode .app-shell {
    pointer-events: none !important;
}

body.dev-mode .potree_container {
    left: 0 !important;
    width: 100% !important;
    top: 36px !important;
    height: calc(100% - 36px) !important;
}

body.dev-mode #potree_render_area {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

body.dev-mode #app-header {
    top: calc(36px + 1.25em) !important;
    left: 1.25em !important;
}

body.dev-mode #loading-indicator {
    top: calc(36px + 3em) !important;
    left: 1.25em !important;
}

body.dev-mode #bottom-dock,
body.dev-mode #dock-pill {
    display: none !important;
}
body.dev-mode #status-bar {
    display: none !important;
}
body.dev-mode #brand-logo {
    display: none !important;
}
body.dev-mode [data-component="ProjectTitleBar"] {
    display: none !important;
}
body.dev-mode .annotation-layer,
body.dev-mode [data-component="AnnotationLayer"] {
    display: none !important;
}

/* ZoomTierIndicator unter den Dev-Header schieben */
body.dev-mode [data-component="ZoomTierIndicator"] {
    top: calc(36px + 1em) !important;
}

/* ── Alle Nicht-Dev App-Panels im Dev-Modus unterdrücken ──
   Verhindert, dass Gebäude-Panel, Raumbuch, Audit-Dialoge,
   Toolbox, Viewer-Overlays etc. im Dev-Modus erscheinen. */
body.dev-mode #toolbox-panel,
body.dev-mode #view-tabs,
body.dev-mode #doc-viewer-overlay,
body.dev-mode .rooms-table-panel,
body.dev-mode .audit-dialog,
body.dev-mode .building-float,
body.dev-mode [data-component="BuildingPanel"],
body.dev-mode [data-component="RaumbuchPanel"],
body.dev-mode [data-component="AuditPanel"],
body.dev-mode [data-component="ScanPanel"] {
    display: none !important;
}

/* ── AppShell Container ──────────────────────────────────────── */
.app-shell {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    pointer-events: none;
    z-index: 10050;
    font-family: var(--font-sans);
}

.app-shell > * {
    pointer-events: auto;
}

/* ── NavRail ─────────────────────────────────────────────────── */
.nav-rail {
    width: var(--nav-rail-w);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.97);
    border-right: 1px solid #eaeaea;
    z-index: 10600;
    flex-shrink: 0;
    padding: 6px 0;
    box-sizing: border-box;
    overflow: visible;
}

.nav-rail__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 48px;
    min-height: 48px;
    padding: 6px 2px;
    border: none;
    background: none;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.15s ease;
    border-radius: 8px;
    position: relative;
    gap: 2px;
    overflow: visible;
}

.nav-rail__btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #374151;
}

.nav-rail__btn--action {
    min-height: 40px;
    color: #9ca3af;
}

.nav-rail__btn--action:hover {
    color: #374151;
}

.nav-rail__btn--nav.is-active,
.nav-rail__btn--action.is-active {
    color: #ffffff !important;
    background: #1a1a1a;
}

.nav-rail__indicator {
    display: none;
    position: absolute;
    left: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: #3b82f6;
    border-radius: 0 2px 2px 0;
}

.nav-rail__btn--nav.is-active .nav-rail__indicator {
    display: none;
}

.nav-rail__icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-rail__btn--nav::after,
.nav-rail__btn--action::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
    background: #1a1a1a;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
    z-index: 10700;
}

.nav-rail__btn--nav:hover::after,
.nav-rail__btn--action:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.nav-rail__groups {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
    padding-top: 8px;
}

.nav-rail__group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.nav-rail__group--gap {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid transparent;
}


/* ── Doc Preview (replaces viewer) ───────────────────────────── */
.app-shell__doc-preview {
    position: absolute;
    top: 0;
    left: var(--shell-offset);
    right: 0;
    bottom: 0;
    z-index: 10060;
    background: #4a4a4a;
    display: flex;
    align-items: stretch;
}

/* ── Hide old app-header (burger now in NavRail) ─────────────── */
#app-header {
    display: none !important;
}

/* ── DocumentEditor Inline Mode ──────────────────────────────── */
.doc-panel--inline {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 0.8125em;
}

.doc-panel--inline .doc-panel-header {
    padding: 1em 0.95em;
}

.doc-panel-inline-toolbar {
    border-bottom: 1px solid #eaeaea;
    padding: 4px 8px;
    background: #ffffff;
    flex-shrink: 0;
}

/* ── 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;
}

@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: 1.75em;
    left: 12em;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 1.5em;
    font-family: var(--font-mono);
    font-size: 0.6875em;
    color: #888;
    user-select: none;
    pointer-events: none;
    transition:
        opacity 0.2s ease,
        left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    right: unset;
}

#sb-cursor {
    display: none !important;
}

#sb-clip-info,
#sb-stats {
    background: rgba(245, 245, 245, 0.75);
    backdrop-filter: blur(0.25em);
    border-radius: 0.35em;
    padding: 0.5em 1em;
    pointer-events: auto;
}

#sb-clip-info {
    display: flex;
    align-items: baseline;
    gap: 0;
}

#sb-clip-info {
    display: none;
}

#sb-stats {
    display: flex;
    align-items: center;
    gap: 1em;
    margin: 0 auto;
}

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

.sb-axis {
    color: #888;
    font-size: 0.9091em;
    margin-left: 0.9em;
    margin-right: 0.15em;
}

.sb-axis:first-of-type {
    margin-left: 0;
}

.sb-val {
    min-width: 3.25em;
    color: #666;
    font-size: 1em;
    margin-right: 1em;
    text-align: right;
}

#sb-pts,
#sb-fps {
    color: #555;
    font-size: 1em;
    white-space: nowrap;
    padding: 0 !important;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    border: none;
}

/* ── Point Budget Anzeige (gedimmt) ──────────────────────────────────── */
#sb-budget {
    color: #555;
    font-size: 1em;
    white-space: nowrap;
    font-weight: 400;
}

/* ============================================================
   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-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-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: 0.625em; /* 10px at 16px */
    font-weight: 500;
    font-family: var(--font-sans);
    padding: 0.15em 0.5em;
    border-radius: 9.9em; /* Pill: 99px/10px */
    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;
}

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

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

/* Zahlenwert */
.cmd-pip-val {
    font-size: 0.6875em;
    font-weight: 600;
    font-family: var(--font-mono);
    color: hsl(var(--foreground));
    width: 1.2727em; /* 14px at own 11px font-size */
    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);
}

/* ============================================================
   DOKUMENTENABLAGE — Expanded Palette Mode
   ============================================================ */

/* Backdrop: weniger padding-top, zentrierter */
#cmd-palette-backdrop.cmd-expanded-backdrop {
    padding-top: 2em;
    padding-bottom: 2em;
    align-items: stretch;
}

/* Palette: expandiert auf fast-fullscreen */
#cmd-palette.cmd-expanded {
    width: calc(100vw - 8em);
    max-width: 66em;
    height: calc(100vh - 8em);
    max-height: calc(100vh - 8em);
    display: flex;
    flex-direction: column;
    margin: auto;
    animation: cmd-expand-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cmd-expand-in {
    from {
        width: 35em;
        height: auto;
        max-height: 26em;
        opacity: 0.7;
    }
    to {
        width: calc(100vw - 8em);
        height: calc(100vh - 8em);
        max-height: calc(100vh - 8em);
        opacity: 1;
    }
}

#cmd-palette.cmd-expanded #cmd-list-wrap {
    max-height: none;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-top: 0;
}
/* When viewing a doc, list-wrap and list must stretch full height */
#cmd-palette.cmd-expanded.cmd-viewing #cmd-list-wrap {
    overflow: hidden;
}
#cmd-palette.cmd-expanded.cmd-viewing #cmd-list {
    height: 100%;
}

/* ---- Back button ---- */
.cmd-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75em;
    height: 1.75em;
    border: none;
    background: none;
    color: hsl(var(--muted-fg));
    cursor: pointer;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    padding: 0;
    transition: color 0.15s ease, background 0.15s ease;
}
.cmd-back-btn:hover {
    color: hsl(var(--foreground));
    background: hsl(var(--muted));
}
.cmd-back-btn svg {
    width: 1em;
    height: 1em;
}

/* ---- Dokumentenablage Header ---- */
.dok-header {
    padding: 0.5em 0.75em 0.25em;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    border-bottom: 0.0625em solid hsl(var(--border));
    position: sticky;
    top: 0;
    background: hsl(var(--card) / 0.97);
    backdrop-filter: blur(0.5em);
    z-index: 2;
}

/* Sort Row */
.dok-sort-row {
    display: flex;
    gap: 0.375em;
}
.dok-sort-btn {
    font-size: 0.6875em;
    font-family: var(--font-sans);
    font-weight: 500;
    padding: 0.3em 0.75em;
    border-radius: 1em;
    border: 0.0625em solid hsl(var(--border));
    background: transparent;
    color: hsl(var(--muted-fg));
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.dok-sort-btn:hover {
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
}
.dok-sort-btn.dok-sort-active {
    background: hsl(var(--primary));
    color: hsl(var(--primary-fg, 0 0% 100%));
    border-color: hsl(var(--primary));
}

/* Tag Filter Chips */
.dok-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25em;
    padding-bottom: 0.25em;
}
.dok-tag-chip {
    font-size: 0.6875em;
    font-family: var(--font-sans);
    font-weight: 500;
    padding: 0.35em 0.6em 0.25em 0.6em;
    border-radius: 0.75em;
    border: 0.0625em solid transparent;
    background: hsl(var(--muted));
    color: hsl(var(--muted-fg));
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.dok-tag-chip:hover {
    opacity: 0.85;
    background: var(--tag-bg);
    color: var(--tag-fg);
}
.dok-tag-chip.dok-tag-chip-active {
    background: var(--tag-bg);
    color: var(--tag-fg);
    border-color: var(--tag-bg);
    box-shadow: 0 0 0 1px var(--tag-bg);
}

/* ---- Document Grid (2 columns) ---- */
.dok-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75em;
    padding: 0.75em;
}

/* ---- Tag Group (when sorted by tags) ---- */
.dok-tag-group {
    display: contents;
}
.dok-tag-group-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.25em 0;
}
.dok-tag-group-header:not(:first-child) {
    margin-top: 0.75em;
    padding-top: 0.75em;
    border-top: 0.0625em solid hsl(var(--border) / 0.5);
}
.dok-tag-group-label {
    font-size: 0.6875em;
    font-family: var(--font-sans);
    font-weight: 600;
    padding: 0.25em 0.6em 0.15em 0.6em;
    border-radius: 0.35em;
    white-space: nowrap;
    line-height: 1.5;
}
.dok-tag-group-count {
    font-size: 0.5625em;
    font-family: var(--font-mono);
    color: hsl(var(--muted-fg));
}

/* ---- Document Card (horizontal: cover left, content right) ---- */
.dok-card {
    display: flex;
    flex-direction: row;
    background: hsl(var(--card-elevated) / 0.6);
    border: 0.0625em solid hsl(var(--border));
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    min-height: 7em;
}
.dok-card:hover {
    border-color: hsl(var(--primary) / 0.4);
    box-shadow: 0 2px 8px hsl(var(--primary) / 0.1);
    transform: translateY(-1px);
}

/* Thumbnail — full page view on the left */
.dok-card-thumb {
    position: relative;
    width: 11em;
    min-width: 11em;
    background: hsl(var(--muted) / 0.5);
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.dok-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center;
    background: hsl(0 0% 100% / 0.05);
}

/* Favorite Button (overlay on thumb) */
.dok-fav-btn {
    position: absolute;
    top: 0.5em;
    right: 0.5em;
    width: 2em;
    height: 2em;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: hsl(0 0% 0% / 0.45);
    color: hsl(0 0% 80%);
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    backdrop-filter: blur(4px);
}
.dok-fav-btn:hover {
    background: hsl(0 0% 0% / 0.7);
    color: hsl(45 100% 60%);
    transform: scale(1.15);
}
.dok-fav-btn.dok-fav-active {
    color: hsl(45 100% 55%);
}
.dok-fav-btn svg {
    width: 1em;
    height: 1em;
}

/* Card Body — right side, split into top + bottom */
.dok-card-body {
    padding: 0.5em 0.625em;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
}
.dok-card-top {
    display: flex;
    flex-direction: column;
    gap: 0.15em;
}
.dok-card-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.15em;
    margin-top: 0.35em;
}
.dok-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35em;
}
.dok-card-tag {
    font-size: 0.6875em;
    font-family: var(--font-sans);
    font-weight: 500;
    padding: 0.25em 0.6em 0.15em 0.6em;
    border-radius: 0.35em;
    white-space: nowrap;
    line-height: 1.5;
    margin-bottom: 0.75em;
}
.dok-card-title {
    font-size: 0.75em;
    font-weight: 600;
    font-family: var(--font-sans);
    color: hsl(var(--foreground));
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dok-card-summary {
    font-size: 0.625em;
    font-family: var(--font-sans);
    color: hsl(var(--muted-fg));
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@keyframes dok-ai-appear {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0);   }
}
@keyframes dok-ai-skeleton-shimmer {
    from { background-position: 130% 0, 0 0; }
    to   { background-position: -30% 0,  0 0; }
}
@keyframes dok-ai-skeleton-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes dok-ai-icon-pulse {
    0%   { opacity: 0;    transform: scale(0.55) rotate(-18deg); }
    60%  { opacity: 1;    transform: scale(1.18) rotate(5deg);   }
    100% { opacity: 0.65; transform: scale(1)    rotate(0deg);   }
}
@keyframes dok-ai-text-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.dok-card-ai-summary {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
    margin-top: 1em;
    font-size: 0.625em;
    font-family: var(--font-sans);
    color: hsl(var(--muted-fg));
    line-height: 1.4;
    animation: dok-ai-appear 0.3s ease-out 0.1s both;
    flex-direction: column;
}
.dok-card-ai-icon {
    flex-shrink: 0;
    margin-top: 0.15em;
    opacity: 0.65;
    animation: dok-ai-icon-pulse 0.6s cubic-bezier(0.2, 0.8, 0.3, 1) 0.85s both;
}
.dok-card-ai-body {
    position: relative;
    flex: 1;
    min-height: 2.6em;
}
.dok-card-ai-skeleton {
    position: absolute;
    inset: 0;
    border-radius: 3px;
    pointer-events: none;
    background-image:
        linear-gradient(90deg,
            transparent            0%,
            hsl(var(--muted-fg) / 0.22) 50%,
            transparent            100%
        ),
        repeating-linear-gradient(
            to bottom,
            hsl(var(--muted-fg) / 0.13) 0px,
            hsl(var(--muted-fg) / 0.13) 8px,
            transparent                 8px,
            transparent                 14px
        );
    background-size: 300% 100%, 100% 100%;
    animation:
        dok-ai-skeleton-shimmer 1.1s ease-in-out 0.15s 1,
        dok-ai-skeleton-out     0.4s ease-in      1.2s  both;
}
.dok-card-ai-summary span {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    animation: dok-ai-text-in 0.55s ease-out 1.2s both;
}
.dok-card-notes {
    font-size: 0.5625em;
    font-family: var(--font-sans);
    color: hsl(var(--primary) / 0.7);
    font-style: italic;
}
.dok-card-meta {
    font-size: 0.685em;
    font-family: var(--font-mono);
    color: hsl(var(--muted-fg));
}

/* ---- Document Count ---- */
.dok-count {
    text-align: center;
    padding: 0.75em;
    font-size: 0.6875em;
    font-family: var(--font-sans);
    color: hsl(var(--muted-fg));
}

/* ---- Inline Document Viewer ---- */
.dok-viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
.dok-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;
}
.dok-viewer-back {
    display: flex;
    align-items: center;
    gap: 0.25em;
    background: none;
    border: 0.0625em solid hsl(var(--border));
    border-radius: var(--radius);
    color: hsl(var(--foreground));
    font-size: 0.6875em;
    font-family: var(--font-sans);
    padding: 0.4em 0.6em;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.1;
}
.dok-viewer-back:hover {
    background: hsl(var(--muted) / 0.5);
    border-color: #333;
}
.dok-viewer-info {
    display: flex;
    align-items: baseline;
    gap: 0.5em;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.dok-viewer-tags {
    display: flex;
    gap: 0.15em;
    flex-shrink: 0;
}
.dok-viewer-title {
    font-size: 0.75em;
    font-weight: 600;
    font-family: var(--font-sans);
    color: hsl(var(--foreground));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dok-viewer-meta {
    font-size: 0.685em;
    font-family: var(--font-mono);
    color: hsl(var(--muted-fg));
    white-space: nowrap;
    flex-shrink: 0;
}
.dok-viewer-fullscreen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0.0625em solid hsl(var(--border));
    border-radius: var(--radius);
    color: hsl(var(--foreground));
    padding: 0.3em;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.dok-viewer-fullscreen:hover {
    background: hsl(var(--primary) / 0.1);
    border-color: hsl(var(--primary) / 0.4);
    color: hsl(var(--primary));
}
.dok-viewer-download {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0.0625em solid hsl(var(--border));
    border-radius: var(--radius);
    color: hsl(var(--foreground));
    padding: 0.3em;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    flex-shrink: 0;
}
.dok-viewer-download:hover {
    background: hsl(var(--primary) / 0.1);
    border-color: hsl(var(--primary) / 0.4);
    color: hsl(var(--primary));
}
.dok-viewer-embed {
    flex: 1;
    min-height: 0;
    background: hsl(var(--muted) / 0.3);
}
.dok-viewer-embed iframe {
    width: 100%;
    height: 100%;
    border: none;
}
.dok-viewer-embed:fullscreen {
    background: hsl(0 0% 10%);
}
.dok-viewer-embed:fullscreen iframe {
    width: 100vw;
    height: 100vh;
}

/* ---- Global Document Viewer Overlay ---- */
#doc-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    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;
}
#doc-viewer-overlay.doc-viewer-hidden {
    display: none;
}
@keyframes doc-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
#doc-viewer-panel {
    width: 100%;
    max-width: 72em;
    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);
}
#doc-viewer-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 0.75em;
    border-bottom: 0.0625em solid hsl(var(--border));
    flex-shrink: 0;
}
#doc-viewer-content {
    flex: 1;
    min-height: 0;
    position: relative;     /* anchor for summary box */
    overflow: auto;
    display: flex;
}
/* Bild-Anzeige im Doc-Viewer */
.doc-viewer-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    margin: auto;
    object-fit: contain;
    padding: 1em;
    cursor: default;
    user-select: none;
}

/* ============================================================
   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: 15%;
    right: 15%;
    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: 36.9231em; /* 480px at font-size 0.8125em */
    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%);
}

/* ── Embedded mode: din-ic (Input Card) inside ContentPanel ────── */
.din-ic.din-ic--embedded {
    position: relative;
    bottom: auto;
    right: auto;
    width: 100%;
    z-index: auto;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    transition: none;
    transform: none;
    color: #333;
}
.din-ic.din-ic--embedded.din-ic-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.din-ic.din-ic--embedded.din-ic-closed {
    opacity: 0;
    transform: none;
    pointer-events: none;
    display: none;
}
.din-ic.din-ic--embedded .din-ic-header {
    display: none; /* ContentPanel already has a header */
}
.din-ic.din-ic--embedded .din-ic-body {
    padding: 0.75em 1em 1.25em;
}
.din-ic.din-ic--embedded .din-ic-label {
    color: #555;
}
.din-ic.din-ic--embedded .din-ic-input,
.din-ic.din-ic--embedded .din-ic-select {
    background: #fff;
    color: #111;
    border-color: #d1d5db;
}
.din-ic.din-ic--embedded .din-ic-section-title {
    color: #888;
}

/* ── din-ic inside ContentPanel (#din-ic-mount) ─────────────────────────── */
#din-ic-mount .din-ic.din-ic--embedded {
    font-size: 1em;                         /* 14px — gleich wie ContentPanel-Basis */
    color: #111;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
#din-ic-mount .din-ic-body {
    padding: 0.857em 0.929em 1.143em;       /* 12 13 16 ÷ 14 */
}
#din-ic-mount .din-ic-row {
    margin-bottom: 0.571em;                 /* 8 ÷ 14 */
}
#din-ic-mount .din-ic-row-half {
    max-width: 50%;
}
#din-ic-mount .din-ic-section-title {
    display: block;                         /* sichtbar im ContentPanel */
    font-size: 0.714em;                     /* 10px ÷ 14 */
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #bbb;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.5em;
    margin-top: 1.071em;                    /* 15 ÷ 14 */
    margin-bottom: 0.714em;                 /* 10 ÷ 14 */
}
#din-ic-mount .din-ic-section-title:first-child {
    margin-top: 0;
}
#din-ic-mount .din-ic-label {
    font-family: var(--font-sans);
    font-size: 0.857em;                     /* 12px ÷ 14 */
    color: #999;
    margin-bottom: 0.286em;
    font-weight: 400;
}
#din-ic-mount .din-ic-input,
#din-ic-mount .din-ic-select {
    background: #fafafa;
    border: 1px solid #eaeaea;
    color: #111;
    border-radius: 0.357em;                 /* 5px ÷ 14 */
    height: 2em;                            /* 28px */
    font-family: var(--font-sans);
    font-size: 0.929em;                     /* 13px ÷ 14 */
    box-sizing: border-box;
    width: 100%;
    transition: border-color 0.15s ease;
}
#din-ic-mount .din-ic-input:focus,
#din-ic-mount .din-ic-select:focus {
    border-color: #555;
    box-shadow: none;
    outline: none;
}
/* 4-Spalten → 2×2 Grid im schmalen Panel */
#din-ic-mount .din-ic-row-4col {
    grid-template-columns: 1fr 1fr;         /* 2 Spalten statt 4 */
    gap: 0.357em 0.571em;                   /* 5 8 ÷ 14 */
    margin-bottom: 0.571em;
}
#din-ic-mount .din-ic-calc-btn {
    background: #111;
    color: #fff;
    border-radius: 0.357em;
    height: 2.143em;                        /* 30px ÷ 14 */
    font-size: 0.929em;                     /* 13px */
    font-weight: 600;
    margin-top: 1em;
    letter-spacing: 0.02em;
    transition: background 0.15s ease;
}
#din-ic-mount .din-ic-calc-btn:hover {
    background: #000;
}
#din-ic-mount .din-ic-calc-btn svg {
    stroke: #fff;
}
#din-ic-mount .din-ic-error {
    font-size: 0.857em;
    border-radius: 0.357em;
    margin-top: 0.571em;
}

/* ── DinPanel — Accordion-Container im ContentPanel ─────────────────────── */
.din-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: var(--font-sans);
    font-size: 1em;                         /* inherits 14px from .content-panel — gleich wie .ghost-panel */
    -webkit-font-smoothing: antialiased;
}

.din-panel__section {
    border-bottom: 1px solid #eaeaea;
}
.din-panel__section--result {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.din-panel__fold-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.615em 1em;                   /* 8 13 ÷ 13 */
    border: none;
    background: #fafafa;
    color: #999;
    cursor: pointer;
    font-size: 0.692em;                     /* ~9px */
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: left;
    font-family: inherit;
    transition: background 0.12s ease, color 0.12s ease;
}
.din-panel__fold-header:hover {
    background: #f0f0f0;
    color: #555;
}
.din-panel__fold-header--static {
    cursor: default;
    pointer-events: none;
}
.din-panel__fold-header--static:hover {
    background: #fafafa;
    color: #999;
}

.din-panel__chevron {
    flex-shrink: 0;
    color: #ccc;
    transform: rotate(0deg);
    transition: transform 0.18s ease;
}
.din-panel__chevron--open {
    transform: rotate(180deg);
}

/* Smooth accordion via grid trick (keine fixe Höhe nötig) */
.din-panel__fold-body {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.2s ease;
}
.din-panel__fold-body--collapsed {
    grid-template-rows: 0fr;
}
.din-panel__fold-inner {
    overflow: hidden;
}

/* ── #din-rp-mount im DinPanel ───────────────────────────────────────────── */
#din-rp-mount .din-rp.din-rp--embedded {
    height: auto;
    font-size: 0.923em;                     /* ~12px */
}
#din-rp-mount .din-rp.din-rp--embedded .din-rp-body {
    padding: 0.923em 1em 1.231em;
    overflow-x: hidden;
}

/* ── Embedded mode: din-rp inside ContentPanel ─────────────────── */
.din-rp.din-rp--embedded {
    position: relative;
    top: auto;
    left: auto;
    bottom: auto;
    width: 100%;
    height: 100%;
    z-index: auto;
    box-shadow: none;
    transition: none;
    transform: none;
    background: transparent;
}
.din-rp.din-rp--embedded.din-rp-open {
    transform: none;
}
.din-rp.din-rp--embedded.din-rp-closed {
    transform: none;
    display: none;
}
.din-rp.din-rp--embedded .din-rp-header {
    display: none; /* ContentPanel already has a header */
}
.din-rp.din-rp--embedded .din-rp-body {
    padding: 0.75em 1em 1.25em;
}

.din-rp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.3846em 1.5385em;
    border-bottom: 1px solid #eaeaea;
    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: #555;
    padding: 0;
    border-radius: 0.375em;
    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: 1px solid #eaeaea;
    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: #555;
    padding: 0;
    border-radius: 0.375em;
    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: 0.3125em; /* 5px at 16px */
    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;
    top: 50%;
    left: calc(50% + 30px);             /* +30px: Mitte der Fläche rechts der Sidebar (60px) */
    /* Zentriert — wird durch dinChatOpen(posRect) überschrieben wenn Koordinaten übergeben */
    transform: translateY(-50%) translateX(-50%);
    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(-50%) translateX(-50%);
    pointer-events: auto;
}
.din-cw-closed {
    opacity: 0;
    transform: translateY(calc(-50% + 1.6667em)) translateX(-50%);
    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;
}

/* ── Brand Logo ─────────────────────────────────────────────── */
#brand-logo {
    display: none;
}

#brand-logo a {
    display: block;
    cursor: pointer;
}

#brand-logo img {
    width: 100%;
    height: auto;
    display: block;
}

body.shell-viewer-hidden #brand-logo {
    display: none;
}

/* ── Bottom Dock wrapper ────────────────────────────────────── */
#bottom-dock {
    position: absolute;
    bottom: 1.15em;
    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 {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: rgba(30, 30, 30, 0.65);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.919em;
    border-radius: 0.8em;
    padding: 0.3em;
    gap: 0;
    overflow: hidden;
    box-shadow: none;
}

/* Tab-Zeile + Toggle innerhalb der Pill */
.dock-pill__row {
    display: flex;
    align-items: center;
    padding: 0.2em;
    gap: 0;
    justify-content: center;
}

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

.view-tab {
    font-size: 0.82em;
    height: 2.4em;
    padding: 0 1.2em;
    background: transparent;
    border: none;
    border-radius: 0.55em;
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--font-sans);
    font-weight: 550;
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.view-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
}
.view-tab.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 600;
    box-shadow: none;
}

/* separator */
.dock-sep {
    width: 1px;
    height: 1.4em;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 0.3em;
    flex-shrink: 0;
}

/* Grid / toolbox toggle button */
.dock-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.2em;
    height: 2.2em;
    background: transparent;
    border: none;
    border-radius: 0.4em;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease;
    flex-shrink: 0;
}
.dock-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
}
.dock-icon-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* ── Toolbox panel (innerhalb der dock-pill) ─────────────────── */
#toolbox-panel {
    display: flex;
    align-items: flex-end;
    gap: 1.5em;
    padding: 0.75em 0.5em 0.75em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    max-height: 10em;           /* generous room for bigger buttons */
    opacity: 1;
    transition:
        max-height 0.22s ease,
        opacity 0.18s ease,
        padding 0.22s ease;
    background: none;
}
#toolbox-panel.toolbox-hidden {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom-color: transparent;
}

/* 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.6875em;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    line-height: 1;
}
.tbx-pills {
    display: flex;
    align-items: center;
    gap: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.1875em;
    box-shadow: none;
}
.tbx-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1875em;
    width: 3.75em;
    height: 3em;
    padding: 0.375em 0.5em;
    background: transparent;
    border: none;
    border-radius: 0.5em;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}
.tbx-btn svg {
    width: 21px;
    height: 21px;
}

.tbx-btn span {
    font-family: var(--font-sans);
    font-size: 0.804em;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.2;
    white-space: nowrap;
}
.tbx-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
}
/* active measure tool */
.tbx-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}
.tbx-btn.active:hover {
    background: rgba(255, 255, 255, 0.2);
}
/* first-point set — subtle blue accent */
.tbx-btn.measure-btn-first-pt {
    background: #2563eb;
    color: #fff;
}
/* danger (clear/trash) */
.tbx-btn-danger:hover {
    background: rgba(220, 50, 50, 0.15) !important;
    color: #ff6b6b !important;
}
/* separator inside pills */
.tbx-sep {
    width: 1px;
    height: 1.125em;
    background: rgba(255, 255, 255, 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 ──────────────────────────────────────────────── */

#status-bar:hover {
    opacity: 1;
}

/* ── 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);
    }
}

/* ══════════════════════════════════════════════════════════════
   Ö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 */
}

/* Clip-Info: sichtbar während Drag, #sb-drag-val hervorgehoben */
#sb-clip-info #sb-drag-val {
    color: #555;
    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 0.3125em-Rahmen (= 5px at 16px) um den gesamten Viewport */
body.inspect-mode::before {
    content: "";
    position: fixed;
    inset: 0;
    border: 0.3125em 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: 0.09375em solid var(--inspect-ci-55) !important; /* 1.5px at 16px */
    outline-offset: 0.0625em; /* 1px at 16px */
}

/* ── Tooltip ──────────────────────────────────────────────────── */
#inspect-tooltip {
    position: fixed;
    z-index: 2147483646;
    pointer-events: none;
    display: none;
    flex-direction: column;
    gap: 0.3em;
    min-width: 11.25em; /* 180px at 16px */
    max-width: 20em;    /* 320px at 16px */
    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: 36.9231em; /* 480px at font-size 0.8125em */
    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: 1px solid #eaeaea;
    flex-shrink: 0;
    flex-direction: column;
    gap: 1.5em;
    font-size: 1.15em;
}
.doc-panel-header-text {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.1538em;
    min-width: 0;
    flex: 1;
    padding: 0 0.4em;
}
.doc-panel-title {
    font-size: 1.23em;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.01em;
    border: none;
    background: none;
    outline: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    flex: 1;
    min-width: 0;
}
.doc-panel-title::placeholder {
    color: #bbb;
}
.doc-panel-title:focus {
    color: #000;
}
.doc-panel-subtitle {
    font-size: 0.8462em;
    color: #666;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: none;
}

/* ── Save indicator ──────────────────────────────────────────────────────── */
.doc-save-indicator {
    margin-left: 1em;
    font-size: 0.929em;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: #999;
    white-space: nowrap;
    transition: color 0.3s ease, opacity 0.3s ease;
}
.doc-save-indicator--saved {
    color: #30cf79;
}
.doc-save-indicator--error {
    color: #eb4d4b;
}
.doc-panel-close {
    width: 3em;
    height: 3em;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #555;
    padding: 0;
    border-radius: 0.375em;
    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: #f5f5f5;
    color: #111;
}
.doc-panel-close svg {
    width: 40%;
    height: 40%;
}

/* ── Header buttons row ── */
.doc-panel-header-actions {
    display: flex;
    align-items: center;
    gap: 0.25em;
    flex-shrink: 0;
    width: 60%;
    justify-content: flex-end;
}

/* ── Header action buttons (Export, Bearbeiten, Lesen) ── */
.doc-panel-header-btn {
    display: flex;
    align-items: center;
    gap: 0.615em;                               /* 8 ÷ 13 — mirrors sidebar__item */
    height: 2.462em;                            /* 32 ÷ 13 */
    padding: 0 0.923em;                         /* 0 12 ÷ 13 */
    border: none;
    background: transparent;
    color: #666;
    font-size: 1em;                             /* inherits 13px from .doc-panel */
    font-weight: 400;
    border-radius: 0.462em;                     /* 6 ÷ 13 */
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
    font-family: var(--font-sans);
    transition: background 0.15s, color 0.15s;
}
.doc-panel-header-btn:hover {
    background: #f5f5f5;
    color: #111;
}

/* ── Header export dropdown ── */
.doc-panel-header-export-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.3em;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 0.5em;
    padding: 0.25em;
    display: flex;
    flex-direction: column;
    gap: 0.1em;
    min-width: 10em;
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
    z-index: 20;
}
.doc-panel-header-export-dropdown__item {
    display: block;
    width: 100%;
    padding: 0.4em 0.65em;
    border: none;
    background: transparent;
    color: #444;
    font-size: 0.82em;
    font-family: var(--font-sans);
    text-align: left;
    border-radius: 0.3em;
    cursor: pointer;
}
.doc-panel-header-export-dropdown__item:hover {
    background: #f5f5f5;
    color: #111;
}


/* ── Floating Toolbar — schwebt rechts vom doc-panel, folgt Cursor vertikal ── */
.doc-panel-floating-toolbar {
    position: fixed;
    left: calc(var(--shell-offset, 456px) + 0.625em);
    top: -3em;                            /* Anker; Position via transform gesetzt */
    z-index: 10600;
    font-size: 1em;
    /* Kein eigenes background/border/shadow — übernimmt .doc-panel-toolbar */
    transition: transform 0.5s ease;
    will-change: transform;
    pointer-events: auto;
}

/* ── Floating Toolbar Container — transparent, Styling übernimmt die Toolbar selbst */
.doc-panel-floating-toolbar {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
}

/* ── Toolbar — Dark Pill Style, 2-zeilig ────────────���───────────────────── */
.doc-panel-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.15em;
    padding: 0.4em 0.6em;
    background: #1c1c1e;
    border-radius: 0.5em;
    box-shadow:
        0 0.5em 1.5em rgba(0, 0, 0, 0.35),
        0 0.125em 0.375em rgba(0, 0, 0, 0.25),
        inset 0 0.0625em 0 rgba(255, 255, 255, 0.06);
    position: relative;
    flex-shrink: 0;
    align-items: flex-start;
    border-bottom: none;
}

/* Einzelne Zeile */
.doc-panel-toolbar-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.1em;
}

/* Trennlinie zwischen den zwei Zeilen */
.doc-panel-toolbar-row + .doc-panel-toolbar-row {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 0.15em;
}

/* Einzelner Button */
.doc-panel-toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.1em;
    height: 2.1em;
    padding: 0;
    border-radius: 0.35em;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9em;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background 0.1s ease, color 0.1s ease;
    flex-shrink: 0;
}
.doc-panel-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.doc-panel-toolbar-btn.is-active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}
.doc-panel-toolbar-btn:disabled {
    color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
}
.doc-panel-toolbar-btn--labeled {
    width: auto;
    padding: 0 0.55em;
    gap: 0.5em;
    font-size: 0.75em;
    letter-spacing: 0;
    padding-top: 0.25em;
}

/* Trennstrich zwischen Gruppen */
.doc-panel-toolbar-divider {
    width: 1px;
    height: 1.1em;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 0.25em;
    flex-shrink: 0;
}

/* ── Export Menu ── */
.doc-panel-export-menu {
    position: absolute;
    bottom: calc(100% + 0.5em);
    right: 0;
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.5em;
    padding: 0.25em;
    display: flex;
    flex-direction: column;
    gap: 0.15em;
    min-width: 10em;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    z-index: 10;
}

.doc-panel-export-menu__item {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.4em 0.6em;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82em;
    border-radius: 0.3em;
    cursor: pointer;
    white-space: nowrap;
    text-align: left;
}

.doc-panel-export-menu__item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ── 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.2em;
    background: #ffffff;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
    font-size: 1.25em;
}
.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;
}
/* ── Links ── */
.doc-panel-body .tiptap a {
    color: inherit !important;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    cursor: pointer;
}
/* Anchor links: kleiner Pfeil ↘ */
.doc-panel-body .tiptap a[href^="#"]::after {
    content: " ↘";
    font-size: 0.75em;
    opacity: 0.65;
    display: inline-block;
    text-decoration: none;
}

.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);
}


/* ── 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 {
    height: 2.462em;                            /* 32 ÷ 13 — matches sidebar__item */
    padding: 0 0.923em;                         /* 0 12 ÷ 13 */
    border-radius: 0.462em;                     /* 6 ÷ 13 */
    border: none;
    background: transparent;
    color: #999;
    font-size: 1em;                             /* inherits 13px */
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.615em;                               /* 8 ÷ 13 */
    transition: background 0.15s, color 0.15s;
    font-family: var(--font-sans);
    font-weight: 400;
    white-space: nowrap;
    box-sizing: border-box;
}
.doc-panel-toggle-btn.is-active {
    background: #ebebeb;
    color: #444;
}
.doc-panel-toggle-btn:hover {
    background: #f5f5f5;
    color: #444;
}

/* ── Link-Input — dark, passend zum Toolbar-Pill ── */
.doc-panel-link-input {
    display: flex;
    flex-direction: column;
    gap: 0.45em;
    padding: 0.5em 0.1em 0.1em;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    margin-top: 0.1em;
    width: 100%;
}

.doc-panel-link-input__field {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75em 0.65em;
    border-radius: 0.35em;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75em;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.doc-panel-link-input__field::placeholder {
    color: rgba(255, 255, 255, 0.3);
}
.doc-panel-link-input__field:focus {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(255, 255, 255, 0.1);
}

.doc-panel-link-input__actions {
    display: flex;
    gap: 0.3em;
}

.doc-panel-link-input__btn {
    padding: 0.65em 0.7em 0.45em;
    border-radius: 0.4em;
    font-size: 0.8;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    border: none;
    transition: background 0.12s ease, opacity 0.12s ease;
    white-space: nowrap;
    background: transparent;
}

/* Setzen */
.doc-panel-link-input__btn--confirm {
    background: none;
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.75);
}
.doc-panel-link-input__btn--confirm:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

/* Entfernen */
.doc-panel-link-input__btn--remove {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
}
.doc-panel-link-input__btn--remove:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}

/* ✕ Schließen */
.doc-panel-link-input__btn--cancel {
    background: transparent;
    border-color: transparent;
    color: rgba(255, 255, 255, 0.25);
    margin-left: auto;
}
.doc-panel-link-input__btn--cancel:hover {
    color: rgba(255, 255, 255, 0.55);
}

/* ── Anchor heading list inside link input ─────────────────────────────── */
.doc-panel-link-anchors {
    display: flex;
    flex-direction: column;
    max-height: 11em;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    margin-top: 0.15em;
    padding-top: 0.1em;
}
.doc-panel-link-anchors__item {
    display: flex;
    align-items: center;
    gap: 0.55em;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.82em;
    font-weight: 400;
    font-family: var(--font-sans);
    padding: 0.8em 0.75em;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.1s ease;
}
.doc-panel-link-anchors__item:last-child {
    border-bottom: none;
}
.doc-panel-link-anchors__item:hover {
    background: rgba(255, 255, 255, 0.075);
    color: rgba(255, 255, 255, 0.95);
}
.doc-panel-link-anchors__level {
    font-size: 0.7em;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    width: 1.6em;
}

/* ── Annotation Picker — dark dropdown, Screenshot-Stil ──────────────────── */
.doc-panel-annotation-picker {
    position: absolute;
    bottom: unset;   /* öffnet nach oben, über der Toolbar */
    left: 0;
    z-index: 10700;
    width: 16em;
    background: #242428;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.65em;
    box-shadow:
        0 1em 2.5em rgba(0, 0, 0, 0.5),
        0 0.25em 0.5em rgba(0, 0, 0, 0.3);
    font-family: var(--font-sans);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-size: 0.9em;
    top: calc(100% + 0.5em);
}

/* Suche */
.doc-panel-annotation-picker__search {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.6em 0.75em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}
.doc-panel-annotation-picker__search-icon {
    width: 0.85em;
    height: 0.85em;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}
.doc-panel-annotation-picker__search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85em;
    font-family: var(--font-sans);
}
.doc-panel-annotation-picker__search-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* Item-Liste */
.doc-panel-annotation-picker__list {
    overflow-y: auto;
    max-height: 13em;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.doc-panel-annotation-picker__empty {
    padding: 0.75em;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
}

.doc-panel-annotation-picker__item {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.55em 0.75em;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.1s ease;
}
.doc-panel-annotation-picker__item:last-child {
    border-bottom: none;
}
.doc-panel-annotation-picker__item:hover {
    background: rgba(255, 255, 255, 0.075);
}

/* Kleiner Farbpunkt links */
.doc-panel-annotation-picker__item-dot {
    width: 0.45em;
    height: 0.45em;
    border-radius: 50%;
    background: rgb(244, 230, 132, 0.7);
    flex-shrink: 0;
}

.doc-panel-annotation-picker__item-body {
    flex: 1;
    min-width: 0;
}
.doc-panel-annotation-picker__item-title {
    font-size: 0.85em;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.doc-panel-annotation-picker__item-sub {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.35);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0.1em;
}

/* Footer */
.doc-panel-annotation-picker__footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.75em 0.75em 0.65em;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}
.doc-panel-annotation-picker__footer-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    padding: 0.2em 0.4em;
    border-radius: 0.3em;
    transition: color 0.12s ease, background 0.12s ease;
}
.doc-panel-annotation-picker__footer-btn:hover {
    color: rgba(255, 255, 255, 0.75);
    background: rgba(139, 92, 246, 0.12);
}

/* ── Document list (sidebar integration) ── */
/* ── Dokumente-Liste — alle em-Werte (doc-panel hat font-size: 0.8125em = 13px) ── */
.doc-panel-list-header {
    display: flex;
    align-items: center;
    gap: 0.6154em;        /* 8px/13px */
    padding: 0.7692em 1.0769em; /* 10px/13px, 14px/13px */
    border-bottom: 1px solid #eaeaea;
    flex-shrink: 0;
}
.doc-panel-list-count {
    font-size: 0.8462em;  /* 11px/13px */
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6b7280;
    flex: 1;
}
.doc-panel-list-new-btn {
    padding: 0.3636em 1.0909em; /* 4px/11px, 12px/11px */
    border-radius: 0.3636em;    /* 4px/11px */
    border: 1px solid rgba(59, 130, 246, 0.22);
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
    font-size: 0.8462em;        /* 11px/13px */
    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: 0.7692em;        /* 10px/13px */
    padding: 0.6923em 1.0769em; /* 9px/13px, 14px/13px */
    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: 0.1538em; /* 2px/13px */
}
.doc-panel-list-icon svg {
    width: 1.0769em;  /* 14px/13px */
    height: 1.0769em;
}

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

.doc-panel-list-empty {
    padding: 1.8462em 1.0769em; /* 24px/13px, 14px/13px */
    text-align: center;
    color: #6b7280;
    font-size: 0.9231em; /* 12px/13px */
}

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

/* ══════════════════════════════════════════════════════════════
   ANNOTATION LINK CHIP  (TipTap NodeView — doc-panel)
   Dynamische Farben (background, border, color) bleiben inline,
   da sie zur Laufzeit vom Annotationstyp bestimmt werden.
   ══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   EMBED DROP CURSOR — visible line when dragging embeds
   ═══════════════════════════════════════════════════════════════ */

/* Custom Embed Drop Indicator — eigenes Drag-System (EmbedDragPlugin) */
.embed-drop-indicator {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: hsl(221 83% 53%);
    border-radius: 1px;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 0 4px hsl(221 83% 53% / 0.4);
}
.embed-drop-indicator::before,
.embed-drop-indicator::after {
    content: '';
    position: absolute;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: hsl(221 83% 53%);
}
.embed-drop-indicator::before { left: -4px; }
.embed-drop-indicator::after  { right: -4px; }

/* ProseMirror dropcursor: override default to full-width blue line */
.ProseMirror .embed-dropcursor,
.ProseMirror .ProseMirror-dropcursor {
    background: hsl(221 83% 53%) !important;
    height: 2px !important;
    border-radius: 1px;
    margin: 2px 0;
    opacity: 1 !important;
}

/* ═══════════════════════════════════════════════════════════════
   SLASH COMMAND POPUP
   ═══════════════════════════════════════════════════════════════ */

.slash-cmd-popup {
    position: absolute;
    left: 0;
    top: 0.25em;
    z-index: 200;
    min-width: 220px;
    max-width: 300px;
    background: hsl(220 13% 18%);
    border: 1px solid hsl(220 13% 28%);
    border-radius: 0.5em;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    padding: 0.25em;
    font-family: var(--font-sans, system-ui);
    font-size: 0.85em;
}

.slash-cmd-item {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.45em 0.6em;
    border-radius: 0.35em;
    cursor: pointer;
    transition: background 0.1s;
    color: hsl(220 13% 80%);
}

.slash-cmd-item:hover,
.slash-cmd-item--active {
    background: hsl(221 83% 53% / 0.18);
    color: hsl(220 13% 95%);
}

.slash-cmd-icon {
    font-size: 1.1em;
    flex-shrink: 0;
    width: 1.5em;
    text-align: center;
}

.slash-cmd-text {
    display: flex;
    flex-direction: column;
    gap: 0.05em;
    min-width: 0;
}

.slash-cmd-label {
    font-weight: 600;
    font-size: 0.9em;
    white-space: nowrap;
}

.slash-cmd-desc {
    font-size: 0.78em;
    color: hsl(220 13% 55%);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════════════
   LESE-MODUS: ViewSnapshot-Nodes im Report ausblenden
   Die Elemente behalten 1px Höhe damit IntersectionObserver
   weiterhin feuert und die Kameranavigation funktioniert.
   ═══════════════════════════════════════════════════════════════ */

[data-component="DocumentEditor"]:not([data-mode="edit"]) .node-viewSnapshot {
    height: 0;
    overflow: hidden;
    opacity: 0;
    margin: 0;
    padding: 0;
    border: none;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   SNAPSHOT TRAIL — Rechter Bildschirmrand
   Fixed overlay, wirkt wie eine visuelle Scrollbar.
   Thumbnails als Wegmarken, Scroll-Indikator bewegt sich
   kontinuierlich mit der Report-Scroll-Position.
   ═══════════════════════════════════════════════════════════════ */

.snapshot-trail {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 10300;
    pointer-events: none;
}

/* ── Scroll-Indikator (bewegt sich mit Scroll) ─────────────── */

.snapshot-trail__indicator {
    position: absolute;
    right: 0.5em;
    width: 0.5em;
    height: 0.5em;
    border-radius: 50%;
    background: #6366f1;
    transform: translateY(calc(-50% - 0.7em));
    box-shadow: 0 0 0.4em rgba(99, 102, 241, 0.5);
    z-index: 2;
    pointer-events: none;
    will-change: top;
}

/* ── Stop: ein Snapshot-Marker ─────────────────────────────── */

.snapshot-trail__stop {
    position: absolute;
    right: 1.25em;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    pointer-events: auto;
    cursor: pointer;
}

/* ── Thumbnail-Karte ────────────────────────────────────────── */

.snapshot-trail__card {
    display: flex;
    align-items: center;
    gap: 0.5em;
    opacity: 0.4;
    transition: opacity 0.25s ease;
    flex-direction: column;
    width: 4.5em;
}

.snapshot-trail__stop:hover .snapshot-trail__card {
    opacity: 0.85;
}

.snapshot-trail__stop.is-active .snapshot-trail__card {
    opacity: 1;
}

.snapshot-trail__thumb {
    width: 3.5em;
    height: 2.25em;
    object-fit: cover;
    border-radius: var(--radius, 0.375em);
    border: 1px solid #ddd;
    background: #f0f0f0;
    flex-shrink: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.snapshot-trail__thumb--empty {
    background: #e8e8e8;
}

.snapshot-trail__stop:hover .snapshot-trail__thumb {
    border-color: #999;
}

.snapshot-trail__stop.is-active .snapshot-trail__thumb {
    border-color: #6366f1;
    box-shadow: 0 0 0 1.5px rgba(99, 102, 241, 0.3);
}

.snapshot-trail__label {
    font-family: var(--font-sans);
    font-size: 0.6875em;
    font-weight: 500;
    color: #888;
    white-space: nowrap;
    max-width: 6em;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    transition: color 0.2s ease;
}

.snapshot-trail__stop:hover .snapshot-trail__label {
    color: #444;
}

.snapshot-trail__stop.is-active .snapshot-trail__label {
    color: #111;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   EMBED INLINE — Lese-Modus: kompakte Inline-Referenzen
   Minimale Darstellung die im Lesefluss aufgeht.
   ═══════════════════════════════════════════════════════════════ */

.embed-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.1em 0.45em 0.15em;
    border-radius: 0.25em;
    border-bottom: 1.5px solid transparent;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    font-size: 0.92em;
    font-weight: 500;
    font-family: var(--font-sans, system-ui);
    line-height: 1.5;
    vertical-align: baseline;
    text-decoration: none;
    white-space: nowrap;
    max-width: 100%;
}

.embed-inline:hover {
    text-decoration: none;
}

.embed-inline__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 28em;
}

.embed-inline__badge {
    font-size: 0.72em;
    font-weight: 600;
    padding: 0.1em 0.4em;
    border-radius: 0.25em;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.embed-inline__dim {
    font-size: 0.78em;
    opacity: 0.55;
    font-weight: 400;
    flex-shrink: 0;
}

.embed-inline__thumb {
    width: 1.3em;
    height: 1.6em;
    object-fit: cover;
    border-radius: 0.15em;
    flex-shrink: 0;
    box-shadow: 0 0 0 0.5px rgba(0,0,0,0.12);
}

/* Paperless-Dokument: Lese-Modus Card (Cover + Titel + Autor + Tags) */
.embed-doc-read {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 0.6em 0;
    border-radius: 0.5em;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    font-family: var(--font-sans, system-ui);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.embed-doc-read:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

.embed-doc-read__cover {
    flex-shrink: 0;
    width: 64px;
    background: hsl(220 14% 90%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.embed-doc-read__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.embed-doc-read__cover--fallback {
    color: hsl(220 14% 70%);
}

.embed-doc-read__body {
    flex: 1;
    min-width: 0;
    padding: 0.55em 0.75em;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15em;
}

.embed-doc-read__title {
    font-weight: 600;
    font-size: 0.88em;
    color: hsl(220 14% 20%);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.embed-doc-read__author {
    font-size: 0.78em;
    color: hsl(220 10% 48%);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.embed-doc-read__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25em;
    margin-top: 0.15em;
}

.embed-doc-read__tag {
    font-size: 0.68em;
    font-weight: 500;
    padding: 0.1em 0.45em 0.15em;
    border-radius: 0.75em;
    background: hsl(220 14% 88%);
    color: hsl(220 14% 40%);
    white-space: nowrap;
}

/* Annotation-Chip im Lese-Modus: noch schlanker als Edit */
.ann-embed-chip--read {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    padding: 0.05em 0.35em 0.1em;
    border-radius: 0.2em;
    border: none;
    border-bottom: 1.5px solid transparent;
    cursor: pointer;
    font-size: 0.92em;
    font-weight: 500;
    transition: background 0.12s;
    vertical-align: baseline;
    white-space: nowrap;
}

.ann-embed-chip--read .ann-embed-chip__dot {
    width: 5px;
    height: 5px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   EMBED CARDS — shared styles for all embed node types
   (AnnotationLink, AuditLink, PaperlessDocLink, ViewSnapshot)
   ═══════════════════════════════════════════════════════════════ */

.embed-card {
    display: flex;
    align-items: stretch;
    margin: 0.5em 0;
    border-radius: 0.375em;
    border: 1px solid;
    transition: all 0.15s ease;
    font-family: var(--font-sans, system-ui);
    overflow: hidden;
    /* borderLeft, background, borderColor: set inline per type */
}

/* Drag grip — left edge */
.embed-card__grip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    flex-shrink: 0;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    transition: opacity 0.15s ease;
    opacity: 0;
}
.embed-card:hover .embed-card__grip {
    opacity: 1;
}
.embed-card__grip:active {
    cursor: grabbing;
}

/* Prevent ProseMirror text-selection on the whole card */
.embed-card {
    user-select: none;
    -webkit-user-select: none;
}

/* Main content area */
.embed-card__body {
    flex: 1;
    min-width: 0;
    padding: 0.5em 0.6em;
    cursor: pointer;
}

/* Header row: icon + title + badges */
.embed-card__header {
    display: flex;
    align-items: center;
    gap: 0.4em;
    line-height: 1.4;
}

.embed-card__dot {
    width: 0.5em;
    height: 0.5em;
    border-radius: 50%;
    flex-shrink: 0;
}

.embed-card__title {
    font-size: 0.8125em;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.embed-card__badge {
    font-size: 0.625em;
    font-weight: 600;
    padding: 0.15em 0.55em;
    border-radius: 0.3em;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.01em;
}

/* Meta row: detail fields */
.embed-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2em 0.75em;
    margin-top: 0.3em;
    line-height: 1.5;
}

.embed-card__meta-item {
    font-size: 0.6875em;
    color: hsl(0 0% 40%);
}

.embed-card__meta-label {
    font-weight: 600;
    color: hsl(0 0% 55%);
    margin-right: 0.25em;
    font-size: 0.92em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.embed-card__meta-dim {
    color: hsl(0 0% 60%);
}

.embed-card__meta-tags {
    display: inline-flex;
    gap: 0.3em;
    align-items: center;
}

.embed-card__tag {
    font-size: 0.9em;
    padding: 0 0.4em;
    border-radius: 0.25em;
    background: hsl(0 0% 0% / 0.06);
    color: hsl(0 0% 45%);
    white-space: nowrap;
}

/* Actions column — right edge */
.embed-card__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 0.5em;
    flex-shrink: 0;
    gap: 0.25em;
}

/* Thumbnail area — left of body, after grip */
.embed-card__thumb {
    width: 64px;
    min-height: 48px;
    flex-shrink: 0;
    overflow: hidden;
    border-right: 1px solid hsl(0 0% 0% / 0.06);
    cursor: pointer;
    background: hsl(0 0% 0% / 0.03);
}
.embed-card__thumb img {
    display: block;
}

/* Inline edit input */
.embed-card__edit-input {
    font-size: 0.8125em;
    font-weight: 600;
    border: 1px solid hsl(221 83% 53% / 0.4);
    border-radius: 0.25em;
    padding: 0.1em 0.35em;
    outline: none;
    background: white;
    color: inherit;
    flex: 1;
    min-width: 0;
    font-family: inherit;
}
.embed-card__edit-input:focus {
    border-color: hsl(221 83% 53%);
    box-shadow: 0 0 0 2px hsl(221 83% 53% / 0.15);
}

.embed-card__action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75em;
    height: 1.75em;
    border-radius: 0.25em;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    background: transparent;
    color: hsl(0 0% 45%);
}
.embed-card__action-btn:hover {
    background: hsl(0 0% 0% / 0.06);
}
.embed-card__action-btn--danger:hover {
    background: hsl(0 80% 95%);
    color: hsl(0 70% 45%);
}

/* Edit-Button direkt im Header (neben Titel) */
.embed-card__action-btn--inline {
    width: 1.4em;
    height: 1.4em;
    border-radius: 0.2em;
    color: hsl(0 0% 60%);
    flex-shrink: 0;
}

/* ── Doc-Panel: Geist Light embed-card ─────────────────────── */

/* Card base */
.doc-panel-body .tiptap .embed-card {
    flex-wrap: wrap;
    border-radius: 0.5em;
    transition: background 0.12s, border-color 0.12s;
}

/* Title */
.doc-panel-body .tiptap .embed-card__title {
    font-size: 0.875em;
    font-weight: 600;
    color: #111;
    padding-top: 0.15em;
}

/* Badge — Geist pill */
.doc-panel-body .tiptap .embed-card__badge {
    font-size: 0.65em;
    font-weight: 500;
    padding: 0.2em 0.55em;
    border-radius: 0.35em;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #eaeaea;
}

/* Meta */
.doc-panel-body .tiptap .embed-card__meta-item {
    font-size: 0.72em;
    color: #666;
}
.doc-panel-body .tiptap .embed-card__meta-label {
    color: #999;
    font-size: 0.9em;
}
.doc-panel-body .tiptap .embed-card__meta-dim {
    color: #aaa;
}

/* Thumbnail border */
.doc-panel-body .tiptap .embed-card__thumb {
    border-right: 1px solid #eaeaea;
    background: #f9f9f9;
}

/* Actions row — flush bottom, proper padding */
.doc-panel-body .tiptap .embed-card__actions {
    flex-basis: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35em;
    padding: 0.4em 0.6em;
    border-top: 1px solid #eaeaea;
    background: #fafafa;
    box-sizing: border-box;
}
.doc-panel-body .tiptap .embed-card__action-btn {
    width: 1.6em;
    height: 1.6em;
    border-radius: 0.3em;
    color: #999;
}
.doc-panel-body .tiptap .embed-card__action-btn:hover {
    background: #f0f0f0;
    color: #333;
}
.doc-panel-body .tiptap .embed-card__action-btn--danger:hover {
    background: #fff0f0;
    color: #c00;
}
.doc-panel-body .tiptap .embed-card__checkbox-label {
    gap: 0.35em;
    margin-right: auto;
}
.doc-panel-body .tiptap .embed-card__checkbox-label input[type="checkbox"] {
    width: 0.85em;
    height: 0.85em;
}

.embed-card__checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.3em;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.embed-card__checkbox-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    accent-color: #6366f1;
}
.embed-card__checkbox-text {
    font-size: 0.8em;
    font-weight: 500;
    color: #777;
    padding-top: 0.1em;
}
.embed-card__checkbox-label.is-active .embed-card__checkbox-text {
    color: hsl(0 0% 35%);
}

/* ── Tooltip-Wrapper um das Checkbox-Label ── */
.embed-card__tooltip-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: auto;
}
.embed-card__tooltip {
    position: absolute;
    bottom: calc(100% + 0.5em);
    left: 0;
    z-index: 10900;
    background: #1a1a1a;
    color: #f5f5f5;
    font-size: 0.72em;
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.4;
    padding: 0.45em 0.7em;
    border-radius: 0.4em;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(0.3em);
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.embed-card__tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 1em;
    border: 0.3em solid transparent;
    border-top-color: #1a1a1a;
}
.embed-card__tooltip-wrap:hover .embed-card__tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════
   ANNOTATION EMBED CHIP — enhanced inline with drag grip
   ═══════════════════════════════════════════════════════════════ */

.ann-link-wrapper {
    display: inline;
}

.ann-embed-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    padding: 0.15em 0.6em 0.2em 0.2em;
    border-radius: 0.35em;
    font-size: 0.8em;
    font-weight: 600;
    cursor: default;
    user-select: none;
    vertical-align: middle;
    transition: all 0.15s ease;
    font-family: var(--font-sans, system-ui);
    line-height: 1.6;
    white-space: nowrap;
    position: relative;
}

.ann-embed-chip__grip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.9em;
    cursor: grab;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}
.ann-embed-chip__grip:active {
    cursor: grabbing;
}

.ann-embed-chip__main {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    cursor: pointer;
}

.ann-embed-chip__dot {
    width: 0.45em;
    height: 0.45em;
    border-radius: 50%;
    flex-shrink: 0;
}

.ann-embed-chip__badge {
    font-size: 0.8em;
    padding: 0 0.45em;
    border-radius: 0.25em;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Vorlauftext — sichtbar nach dem Label */
.ann-embed-chip__vorlauf {
    display: inline;
    margin-left: 0.3em;
    font-size: 0.85em;
    font-style: italic;
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 22em;
}

/* Inline edit input for annotation chip */
.ann-embed-chip__edit-input {
    font-size: 0.9em;
    font-weight: 600;
    border: 1px solid hsl(221 83% 53% / 0.4);
    border-radius: 0.2em;
    padding: 0 0.25em;
    outline: none;
    background: white;
    color: inherit;
    width: 8em;
    font-family: inherit;
}

.ann-embed-chip__toggle--danger:hover {
    color: hsl(0 70% 45%) !important;
    background: hsl(0 80% 95%) !important;
}

.ann-embed-chip__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35em;
    height: 1.35em;
    border-radius: 0.25em;
    margin-left: 0.15em;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.ann-embed-chip__indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15em;
    height: 1.15em;
    margin-left: 0.15em;
    opacity: 0.4;
    flex-shrink: 0;
}

.doc-panel-link-input__btn:hover {
    background: transparent;
}

/* ── Projekt-Wolken-Liste in der Info-Karte (cmd-palette) ────────────────── */
.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));
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cmd-proj-cloud-pts {
    margin-left: auto;
    font-family: var(--font-mono);
    color: hsl(var(--muted-fg));
    font-size: 0.9em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Info-Karten Layout (cmd-palette) ────────────────────────────────────── */
.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;
    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;
    display: flex;
    flex-direction: column;
}
.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 {}
.cmd-cloud-info-meta-sp {
    margin-left: auto;
}
.cmd-cloud-info-actions {
    display: flex;
    align-items: center;
    gap: 0.75em;
    margin-top: auto;
    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;
}

/* ── 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;
}
.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;
}
.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));
}
.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;
}

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

/* ══════════════════════════════════════════════════════════════════════════
   BuildingDataPanel (DIN-Spec style)
   ══════════════════════════════════════════════════════════════════════════ */

.bdp {
    display: flex;
    flex-direction: column;
    height: 100%;
    font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
}

/* ── Header ── */
.bdp-header {
    padding: 0.625em 1em;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.bdp-header__count {
    font-size: 0.75em;
    color: #9ca3af;
}
.bdp-header__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75em;
    height: 1.75em;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #6b7280;
    border-radius: 0.25em;
}
.bdp-header__toggle:hover {
    background: #f3f4f6;
    color: #374151;
}

/* ── Scrollable body ── */
.bdp-body {
    overflow-y: auto;
    flex: 1;
    padding: 0.75em 1em;
    display: flex;
    flex-direction: column;
    gap: 0.85em;
}

/* ── Row (side-by-side fields) ── */
.bdp-row {
    display: flex;
    gap: 0.75em;
}
.bdp-row > .bdp-field {
    flex: 1;
    min-width: 0;
}

/* ── Field cell ── */
.bdp-field {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
}
.bdp-field__label {
    font-size: 0.72em;
    font-weight: 500;
    color: #6b7280;
    letter-spacing: 0.01em;
}

/* ── Input / Select (edit mode) ── */
.bdp-field__input {
    width: 100%;
    font-size: 0.85em;
    font-weight: 500;
    padding: 0.55em 0.7em;
    border: none;
    border-radius: 0.5em;
    background: #f3f4f6;
    color: #1f2937;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: background 0.15s, box-shadow 0.15s;
}
.bdp-field__input:focus {
    background: #eaeaea;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}
.bdp-field__input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* Select arrow adjustment */
.bdp-field__select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6em center;
    padding-right: 2em;
}

/* ── Read-only value ── */
.bdp-field__value {
    font-size: 0.85em;
    font-weight: 500;
    padding: 0.55em 0.7em;
    border-radius: 0.5em;
    background: #f3f4f6;
    color: #1f2937;
    min-height: 1.2em;
}
.bdp-field__value--empty {
    color: #9ca3af;
    font-weight: 400;
}

/* ── Hint text ── */
.bdp-field__hint {
    font-size: 0.62em;
    color: #b0b5bf;
    line-height: 1.3;
    margin-top: 0.1em;
}



[data-component="ZoomTierIndicator"] {
    top: 0.75em;
}

.ghost-tag {
    border-radius: 0.35em;
    padding: 0.367em 0.667em 0.167em 0.667em;
    margin: 1em 0 0.5em;
}

.dok-card-summary,
.dok-card-ai-summary {
    font-size: 0.805em;
    line-height: 1.3;
}

.dok-sort-btn,
.dok-tag-chip {
    border-radius: 0.35em;
}

#doc-viewer-summary-text {
    font-size: 1.1em;
}

#doc-viewer-panel .dok-card-tag {
    margin-bottom: 0;
}

.doc-viewer-summary__notes-header {
    padding: 0.35em 0;
}



.doc-panel-toolbar-row:nth-child(2) {
    gap: .325em;
    padding-top: 0.25em;
    width: 100%;
    justify-content: space-between;
}

#brand-logo:hover {
    opacity: 1;
}

.audit-btn-link-doc {
    font-size: 0.9875em;
    padding: 0.75em 0.75em 0.65em 0.75em;
    border: 1.5px dashed #535353;
    margin-top: 0.75em;
    margin-bottom: 0.75em;
}

.audit-doc-picker-item {
    font-size: 1.2em;
}

.audit-doc-thumb-sm {
    width: 3.25em;
    height: 3.25em;
}

.audit-doc-picker-date {
    font-size: 0.7875em;
}

.audit-lbl {
    margin-bottom: 0.25em;
}

.audit-inp {
    font-size: 1em;
    padding: 0.8em 0.625em 0.6em;
}

.audit-dialog {
    max-height: 75vh;
}

.audit-doc-picker-search .audit-inp {
    font-size: 0.95em;
}

/* ══════════════════════════════════════════════════════════════════════════
   Potree Splash — pulsierendes Logo-Overlay beim Laden
   ══════════════════════════════════════════════════════════════════════════ */

#potree-splash {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: var(--nav-rail-w, 60px);
    z-index: 10500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#potree-splash.splash-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#potree-splash__logo {
    width: 120px;
    height: auto;
    animation: splash-pulse 1.8s ease-in-out infinite;
}

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

.doc-panel-toggle {
    display: none;
}

#status-bar > div {
    background: transparent;
    backdrop-filter: none;
}

#sb-pts,
#sb-fps {
    padding-right: 1em !important;
    border-right: 1px solid #ccc;
}


/* ============================================================
   Loading Screen
   ============================================================ */

.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-screen__logo {
    width: 138px;
    height: auto;
    animation: loadingPulse 2s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* ============================================================
   Project Selector — Ghost-Theme Typography (PP Mori)
   ============================================================ */

.ps {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #fff;
    font-family: var(--font-sans);
    color: #111827;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Navbar ─────��────────────��───��─��─────────────────────── */

.ps__navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.15em 0 1.5em;
    height: 54px;
    border-bottom: 1px solid #eaeaea;
    flex-shrink: 0;
}

.ps__navbar-left {
    display: flex;
    align-items: center;
    gap: 1.1em;
}

.ps__navbar-logo {
    height: 1.05em;
    display: block;
}

.ps__navbar-divider {
    width: 1px;
    height: 18px;
    background: #e0e0e0;
}

.ps__navbar-section {
    font-size: 0.699em;
    font-weight: 400;
    letter-spacing: 0;
    color: #999;
    text-transform: none;
    margin-top: 0.1em;
}

.ps__navbar-version {
    font-size: 0.6em;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #aaa;
    text-transform: uppercase;
}

.ps__navbar-right {
    display: flex;
    align-items: center;
    gap: 0.8em;
}

.ps__navbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.4em 0.75em;
    border-radius: 0.35em;
    border: none;
    background: none;
    color: #888;
    font-size: 0.78em;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.ps__navbar-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.ps__navbar-user-label {
    font-size: 0.76em;
    color: #bbb;
    font-weight: 400;
    display: none;
}

.ps__navbar-user-email {
    font-size: 0.76em;
    font-weight: 600;
    color: #222;
}

.ps__navbar-avatar {
    width: 3em;
    height: 2em;
    border-radius: 0.5em;
    background: #f0f0ef;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.729em;
    font-weight: 400;
    color: #888;
    padding-top: 0.15em;
    letter-spacing: 0.1em;
}

/* ── Main ────────────────────────────────────────────────── */

.ps__main {
    flex: 1;
    overflow-y: auto;
    padding: 2.25em 1.5em 3em;
    width: 100%;
    box-sizing: border-box;
    max-width: unset;
}

/* ── Project Map ─────────────────────────────────────────── */

.ps-map {
    position: fixed;
    bottom: 1.5em;
    left: 1.5em;
    width: 25vw;
    height: 20vh;
    z-index: 100;
    border-radius: 0.75em;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: width 0.3s ease, height 0.3s ease;
}

.ps-map--expanded {
    width: 50vw;
    height: 45vh;
}

.ps-map__container {
    width: 100%;
    height: 100%;
}

.ps-map__expand {
    position: absolute;
    top: 0.5em;
    right: 0.5em;
    z-index: 1000;
    width: 2.2em;
    height: 2.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.4em;
    background: rgba(60, 60, 60, 0.4);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    box-shadow: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.ps-map__expand:hover {
    background: rgba(60, 60, 60, 0.6);
    color: #fff;
}

/* POI: dot + city label */
.ps-map__poi {
    display: flex !important;
    align-items: center;
    gap: 0.4em;
    white-space: nowrap;
    background: none !important;
    border: none !important;
}

.ps-map__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4242F5;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.ps-map__label {
    font-family: var(--font-sans);
    font-size: 13.5px;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.01em;
    line-height: 1.3;
    pointer-events: none;
    text-shadow: 0 0 3px #fff, 0 0 6px #fff;
}

.ps-map__street {
    font-size: 0.85em;
    font-weight: 450;
    color: #333;
}

/* Tooltip */
.ps-map__tooltip {
    font-family: var(--font-sans);
    font-size: 0.88em;
    font-weight: 500;
    padding: 0.4em 0.75em;
    border-radius: 0.35em;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.ps-map__tooltip::before {
    border-top-color: rgba(0, 0, 0, 0.8) !important;
}

/* Override Leaflet defaults inside our map */
.ps-map .leaflet-control-zoom {
    border: none !important;
    box-shadow: none !important;
    overflow: hidden;
    border-radius: 0.4em !important;
}
.ps-map .leaflet-control-zoom a {
    width: 2.2em !important;
    height: 2.2em !important;
    line-height: 2.2em !important;
    font-size: 1em !important;
    background: rgba(60, 60, 60, 0.4) !important;
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    color: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.ps-map .leaflet-control-zoom a:last-child {
    border-bottom: none !important;
}
.ps-map .leaflet-control-zoom a:hover {
    background: rgba(60, 60, 60, 0.6) !important;
    color: #fff !important;
}

/* ── Header ──────────────────────────────────────────────── */

.ps__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.75em;
}

.ps__title {
    margin: 0;
    font-size: 2em;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.03em;
}

.ps__subtitle {
    margin: 0.4em 0 0;
    font-size: 0.88em;
    color: #bbb;
    font-weight: 400;
    margin-left: 0.15em;
}
.ps__subtitle strong {
    font-weight: 600;
    color: #888;
}

.ps__view-toggle {
    display: flex;
    border: 1px solid #e5e5e3;
    border-radius: 0.4em;
    overflow: hidden;
}

.ps__view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.45em 0.85em;
    border: none;
    background: #fff;
    color: #bbb;
    font-size: 0.76em;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.15s ease;
}
.ps__view-btn:first-child {
    border-right: 1px solid #e5e5e3;
}
.ps__view-btn--active {
    background: #111;
    color: #fff;
}
.ps__view-btn:not(.ps__view-btn--active):hover {
    background: #fafafa;
    color: #888;
}

/* ── Filter Bar ──────────────────────────────────────────── */

.ps__filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45em 0.6em;
    border: 1px solid #e5e5e3;
    border-radius: 0.55em;
    margin-bottom: 1.75em;
    gap: 0.35em;
}

.ps__filters-left {
    display: flex;
    align-items: center;
    gap: 0.35em;
    flex: 1;
    min-width: 0;
}

.ps__filters-tab {
    display: none;
    align-items: center;
    gap: 0.45em;
    padding: 0.35em 0.8em;
    font-size: 0.8em;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
}

.ps__filters-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5em;
    height: 1.5em;
    border-radius: 0.3em;
    background: #f0f0ef;
    font-size: 0.8em;
    font-weight: 600;
    color: #999;
}

.ps__search {
    display: flex;
    align-items: center;
    gap: 0.45em;
    padding: 0.35em 0.65em;
    border-radius: 0.35em;
    border: 1px solid #e5e5e3;
    background: #fff;
    flex: 0 1 250px;
    min-width: 120px;
    color: #bbb;
}

.ps__search-input {
    flex: 1;
    border: none;
    outline: none;
    background: none;
    font-size: 0.78em;
    font-weight: 400;
    font-family: var(--font-sans);
    color: #222;
    min-width: 0;
}
.ps__search-input::placeholder {
    color: #ccc;
}

.ps__search-kbd {
    font-size: 0.65em;
    font-family: var(--font-mono);
    padding: 0.15em 0.4em;
    border-radius: 0.25em;
    border: 1px solid #e5e5e3;
    background: #fafafa;
    color: #bbb;
    white-space: nowrap;
}

.ps__status-pills {
    display: flex;
    align-items: center;
    gap: 0.15em;
}

.ps__pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.35em 0.65em 0.2em 0.65em;
    border: 1px solid transparent;
    border-radius: 999px;
    background: none;
    font-size: 0.76em;
    font-weight: 500;
    font-family: var(--font-sans);
    color: #999;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.ps__pill:hover {
    background: #f5f5f5;
    color: #666;
}
.ps__pill--active {
    background: #4242F5;
    color: #fff;
    border-color: #4242F5;
}

.ps__filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.35em 0.65em;
    border: none;
    border-radius: 0.3em;
    background: none;
    color: #bbb;
    font-size: 0.78em;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    white-space: nowrap;
}
.ps__filter-btn:hover {
    color: #888;
    background: #f5f5f5;
}

.ps__new-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.5em 1.1em;
    border: none;
    border-radius: 0.4em;
    background: #111;
    color: #fff;
    font-size: 0.78em;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}
.ps__new-btn:hover {
    background: #222;
}

/* ── Error / Empty ───────────────────────────────────────── */

.ps__error {
    padding: 0.6em 1em;
    margin-bottom: 1em;
    border-radius: 0.4em;
    background: rgba(220, 38, 38, 0.05);
    border: 1px solid rgba(220, 38, 38, 0.15);
    color: #dc2626;
    font-size: 0.82em;
    text-align: center;
}

.ps__empty {
    color: #bbb;
    font-size: 0.88em;
    text-align: center;
    margin-top: 4em;
}

/* ── Status Badges (Grid) ────────────────────────────────── */

.ps-badge {
    position: absolute;
    top: 0.65em;
    left: 0.65em;
    padding: 0.3em 0.65em;
    border-radius: 0.3em;
    font-size: 0.829em;
    font-weight: 400;
    letter-spacing: 0.1;
    white-space: nowrap;
    z-index: 1;
    line-height: 1.4;
    background: rgba(0,0,0,0.1);
    color: #000;
}

.ps-badge--active {
    background: #1a1a1a;
    color: #fff;
}

.ps-badge--audit {
    background: #d1fae5;
    color: #065f46;
}

.ps-badge--incomplete {
    background: #fff;
    border: 1px solid #fdba74;
    color: #c2410c;
}

.ps-badge--new {
    background: #dbeafe;
    color: #1e40af;
}

/* ── Status Dots (List) ──────────────────────────────────── */

.ps-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ps-dot--green  { background: #16a34a; }
.ps-dot--orange { background: #ea580c; }
.ps-dot--blue   { background: #3b82f6; }

/* ── Grid View ───────────────────────────────────────────── */

.ps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25em;
}

.ps-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #d4d4d4;
    border-radius: 0.55em;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-sans);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
    padding: 0;
}
.ps-card:hover {
    border-color: #ddd;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.ps-card--loading {
    opacity: 0.45;
    pointer-events: none;
}

.ps-card__preview {
    position: relative;
    height: 180px;
    background: #f3f2f0;
    overflow: hidden;
}

.ps-card__canvas,
.ps-card__thumb {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.ps-card__scale {
    position: absolute;
    bottom: 0.65em;
    left: 0.75em;
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-size: 0.829em;
    font-weight: 500;
    color: rgba(0,0,0,0.38);
}

.ps-card__scale-bar {
    display: inline-block;
    width: 28px;
    height: 0;
    border-top: 1.5px solid rgba(0,0,0,0.28);
}

.ps-card__compass {
    position: absolute;
    bottom: 0.65em;
    right: 0.75em;
    opacity: 0.28;
}

.ps-card__body {
    padding: 1em 1.15em 0.9em;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ps-card__name-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5em;
    margin-bottom: 0.2em;
}

.ps-card__name {
    font-size: 1.08em;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.015em;
}

.ps-card__code {
    font-size: 0.82em;
    font-weight: 500;
    color: #bbb;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.ps-card__desc {
    display: block;
    font-size: 1em;
    font-weight: 400;
    color: #333;
    line-height: 1.45;
    margin-top: 0.15em;
}

.ps-card__divider {
    height: 1px;
    background: #f0f0ee;
    margin: 0.7em 0;
}

.ps-card__stats {
    display: flex;
    align-items: center;
    gap: 0.6em;
    font-size: 0.82em;
    font-weight: 500;
    color: #bbb;
    flex-wrap: wrap;
}

.ps-card__stat {
    display: inline-flex;
    align-items: center;
    gap: 0.2em;
    white-space: nowrap;
    color: #555;
}

.ps-card__stat--accent {
    color: #4242F5;
    font-weight: 600;
}

.ps-card__time {
    margin-top: auto;
    padding-top: 1.5em;
    font-size: 0.82em;
    font-weight: 400;
    color: #ccc;
}

/* ── Risikobewertung ─────────────────────────────────────── */

.ps-card__risk {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.3em;
    padding: 0.8em 1.25em 0.6em;
    border-top: 1px solid #f0f0f0;
}

.ps-card__risk-label {
    font-size: 1.05em;
    font-weight: 500;
    color: #888;
    grid-column: 1;
}

.ps-card__risk-value {
    font-size: 1.05em;
    font-weight: 600;
    text-align: right;
    grid-column: 2;
}

.ps-card__risk-bar {
    grid-column: 1 / -1;
    height: 4px;
    border-radius: 2px;
    background: #f0f0f0;
    overflow: hidden;
}

.ps-card__risk-fill {
    height: 100%;
    border-radius: 2px;
    transform-origin: left;
    transform: scaleX(0);
    animation: ps-risk-grow 0.8s ease 0.3s forwards;
}

@keyframes ps-risk-grow {
    to { transform: scaleX(1); }
}

.ps-card__risk-rec {
    padding: 0.7em 1em;
    margin: 0.15em 0.75em 0.75em;
    border-left: none;
    border-radius: 0.25em;
    font-size: 1.029em;
    font-weight: 450;
    line-height: 1.45;
    color: #555;
    text-align: left;
}

/* ── List View ───────────────────────────────────────────── */

.ps-list {
    border: 1px solid #eaeaea;
    border-radius: 0.55em;
    overflow: hidden;
}

.ps-list__header {
    display: flex;
    align-items: center;
    padding: 0.8em 1.25em;
    border-bottom: 1px solid #eaeaea;
    background: #fafafa;
}

.ps-list__col {
    font-size: 0.829em;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #000;
    text-transform: none;
}

.ps-list__col--project {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.85em;
}

.ps-list__col--status {
    width: 130px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.ps-list__col--num {
    width: 95px;
    flex-shrink: 0;
    text-align: center;
}

.ps-list__col--time {
    width: 120px;
    flex-shrink: 0;
    text-align: right;
}

.ps-list__group {
    padding: 1.4em 1.75em 1.2em;
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #bbb;
    border-top: 1px solid #f0f0ee;
}

.ps-list__row {
    display: flex;
    align-items: center;
    padding: 0.7em 1.5em;
    border: none;
    border-top: 1px solid #f0f0ee;
    background: #fff;
    width: 100%;
    text-align: left;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background 0.1s ease;
}
.ps-list__row:hover {
    background: #fafaf9;
}
.ps-list__row--loading {
    opacity: 0.45;
    pointer-events: none;
}

.ps-list__row .ps-list__col {
    font-size: 0.92em;
    font-weight: 400;
    letter-spacing: 0;
    color: #555;
    text-transform: none;
}

.ps-list__thumb {
    width: 11em;
    height: 5em;
    border-radius: 0.3em;
    background: #f0f0ee;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.ps-list__thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ps-list__thumb-label {
    font-size: 0.6em;
    font-weight: 700;
    color: #bbb;
    letter-spacing: 0.03em;
}

.ps-list__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.15em;
}

.ps-list__name {
    font-size: 1em;
    font-weight: 700;
    color: #111;
    display: flex;
    align-items: baseline;
    gap: 0.5em;
    letter-spacing: -0.015em;
}

.ps-list__code {
    font-size: 0.82em;
    font-weight: 500;
    color: #bbb;
}

.ps-list__desc {
    font-size: 1em;
    font-weight: 400;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 420px;
}

.ps-list__status-label {
    font-size: 1.2em !important;
    font-weight: 500;
    color: #555;
    margin-top: 0.1em;
}
.ps-dot--orange + .ps-list__status-label { color: #c2410c; }
.ps-dot--green  + .ps-list__status-label { color: #16a34a; }

.ps-list__row .ps-list__col--num {
    font-size: 0.92em;
    font-weight: 500;
    color: #444;
}

.ps-list__row .ps-list__col--time {
    font-size: 0.82em;
    font-weight: 400;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* ── Profile Overlay ─────────────────────────────────────── */

.ps__navbar-user-email,
.ps__navbar-avatar {
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.ps__navbar-user-email:hover,
.ps__navbar-avatar:hover {
    opacity: 0.7;
}

.ps-profile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(0.25em);
    -webkit-backdrop-filter: blur(16px);
    animation: psOverlayIn 0.2s ease;
}

@keyframes psOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.ps-profile {
    width: 480px;
    max-width: calc(100vw - 3em);
    max-height: calc(100vh - 4em);
    overflow-y: auto;
    background: rgba(250,250,250,0.9);
    border: 1px solid #eaeaea;
    border-radius: 0.35em;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.04);
    font-family: var(--font-sans);
    animation: psCardIn 0.25s ease;
}

@keyframes psCardIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ps-profile__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2em 1.2em 0;
}

.ps-profile__title {
    margin: 0;
    font-size: 1.2em;
    font-weight: 700;
    color: #111;
    letter-spacing: 0;
}

.ps-profile__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 0.3em;
    background: none;
    color: #bbb;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.ps-profile__close:hover {
    background: none;
    color: #555;
}

.ps-profile__form {
    padding: 1.2em 1.2em 1.4em;
}

.ps-profile__row {
    margin-bottom: 0.9em;
}

.ps-profile__row--half {
    display: flex;
    gap: 0.75em;
}
.ps-profile__row--half .ps-profile__field {
    flex: 1;
}

.ps-profile__field {
    display: flex;
    flex-direction: column;
}

.ps-profile__label {
    font-size: 0.78em;
    font-weight: 400;
    color: #888;
    margin-bottom: 0.35em;
}

.ps-profile__input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6em 0.75em;
    border-radius: 0.25em;
    border: none;
    background: #eee;
    font-size: 0.88em;
    font-family: var(--font-sans);
    font-weight: 400;
    color: #222;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
    margin-top: 0.25em;
}
.ps-profile__input:focus {
    border-color: #bbb;
    background: #e7e7e7;
}
.ps-profile__input::placeholder {
    color: #ccc;
}

.ps-profile__divider {
    height: 1px;
    background: #eaeaea;
    margin: 0.6em 0 1em;
}

.ps-profile__error {
    padding: 0.5em 0.75em;
    margin-bottom: 0.8em;
    border-radius: 0.35em;
    background: rgba(220, 38, 38, 0.05);
    border: 1px solid rgba(220, 38, 38, 0.15);
    color: #dc2626;
    font-size: 0.82em;
}

.ps-profile__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5em;
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px solid #eaeaea;
}

.ps-profile__btn {
    padding: 0.5em 1.1em;
    border-radius: 0.4em;
    font-size: 0.82em;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.15s ease;
}

.ps-profile__btn--ghost {
    border: none;
    background: #ececec;
    color: #888;
}
.ps-profile__btn--ghost:hover {
    background: #e7e7e7;
    color: #222222;
}

.ps-profile__btn--primary {
    border: none;
    background: #333;
    color: #fff;
}
.ps-profile__btn--primary:hover {
    background: #000;
}
.ps-profile__btn--primary:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ============================================================
   Login Page — Fullscreen Animation + Glass Pane (Light)
   ============================================================ */

.login-page {
    position: fixed;
    inset: 0;
    z-index: 9999;
    font-family: var(--font-sans);
    background: #f8f8f8;
    overflow: hidden;
}

/* ── Fullscreen Background Animation ─────────────────────────── */

.login-page__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.login-page__bg canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* ── Logo (top-left) ─────────────────────────────────────────── */

.login-page__logo-wrap {
    position: absolute;
    top: 2em;
    left: 2.5em;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1em;
}

.login-page__logo {
    height: 1.3em;
    display: block;
}

.login-page__version {
    font-size: 0.6em;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: #aaa;
    text-transform: uppercase;
}

/* ── Claims (bottom-left) ────────────────────────────────────── */

.login-page__claim {
    position: absolute;
    bottom: 2.5em;
    left: 2.5em;
    max-width: calc(100% - 55em);
    z-index: 10;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.login-page__claim--visible {
    opacity: 1;
    transform: translateY(0);
}

.login-page__claim-text {
    margin: 0;
    font-size: 1.75vw;
    font-weight: 450;
    line-height: 1.25;
    color: rgba(0, 0, 0, 0.45);
    letter-spacing: 0;
}

.login-page__claim-source {
    display: inline-block;
    margin-top: 1em;
    font-size: 0.7em;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.25);
}

/* ── Glass Pane (bottom-right) ───────────────────────────────── */

.login-page__pane {
    position: absolute;
    bottom: 1.75em;
    right: 1.75em;
    z-index: 10;
    width: 30em;
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.035);
    backdrop-filter: blur(0.2em);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: none;
    border-radius: 0.5em;
    box-shadow: none;
    overflow: hidden;
}

/* ── Form ────────────────────────────────────────────────────── */

.login-page__form {
    display: flex;
    flex-direction: column;
    padding: 1.15em 1.75em 1em;
}

.login-page__fields {
    display: flex;
    gap: 0.75em;
    margin-bottom: 0.5em;
}

.login-page__footer-link {
    color: #aaa;
    text-decoration: none;
    transition: color 0.15s ease;
}
.login-page__footer-link:hover {
    color: #555;
}

.login-page__input {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.7em 0;
    margin: 0;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0;
    background: none;
    color: #111;
    font-size: 0.88em;
    font-family: var(--font-sans);
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}
.login-page__input::placeholder {
    color: rgba(0, 0, 0, 0.7);
}
.login-page__input:focus,
.login-page__input:active,
.login-page__input:hover {
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    background: none;
    box-shadow: none;
    outline: none;
}
.login-page__input:-webkit-autofill,
.login-page__input:-webkit-autofill:hover,
.login-page__input:-webkit-autofill:focus,
.login-page__input:-webkit-autofill:active {
    -webkit-text-fill-color: #111;
    -webkit-box-shadow: 0 0 0 1000px transparent inset;
    transition: background-color 5000s ease-in-out 0s;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.login-page__submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.8em 1em;
    margin-top: 0.2em;
    border-radius: 0.5em;
    border: none;
    background: #1a1a1a;
    color: #fff;
    font-size: 0.88em;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}
.login-page__submit:hover {
    background: #4242F5;
}
.login-page__submit:active {
    transform: scale(0.985);
}
.login-page__submit:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

.login-page__divider {
    display: none;
    align-items: center;
    gap: 0.8em;
    margin: 1.2em 0;
    color: #ccc;
    font-size: 0.78em;
}
.login-page__divider::before,
.login-page__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e5e5;
}

.login-page__sso {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55em;
    width: 100%;
    padding: 0.75em 1em;
    border-radius: 0.5em;
    border: none;
    background: #ddd;
    color: #444;
    font-size: 0.82em;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.login-page__sso:hover {
    border-color: rgba(0, 0, 0, 0.2);
    background: #d1d1d1;
}

.login-page__error {
    padding: 0.6em 0.85em;
    margin-bottom: 1.1em;
    border-radius: 0.45em;
    background: rgba(220, 38, 38, 0.06);
    border: 1px solid rgba(220, 38, 38, 0.15);
    color: #b91c1c;
    font-size: 0.8em;
    text-align: center;
}

/* ── Pane Footer ─────────────────────────────────────────────── */

.login-page__pane-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5em 2em;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.65em;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #aaa;
}

.login-page__status {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.login-page__status-dot {
    width: 0.5em;
    height: 0.5em;
    border-radius: 50%;
    background: #30cf79;
    flex-shrink: 0;
}

.login-page__footer-links {
    display: flex;
    align-items: center;
    gap: 0.5em;
}
.login-page__footer-links a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.15s ease;
}
.login-page__footer-links a:hover {
    color: #555;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 860px) {
    .login-page__logo-wrap {
        top: 1.5em;
        left: 1.5em;
    }
}

.ps_pill {
    padding: 0.3em 0.85em 0.2em 0.85em;
}

.ps__view-btn,
.ps__new-btn {
    padding: 0.5em 0.85em 0.45em 0.85em;
}

.ps__new-btn,
.ps__view-toggle {
    border-radius: 0.5em;
}

.ps-card__name,
.ps-card__stat,
.ps-list__name,
.ps-list__status-label {
    font-size: 1.4em;
}

.ps-list__row .ps-list__col--num {
    font-size: 1.2em;
}

.ps-badge--active,
.ps-badge {
    background: rgba(0,0,0,0.1);
    color: #000;
    line-height: 1.4;
    font-size: 0.929em;
    padding: 0.3em 0.65em 0.2em 0.65em;
}

.ps-list__row .ps-list__col--time,
.ps-card__time {
    font-size: 0.929em;
    letter-spacing: 0;
    text-transform: none;
}

.login-page__sso,
.login-page__submit {
    margin-top: 1em;
    border-radius: 0.5em;
}

.login-page__footer-link,
.login-page__footer-links a {
    color: #999 !important;
}

.ps__title,
.ps-card__name {
    letter-spacing: 0;
}

.sidebar--collapsed {
    padding: 0.55em 0 0.85em;
}

.ps__new-btn,
.ps__view-toggle {
    border-radius: 0.35em;
}

#sb-pts,
#sb-fps {
    border-right: 1px solid rgba(0,0,0,0.2);
}

/* ============================================================
   Presentation Dock — Bottom-Right Image Strip
   ============================================================ */

.pres-dock {
    position: fixed;
    bottom: 1em;
    right: 1em;
    z-index: 10200;
    display: flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.35em;
    background: transparent;
    backdrop-filter: blur(0.75em);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border: none;
    border-radius: 0.5em;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.3s ease;
}

/* ── Scrollable thumb strip ──────────────────────────────────── */

.pres-dock__scroll {
    display: flex;
    align-items: center;
    gap: 0.4em;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.pres-dock__scroll::-webkit-scrollbar {
    display: none;
}

.pres-dock__more {
    flex-shrink: 0;
    width: 1.6em;
    height: 2.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 0.3em;
    color: #888;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.pres-dock__more:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #444;
}

.pres-dock--hidden {
    transform: translateY(calc(100% + 1.5em));
    pointer-events: none;
}

.pres-dock--drag-over {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2), 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* ── Plus Button ─────────────────────────────────────────────── */

.pres-dock__add {
    width: 3em;
    height: 2.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px dashed rgba(0, 0, 0, 0.15);
    border-radius: 0.35em;
    background: none;
    color: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.pres-dock__add:hover {
    border-color: rgba(0, 0, 0, 0.3);
    color: #555;
    background: rgba(0, 0, 0, 0.03);
}

/* ── Thumbnails ──────────────────────────────────────────────── */

.pres-dock__thumb-wrap {
    position: relative;
    width: 3em;
    height: 2.1em;
    flex-shrink: 0;
    border-radius: 0.35em;
    overflow: hidden;
    cursor: grab;
    border: 1.5px solid transparent;
    transition: border-color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}
.pres-dock__thumb-wrap:active {
    cursor: grabbing;
}
.pres-dock__thumb-wrap:hover {
    border-color: rgba(0, 0, 0, 0.15);
}
.pres-dock__thumb-wrap.is-active {
    border-color: #6366f1;
    box-shadow: 0 0 0 1.5px rgba(99, 102, 241, 0.25);
}
.pres-dock__thumb-wrap--drop-target {
    border-color: #6366f1;
    transform: scale(1.08);
}

.pres-dock__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* ── Remove Button ───────────────────────────────────────────── */

.pres-dock__remove {
    position: absolute;
    top: 0.15em;
    right: 0.15em;
    width: 1.2em;
    height: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease;
    padding: 0;
    line-height: 1;
}
.pres-dock__thumb-wrap:hover .pres-dock__remove {
    opacity: 1;
}
.pres-dock__remove:hover {
    background: #4242F5;
}

/* ── Confirm Delete Popover ───────────────────────────────────── */

.pres-dock__confirm {
    position: absolute;
    bottom: calc(100% + 0.5em);
    right: 0;
    display: flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.35em 0.5em 0.25em 0.5em;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none;
    border-radius: 0.35em;
    box-shadow: none;
    white-space: nowrap;
    font-family: var(--font-sans);
    animation: pres-dock-confirm-in 0.15s ease;
}

@keyframes pres-dock-confirm-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pres-dock__confirm-text {
    font-size: 0.72em;
    font-weight: 500;
    color: #555;
}

.pres-dock__confirm-yes,
.pres-dock__confirm-no {
    padding: 0.2em 0.55em;
    border: none;
    border-radius: 0.3em;
    font-size: 0.68em;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background 0.12s ease;
}

.pres-dock__confirm-yes {
    background: #4242F5;
    color: #fff;
}
.pres-dock__confirm-yes:hover {
    background: #3333d4;
}

.pres-dock__confirm-no {
    background: rgba(0, 0, 0, 0.06);
    color: #555;
}
.pres-dock__confirm-no:hover {
    background: rgba(0, 0, 0, 0.12);
}

/* ── Slideshow Overlay ────────────────────────────────────────── */

.pres-slider {
    position: fixed;
    inset: 0;
    z-index: 10150;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: pres-slider-in 0.2s ease;
}

@keyframes pres-slider-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.pres-slider__stage {
    position: absolute;
    inset: 4em 5em 5em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.pres-slider__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0.5em;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    user-select: none;
    pointer-events: none;
}

.pres-slider__arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10151;
    width: 2.5em;
    height: 3.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0.25em;
    background: rgba(255, 255, 255, 0.8);
    color: #333;
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
    transition: background 0.15s ease, color 0.15s ease;
}
.pres-slider__arrow:hover {
    background: #fff;
    color: #111;
}

.pres-slider__arrow--prev {
    left: 1.5em;
}
.pres-slider__arrow--next {
    right: 1.5em;
}

.pres-dock__confirm-yes,
.pres-dock__confirm-no {
    font-weight: 600;
}

.pres-dock__confirm-yes,
.pres-dock__confirm-no {
    padding: 0.3em 0.55em 0.2em 0.55em;
}


/* ══════════════════════════════════════════════════════════════
   AnimationBar — Bottom-Bar für Präsentations-Playback
   ══════════════════════════════════════════════════════════════ */

.anim-bar {
  position: fixed;
  bottom: 0;
  left: var(--nav-rail-w, 60px);
  right: 0;
  display: flex;
  flex-direction: column;
  background: rgba(24, 24, 27, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 10100; /* über .app-shell (10050) und dev-header (11000) */
  font-family: var(--font-mono, 'Sohne Mono', monospace);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  transition: opacity 0.25s, transform 0.25s;
}
.anim-bar--presentation {
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%);
  left: 0; /* kein nav-rail offset im Präsentationsmodus */
}
.anim-bar__bottom {
  position: relative;                       /* Anker für Help-Button */
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  /* 28 (filmstrip padding-top) + 56 (slide) + 6 (gap) + 38 (slot) + 4 (Atemraum) = 132px */
  min-height: 132px;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.2s;
}
.anim-bar__bottom--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%);
}

/* ── Instant Tooltips (data-tip, above button) ── */
.anim-bar [data-tip] {
  position: relative;
}
.anim-bar [data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #1a1a1a;
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  font-family: var(--font-sans);
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 10;
}
.anim-bar [data-tip]:hover::after {
  opacity: 1;
}

/* ── Transport Controls ── */
.anim-bar__transport {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ── Separator ── */
.anim-bar__sep {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  margin: 0 4px;
}

/* ── Scene buttons (speichern + hinzufügen) ── */
.anim-bar__scene-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.anim-bar__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.anim-bar__btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.anim-bar__btn--play {
  width: 36px;
  height: 36px;
  background: rgba(99, 102, 241, 0.5);
}
.anim-bar__btn--play:hover {
  background: rgba(99, 102, 241, 0.7);
}
.anim-bar__btn--close {
  background: rgba(239, 68, 68, 0.15);
}
.anim-bar__btn--close:hover {
  background: rgba(239, 68, 68, 0.35);
}

/* ── Filmstrip ── */
.anim-bar__filmstrip {
  flex: 1;
  align-self: stretch;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 0 4px;
  scroll-behavior: smooth;
}
.anim-bar__filmstrip::-webkit-scrollbar { height: 3px; }
.anim-bar__filmstrip::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* ── "Szene anlegen" Button in der Filmstrip ── */
.anim-bar__filmstrip-add {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.anim-bar__filmstrip-add:hover {
  border-color: rgba(99, 102, 241, 0.5);
  color: rgba(99, 102, 241, 0.9);
  background: rgba(99, 102, 241, 0.08);
}

/* ── Transition-Indikator zwischen Slides (read-only) ── */
.anim-bar__transition-dot {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: default;
  padding: 2px;
  height: 56px;
}
.anim-bar__transition-dot__icon {
  font-size: 10px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.35);
}
.anim-bar__transition-dot__label {
  font-size: 7px;
  color: rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  line-height: 1;
}

/* (Transition-Popover entfernt — jetzt Teil des kombinierten Slide-Popovers) */
/* ── Hold-Badge auf dem Slide (read-only) ── */
.anim-bar__slide-hold {
  position: absolute;
  top: 2px;
  right: 2px;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.5);
  font-size: 8px;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
  z-index: 2;
}

.anim-bar__empty {
  display: flex;
  align-items: center;
  height: 56px;
  gap: 6px;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}
.anim-bar__quick-start {
  padding: 6px 12px;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.15);
  color: rgba(165, 180, 252, 0.9);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s;
}
.anim-bar__quick-start:hover {
  background: rgba(99, 102, 241, 0.3);
}

/* ── Slide Column (wraps scene card + ovl-slot + txt-slot) ── */
.anim-bar__slide-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
  width: 88px;
  position: relative;
}

/* ── Slide Card ── */
.anim-bar__slide {
  position: relative;
  flex-shrink: 0;
  width: 88px;
  height: 56px;
  border-radius: 5px;
  overflow: visible;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: border-color 0.2s, transform 0.15s;
  background: rgba(255, 255, 255, 0.04);
}
.anim-bar__slide:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}
.anim-bar__slide--active {
  border-color: rgba(99, 102, 241, 0.7);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.25);
}

.anim-bar__slide-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
  display: block;
}
.anim-bar__slide-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
}

.anim-bar__slide-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 4px;
  height: 12px;
  font-size: 8px;
  line-height: 12px;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 0 0 4px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.anim-bar__slide-transition {
  position: absolute;
  top: 2px;
  right: 2px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.5);
  font-size: 8px;
  color: rgba(255, 255, 255, 0.7);
}

.anim-bar__slide-settings {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  opacity: 1;
  transition: background 0.15s, color 0.15s;
}
.anim-bar__slide-settings:hover {
  background: rgba(99, 102, 241, 0.5);
  color: #fff;
}

/* ── Popover (Slide Settings) ── */
.anim-bar__popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  padding: 10px;
  background: rgba(30, 30, 35, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 910;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.anim-bar__popover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.anim-bar__popover-row label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}
.anim-bar__popover-row input[type="number"],
.anim-bar__popover-row select {
  width: 70px;
  padding: 3px 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 10px;
  font-family: inherit;
}
.anim-bar__popover-row input[type="checkbox"] {
  accent-color: #6366f1;
}
.anim-bar__popover-delete {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 4px 6px;
  border: none;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.12);
  color: rgba(239, 68, 68, 0.85);
  font-size: 10px;
  cursor: pointer;
}
.anim-bar__popover-delete:hover {
  background: rgba(239, 68, 68, 0.25);
}
.anim-bar__popover-section-title {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.35);
  padding-bottom: 2px;
}
.anim-bar__popover-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}

/* ── Actions (right side) ── */
.anim-bar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.anim-bar__counter {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  min-width: 30px;
  text-align: center;
}

/* ── Scene Picker (portal) ── */
.anim-bar__scene-picker {
  position: fixed;
  width: 220px;
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  background: rgba(30, 30, 35, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 910;
}
.anim-bar__scene-picker-title {
  padding: 4px 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.anim-bar__scene-picker-empty {
  padding: 12px 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
}
.anim-bar__scene-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 6px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  cursor: pointer;
  text-align: left;
}
.anim-bar__scene-picker-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.anim-bar__scene-picker-thumb {
  width: 40px;
  height: 28px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── Expanded Panel ── */
.anim-bar--expanded {
  /* panel adds ~260px above the 72px bottom bar */
}

.anim-panel {
  display: flex;
  flex-direction: column;
  height: 260px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.anim-panel__tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.anim-panel__tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.anim-panel__tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
}
.anim-panel__tab--active {
  background: rgba(99, 102, 241, 0.15);
  color: rgba(165, 180, 252, 0.95);
}

.anim-panel__scene-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.anim-panel__scene-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.65);
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.anim-panel__scene-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

.anim-panel__content {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
}
.anim-panel__content::-webkit-scrollbar { width: 4px; }
.anim-panel__content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

/* ── Grid layout for key-value rows ── */
.anim-panel__grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 6px 10px;
  align-items: center;
}
.anim-panel__grid--wide {
  grid-template-columns: 100px 1fr;
}
.anim-panel__grid label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}
.anim-panel__grid select {
  width: 100%;
  max-width: 160px;
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 10px;
  font-family: inherit;
}
.anim-panel__grid input[type="checkbox"] {
  accent-color: #6366f1;
  width: 14px;
  height: 14px;
  justify-self: start;
}

.anim-panel__range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.anim-panel__range-row input[type="range"] {
  flex: 1;
  height: 3px;
  accent-color: #6366f1;
  cursor: pointer;
}
.anim-panel__range-row span {
  min-width: 38px;
  text-align: right;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}

/* ── Clouds list ── */
.anim-panel__clouds {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.anim-panel__cloud {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
}
.anim-panel__cloud-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.anim-panel__cloud-header:hover {
  background: rgba(255, 255, 255, 0.04);
}
.anim-panel__cloud-name {
  flex: 1;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.anim-panel__vis-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.anim-panel__vis-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}
.anim-panel__chevron {
  color: rgba(255, 255, 255, 0.3);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.anim-panel__chevron--open {
  transform: rotate(180deg);
}
.anim-panel__cloud-body {
  padding: 6px 8px 10px 36px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* ── Camera tab ── */
.anim-panel__vec {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.anim-panel__small-btn {
  padding: 4px 10px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.1);
  color: rgba(165, 180, 252, 0.9);
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.anim-panel__small-btn:hover {
  background: rgba(99, 102, 241, 0.25);
}
.anim-panel__small-btn--active {
  background: rgba(99, 102, 241, 0.35);
  border-color: rgba(99, 102, 241, 0.6);
  color: #a5b4fc;
}
.anim-panel__turntable-row {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
}
.anim-panel__turntable-row input[type="range"] {
  flex: 1;
  accent-color: #6366f1;
  height: 4px;
}
.anim-panel__turntable-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  min-width: 48px;
  text-align: right;
}

/* Turntable button in transport */
.anim-bar__btn--turntable {
  position: relative;
}
.anim-bar__btn--active {
  color: #a5b4fc !important;
  background: rgba(99, 102, 241, 0.2);
}
.anim-bar__btn--active:hover {
  background: rgba(99, 102, 241, 0.35);
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spin {
  animation: spin 2s linear infinite;
}

.anim-panel__empty {
  padding: 20px 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
}

/* ── Drag & Drop indicator ── */
.anim-bar__slide--drop {
  border-color: rgba(99, 102, 241, 0.6) !important;
  background: rgba(99, 102, 241, 0.08);
}

/* ── Popover actions row ── */
.anim-bar__popover-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.anim-bar__popover-dup {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border: none;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.12);
  color: rgba(165, 180, 252, 0.85);
  font-size: 10px;
  cursor: pointer;
  font-family: inherit;
}
.anim-bar__popover-dup:hover {
  background: rgba(99, 102, 241, 0.25);
}

/* ── Portal-based popover (MUST come after .anim-bar__popover rules to win cascade) ── */
.anim-bar__popover--portal {
  position: fixed;
  bottom: auto;
  left: auto;
  right: auto;
  z-index: 999999;
  font-family: var(--font-mono, 'Sohne Mono', monospace);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  -webkit-font-smoothing: antialiased;
}
.anim-bar__popover--portal .anim-bar__popover-row label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}
.anim-bar__popover--portal .anim-bar__popover-row input[type="number"],
.anim-bar__popover--portal .anim-bar__popover-row select {
  width: 70px;
  padding: 3px 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 10px;
  font-family: inherit;
}
.anim-bar__popover--portal .anim-bar__popover-row input[type="checkbox"] {
  accent-color: #6366f1;
}

/* ── Context Menu (portal on body) ── */
.anim-bar__ctx-menu {
  position: fixed;
  z-index: 999999;
  min-width: 170px;
  padding: 4px;
  background: rgba(24, 24, 27, 0.96);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  font-family: var(--font-mono, 'Sohne Mono', monospace);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
.anim-bar__ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font: inherit;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}
.anim-bar__ctx-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.anim-bar__ctx-item--danger {
  color: rgba(239, 68, 68, 0.85);
}
.anim-bar__ctx-item--danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}
.anim-bar__ctx-sep {
  height: 1px;
  margin: 3px 6px;
  background: rgba(255, 255, 255, 0.08);
}

/* ══════════════════════════════════════════════════════════════
   AnimationBar — Overlay-Bilder (von stefan portiert)
   ══════════════════════════════════════════════════════════════ */
/* ══════════════════════════════════════════════════════════════
   Overlay-Strip — Bild-Slots 1:1 unter Filmstrip-Slides
   ══════════════════════════════════════════════════════════════ */

/* ── Inline Overlay Slot (below each scene card) ── */
.ovl-slot {
  width: 88px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}
.ovl-slot:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(255, 255, 255, 0.04);
}
.ovl-slot--active {
  border-color: rgba(99, 102, 241, 0.5);
  border-style: solid;
}
.ovl-slot--dragging {
  opacity: 0.4;
}
.ovl-slot--drop-target {
  border-color: rgba(99, 102, 241, 0.8) !important;
  border-style: solid !important;
  background: rgba(99, 102, 241, 0.15) !important;
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.3);
}
/* Span: stretch over neighbor slide-cols (col 88px + gap 6px + dot ~10px + gap 6px = ~110px per extra) */
.ovl-slot--span2 { width: calc(88px * 2 + 24px); z-index: 2; }
.ovl-slot--span3 { width: calc(88px * 3 + 48px); z-index: 2; }

.ovl-slot__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ovl-slot__empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.15);
  line-height: 0;       /* kein Inline-Box-Padding um das Icon */
}
.ovl-slot__count {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.8);
  color: #fff;
  font-size: 8px;
  font-weight: 600;
  padding: 0 2px;
}
.ovl-slot__span-badge {
  position: absolute;
  bottom: 1px;
  left: 1px;
  padding: 0 3px;
  border-radius: 3px;
  background: rgba(234, 179, 8, 0.7);
  color: #000;
  font-size: 8px;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════
   Text-Overlay Slots (3. Zeile unter Bild-Slots)
   ══════════════════════════════════════════════════════════════ */
.txt-slot {
  width: 88px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.txt-slot:hover {
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(255, 255, 255, 0.04);
}
.txt-slot--active {
  border-color: rgba(168, 85, 247, 0.5);
  border-style: solid;
}
.txt-slot--dragging { opacity: 0.4; }
.txt-slot--drop-target {
  border-color: rgba(168, 85, 247, 0.8) !important;
  border-style: solid !important;
  background: rgba(168, 85, 247, 0.15) !important;
  box-shadow: 0 0 6px rgba(168, 85, 247, 0.3);
}
.txt-slot--span2 { width: calc(88px * 2 + 24px); z-index: 2; }
.txt-slot--span3 { width: calc(88px * 3 + 48px); z-index: 2; }
.txt-slot__preview {
  font-family: 'PP Mori', sans-serif;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 6px;
  max-width: 100%;
}
.txt-slot__empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.15);
  line-height: 0;
}
.txt-slot__count {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(168, 85, 247, 0.8);
  color: #fff;
  font-size: 8px;
  font-weight: 600;
  padding: 0 2px;
}
.txt-slot__span-badge {
  position: absolute;
  bottom: 1px;
  left: 1px;
  padding: 0 3px;
  border-radius: 3px;
  background: rgba(234, 179, 8, 0.7);
  color: #000;
  font-size: 8px;
  font-weight: 600;
}

/* ── Text Popover ── */
.txt-popover__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.txt-popover__item:last-child { border-bottom: none; }
.txt-popover__textarea {
  width: 100%;
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
  font-family: 'PP Mori', sans-serif;
  font-size: 11px;
  resize: vertical;
}
.txt-popover__textarea:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.5);
}
.txt-popover__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}

.txt-popover__color-row {
  flex-wrap: nowrap !important;
}
.txt-popover__color-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: border-color 0.12s;
}
.txt-popover__color-swatch:hover {
  border-color: rgba(255, 255, 255, 0.5);
}
.txt-popover__color-swatch--active {
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.4);
}

/* ── Text-Overlay über dem Canvas ── */
.txt-overlay-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  overflow: visible;
}
.txt-overlay {
  position: absolute;
  font-family: 'PP Mori', sans-serif;
  font-weight: 400;
  white-space: pre-line;
  width: max-content;
  text-shadow: none;
  transition: opacity 0.5s ease;
  transform: translate(-50%, -50%);
}
.txt-overlay--hidden {
  opacity: 0 !important;
}

/* ── Popover: Images header ── */
.imgstrip__popover-images-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 2px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 4px;
}
.imgstrip__popover-upload-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-size: 9px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.imgstrip__popover-upload-btn:hover {
  border-color: rgba(99, 102, 241, 0.5);
  color: #fff;
}

.imgstrip__popover-empty {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  padding: 6px 0;
  text-align: center;
}

.imgstrip__popover-images-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
}

.imgstrip__popover-image-item {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.imgstrip__popover-image-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.imgstrip__popover-image-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.imgstrip__popover-image-name {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Vec3 / Vec2 inline inputs ── */
.imgstrip__popover-vec3,
.imgstrip__popover-vec2 {
  display: flex;
  align-items: center;
  gap: 3px;
}
.imgstrip__popover-vec3 label,
.imgstrip__popover-vec2 label {
  width: 28px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}
.imgstrip__popover-vec3 input,
.imgstrip__popover-vec2 input {
  width: 48px;
  padding: 1px 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font-size: 10px;
  font-family: inherit;
}

.imgstrip__pick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  flex-shrink: 0;
}
.imgstrip__pick-btn:hover {
  border-color: rgba(99, 102, 241, 0.5);
  color: #fff;
}

.imgstrip__popover-img-remove {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 4px;
  border: none;
  border-radius: 3px;
  background: rgba(239, 68, 68, 0.1);
  color: rgba(239, 68, 68, 0.7);
  font-size: 9px;
  cursor: pointer;
  align-self: flex-start;
  margin-top: 2px;
  transition: background 0.15s, color 0.15s;
}
.imgstrip__popover-img-remove:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* ── Help-Button (Tastenkürzel-Anzeige) ─────────────────────── */
/* ── Drag-Modus Indikator ── */
.anim-bar__drag-mode {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(255, 105, 180, 0.9);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 12px;
  white-space: nowrap;
  pointer-events: none;
  animation: anim-bar__drag-mode-in 0.15s ease-out;
}
@keyframes anim-bar__drag-mode-in {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.anim-bar__help-wrap {
  position: absolute;
  top: -36px;
  left: 12px;
  z-index: 10;
}
.anim-bar__help-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(24, 24, 27, 0.85);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.anim-bar__help-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.25);
}
.anim-bar__help-box {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 210px;
  padding: 10px 12px;
  background: rgba(24, 24, 27, 0.96);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  font-family: var(--font-mono, 'Sohne Mono', monospace);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.anim-bar__help-title {
  font-weight: 600;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2px;
}
.anim-bar__help-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.anim-bar__help-row kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}
.anim-bar__help-row span {
  color: rgba(255, 255, 255, 0.55);
}
