/**
 * ╔══════════════════════════════════════════════════════════════════════════════╗
 * ║              PAPEROFFICE MOBILE PWA - CORE STYLES                            ║
 * ║                      App-CI: Workspaces-Slate (APP_CI_WORKSPACES_SOT)        ║
 * ╠══════════════════════════════════════════════════════════════════════════════╣
 * ║  Light-only Marke: Slate #587899. Dark-Selektoren mappen auf Light-Tokens. ║
 * ║  Touch-Targets min. 44x44px, Safe Area Support, Smooth Animations            ║
 * ╚══════════════════════════════════════════════════════════════════════════════╝
 */

/* ═══════════════════════════════════════════════════════════════════════════════
   CSS VARIABLES – Light Default (= Desktop core-variables / Workspaces-SOT)
   ═══════════════════════════════════════════════════════════════════════════════ */

:root {
    --pm-bg-primary: #f8f9fa;
    --pm-bg-secondary: #ffffff;
    --pm-bg-tertiary: #f1f3f5;
    --pm-bg-elevated: #ffffff;
    --pm-bg-sidebar: #EBEFF4;
    --pm-bg-input: #ffffff;
    --pm-bg-hover: #eef3f8;
    --pm-bg-active: #E6F2FA; /* Getting-Started — nicht ändern */
    --pm-bg-selected: #e8f3f9;

    --pm-text-primary: #1f2937;
    --pm-text-secondary: #495057;
    --pm-text-muted: #6b7280;
    --pm-text-light: #9ca3af;
    --pm-text-inverse: #ffffff;
    --pm-ink: #0f172a;
    --pm-secondary-label: #667085;
    --pm-muted-label: #5b6b7f;
    --pm-line: rgba(15, 23, 42, 0.12);

    --pm-border: #e5e7eb;
    --pm-border-light: #f3f4f6;
    --pm-border-dark: #d1d5db;
    --pm-border-focus: #587899;

    /* Slate-Treppe — kein Fluent #0078d4, kein Soft-Brand #5B9BD5 */
    --pm-accent: #587899;
    --pm-accent-dark: #4C6C8B;
    --pm-accent-hover: #4C6C8B;
    --pm-accent-active: #405F7D;
    --pm-accent-light: #4C6C8B;
    --pm-accent-soft: rgba(88, 120, 153, 0.1);

    --pm-link: #587899;

    --pm-success: #10b981;
    --pm-success-bg: rgba(16, 185, 129, 0.1);
    /* Warning-Token bleibt Mini-Status; Banner-Chrome = Clay (§7.1) */
    --pm-warning: #f59e0b;
    --pm-warning-bg: rgba(245, 158, 11, 0.1);
    --pm-danger: #ef4444;
    --pm-danger-bg: rgba(239, 68, 68, 0.1);
    --pm-info: #2563eb; /* Fachfarbe Business — nicht Marke */
    --pm-info-bg: rgba(37, 99, 235, 0.1);

    --pm-credit-alarm-clay: #A67C52;
    --pm-credit-alarm-clay-hover: #8F6844;
    --pm-credit-alarm-clay-active: #7A583A;
    --pm-credit-alarm-surface: #F6F0E8;
    --pm-credit-alarm-border: #E4D5C5;

    --pm-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --pm-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --pm-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    --pm-overlay: rgba(0, 0, 0, 0.5);
    --pm-overlay-light: rgba(0, 0, 0, 0.3);
    --pm-modal-backdrop: rgba(15, 23, 42, 0.38);
    --pm-loading-scrim: rgba(248, 249, 250, 0.78);
    --pm-loading-scrim-subtle: rgba(248, 249, 250, 0.52);
    --pm-loading-panel-bg: #ffffff;
    --pm-loading-panel-border: rgba(15, 23, 42, 0.08);
    --pm-skeleton-base: #e5e7eb;
    --pm-skeleton-shine: #f3f4f6;

    --pm-safe-top: env(safe-area-inset-top, 0px);
    --pm-safe-bottom: env(safe-area-inset-bottom, 0px);
    --pm-safe-left: env(safe-area-inset-left, 0px);
    --pm-safe-right: env(safe-area-inset-right, 0px);

    --pm-header-height: 56px;
    --pm-bottom-nav-height: 56px;
    --pm-touch-target: 44px;

    --pm-transition-fast: 150ms ease;
    --pm-transition-normal: 250ms ease;
    --pm-transition-slow: 350ms ease;

    --pm-card-bg: var(--pm-bg-secondary);
    --pm-input-bg: var(--pm-bg-input);
    --pm-text: var(--pm-text-primary);
    --pm-bg: var(--pm-bg-secondary);
    --pm-primary: var(--pm-accent);
    --pm-hover: var(--pm-bg-hover);
    --pm-border-color: var(--pm-border);
    --pm-chat-input-fade: rgba(248, 249, 250, 0.72);

    --pm-radius-sm: 8px;
    --pm-radius-md: 12px;
    --pm-radius-lg: 16px;
    --pm-radius-xl: 24px;
    --pm-radius-full: 9999px;

    color-scheme: light;
}

/* Dark deprecated: Leftover-Selektoren behalten Light-Tokens (wie Desktop). */
html.dark-side,
html[data-theme="dark"],
html.pm-theme-dark {
    --pm-bg-primary: #f8f9fa;
    --pm-bg-secondary: #ffffff;
    --pm-bg-tertiary: #f1f3f5;
    --pm-bg-elevated: #ffffff;
    --pm-bg-sidebar: #EBEFF4;
    --pm-bg-input: #ffffff;
    --pm-bg-hover: #eef3f8;
    --pm-bg-active: #E6F2FA;
    --pm-bg-selected: #e8f3f9;

    --pm-text-primary: #1f2937;
    --pm-text-secondary: #495057;
    --pm-text-muted: #6b7280;
    --pm-text-light: #9ca3af;
    --pm-text-inverse: #ffffff;
    --pm-ink: #0f172a;
    --pm-secondary-label: #667085;
    --pm-muted-label: #5b6b7f;
    --pm-line: rgba(15, 23, 42, 0.12);

    --pm-border: #e5e7eb;
    --pm-border-light: #f3f4f6;
    --pm-border-dark: #d1d5db;
    --pm-border-focus: #587899;

    --pm-accent: #587899;
    --pm-accent-dark: #4C6C8B;
    --pm-accent-hover: #4C6C8B;
    --pm-accent-active: #405F7D;
    --pm-accent-light: #4C6C8B;
    --pm-accent-soft: rgba(88, 120, 153, 0.1);
    --pm-link: #587899;

    --pm-success: #10b981;
    --pm-success-bg: rgba(16, 185, 129, 0.1);
    --pm-warning: #f59e0b;
    --pm-warning-bg: rgba(245, 158, 11, 0.1);
    --pm-danger: #ef4444;
    --pm-danger-bg: rgba(239, 68, 68, 0.1);
    --pm-info: #2563eb;
    --pm-info-bg: rgba(37, 99, 235, 0.1);

    --pm-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --pm-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --pm-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    --pm-overlay: rgba(0, 0, 0, 0.5);
    --pm-overlay-light: rgba(0, 0, 0, 0.3);
    --pm-modal-backdrop: rgba(15, 23, 42, 0.38);
    --pm-loading-scrim: rgba(248, 249, 250, 0.78);
    --pm-loading-scrim-subtle: rgba(248, 249, 250, 0.52);
    --pm-loading-panel-bg: #ffffff;
    --pm-loading-panel-border: rgba(15, 23, 42, 0.08);
    --pm-skeleton-base: #e5e7eb;
    --pm-skeleton-shine: #f3f4f6;
    --pm-chat-input-fade: rgba(248, 249, 250, 0.72);

    color-scheme: light;
}

html {
    transition: background-color 0.25s ease, color 0.25s ease;
}

html.no-transition,
html.no-transition * {
    transition: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BASE STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

/* Erscheinungsbild (Einstellungen) */
.mobile-theme-segment {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.mobile-theme-option {
    min-height: var(--pm-touch-target);
    padding: 10px 8px;
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-md);
    background: var(--pm-bg-tertiary);
    color: var(--pm-text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--pm-transition-fast), border-color var(--pm-transition-fast), color var(--pm-transition-fast);
}

.mobile-theme-option.is-active {
    background: var(--pm-bg-active);
    border-color: var(--pm-accent);
    color: var(--pm-accent);
    box-shadow: var(--pm-shadow-sm);
}

.mobile-theme-option i {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--pm-bg-primary);
    color: var(--pm-text-primary);
    line-height: 1.5;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Disable native pull-to-refresh - aber normales Scrollen erlauben! */
html {
    overscroll-behavior-y: contain;
}

body {
    overscroll-behavior-y: contain;
}

/* Selection */
::selection {
    background: var(--pm-accent-soft);
    color: var(--pm-accent);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SPLASH SCREEN
   ═══════════════════════════════════════════════════════════════════════════════ */

.splash-screen {
    position: fixed;
    inset: 0;
    background: var(--pm-bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity var(--pm-transition-slow), visibility var(--pm-transition-slow);
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    text-align: center;
}

.splash-logo {
    width: 80px;
    height: auto;
    margin-bottom: 24px;
    animation: splash_pulse 2s ease-in-out infinite;
}

@keyframes splash_pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.splash-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--pm-border);
    border-top-color: var(--pm-accent);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.splash-text {
    font-size: 14px;
    color: var(--pm-text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   APP CONTAINER
   ═══════════════════════════════════════════════════════════════════════════════ */

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: var(--pm-safe-top);
    padding-bottom: var(--pm-safe-bottom);
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════════════════ */

.app-header {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    height: var(--pm-header-height);
    padding-top: var(--pm-safe-top);
    background: var(--pm-bg-secondary);
    border-bottom: 1px solid var(--pm-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-left: max(12px, var(--pm-safe-left));
    padding-right: max(12px, var(--pm-safe-right));
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-left,
.header-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.header-right {
    position: relative;
    justify-content: flex-end;
    gap: 4px;
}

.header-center {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.header-logo {
    height: 28px;
    width: auto;
    flex: 0 0 auto;
}

.app-header.dashboard-header .header-logo {
    display: none;
}

.app-header.dashboard-header .header-title {
    order: 1;
}

.app-header.dashboard-header .header-avatar {
    order: 2;
    margin-left: auto;
}

.header-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--pm-border);
    background: var(--pm-bg-tertiary);
}

.header-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--pm-text-primary);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Browser: Workspace-Scope im Header (tippbar, ersetzt Doppel-Selector) */
.header-workspace-btn {
    display: none;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    padding: 2px 8px 2px 2px;
    margin: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--pm-text-primary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    text-align: left;
}
.header-workspace-btn:active,
.header-workspace-btn.is-open {
    background: var(--pm-bg-hover, rgba(15, 23, 42, 0.06));
}
/* Gleiches Aktentaschen-Icon wie Workspace-Picker — nicht das Markenlogo */
.header-workspace-icon {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--pm-accent-soft);
    color: var(--pm-accent);
}
.header-workspace-icon i {
    font-size: 13px;
    line-height: 1;
    color: inherit;
}
.header-workspace-label {
    min-width: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: left;
}
.header-workspace-chevron {
    flex: 0 0 auto;
    font-size: 11px;
    color: var(--pm-text-muted);
}
/* Browser: Markenlogo/Avatar aus — sonst wirkt Logo wie Workspace-Icon */
.app-header.browser-workspace-header {
    height: auto;
    min-height: var(--pm-header-height);
    align-items: center;
    padding-top: calc(var(--pm-safe-top) + 8px);
    padding-bottom: 8px;
}
.app-header.browser-workspace-header .header-left,
.app-header.browser-workspace-header .header-right {
    align-items: center;
}
.app-header.browser-workspace-header .header-center {
    align-items: center;
}
.app-header.browser-workspace-header .header-logo,
.app-header.browser-workspace-header .header-avatar {
    display: none !important;
}
.app-header.browser-workspace-header .header-title {
    display: none !important;
}
.app-header.browser-workspace-header .header-workspace-btn {
    max-width: 100%;
}

/* Legacy Workspace-Zeile unter Suche bleibt im DOM, aber unsichtbar */
.workspace-selector-legacy,
.mobile-browser-v2 .workspace-selector[hidden] {
    display: none !important;
}

.header-btn {
    width: var(--pm-touch-target);
    height: var(--pm-touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--pm-radius-md);
    color: var(--pm-text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--pm-transition-fast);
    position: relative;
}

.header-btn:active {
    background: var(--pm-bg-hover);
    transform: scale(0.95);
}

.browser-controls-toggle {
    background: transparent;
    color: var(--pm-text-secondary);
}

.browser-doctype-filter {
    background: transparent;
    color: var(--pm-text-secondary);
}

/* Aktiver Filter: klar als Einschränkung erkennbar (nicht Accent-Blau) */
.browser-doctype-filter.is-active,
.browser-doctype-filter.has-indicator {
    background: var(--pm-danger-bg, rgba(239, 68, 68, 0.1));
    color: var(--pm-danger, #ef4444);
}

.browser-doctype-filter.has-indicator .header-btn-indicator {
    display: block;
    background: var(--pm-danger, #ef4444);
    border-color: var(--pm-bg-secondary);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45);
    animation: po-filter-indicator-pulse 1.35s ease-in-out infinite;
}

@keyframes po-filter-indicator-pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    }
    50% {
        transform: scale(1.2);
        opacity: 0.92;
        box-shadow: 0 0 0 5px rgba(239, 68, 68, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .browser-doctype-filter.has-indicator .header-btn-indicator {
        animation: none;
        box-shadow: none;
    }
}

.browser-view-toggle {
    background: transparent;
    color: var(--pm-text-secondary);
}

.browser-view-toggle.active {
    background: var(--pm-accent-soft);
    color: var(--pm-accent);
}

.browser-controls-toggle.active {
    background: var(--pm-accent);
    color: white;
}

.header-btn-indicator {
    display: none;
    position: absolute;
    top: 7px;
    right: 7px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--pm-warning, #f59e0b);
    border: 2px solid var(--pm-bg-secondary);
}

.header-btn.has-indicator .header-btn-indicator {
    display: block;
}

/* Refresh Button Animation */
#btn_global_refresh i.fa-spin {
    color: var(--pm-accent);
}

#btn_global_refresh.is-success {
    color: var(--pm-success, #10b981);
}

#btn_global_refresh.is-success i {
    color: var(--pm-success, #10b981);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--pm-danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--pm-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════════════════ */

.main-content {
    flex: 1;
    min-height: 0;
    padding: 16px;
    padding-left: max(16px, var(--pm-safe-left));
    padding-right: max(16px, var(--pm-safe-right));
    padding-bottom: calc(var(--pm-bottom-nav-height) + 16px + var(--pm-safe-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

/* Globale App-Topbar aus — Chrome lebt in den Views */
#app.app-container > .app-header {
    display: none !important;
}

/* Chat / Start: keine globale Topbar — Chrome + Hero im Content */
body.pm-route-chat .app-header {
    display: none !important;
}

body.pm-route-dashboard .app-header {
    display: none !important;
}

body.pm-route-desktop-connections .app-header {
    display: none !important;
}

body.pm-route-inbox .app-header,
body.pm-route-browser .app-header,
body.pm-route-documents .app-header,
body.pm-route-scanner .app-header,
body.pm-route-settings .app-header,
body.pm-route-security .app-header,
body.pm-route-storage .app-header,
body.pm-route-about .app-header,
body.pm-route-tasks .app-header,
body.pm-route-signature .app-header,
body.pm-route-upload .app-header,
body.pm-route-more .app-header,
body.pm-route-document .app-header {
    display: none !important;
}

body.pm-route-chat .app-header[aria-hidden="true"],
body.pm-route-dashboard .app-header[aria-hidden="true"],
body.pm-route-desktop-connections .app-header[aria-hidden="true"],
#app.app-container > .app-header[aria-hidden="true"] {
    pointer-events: none;
}

/* Dokumente: seitenlokale Toolbar (Workspace + Upload/Ansicht/Filter/Suche) */
.browser-page-chrome {
    display: none;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: var(--pm-header-height);
    height: auto;
    padding: 8px max(12px, var(--pm-safe-right)) 8px max(12px, var(--pm-safe-left));
    background: var(--pm-bg-secondary);
    border-bottom: 1px solid var(--pm-border);
    z-index: 100;
}

body.pm-route-browser .browser-page-chrome,
body.pm-route-documents .browser-page-chrome {
    display: flex;
}

.browser-page-chrome-start {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.browser-page-chrome-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex: 0 0 auto;
}

.browser-page-chrome.browser-workspace-header {
    height: auto;
    min-height: var(--pm-header-height);
    align-items: center;
}

/* Einstellungen / Unterseiten: In-Page Zurück + Titel */
.page-top-chrome {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin: 0 0 14px;
}

.page-top-back {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--pm-text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
    -webkit-tap-highlight-color: transparent;
}

.page-top-back:active {
    background: var(--pm-bg-hover, #eef3f8);
}

.page-top-title {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--pm-text-primary);
    min-width: 0;
    line-height: 1.3;
}

.page-top-chrome-plain {
    gap: 0;
}

/* Desktop-Verbindungen: Headerless + Safe-Area oben */
.main-content.desktop-connections-view-active {
    padding-top: max(12px, var(--pm-safe-top, 0px));
}

/* Eingang: Headerless — Safe-Area kommt vom App-Container */
.main-content.inbox-view-active {
    padding-top: 12px;
}

/* Start: volle Breite, Safe-Area über Home-Chrome */
.main-content.home-view-active {
    padding-top: 0;
    padding-left: var(--pm-safe-left, 0px);
    padding-right: var(--pm-safe-right, 0px);
}

.mobile-home-container.home-headerless {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 100%;
}

.home-top-chrome {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-height: 44px;
    padding: max(6px, var(--pm-safe-top, 0px)) 10px 0;
}

.home-chrome-spacer {
    flex: 1;
    min-width: 0;
}

.home-chrome-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--pm-text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.home-chrome-btn:active {
    transform: scale(0.94);
    background: var(--pm-accent-soft, rgba(88, 120, 153, 0.12));
}

.home-chrome-btn i {
    font-size: 18px;
    line-height: 1;
}

.home-welcome {
    text-align: center;
    padding: 10px 22px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.home-welcome-avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--pm-surface, #fff);
    border: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.home-welcome-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-welcome-title {
    font-family: inherit;
    font-size: clamp(22px, 6.2vw, 30px);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--pm-text-primary);
    margin: 0;
    line-height: 1.25;
    max-width: 16em;
}

.home-desktop-chip-wrap {
    margin-top: 14px;
    display: flex;
    justify-content: center;
}

.home-desktop-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(255, 255, 255, 0.72);
    color: var(--pm-text-secondary, #4b5563);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.home-desktop-chip:active {
    transform: scale(0.97);
}

.home-desktop-chip:disabled {
    opacity: 0.7;
    cursor: default;
}

.home-desktop-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    flex-shrink: 0;
}

.home-desktop-chip.is-connected .home-desktop-chip-dot {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

.home-desktop-chip.is-connected {
    color: #166534;
    border-color: rgba(34, 197, 94, 0.28);
    background: rgba(240, 253, 244, 0.9);
}

.home-desktop-chip.is-offline {
    color: var(--pm-accent-dark, #4C6C8B);
    border-color: rgba(88, 120, 153, 0.22);
    background: rgba(239, 246, 255, 0.92);
}

.home-desktop-chip.is-offline .home-desktop-chip-dot {
    background: var(--pm-accent, #587899);
    box-shadow: 0 0 0 3px rgba(88, 120, 153, 0.18);
}

/* Desktop erreichbar, Uploader nicht zwingend offen */
.home-desktop-chip.is-online {
    color: #1e4e7a;
    border-color: rgba(88, 120, 153, 0.35);
    background: rgba(239, 246, 255, 0.95);
}

.home-desktop-chip.is-online .home-desktop-chip-dot {
    background: #587899;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

/* Uploader am Desktop offen — wartet auf Instant Scan */
.home-desktop-chip.is-waiting {
    color: #0f5c4c;
    border-color: rgba(22, 184, 166, 0.35);
    background: rgba(240, 253, 250, 0.95);
}

.home-desktop-chip.is-waiting .home-desktop-chip-dot {
    background: #16b8a6;
    box-shadow: 0 0 0 3px rgba(22, 184, 166, 0.2);
}

@keyframes po-home-desktop-chip-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 3px rgba(22, 184, 166, 0.16); }
    50% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(22, 184, 166, 0.28); }
}

.home-desktop-chip.is-attention .home-desktop-chip-dot {
    animation: po-home-desktop-chip-pulse 1.8s ease-in-out infinite;
    will-change: transform, box-shadow;
}

.home-desktop-chip.is-attention:hover .home-desktop-chip-dot,
.home-desktop-chip.is-attention:focus-visible .home-desktop-chip-dot {
    animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
    .home-desktop-chip.is-attention .home-desktop-chip-dot {
        animation: none !important;
    }
}

.home-launchpad .home-body {
    padding-bottom: calc(24px + var(--pm-safe-bottom, 0px));
}

.home-search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 16px 10px;
    padding: 0 14px;
    min-height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: var(--pm-surface, #fff);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.home-search-icon {
    color: var(--pm-text-muted, #6b7280);
    font-size: 14px;
    flex-shrink: 0;
}

.home-search-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--pm-text-primary);
    font-size: 15px;
    line-height: 1.3;
    padding: 12px 0;
    -webkit-appearance: none;
    appearance: none;
}

.home-search-input::placeholder {
    color: var(--pm-text-muted, #6b7280);
}

.home-search:focus-within {
    border-color: rgba(88, 120, 153, 0.35);
    box-shadow: 0 0 0 3px rgba(88, 120, 153, 0.12);
}

.home-recent {
    margin-top: 4px;
}

.home-recent-item-icon.is-workspace {
    background: rgba(88, 120, 153, 0.10);
    color: #587899;
}

.home-recent-item-icon.home-recent-item-thumb {
    overflow: hidden;
    padding: 0;
    background: #f3f4f6;
}

.home-recent-item-icon.home-recent-item-thumb.has-custom-image {
    background: #efefef;
}

.home-recent-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-drag: none;
    pointer-events: none;
    -webkit-touch-callout: none;
}

.home-recent-item-icon.home-recent-item-thumb.has-custom-image .home-recent-thumb-img {
    object-fit: contain;
}

.home-recent-thumb-fallback {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.home-recent-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.home-recent-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--pm-text-primary);
}

.home-recent-view-all {
    border: 0;
    background: transparent;
    color: #587899;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.home-recent-view-all:active {
    color: #4C6C8B;
}

.home-recent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.home-recent-item {
    display: grid;
    grid-template-columns: 40px 1fr 14px;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 64px;
    padding: 12px 14px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 14px;
    background: var(--pm-surface, #fff);
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.home-recent-item:active {
    background: #eef3f8;
    border-color: rgba(88, 120, 153, 0.28);
}

.home-recent-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.05);
    color: var(--pm-text-secondary, #4b5563);
    font-size: 15px;
}

.home-recent-item-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.home-recent-item-copy strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--pm-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-recent-item-copy small {
    font-size: 12px;
    color: var(--pm-text-muted, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-recent-item-arrow {
    color: var(--pm-text-muted);
    font-size: 12px;
}

.home-body {
    padding: 0 16px 8px;
}

/* Chat: volle Breite, unten bündig an Bottom-Nav (Composer-Dock) */
.main-content.chat-view-active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: 0;
    padding-left: var(--pm-safe-left, 0px);
    padding-right: var(--pm-safe-right, 0px);
    padding-bottom: calc(var(--pm-bottom-nav-height) + var(--pm-safe-bottom));
}

/*
 * Keyboard-Overlay (Android/Chrome oft ohne Layout-Resize):
 * Bottom-Nav aus, padding-bottom = visualViewport-Inset → Composer bleibt sichtbar.
 */
body.po-chat-keyboard-open .main-content.chat-view-active {
    padding-bottom: max(var(--pm-chat-keyboard-inset, 0px), var(--pm-safe-bottom, 0px));
}

body.po-chat-keyboard-open #bottom_nav,
body.po-chat-keyboard-open .bottom-nav {
    visibility: hidden;
    pointer-events: none;
}

.main-content.chat-view-active > .mobile-chat-container {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    margin: 0;
}

/* Documents/Browser: volle Nutzbreite — kein doppeltes Shell-Padding */
.main-content.browser-view-active {
    display: flex;
    flex-direction: column;
    padding-left: var(--pm-safe-left, 0px);
    padding-right: var(--pm-safe-right, 0px);
    padding-top: 0;
    overflow: hidden; /* Scroll nur in .browser-content */
}

.main-content.browser-view-active > .mobile-browser-v2 {
    flex: 1;
    min-height: 0;
    height: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BOTTOM NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════════ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--pm-bottom-nav-height) + var(--pm-safe-bottom));
    padding-bottom: var(--pm-safe-bottom);
    background: var(--pm-bg-secondary);
    border-top: 1px solid var(--pm-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 99999 !important; /* Kommentar: MUSS über Scanner-Canvas liegen! */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: auto !important; /* Kommentar: Touch-Events erlauben */
    overflow: hidden; /* kein FAB-Überstand mehr */
}

.nav-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: var(--pm-bottom-nav-height);
    text-decoration: none;
    color: var(--pm-text-muted);
    font-size: 10px;
    font-weight: 500;
    transition: all var(--pm-transition-fast);
    border: 0;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    /* button reset — Bottom-Nav sind <button>, nicht <a> (Chrome Status-Bubble) */
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
}

.nav-item:focus {
    outline: none;
}

.nav-item:focus-visible {
    outline: 2px solid var(--pm-accent, #587899);
    outline-offset: -2px;
}

/* Nur Label-Spans — nicht Icon-Slot/Badge (sonst Badge = Vollbreite) */
.nav-item > span {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    text-align: center;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-item i {
    font-size: 20px;
    line-height: 1;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--pm-transition-fast);
}

.nav-item:active i {
    transform: scale(0.9);
}

/* Nur das aktive Nav-Item ist farbig — kein Dauer-Primary/FAB */
.nav-item.active {
    color: var(--pm-accent);
}

.nav-item.active i {
    transform: none;
}

/* Shortcut „Dokument hinzufügen“: gleicher flacher Slot, nie Active, kein blauer Kreis */
.nav-item-action,
.nav-item-action.active {
    color: var(--pm-text-muted);
}

.nav-item-action.active i {
    transform: none;
}

.nav-item-icon-slot {
    position: relative;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    overflow: visible;
    /* Badges bleiben im eigenen Slot und greifen nicht in Nachbar-Tabs */
    isolation: isolate;
}

.nav-item-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    left: auto;
    width: auto !important;
    max-width: 28px;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border-radius: 999px;
    background: #587899;
    color: #fff;
    font-size: 9px;
    font-weight: 500;
    line-height: 13px;
    text-align: center;
    border: 1.5px solid var(--pm-bg-secondary);
    box-sizing: border-box;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
    transform: translateZ(0);
}

.nav-item.active .nav-item-badge {
    border-color: var(--pm-bg-secondary);
}

.browser-add-btn {
    background: transparent;
    color: var(--pm-text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PAIRING SCREEN
   ═══════════════════════════════════════════════════════════════════════════════ */

.pairing-screen {
    position: fixed;
    inset: 0;
    background: var(--pm-bg-primary);
    padding: 24px;
    padding-top: calc(24px + var(--pm-safe-top));
    padding-bottom: calc(24px + var(--pm-safe-bottom));
    overflow-y: auto;
    z-index: 500;
}

.pairing-content {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.pairing-cancel-btn {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--pm-border, #e5e7eb);
    border-radius: 12px;
    background: var(--pm-bg-secondary, #fff);
    color: var(--pm-text-primary, #111827);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.pairing-cancel-btn:active {
    opacity: 0.85;
}

.pairing-already-linked-actions {
    display: grid;
    gap: 10px;
    margin-top: 28px;
}

.desktop-connection-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 4px;
}

.desktop-connection-empty-actions .btn-primary,
.desktop-connection-empty-actions .btn-secondary {
    flex: 1 1 140px;
}

.pairing-logo {
    width: 64px;
    height: auto;
    margin-bottom: 24px;
}

.pairing-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--pm-text-primary);
    margin-bottom: 8px;
}

.pairing-subtitle {
    font-size: 14px;
    color: var(--pm-text-muted);
    line-height: 1.6;
    margin-bottom: 32px;
}

#pairing_scanner_mode .pairing-subtitle {
    margin-bottom: 16px;
}

.pairing-where {
    text-align: start;
    background: var(--pm-bg-hover, #eef3f8);
    border: 1px solid var(--pm-border, #e5e7eb);
    border-radius: 12px;
    padding: 14px 14px 12px;
    margin: 0 0 20px;
}

.pairing-where-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--pm-ink, #0f172a);
    margin: 0 0 12px;
    line-height: 1.35;
}

.pairing-where-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.pairing-where-steps li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.pairing-where-num {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--pm-accent, #587899);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pairing-where-text {
    min-width: 0;
    font-size: 13px;
    font-weight: 400;
    color: var(--pm-ink, #0f172a);
    line-height: 1.45;
}

.pairing-where-url {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 500;
    color: var(--pm-accent, #587899);
    letter-spacing: 0.2px;
}

.pairing-where-cta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--pm-accent, #587899);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    pointer-events: none;
}

.pairing-where-cta-chip i {
    font-size: 12px;
}

.pairing-where-note {
    margin: 12px 0 0;
    font-size: 12px;
    font-weight: 400;
    color: var(--pm-text-muted, #6b7280);
    line-height: 1.45;
}

@media (max-height: 720px) {
    #pairing_scanner_mode .qr-scanner-wrapper {
        max-width: 220px;
    }
}

.pairing-scanner-area {
    margin-bottom: 32px;
}

/* Wrapper fuer Scanner + Overlay */
.qr-scanner-wrapper {
    position: relative;
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1;
    margin: 0 auto 12px;
    border-radius: var(--pm-radius-lg);
    overflow: hidden;
}

.qr-scanner-container {
    width: 100%;
    height: 100%;
    background: var(--pm-bg-tertiary);
}

/* Html5Qrcode Video Element */
.qr-scanner-container video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.qr-overlay {
    position: absolute;
    inset: 40px;
    pointer-events: none;
    z-index: 10;
}

.qr-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: var(--pm-accent);
    border-style: solid;
    border-width: 3px;
}

.qr-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.qr-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; border-radius: 0 4px 0 0; }
.qr-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; border-radius: 0 0 0 4px; }
.qr-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; border-radius: 0 0 4px 0; }

.qr-hint {
    font-size: 13px;
    color: var(--pm-text-muted);
}

/* Scanner Status-Anzeige */
.scanner-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: var(--pm-bg-secondary);
    border-radius: var(--pm-radius-md);
    font-size: 14px;
    color: var(--pm-text-muted);
}

.scanner-status i {
    color: var(--pm-accent);
}

.scanner-status.active {
    background: var(--pm-success-bg);
    color: var(--pm-success);
}

/* Scanner Fehler-Anzeige */
.scanner-error {
    text-align: center;
    padding: 24px 16px;
    margin-top: 16px;
}

.scanner-error i {
    display: block;
    font-size: 48px;
    color: var(--pm-text-muted);
    margin-bottom: 16px;
}

.scanner-error p {
    font-size: 16px;
    color: var(--pm-text-primary);
    margin-bottom: 8px;
}

.scanner-error .scanner-error-hint {
    font-size: 13px;
    color: var(--pm-text-muted);
    margin-bottom: 20px;
}

.scanner-error .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pairing-desktop-url {
    font-size: 18px;
    font-weight: 700;
    color: var(--pm-accent);
    margin: -4px 0 8px 0;
    letter-spacing: 0.3px;
}

.pairing-status {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--pm-radius-md);
    font-size: 14px;
    display: none;
}

.pairing-status.success {
    display: block;
    background: var(--pm-success-bg);
    color: var(--pm-success);
}

.pairing-status.error {
    display: block;
    background: var(--pm-danger-bg);
    color: var(--pm-danger);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BIOMETRIC PROMPT
   ═══════════════════════════════════════════════════════════════════════════════ */

.biometric-prompt {
    position: fixed;
    inset: 0;
    background: var(--pm-bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 600;
}

.biometric-content {
    text-align: center;
    max-width: 320px;
}

.biometric-icon {
    width: 80px;
    height: 80px;
    background: var(--pm-accent-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.biometric-icon i {
    font-size: 36px;
    color: var(--pm-accent);
}

.biometric-content h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--pm-text-primary);
    margin-bottom: 8px;
}

.biometric-content p {
    font-size: 14px;
    color: var(--pm-text-muted);
    margin-bottom: 32px;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════════ */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--pm-touch-target);
    padding: 12px 24px;
    background: var(--pm-accent);
    color: #fff;
    border: none;
    border-radius: var(--pm-radius-md);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--pm-transition-fast), transform var(--pm-transition-fast);
    box-shadow: none;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: var(--pm-accent-hover, #4C6C8B);
}

.btn-primary:active {
    transform: scale(0.98);
    background: var(--pm-accent-active, #405F7D);
    box-shadow: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--pm-touch-target);
    padding: 12px 24px;
    background: var(--pm-bg-tertiary);
    color: var(--pm-text-primary);
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-md);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--pm-transition-fast);
}

.btn-secondary:active {
    background: var(--pm-bg-hover);
    transform: scale(0.98);
}

.btn-secondary.is-success,
.device-info-copy-btn.is-success {
    border-color: var(--pm-success, #16a34a);
    background: var(--pm-success-bg, #bbf7d0);
    color: var(--pm-success, #16a34a);
}

/* Geräte-/System-Info: Label oben, Wert darunter; Copy-Icon in Device-ID-Row */
.device-info-grid {
    margin-top: 12px;
    display: grid;
    gap: 8px;
    font-size: 13px;
}

.device-info-row {
    padding: 10px 12px;
    background: var(--pm-bg-tertiary);
    border-radius: var(--pm-radius-sm);
    min-width: 0;
}

.device-info-row--stack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

/* Device ID: 2 Spalten — links Label+Wert, rechts Copy */
.device-info-row--copy-cols {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.device-info-col-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.device-info-col-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
}

.device-info-label {
    color: var(--pm-text-muted);
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.device-info-value {
    color: var(--pm-text-primary);
    font-weight: 500;
    line-height: 1.4;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.device-info-value--mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    word-break: break-all;
}

.device-info-copy-icon-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    background: var(--pm-bg-primary, #fff);
    color: var(--pm-accent, #587899);
    cursor: pointer;
    transition: background var(--pm-transition-fast), border-color var(--pm-transition-fast), color var(--pm-transition-fast);
}

.device-info-copy-icon-btn:active {
    transform: scale(0.96);
}

.device-info-copy-icon-btn i {
    font-size: 14px;
    line-height: 1;
}

.device-info-copy-icon-btn.is-success {
    border-color: var(--pm-success, #16a34a);
    background: var(--pm-success-bg, #bbf7d0);
    color: var(--pm-success, #16a34a);
}

.about-marketing-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--pm-accent, #587899);
    text-decoration: none;
    line-height: 1.4;
}

.about-marketing-link:hover,
.about-marketing-link:focus-visible {
    text-decoration: underline;
    outline: none;
}

.about-marketing-link:active {
    color: var(--pm-accent-hover, #4C6C8B);
}

.push-gate-open .app-container,
.push-gate-open #app {
    pointer-events: none;
    user-select: none;
}

.push-gate-open .bottom-nav {
    pointer-events: none;
}

.push-gate-open .language-prompt-overlay {
    display: none !important;
}

.push-gate-open .push-gate-overlay,
.push-gate-open .push-gate-overlay * {
    pointer-events: auto;
}

.push-gate-overlay {
    backdrop-filter: blur(2px);
}

.btn-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--pm-touch-target);
    padding: 12px 16px;
    background: transparent;
    color: var(--pm-text-muted);
    border: none;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: color var(--pm-transition-fast);
}

.btn-text:active {
    color: var(--pm-accent);
}

.btn-danger {
    background: linear-gradient(135deg, var(--pm-danger) 0%, #dc2626 100%);
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════════ */

.card {
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-lg);
    padding: 16px;
    box-shadow: var(--pm-shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.card-icon {
    width: 40px;
    height: 40px;
    background: var(--pm-accent-soft);
    border-radius: var(--pm-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pm-accent);
    font-size: 18px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--pm-text-primary);
}

.card-subtitle {
    font-size: 13px;
    color: var(--pm-text-muted);
}

/* Dashboard-Segmente trennen Übersicht von Geräte- und App-Funktionen. */
.dashboard-segment-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-lg);
    box-shadow: var(--pm-shadow-sm);
}

.dashboard-segment-btn {
    min-height: 42px;
    border: 0;
    border-radius: calc(var(--pm-radius-lg) - 4px);
    background: transparent;
    color: var(--pm-text-muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-segment-btn.active {
    background: var(--pm-accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(88, 120, 153, 0.24);
}

.dashboard-segment-btn:not(.active):active {
    background: var(--pm-bg-hover);
    color: var(--pm-text-primary);
}

.dashboard-segment-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.dashboard-segment-panel.active {
    display: flex;
}

.dashboard-inbox-entry-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.dashboard-inbox-entry-card {
    width: 100%;
    min-height: 74px;
    display: grid;
    grid-template-columns: 42px 1fr auto 14px;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-lg);
    background: var(--pm-bg-secondary);
    color: var(--pm-text-primary);
    text-align: left;
    font: inherit;
    cursor: pointer;
    box-shadow: var(--pm-shadow-sm);
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.dashboard-inbox-entry-card:active {
    transform: translateY(1px);
    background: var(--pm-bg-hover);
}

.dashboard-inbox-entry-card:focus-visible {
    outline: 2px solid var(--pm-accent);
    outline-offset: 2px;
}

.dashboard-inbox-entry-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--pm-accent-soft);
    color: var(--pm-accent);
    font-size: 17px;
}

.dashboard-inbox-entry-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dashboard-inbox-entry-copy strong {
    color: var(--pm-text-primary);
    font-size: 15px;
    font-weight: 750;
}

.dashboard-inbox-entry-copy small {
    color: var(--pm-text-muted);
    font-size: 12px;
}

.dashboard-inbox-entry-badge {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--pm-radius-full);
    background: var(--pm-bg-tertiary);
    color: var(--pm-text-muted);
    font-size: 13px;
    font-weight: 800;
}

.dashboard-inbox-entry-badge.has-items {
    background: var(--pm-accent);
    color: #fff;
    box-shadow: 0 6px 18px rgba(88, 120, 153, 0.28);
}

.dashboard-inbox-entry-badge.is-error {
    background: var(--pm-danger-bg, rgba(239, 68, 68, 0.14));
    color: var(--pm-danger, #ef4444);
}

.dashboard-inbox-entry-arrow {
    color: var(--pm-text-muted);
    font-size: 12px;
}

.dashboard-desktop-entry-card {
    grid-template-columns: 42px 1fr auto 14px;
}

.dashboard-desktop-entry-card:disabled {
    opacity: 1;
    cursor: default;
}

.dashboard-desktop-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--pm-text-muted);
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
}

.dashboard-desktop-dot.is-online {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.dashboard-desktop-dot.is-waiting {
    background: var(--pm-accent);
    box-shadow: 0 0 0 4px rgba(88, 120, 153, 0.16);
}

.dashboard-desktop-dot.is-offline {
    background: #94a3b8;
}

.dashboard-desktop-status {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-lg);
    background: var(--pm-bg-secondary);
    box-shadow: var(--pm-shadow-sm);
}

.dashboard-desktop-status.is-connected {
    border-color: rgba(34, 197, 94, 0.34);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), var(--pm-bg-secondary));
}

.dashboard-desktop-status.is-waiting {
    border-color: rgba(88, 120, 153, 0.42);
    background: linear-gradient(135deg, rgba(88, 120, 153, 0.1), var(--pm-bg-secondary));
}

.dashboard-desktop-status-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--pm-bg-tertiary);
    color: var(--pm-text-muted);
}

.dashboard-desktop-status.is-connected .dashboard-desktop-status-icon {
    background: rgba(34, 197, 94, 0.16);
    color: #22c55e;
}

.dashboard-desktop-status.is-waiting .dashboard-desktop-status-icon {
    background: var(--pm-accent-soft);
    color: var(--pm-accent);
}

.dashboard-desktop-status-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dashboard-desktop-status-copy strong {
    color: var(--pm-text-primary);
    font-size: 15px;
    font-weight: 800;
}

.dashboard-desktop-status-copy small,
.dashboard-desktop-status-copy em {
    color: var(--pm-text-muted);
    font-size: 12px;
    font-style: normal;
}

.dashboard-desktop-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dashboard-desktop-action {
    min-height: 36px;
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 10px;
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-md);
    background: var(--pm-bg-tertiary);
    color: var(--pm-text-primary);
    font-size: 12px;
    font-weight: 750;
}

.dashboard-desktop-action.primary {
    border-color: var(--pm-accent);
    background: var(--pm-accent);
    color: #fff;
}

.dashboard-desktop-action.danger {
    color: var(--pm-danger, #ef4444);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PWA INSTALL BANNER
   ═══════════════════════════════════════════════════════════════════════════════ */

.pwa-install-banner {
    border: 1px solid var(--pm-accent);
    background: linear-gradient(135deg, var(--pm-bg-secondary) 0%, var(--pm-bg-tertiary) 100%);
}

.pwa-install-banner .card-header {
    padding-bottom: 0;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    padding-top: 16px;
}

.pwa-install-actions .btn-primary {
    flex: 1;
}

.pwa-install-actions .btn-text {
    color: var(--pm-text-muted);
    padding: 8px 12px;
}

.pwa-install-actions .btn-text:hover {
    color: var(--pm-text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: calc(var(--pm-header-height) + var(--pm-safe-top) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: calc(100% - 32px);
    max-width: 400px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--pm-bg-elevated);
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-md);
    box-shadow: var(--pm-shadow-lg);
    pointer-events: auto;
    animation: toast_slide_in 0.3s ease;
}

@keyframes toast_slide_in {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast.fade-out {
    animation: toast_slide_out 0.3s ease forwards;
}

@keyframes toast_slide_out {
    to { opacity: 0; transform: translateY(-20px); }
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.toast.success .toast-icon { background: var(--pm-success-bg); color: var(--pm-success); }
.toast.error .toast-icon { background: var(--pm-danger-bg); color: var(--pm-danger); }
.toast.warning .toast-icon { background: var(--pm-warning-bg); color: var(--pm-warning); }
.toast.info .toast-icon { background: var(--pm-info-bg); color: var(--pm-info); }

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--pm-text-primary);
    line-height: 1.4;
}

.toast-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--pm-text-muted);
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--pm-radius-sm);
    flex-shrink: 0;
}

.toast-close:active {
    background: var(--pm-bg-hover);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LOADING STATES
   ═══════════════════════════════════════════════════════════════════════════════ */

.skeleton {
    background: linear-gradient(90deg, var(--pm-bg-tertiary) 25%, var(--pm-bg-hover) 50%, var(--pm-bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton_shimmer 1.5s infinite;
    border-radius: var(--pm-radius-sm);
}

@keyframes skeleton_shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════════════════ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--pm-text-primary); }
.text-secondary { color: var(--pm-text-secondary); }
.text-muted { color: var(--pm-text-muted); }
.text-accent { color: var(--pm-accent); }
.text-success { color: var(--pm-success); }
.text-warning { color: var(--pm-warning); }
.text-danger { color: var(--pm-danger); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 24px; }

.mt-auto { margin-top: auto; }

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.d-none { display: none !important; }
.d-flex { display: flex; }
.d-block { display: block; }

.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-full { width: 100%; }

.mobile-menu-group-label {
    margin: 6px 4px -4px;
    color: var(--pm-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SCROLLBAR (Webkit)
   ═══════════════════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--pm-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--pm-text-light);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   VIEW TRANSITIONS
   ═══════════════════════════════════════════════════════════════════════════════ */

.view-enter {
    animation: view_enter 0.25s ease;
}

@keyframes view_enter {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.view-exit {
    animation: view_exit 0.2s ease;
}

@keyframes view_exit {
    to { opacity: 0; transform: translateX(-20px); }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PULL TO REFRESH
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Global PTR-Indicator (body) — muss die Browser-Local-Leiche weiter unten überschreiben */
.pull-indicator {
    position: fixed !important;
    top: calc(var(--pm-header-height) + var(--pm-safe-top)) !important;
    left: 50% !important;
    right: auto !important;
    width: 36px !important;
    height: 36px !important;
    transform: translateX(-50%) translateY(-100%);
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0;
    z-index: 240;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    box-shadow: var(--pm-shadow-md);
    color: var(--pm-accent);
    font-size: 16px;
}

.pull-indicator.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(12px);
}

.pull-indicator.ready {
    color: var(--pm-accent);
}

.pull-indicator i {
    color: inherit;
    font-size: 16px;
    transition: transform 0.2s;
}

.pull-indicator.refreshing i {
    animation: spin 1s linear infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   NOTIFICATION TOGGLE
   ═══════════════════════════════════════════════════════════════════════════════ */

.notification-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 14px;
    color: var(--pm-text-secondary);
    padding: 8px 0;
}

.notification-toggle span:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-toggle input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 28px;
    background: var(--pm-bg-tertiary);
    border-radius: 14px;
    transition: background var(--pm-transition-fast);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: var(--pm-text-muted);
    border-radius: 50%;
    transition: all var(--pm-transition-fast);
}

.notification-toggle input:checked + .toggle-slider {
    background: var(--pm-accent);
}

.notification-toggle input:checked + .toggle-slider::after {
    left: 23px;
    background: #fff;
}

.notification-toggle input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TEXT HELPERS
   ═══════════════════════════════════════════════════════════════════════════════ */

.text-accent {
    color: var(--pm-accent);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-task-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard-task-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--pm-border);
    color: var(--pm-text-primary);
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.dashboard-task-item:last-child {
    border-bottom: 0;
}

.dashboard-task-item:focus-visible,
.dashboard-notification-item:focus-visible {
    outline: 2px solid var(--pm-accent);
    outline-offset: 2px;
}

.dashboard-task-item.is-loading,
.dashboard-notification-item.is-busy {
    opacity: 0.65;
    pointer-events: none;
}

.dashboard-task-content {
    flex: 1;
    min-width: 0;
}

.dashboard-task-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--pm-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 3px;
    color: var(--pm-text-muted);
    font-size: 11px;
}

.dashboard-task-side {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.dashboard-task-priority {
    padding: 2px 7px;
    border-radius: var(--pm-radius-full);
    background: var(--pm-bg-tertiary);
    color: var(--pm-text-secondary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.dashboard-task-priority.priority-high,
.dashboard-task-priority.priority-urgent {
    background: var(--pm-danger-bg);
    color: var(--pm-danger);
}

.dashboard-task-status {
    color: var(--pm-text-muted);
    font-size: 10px;
}

.dashboard-notification-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dashboard-clear-notifications-btn,
.dashboard-notification-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--pm-danger);
    cursor: pointer;
    font-weight: 700;
}

.dashboard-notification-delete-btn {
    min-height: 32px;
    padding: 0 2px;
    font-size: 12px;
}

.dashboard-clear-notifications-btn:disabled,
.dashboard-notification-delete-btn:disabled {
    opacity: 0.45;
    pointer-events: none;
}

.dashboard-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 0;
    color: var(--pm-text-muted);
    font-size: 13px;
    text-align: center;
}

.dashboard-activity-card {
    opacity: 0.95;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--pm-border-light);
}

.dashboard-notification-item {
    cursor: pointer;
    transition: opacity 0.22s ease, transform 0.22s ease, max-height 0.26s ease, padding 0.22s ease, margin 0.22s ease;
    max-height: 96px;
    overflow: hidden;
}

.dashboard-notification-item.is-removing {
    opacity: 0;
    transform: translateX(-16px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    border-bottom-color: transparent;
    pointer-events: none;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 28px;
    height: 28px;
    background: var(--pm-bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pm-text-muted);
    font-size: 12px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.dashboard-notification-item .activity-content {
    padding-right: 4px;
}

.activity-text {
    display: block;
    font-size: 13px;
    color: var(--pm-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    display: block;
    font-size: 11px;
    color: var(--pm-text-light);
    margin-top: 2px;
}

/* Notification Description */
.activity-desc {
    display: block;
    font-size: 12px;
    color: var(--pm-text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Unread Notification */
.activity-item.unread {
    background: var(--pm-accent-soft);
    margin: 0 -12px;
    padding: 8px 12px;
    border-radius: var(--pm-radius-sm);
}

.activity-item.unread .activity-icon {
    background: var(--pm-accent);
    color: #fff;
}

.activity-item.unread .activity-text {
    color: var(--pm-text-primary);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BROWSER SUCHLEISTE
   ═══════════════════════════════════════════════════════════════════════════════ */

.browser-search-bar {
    padding: 12px 16px 8px;
    background: var(--pm-bg-primary);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-md);
    padding: 10px 14px;
    transition: all var(--pm-transition-fast);
}

.search-input-wrapper:focus-within {
    border-color: var(--pm-accent);
    box-shadow: 0 0 0 3px var(--pm-accent-soft);
}

.search-input-wrapper i {
    color: var(--pm-text-muted);
    font-size: 14px;
}

.search-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--pm-text-primary);
}

.search-input-wrapper input::placeholder {
    color: var(--pm-text-muted);
}

.search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--pm-bg-tertiary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--pm-text-muted);
    font-size: 12px;
}

.search-clear:active {
    background: var(--pm-bg-hover);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PREVIEW TABS
   ═══════════════════════════════════════════════════════════════════════════════ */

.preview-tabs {
    display: flex;
    gap: 0;
    background: var(--pm-bg-secondary);
    border-bottom: 1px solid var(--pm-border);
    padding: 0 16px;
}

.preview-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--pm-text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--pm-transition-fast);
}

.preview-tab i {
    font-size: 14px;
}

.preview-tab.active {
    color: var(--pm-accent);
    border-bottom-color: var(--pm-accent);
}

.preview-tab:not(.active):active {
    background: var(--pm-bg-hover);
}

.preview-tab-content {
    display: none;
    height: 100%;
    overflow-y: auto;
}

.preview-tab-content.active {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DOCUMENT DETAILS TAB
   ═══════════════════════════════════════════════════════════════════════════════ */

.doc-details-container {
    padding: 16px;
}

.detail-section {
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.detail-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--pm-text-primary);
}

.detail-section h4 i {
    color: var(--pm-accent);
    font-size: 16px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--pm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 14px;
    color: var(--pm-text-primary);
    word-break: break-word;
    /* Kommentar: Max 3 Zeilen fuer lange Werte */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Kommentar: POFID und andere Mono-Werte */
.detail-value.detail-mono {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    background: var(--pm-bg-tertiary);
    padding: 8px;
    border-radius: 4px;
    /* Kommentar: Horizontales Scrollen statt Umbrechen */
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    /* Kommentar: Scrollbar ausblenden aber funktional */
    scrollbar-width: thin;
    -webkit-line-clamp: unset;
}

/* Tags/Keywords */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--pm-accent-soft);
    color: var(--pm-accent);
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
}

.tag-placeholder {
    font-size: 13px;
    color: var(--pm-text-muted);
    font-style: italic;
}

/* Paths */
.paths-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.path-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--pm-bg-tertiary);
    border-radius: var(--pm-radius-sm);
    font-size: 13px;
    color: var(--pm-text-secondary);
    /* Kommentar: Overflow fuer lange Pfade */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.path-item i {
    color: var(--pm-accent);
}

/* Detail Actions */
.detail-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    background: var(--pm-accent);
    border: none;
    border-radius: var(--pm-radius-md);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--pm-transition-fast);
}

.btn-action:active {
    transform: scale(0.98);
}

.btn-action.secondary {
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    color: var(--pm-text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   OCR TEXT TAB
   ═══════════════════════════════════════════════════════════════════════════════ */

.ocr-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ocr-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--pm-bg-secondary);
    border-bottom: 1px solid var(--pm-border);
}

.ocr-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--pm-bg-tertiary);
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-sm);
    color: var(--pm-text-secondary);
    cursor: pointer;
    transition: all var(--pm-transition-fast);
}

.ocr-btn:active {
    background: var(--pm-accent);
    color: white;
    border-color: var(--pm-accent);
}

.ocr-info {
    font-size: 12px;
    color: var(--pm-text-muted);
}

.ocr-text-area {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.ocr-text {
    font-family: monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--pm-text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

.ocr-loading,
.ocr-empty,
.ocr-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    gap: 12px;
    color: var(--pm-text-muted);
    text-align: center;
}

.ocr-loading i,
.ocr-empty i,
.ocr-error i {
    font-size: 32px;
}

.ocr-error {
    color: var(--pm-danger);
}

/* Modal Header Actions */
.modal-header-actions {
    display: flex;
    gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PWA INSTALL OVERLAY - Companion App Installation
   ═══════════════════════════════════════════════════════════════════════════════ */

.pwa-install-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--pm-bg-primary);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    padding-top: calc(24px + var(--pm-safe-top));
    padding-bottom: calc(24px + var(--pm-safe-bottom));
    overflow-y: auto;
}

.pwa-install-content {
    max-width: 380px;
    width: 100%;
    text-align: center;
}

/* Einzelne Steps */
.pwa-step {
    animation: pwa-fade-in 0.4s ease-out;
}

@keyframes pwa-fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.pwa-install-logo {
    width: 96px;
    height: 96px;
    margin-bottom: 24px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.pwa-install-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--pm-text-primary);
    margin: 0 0 16px 0;
}

.pwa-install-description {
    font-size: 15px;
    color: var(--pm-text-secondary);
    margin: 0 0 32px 0;
    line-height: 1.6;
}

.pwa-install-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--pm-accent) 0%, var(--pm-accent-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--pm-radius-lg);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--pm-transition-normal);
    box-shadow: 0 4px 20px rgba(88, 120, 153, 0.4);
}

.pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(88, 120, 153, 0.5);
}

.pwa-install-btn:active {
    transform: translateY(0);
}

.pwa-install-btn i {
    font-size: 20px;
}

.pwa-install-info {
    margin-top: 24px;
    padding: 12px 16px;
    background: var(--pm-bg-secondary);
    border-radius: var(--pm-radius-md);
}

.pwa-install-info p {
    margin: 0;
    font-size: 13px;
    color: var(--pm-text-muted);
}

.pwa-install-info i {
    color: var(--pm-accent);
    margin-right: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   INSTALLING STATE - Grosser Spinner
   ═══════════════════════════════════════════════════════════════════════════════ */

.pwa-installing-spinner {
    width: 80px;
    height: 80px;
    border: 5px solid var(--pm-border);
    border-top-color: var(--pm-accent);
    border-radius: 50%;
    animation: pwa-spin 1s linear infinite;
    margin: 0 auto 32px;
}

@keyframes pwa-spin {
    to { transform: rotate(360deg); }
}

.pwa-installing-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
    padding: 16px;
    background: var(--pm-bg-secondary);
    border-radius: var(--pm-radius-md);
    font-size: 14px;
    color: var(--pm-text-muted);
}

.pwa-installing-hint i {
    font-size: 24px;
    color: var(--pm-accent);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   COMPLETE STATE - Naechste Schritte
   ═══════════════════════════════════════════════════════════════════════════════ */

.pwa-complete-icon {
    margin-bottom: 24px;
}

.pwa-complete-icon i {
    font-size: 72px;
    color: var(--pm-success);
    animation: pwa-pop 0.5s ease-out;
}

@keyframes pwa-pop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.pwa-next-steps {
    background: var(--pm-bg-secondary);
    border-radius: var(--pm-radius-lg);
    padding: 24px;
    text-align: left;
    margin-top: 24px;
}

.pwa-next-steps h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--pm-text-primary);
    text-align: center;
}

.pwa-step-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--pm-border);
}

.pwa-step-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.pwa-step-item:first-of-type {
    padding-top: 0;
}

.pwa-step-item .step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--pm-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
}

.pwa-step-item .step-text {
    flex: 1;
}

.pwa-step-item .step-text strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--pm-text-primary);
    margin-bottom: 4px;
}

.pwa-step-item .step-text span {
    font-size: 13px;
    color: var(--pm-text-muted);
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   iOS SPECIFIC
   ═══════════════════════════════════════════════════════════════════════════════ */

.pwa-ios-steps {
    background: var(--pm-bg-secondary);
    border-radius: var(--pm-radius-lg);
    padding: 24px;
    text-align: left;
    margin-top: 24px;
}

.pwa-ios-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    font-size: 13px;
    color: var(--pm-text-muted);
}

.pwa-ios-hint i {
    font-size: 20px;
    color: var(--pm-accent);
}
/* ═══════════════════════════════════════════════════════════════════════════════
   MOBILE DOCUMENT BROWSER v2.0 - ENTERPRISE GRADE
   Date: 2026-02-05
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Container */
.mobile-browser-v2 {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--pm-bg-primary);
    position: relative;
}

/* Header */
.browser-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px 6px;
    background: var(--pm-bg-primary);
}

.search-container {
    margin-bottom: 0;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--pm-bg-tertiary);
    border-radius: var(--pm-radius-full);
    padding: 0 14px;
    height: 40px;
    gap: 10px;
}

.search-bar .search-icon {
    color: var(--pm-text-muted);
    font-size: 14px;
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--pm-text-primary);
    font-size: 15px;
    outline: none;
}

.search-bar input::placeholder {
    color: var(--pm-text-muted);
}

.search-bar button {
    background: none;
    border: none;
    color: var(--pm-text-muted);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.search-bar button:active {
    color: var(--pm-accent);
}

.doctype-filter-chip {
    display: none;
    align-items: center;
    gap: 8px;
    margin: 8px 0 0;
    padding: 8px 10px;
    border-radius: 999px;
    background: var(--pm-accent-soft, rgba(88, 120, 153, 0.12));
    color: var(--pm-accent);
    border: 1px solid rgba(88, 120, 153, 0.22);
    max-width: 100%;
}

.doctype-filter-chip > i {
    font-size: 12px;
    flex-shrink: 0;
}

.doctype-filter-chip-label {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--pm-text-primary);
}

.doctype-filter-chip-clear {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--pm-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.doctype-filter-chip-clear:active {
    color: var(--pm-accent);
    background: rgba(88, 120, 153, 0.1);
}

.doctype-filter-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 12px;
    border: none;
    border-bottom: 1px solid var(--pm-border);
    background: transparent;
    color: var(--pm-text-primary);
    text-align: left;
    font-size: 15px;
    cursor: pointer;
}

.doctype-filter-option > i:first-child {
    color: var(--pm-text-muted);
    width: 18px;
    text-align: center;
}

.doctype-filter-option span {
    flex: 1;
    min-width: 0;
}

.doctype-filter-option .check-icon {
    opacity: 0;
    color: var(--pm-accent);
}

.doctype-filter-option.active .check-icon {
    opacity: 1;
}

.doctype-filter-option.active {
    background: var(--pm-accent-soft, rgba(88, 120, 153, 0.08));
}

.doctype-filter-option:active {
    background: var(--pm-bg-tertiary);
}

.workspace-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--pm-bg-tertiary);
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-md);
    padding: 9px 12px;
    width: 100%;
    color: var(--pm-text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--pm-transition-fast);
}

.workspace-selector:active {
    background: var(--pm-bg-hover);
}

.workspace-selector i:first-child {
    color: var(--pm-accent);
}

.workspace-selector span {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Breadcrumb */
.browser-breadcrumb {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--pm-bg-secondary);
    border-bottom: 1px solid var(--pm-border);
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.breadcrumb-back {
    background: none;
    border: none;
    color: var(--pm-accent);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    font-size: 18px;
    cursor: pointer;
}

.breadcrumb-path {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.breadcrumb-item {
    color: var(--pm-text-muted);
    white-space: nowrap;
    cursor: pointer;
}

.breadcrumb-item.current {
    color: var(--pm-text-primary);
    font-weight: 500;
}

.breadcrumb-sep {
    color: var(--pm-text-light);
    font-size: 10px;
}

/* Content Area */
.browser-controls {
    flex: 0 0 auto;
    padding: 6px 12px 8px;
    background: var(--pm-bg-primary);
    border-bottom: 1px solid var(--pm-border);
}

.browser-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Liste edge-to-edge; Grid bekommt eigenes Inset */
    padding: 0 0 calc(8px + var(--pm-safe-bottom, 0px));
    min-height: 0;
}

/* Empty State */
.browser-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    padding: 32px 16px;
}

.browser-empty .empty-icon {
    width: 80px;
    height: 80px;
    background: var(--pm-accent-soft);
    border-radius: var(--pm-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.browser-empty .empty-icon i {
    font-size: 32px;
    color: var(--pm-accent);
}

.browser-empty h3 {
    color: var(--pm-text-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
}

.browser-empty p {
    color: var(--pm-text-muted);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    max-width: 280px;
}

.browser-empty .empty-actions {
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    width: 100%;
}

.browser-empty .empty-actions .btn-primary {
    min-width: 180px;
}

/* Folders Section */
/* Folders Toggle Button */
.folders-toggle {
    margin-bottom: 8px;
}

.folders-toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-md);
    color: var(--pm-text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.folders-toggle-btn:active {
    background: var(--pm-bg-tertiary);
    transform: scale(0.98);
}

.folders-toggle-btn i:first-child {
    color: var(--pm-accent);
    font-size: 16px;
}

.folders-badge {
    background: var(--pm-accent);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

.toggle-arrow {
    color: var(--pm-text-muted);
    font-size: 12px;
    transition: transform 0.2s ease;
}

.folders-section,
.documents-section {
    margin-bottom: 16px;
}

.browser-controls .folders-section {
    max-height: 150px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 8px;
}

.section-header {
    margin-bottom: 10px;
}

.browser-controls .section-header {
    margin-bottom: 0;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.section-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--pm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex: 1 1 auto;
    min-width: 0;
}

.section-actions {
    display: flex;
    gap: 4px;
}

.browser-sort-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    max-width: 62%;
    min-height: 36px;
    padding: 6px 10px 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(88, 120, 153, 0.28);
    background: #ffffff;
    color: #4C6C8B;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.browser-sort-chip:active,
.browser-sort-chip[aria-expanded="true"] {
    background: #eef3f8;
    border-color: rgba(88, 120, 153, 0.42);
    color: #405F7D;
}

.browser-sort-chip > i {
    font-size: 12px;
    flex-shrink: 0;
}

.browser-sort-chip-label {
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: inherit;
}

.action-btn {
    background: none;
    border: none;
    color: var(--pm-text-muted);
    padding: 8px;
    border-radius: var(--pm-radius-sm);
    cursor: pointer;
}

.action-btn:active {
    background: var(--pm-bg-hover);
    color: var(--pm-text-primary);
}

/* Folders Grid */
.folders-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--pm-bg-secondary);
    border-radius: var(--pm-radius-md);
    cursor: pointer;
    transition: all var(--pm-transition-fast);
}

.folder-item:active {
    background: var(--pm-bg-hover);
    transform: scale(0.98);
}

.folder-icon {
    width: 40px;
    height: 40px;
    background: var(--pm-warning-bg);
    border-radius: var(--pm-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.folder-icon i {
    font-size: 18px;
    color: var(--pm-warning);
}

.folder-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--pm-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-arrow {
    color: var(--pm-text-light);
    font-size: 12px;
}

/* Documents Grid */
.documents-grid {
    display: grid;
    gap: 0;
}

.documents-grid.grid-view {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* Nebeneinander gleiche Card-Höhe (Grid-Stretch) */
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px 12px;
}

.documents-grid.list-view {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
}

.document-item {
    background: var(--pm-bg-secondary);
    border-radius: var(--pm-radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: background var(--pm-transition-fast), transform var(--pm-transition-fast);
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.document-item .doc-thumb,
.document-item .doc-name,
.document-item .doc-meta {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.document-item .doc-thumb img {
    -webkit-user-drag: none;
    pointer-events: none;
}

.document-item:active {
    transform: scale(0.98);
    background: var(--pm-bg-hover);
}

/* Grid View */
.grid-view .document-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
}

.grid-view .doc-thumb {
    aspect-ratio: 4/3;
    flex: 0 0 auto;
    background: var(--pm-bg-tertiary);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.grid-view .doc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Dateiendung auf Workspace-Thumbs: bewusst aus — der Dateiname trägt sie bereits */
.doc-ext {
    display: none !important;
}

/* Thumb lädt: Shimmer statt leerer grauer Fläche */
.doc-thumb.is-thumb-loading,
.home-recent-item-thumb.is-thumb-loading,
.preview-quarantine-thumb.is-thumb-loading,
.preview-image-wrapper.is-thumb-loading {
    background: linear-gradient(
        90deg,
        var(--pm-skeleton-base) 0%,
        var(--pm-skeleton-shine) 45%,
        var(--pm-skeleton-base) 90%
    );
    background-size: 200% 100%;
    animation: browser-skeleton-shimmer 1.2s ease-in-out infinite;
}

.doc-thumb.is-thumb-loading > img,
.home-recent-item-thumb.is-thumb-loading > img,
.preview-quarantine-thumb.is-thumb-loading > img,
.preview-image-wrapper.is-thumb-loading > img {
    opacity: 0;
}

.doc-thumb:not(.is-thumb-loading) > img[data-po-thumb-hydrated="1"],
.home-recent-item-thumb:not(.is-thumb-loading) > img[data-po-thumb-hydrated="1"],
.preview-quarantine-thumb:not(.is-thumb-loading) > img[data-po-thumb-hydrated="1"] {
    opacity: 1;
    transition: opacity 0.18s ease;
}

@media (prefers-reduced-motion: reduce) {
    .doc-thumb.is-thumb-loading,
    .home-recent-item-thumb.is-thumb-loading,
    .preview-quarantine-thumb.is-thumb-loading,
    .preview-image-wrapper.is-thumb-loading {
        animation: none;
        background: var(--pm-skeleton-base);
    }
}

.grid-view .doc-icon-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.grid-view .doc-icon-fallback i {
    font-size: 36px;
    color: var(--pm-text-light);
}

.grid-view .doc-info {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    min-height: 0;
}

.grid-view .doc-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--pm-text-primary);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.25;
    min-height: 49px;
    word-break: break-word;
}

.grid-view .doc-meta {
    font-size: 11px;
    color: var(--pm-text-muted);
    flex: 0 0 auto;
}

.doc-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

/* Badges am unteren Card-Rand — bei Stretch optisch konsistent */
.grid-view .doc-badges {
    margin-top: auto;
    min-height: 22px;
}

.grid-view .doc-type {
    font-size: 10px;
    color: var(--pm-accent);
    background: var(--pm-accent-soft);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    max-width: fit-content;
}

/* List View — volle Breite, dichtere Rows (Mobile Best Practice) */
.list-view .document-item {
    display: flex;
    align-items: center;
    padding: 12px 12px;
    gap: 12px;
    border-radius: 0;
    background: var(--pm-bg-secondary);
    border-bottom: 1px solid var(--pm-border);
    box-shadow: none;
}

.list-view .document-item:active {
    transform: none;
    background: var(--pm-bg-hover);
}

.list-view .document-item:last-child {
    border-bottom: none;
}

.list-view .doc-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--pm-radius-sm);
    background: var(--pm-bg-tertiary);
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-view .doc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--pm-radius-sm);
}

.list-view .doc-icon-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-view .doc-icon-fallback i {
    font-size: 24px;
    color: var(--pm-text-light);
}

.list-view .doc-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.list-view .doc-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--pm-text-primary);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.25;
    word-break: break-word;
}

.list-view .doc-meta {
    font-size: 12px;
    color: var(--pm-text-muted);
}

.list-view .doc-type {
    font-size: 11px;
    color: var(--pm-accent);
    background: var(--pm-accent-soft);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    max-width: fit-content;
}

.doc-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid transparent;
}

.doc-status-badge i {
    font-size: 9px;
}

.doc-status-badge-compact {
    max-width: 100%;
}

/* Feature-Chips (AI-DMS / Extract): kurzer Produktname, Status nur über Farbe */
.doc-feature-chip,
.doc-ai-dms-chip,
.doc-extract-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.02em;
    white-space: nowrap;
    color: var(--pm-text-muted);
    background: var(--pm-bg-tertiary);
    border: 1px solid var(--pm-border);
    max-width: fit-content;
}

.doc-ai-dms-chip.is-ai-dms-active {
    color: #405F7D;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.28);
}

.doc-ai-dms-chip.is-ai-dms-active i {
    font-size: 9px;
}

.doc-thumb.is-ai-dms-active {
    position: relative;
}

.doc-ai-dms-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 8px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.05) 35%, rgba(15, 23, 42, 0.45) 100%);
    pointer-events: none;
}

.doc-ai-dms-overlay-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

.doc-ai-dms-overlay-pill i {
    font-size: 11px;
}

.document-item.is-ai-dms-active .doc-ai-dms-cta {
    display: none;
}

.grid-view .doc-badges .doc-type {
    order: 1;
}

.grid-view .doc-badges .doc-extract-chip {
    order: 2;
}

.grid-view .doc-badges .doc-ai-dms-chip {
    order: 3; /* immer zuletzt */
}

.grid-view .doc-badges .doc-status-badge {
    order: 4;
    max-width: 100%;
    overflow: hidden;
}

.grid-view .doc-badges .doc-status-badge span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* AI-DMS muted Badge: nicht mehr als Chip — Upsell-CTA statt Pill */
.doc-ai-dms-chip.doc-status-muted {
    display: none !important;
}

/* Audit-Quarantäne: Danger-Chip vor AI-DMS */
.grid-view .doc-badges .doc-quarantine-chip {
    order: 0;
}
.doc-quarantine-chip {
    gap: 4px;
    color: #991b1b;
    background: #fecaca;
    border-color: #fca5a5;
}
.doc-quarantine-chip i {
    font-size: 9px;
}

/* Upsell-CTA: volle Kartenbreite (Desktop-Parität „AI-DMS inaktiv“) */
.doc-ai-dms-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 6px;
    padding: 7px 8px;
    border-radius: 8px;
    border: 1px solid rgba(88, 120, 153, 0.28);
    background: rgba(88, 120, 153, 0.08);
    color: #587899;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Kein Icon — Text braucht die volle Breite in der Grid-Karte */
.doc-ai-dms-cta i {
    display: none !important;
}

.doc-ai-dms-cta:active {
    background: rgba(88, 120, 153, 0.16);
}

.list-view .doc-ai-dms-cta {
    width: 100%;
    max-width: none;
    margin-top: 4px;
}

.ai-dms-activate-sheet .ai-dms-activate-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 18px;
}

.ai-dms-activate-summary {
    font-size: 13px;
    color: var(--pm-text-muted);
    line-height: 1.35;
}

.ai-dms-activate-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--pm-text-secondary, #4b5563);
}

.ai-dms-activate-select {
    width: 100%;
    border: 1px solid var(--pm-border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    background: var(--pm-bg-primary, #fff);
    color: var(--pm-text-primary, #111827);
}

.ai-dms-tier-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.ai-dms-tier-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--pm-border);
    background: var(--pm-bg-primary, #fff);
    color: var(--pm-text-primary, #111827);
    cursor: pointer;
}

.ai-dms-tier-option:active {
    border-color: #587899;
    background: rgba(88, 120, 153, 0.06);
}

.ai-dms-tier-option-title {
    font-size: 14px;
    font-weight: 500;
}

.ai-dms-tier-option-sub {
    font-size: 12px;
    color: var(--pm-text-muted);
    line-height: 1.35;
}

/* AI-DMS Final: Tier-Farben (SOT wie Desktop po_tier_badge) */
.doc-ai-dms-chip.doc-status-success.doc-ai-dms-tier-basic {
    color: #64748b;
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.doc-ai-dms-chip.doc-status-success.doc-ai-dms-tier-premium {
    color: #587899;
    background: #eef3f8;
    border-color: #bfdbfe;
}

.doc-ai-dms-chip.doc-status-success.doc-ai-dms-tier-ultra {
    color: #6d28d9;
    background: #f5f3ff;
    border-color: #ddd6fe;
}

.doc-feature-chip.doc-status-success,
.doc-extract-chip.doc-status-success {
    color: #047857;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.22);
}

.doc-feature-chip.doc-status-progress,
.doc-extract-chip.doc-status-progress {
    color: #405F7D;
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.22);
}

.doc-feature-chip.doc-status-warning,
.doc-extract-chip.doc-status-warning {
    color: #b45309;
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.22);
}

.doc-status-success {
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
}

.doc-status-progress {
    color: #7d9bb5;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
}

.doc-status-warning {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.25);
}

.doc-status-danger {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
}

.doc-status-muted {
    color: var(--pm-text-muted);
    background: rgba(148, 163, 184, 0.10);
    border-color: rgba(148, 163, 184, 0.18);
}

/* Load More */
.load-more {
    padding: 16px;
    text-align: center;
}

.btn-load-more {
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    color: var(--pm-text-primary);
    padding: 12px 24px;
    border-radius: var(--pm-radius-full);
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.btn-load-more:active {
    background: var(--pm-bg-hover);
}

/* Loading Overlay – theme-aware (kein hardcoded Dark-Scrim) */
.browser-loading {
    position: absolute;
    inset: 0;
    background: var(--pm-loading-scrim);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity var(--pm-transition-fast), background-color var(--pm-transition-normal);
}

.browser-loading.browser-loading--subtle {
    background: var(--pm-loading-scrim-subtle);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.browser-loading-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    min-width: 148px;
    border-radius: var(--pm-radius-lg);
    background: var(--pm-loading-panel-bg);
    border: 1px solid var(--pm-loading-panel-border);
    box-shadow: var(--pm-shadow-md);
}

.browser-loading-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--pm-text-secondary);
    letter-spacing: 0.01em;
}

.loading-spinner {
    color: var(--pm-accent);
    font-size: 28px;
    line-height: 1;
}

/* Skeleton – Erstladen Dokumentenliste */
.browser-skeleton {
    display: none;
    gap: 12px;
    padding-bottom: 8px;
}

.browser-skeleton-card {
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-md);
    overflow: hidden;
}

.browser-skeleton-thumb,
.browser-skeleton-lines span {
    background: linear-gradient(
        90deg,
        var(--pm-skeleton-base) 0%,
        var(--pm-skeleton-shine) 45%,
        var(--pm-skeleton-base) 90%
    );
    background-size: 200% 100%;
    animation: browser-skeleton-shimmer 1.2s ease-in-out infinite;
}

.browser-skeleton-thumb {
    aspect-ratio: 4 / 3;
    width: 100%;
}

.browser-skeleton-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px 12px;
}

.browser-skeleton-lines span {
    display: block;
    height: 10px;
    border-radius: 999px;
}

.browser-skeleton-lines span:first-child {
    width: 88%;
}

.browser-skeleton-lines span:last-child {
    width: 56%;
}

@keyframes browser-skeleton-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Workspace-Label während Boot/Load — kein Fake-„Bitte wählen“ */
#workspace_name.workspace-name-loading {
    color: var(--pm-text-muted);
    opacity: 0.85;
}

/* Search Results */
.search-results {
    padding: 0;
}

.search-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--pm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
    padding: 10px 12px 8px;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.search-results-list.documents-grid {
    display: grid;
}

.search-results-list.documents-grid.list-view {
    gap: 0;
    padding: 0;
}

.search-results-list.documents-grid.grid-view {
    gap: 10px;
    padding: 10px 12px 12px;
}

.search-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--pm-text-muted);
}

.search-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Modal Sheet */
.modal-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--pm-bg-secondary);
    border-radius: var(--pm-radius-xl) var(--pm-radius-xl) 0 0;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

html.workspace-modal-open,
body.workspace-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

.workspace-modal-overlay {
    touch-action: none;
}

.workspace-modal-sheet {
    bottom: calc(var(--pm-bottom-nav-height) + var(--pm-safe-bottom) + 12px);
    height: min(82dvh, calc(100dvh - var(--pm-safe-top) - var(--pm-bottom-nav-height) - var(--pm-safe-bottom) - 24px));
    max-height: min(82dvh, calc(100dvh - var(--pm-safe-top) - var(--pm-bottom-nav-height) - var(--pm-safe-bottom) - 24px));
    min-height: min(280px, calc(100dvh - var(--pm-safe-top) - var(--pm-bottom-nav-height) - var(--pm-safe-bottom) - 24px));
    box-sizing: border-box;
}

.modal-sheet.modal-compact {
    max-height: 50vh;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: var(--pm-border);
    border-radius: 2px;
    margin: 12px auto;
}

.modal-sheet .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 16px;
    border-bottom: 1px solid var(--pm-border);
}

.modal-sheet .modal-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--pm-text-primary);
    margin: 0;
}

.modal-sheet .modal-close {
    background: none;
    border: none;
    color: var(--pm-text-muted);
    font-size: 20px;
    padding: 8px;
    cursor: pointer;
}

.modal-sheet .modal-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--pm-bg-tertiary);
    margin: 16px 20px;
    border-radius: var(--pm-radius-md);
}

.modal-sheet .modal-search i {
    color: var(--pm-text-muted);
}

.modal-sheet .modal-search input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--pm-text-primary);
    font-size: 15px;
    outline: none;
}

.modal-sheet .modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px;
}

.workspace-modal-content {
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding-bottom: 20px;
}

/* Workspace List */
.workspace-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: var(--pm-bg-tertiary);
    border-radius: var(--pm-radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--pm-transition-fast);
}

.workspace-item:active,
.workspace-item.active {
    background: var(--pm-accent-soft);
}

.workspace-picker-section-label {
    padding: 8px 4px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--pm-text-muted);
    letter-spacing: 0.04em;
}

.workspace-picker-hint {
    padding: 10px 4px 4px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--pm-text-muted);
}

.workspace-picker-loading {
    padding: 24px 12px;
    text-align: center;
    color: var(--pm-text-muted);
    font-size: 14px;
}

.workspace-item-create .workspace-icon {
    background: rgba(88, 120, 153, 0.12);
    color: var(--pm-primary);
}

.scanner-workspace-list {
    max-height: 42vh;
    overflow-y: auto;
    margin-top: 8px;
}

/* Scanner-Upload-Modal: PO Light Sheet (kein Dark-Navy mehr) */
.scanner-upload-modal .workspace-picker-section-label {
    color: var(--pm-text-muted, #6b7280);
}

.scanner-upload-modal .workspace-picker-hint,
.scanner-upload-modal .workspace-picker-loading,
.scanner-upload-modal .workspace-empty {
    color: var(--pm-text-muted, #6b7280);
}

.scanner-upload-modal .modal-search.workspace-modal-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #f8f9fa;
    border: 1px solid var(--pm-border, #e5e7eb);
    border-radius: 12px;
    margin-top: 0;
}

.scanner-upload-modal .modal-search.workspace-modal-search i {
    color: #9ca3af;
    flex-shrink: 0;
}

.scanner-upload-modal .modal-search.workspace-modal-search input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: var(--pm-text-primary, #1f2937);
    font-size: 15px;
    outline: none;
}

.scanner-upload-modal .modal-search.workspace-modal-search input::placeholder {
    color: #9ca3af;
}

.scanner-upload-modal .workspace-item {
    background: #fff;
    border: 1px solid var(--pm-border, #e5e7eb);
    border-radius: 12px;
    margin-bottom: 8px;
}

.scanner-upload-modal .workspace-item .workspace-name {
    color: #1f2937;
}

.scanner-upload-modal .workspace-item .workspace-meta {
    color: #6b7280;
}

.scanner-upload-modal .workspace-item .workspace-icon {
    background: rgba(88, 120, 153, 0.10);
    color: #587899;
}

.scanner-upload-modal .workspace-item:active:not(.active) {
    background: #f8f9fa;
}

.scanner-upload-modal .workspace-item.active {
    background: #eef3f8;
    border-color: #587899;
    box-shadow: none;
}

.scanner-upload-modal .workspace-item.active .workspace-name {
    color: #0f172a;
    font-weight: 600;
}

.scanner-upload-modal .workspace-item.active .workspace-meta {
    color: #475569;
}

.scanner-upload-modal .workspace-item.active .workspace-check {
    color: #587899;
}

.scanner-upload-modal .workspace-item-create .workspace-name {
    color: #587899;
}

.scanner-upload-modal .workspace-item-create.active {
    background: #eef3f8;
    border-color: #587899;
}

.scanner-upload-modal .workspace-item-create.active .workspace-name {
    color: #4C6C8B;
    font-weight: 600;
}

.workspace-modal-search {
    margin-top: 8px;
}

.workspace-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    background: var(--pm-accent-soft);
    border-radius: var(--pm-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.workspace-icon i {
    font-size: 18px;
    color: var(--pm-accent);
}

.workspace-info {
    flex: 1;
    min-width: 0;
}

/* Lange Namen immer vollständig — hart wrappen, notfalls mitten im Wort */
.workspace-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--pm-text-primary);
    line-height: 1.35;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: none;
}

.workspace-meta {
    font-size: 12px;
    color: var(--pm-text-muted);
    margin-top: 2px;
}

.workspace-check {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--pm-accent);
}

.workspace-empty {
    text-align: center;
    padding: 32px;
    color: var(--pm-text-muted);
}

.workspace-empty i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Sort Options */
.sort-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--pm-border);
    color: var(--pm-text-primary);
    font-size: 15px;
    text-align: left;
    cursor: pointer;
}

.sort-option:last-child {
    border-bottom: none;
}

.sort-option:active {
    background: var(--pm-bg-hover);
}

.sort-option i:first-child {
    width: 24px;
    color: var(--pm-text-muted);
}

.sort-option .check-icon {
    margin-left: auto;
    color: var(--pm-accent);
    opacity: 0;
}

.sort-option.active .check-icon {
    opacity: 1;
}

/* Context Menu */
.context-menu {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

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

.context-menu-content {
    background: var(--pm-bg-secondary);
    border-radius: var(--pm-radius-xl) var(--pm-radius-xl) 0 0;
    width: 100%;
    max-width: 500px;
    animation: slideUp 0.3s ease;
}

.context-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--pm-border);
}

.context-doc-icon {
    width: 44px;
    height: 44px;
    background: var(--pm-bg-tertiary);
    border-radius: var(--pm-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.context-doc-icon i {
    font-size: 20px;
    color: var(--pm-accent);
}

.context-doc-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--pm-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.context-menu-actions {
    padding: 8px 0;
}

.context-action {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 20px;
    background: none;
    border: none;
    color: var(--pm-text-primary);
    font-size: 15px;
    text-align: left;
    cursor: pointer;
}

.context-action:active {
    background: var(--pm-bg-hover);
}

.context-action i {
    width: 24px;
    color: var(--pm-text-muted);
}

/* Preview Modal */
.preview-modal {
    position: fixed;
    inset: 0;
    background: var(--pm-bg-primary);
    display: flex;
    flex-direction: column;
    z-index: 1000000;
}

.preview-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--pm-bg-secondary);
    border-bottom: 1px solid var(--pm-border);
    gap: 12px;
}

.preview-close {
    background: none;
    border: none;
    color: var(--pm-accent);
    font-size: 20px;
    padding: 8px;
    cursor: pointer;
}

.preview-title {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    color: var(--pm-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-actions {
    display: none;
    gap: 4px;
}

.preview-action {
    background: none;
    border: none;
    color: var(--pm-text-muted);
    font-size: 18px;
    padding: 8px;
    cursor: pointer;
}

.preview-action:active {
    color: var(--pm-accent);
}

/* Preview Content */
.preview-content {
    flex: 1;
    overflow: auto;
    background: var(--pm-bg-tertiary);
    padding: 24px 12px;
    overscroll-behavior: contain;
    touch-action: pan-x pan-y;
}

.preview-loading {
    color: var(--pm-accent);
    font-size: 32px;
}

.preview-loading-card,
.preview-error-card {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--pm-text-muted);
    text-align: center;
}

.preview-loading-title {
    color: var(--pm-text-primary);
    font-size: 15px;
    font-weight: 500;
}

.preview-loading-meta {
    font-size: 12px;
}

.preview-progress-track {
    width: min(280px, 78vw);
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
}

.preview-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: var(--pm-accent);
    transition: width 0.16s ease;
}

.preview-progress-track.indeterminate .preview-progress-bar {
    width: 38%;
    animation: previewProgressIndeterminate 1s ease-in-out infinite;
}

@keyframes previewProgressIndeterminate {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(280%); }
}

.preview-document {
    --preview-zoom: 1;
    width: min(100%, 920px);
    margin: 0 auto 96px;
    transform-origin: top center;
}

.preview-document.preview-zoomed {
    width: calc(100% * var(--preview-zoom));
    max-width: calc(920px * var(--preview-zoom));
}

.preview-pdf-document {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.preview-page {
    position: relative;
    width: 100%;
}

.preview-page.is-page-pending .preview-page-canvas-wrap,
.preview-page-skeleton {
    aspect-ratio: var(--page-aspect, 210 / 297);
    width: 100%;
    background: linear-gradient(
        90deg,
        var(--pm-skeleton-base) 0%,
        var(--pm-skeleton-shine) 45%,
        var(--pm-skeleton-base) 90%
    );
    background-size: 200% 100%;
    animation: browser-skeleton-shimmer 1.2s ease-in-out infinite;
    border-radius: 4px;
    overflow: hidden;
}

.preview-page-skeleton-shine {
    display: block;
    width: 100%;
    height: 100%;
}

@media (prefers-reduced-motion: reduce) {
    .preview-page.is-page-pending .preview-page-canvas-wrap,
    .preview-page-skeleton {
        animation: none;
        background: var(--pm-skeleton-base);
    }
}

.preview-page-canvas-wrap {
    position: relative;
    width: 100%;
}

.preview-large-consent-body {
    max-width: 320px;
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--pm-text-muted);
}

.preview-large-consent-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(280px, 78vw);
    margin-top: 4px;
}

.preview-large-consent-actions .btn-primary,
.preview-large-consent-actions .btn-secondary-outline,
.preview-large-consent-actions .btn-text {
    width: 100%;
    justify-content: center;
}

.preview-page-label,
.preview-render-progress {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 11px;
}

.preview-render-progress {
    position: sticky;
    bottom: 88px;
    left: 50%;
    z-index: 4;
}

.preview-canvas {
    width: 100%;
    height: auto;
    display: block;
    background: #fff;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}

.mobile-annotation-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    pointer-events: none;
    touch-action: auto;
}

body.mobile-annotation-mode .mobile-annotation-overlay {
    pointer-events: auto;
    touch-action: none;
}

.mobile-annotation-path {
    filter: drop-shadow(0 1px 3px rgba(15, 23, 42, 0.22));
    pointer-events: none;
}

@keyframes mobileAnnotationBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.18; }
}

.mobile-annotation-blink {
    animation: mobileAnnotationBlink 0.45s ease-in-out 4;
}

.mobile-annotation-draft {
    opacity: 0.72;
}

.mobile-annotation-saved {
    opacity: 0.9;
}

.mobile-annotation-stamp {
    font-weight: 900;
    paint-order: stroke;
    stroke: #ffffff;
    stroke-width: 0.55;
}

.preview-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image {
    width: calc(100% * var(--preview-zoom));
    max-width: none;
    max-height: none;
    object-fit: contain;
    transition: width 0.12s ease;
}

.preview-error {
    text-align: center;
    color: var(--pm-text-muted);
    padding: 32px;
}

.preview-error i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Preview Pagination */
.preview-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px;
    background: var(--pm-bg-secondary);
    border-top: 1px solid var(--pm-border);
}

.preview-nav {
    width: 44px;
    height: 44px;
    background: var(--pm-bg-tertiary);
    border: none;
    border-radius: 50%;
    color: var(--pm-text-primary);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.preview-nav:disabled {
    opacity: 0.3;
    cursor: default;
}

.preview-nav:not(:disabled):active {
    background: var(--pm-accent);
    color: white;
}

.preview-page-info {
    font-size: 14px;
    color: var(--pm-text-muted);
    min-width: 60px;
    text-align: center;
}

/* Bottom Sheet — Peek = Aktionsleiste, Handle öffnet Details */
.bottom-sheet {
    --pm-preview-sheet-peek: 112px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--pm-bg-secondary);
    border-radius: var(--pm-radius-xl) var(--pm-radius-xl) 0 0;
    transform: translateY(calc(100% - var(--pm-preview-sheet-peek)));
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    /* Genug Höhe für spürbaren Swipe-up auch bei wenig IDP-Inhalt */
    min-height: 42vh;
    max-height: 70vh;
    z-index: 10;
    box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.08);
}

.bottom-sheet.expanded {
    transform: translateY(0);
}

.bottom-sheet.is-dragging {
    transition: none !important;
}

.bottom-sheet-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px 6px;
    cursor: grab;
    touch-action: none;
}

.handle-bar {
    width: 40px;
    height: 4px;
    background: var(--pm-border);
    border-radius: 2px;
}

.bottom-sheet-peek,
.sheet-peek-actions {
    display: flex;
    align-items: center;
    justify-content: stretch;
    padding: 0 12px 12px;
    touch-action: none;
}

.sheet-peek-action-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

/* 3 gleiche Spalten: Chat | Teilen (primary) | Download — Text, keine Icons */
.sheet-peek-action {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    height: 44px;
    padding: 0 8px;
    border: none;
    border-radius: 12px;
    background: var(--pm-bg-tertiary);
    color: var(--pm-text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    transition: background var(--pm-transition-fast), transform var(--pm-transition-fast);
}

.sheet-peek-action i {
    display: none !important;
}

.sheet-peek-action span {
    display: block;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.sheet-peek-action:active {
    transform: scale(0.98);
    background: var(--pm-bg-hover);
}

.sheet-peek-action.primary {
    background: var(--pm-accent);
    color: #fff;
}

.sheet-peek-action.primary:active {
    background: var(--pm-accent-dark);
}

.sheet-peek-action[hidden] {
    display: none !important;
}

.sheet-peek-action:disabled {
    opacity: 0.45;
}

.bottom-sheet-content {
    padding: 0 20px 20px;
    max-height: calc(70vh - var(--pm-preview-sheet-peek));
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

/* Legacy Peek-Label/Toggle entfernt — Klassen nur noch harmlos */
.peek-info,
.peek-label,
.sheet-peek-toggle {
    display: none !important;
}

.inline-signature-panel {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.5));
}

.inline-signature-card {
    width: min(100%, 520px);
    border-radius: var(--pm-radius-xl);
    background: var(--pm-bg-primary);
    box-shadow: var(--pm-shadow-lg);
    padding: 16px;
}

.inline-signature-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.inline-signature-header strong {
    display: block;
    color: var(--pm-text-primary);
    font-size: 16px;
}

.inline-signature-header span {
    display: block;
    color: var(--pm-text-muted);
    font-size: 12px;
    margin-top: 2px;
}

.inline-signature-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    color: var(--pm-text-primary);
    background: var(--pm-bg-secondary);
}

.inline-signature-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
    color: var(--pm-text-muted);
    font-size: 12px;
}

.inline-signature-field input {
    width: 100%;
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-md);
    padding: 11px 12px;
    color: var(--pm-text-primary);
    background: var(--pm-bg-secondary);
    font-size: 15px;
}

.inline-signature-canvas-wrap {
    position: relative;
    height: 160px;
    border: 1px dashed var(--pm-border);
    border-radius: var(--pm-radius-lg);
    background: #fff;
    overflow: hidden;
    touch-action: none;
}

#inline_signature_canvas {
    position: relative;
    z-index: 2;
    display: block;
}

.inline-signature-placeholder {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 14px;
    pointer-events: none;
}

.inline-signature-placeholder.hidden {
    display: none;
}

.inline-signature-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

/* Sheet Sections */
.sheet-section {
    margin-bottom: 24px;
}

.sheet-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pm-text-primary);
    margin: 0 0 12px;
}

.sheet-section h4 i {
    color: var(--pm-accent);
}

.sheet-section .copy-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--pm-text-muted);
    padding: 4px 8px;
    cursor: pointer;
}

/* IDP / Eigenschaften Fields */
.idp-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.idp-props-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.idp-props-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--pm-text-primary);
    letter-spacing: 0.01em;
}

.idp-props-section-title i {
    color: var(--pm-accent, #587899);
    font-size: 13px;
}

.idp-props-section-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.idp-field {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    background: var(--pm-bg-tertiary);
    border-radius: var(--pm-radius-sm);
}

.idp-field.is-stack,
.idp-field.is-multiline {
    flex-direction: column;
    align-items: stretch;
}

.idp-label {
    font-size: 12px;
    color: var(--pm-text-muted);
    flex: 0 0 auto;
}

.idp-value {
    font-size: 14px;
    color: var(--pm-text-primary);
    font-weight: 500;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

.idp-field.is-stack .idp-value,
.idp-field.is-multiline .idp-value {
    max-width: 100%;
    width: 100%;
    text-align: left;
    font-weight: 500;
    line-height: 1.45;
    white-space: pre-wrap;
}

.idp-field.is-stack .doc-keyword-chips {
    justify-content: flex-start;
}

.doc-keyword-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
}

.doc-keyword-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--pm-accent-soft);
    color: var(--pm-accent);
    font-size: 11px;
    font-weight: 600;
}

.idp-loading,
.idp-empty {
    text-align: center;
    padding: 16px;
    color: var(--pm-text-muted);
    font-size: 13px;
}

/* Preview-Sheet: AI-DMS Upsell in „Wichtiger Inhalt“ */
.idp-ai-dms-upsell {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.idp-ai-dms-upsell .idp-empty {
    padding-bottom: 0;
}

.idp-ai-dms-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--pm-credit-alarm-border, #E4D5C5);
    background: var(--pm-credit-alarm-surface, #F6F0E8);
    color: var(--pm-ink, #0f172a);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    box-shadow: none;
}

.idp-ai-dms-warning i {
    flex: 0 0 auto;
    margin-top: 1px;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--pm-credit-alarm-clay, #A67C52);
}

.idp-ai-dms-warning span {
    min-width: 0;
    flex: 1 1 auto;
}

.idp-fields .doc-ai-dms-cta.idp-ai-dms-cta {
    width: 100%;
    margin-top: 0;
    padding: 12px 14px;
    font-size: 14px;
    border-radius: 10px;
}

.idp-ai-dms-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.idp-ai-dms-progress i {
    color: var(--pm-accent, #587899);
    font-size: 18px;
}

.idp-ai-dms-progress-hint {
    margin: 4px 0 0;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    color: var(--pm-text-muted, #6b7280);
    text-align: center;
}

.doc-ai-dms-cta.idp-ai-dms-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    background: #fff;
    color: var(--pm-accent, #587899);
    border: 1px solid rgba(15, 23, 42, 0.12);
    font-weight: 400;
}

.doc-ai-dms-cta.idp-ai-dms-refresh i {
    display: inline-block !important;
    font-size: 14px;
    color: inherit;
}

.doc-ai-dms-cta.idp-ai-dms-refresh.is-busy {
    opacity: 0.72;
    pointer-events: none;
}

.doc-ai-dms-cta.idp-ai-dms-refresh.is-success {
    border-color: rgba(16, 185, 129, 0.35);
    color: #0f172a;
}

.doc-ai-dms-cta.idp-ai-dms-refresh.is-error {
    border-color: #E4D5C5;
    background: #F6F0E8;
    color: #0f172a;
}

/* Info Grid — Preview-Sheet: Karten immer untereinander, volle Breite */
.info-grid,
.business-info-grid,
.technical-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
}

.info-grid .info-item,
.business-info-grid .info-item,
.technical-info-grid .info-item {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.info-item {
    padding: 10px 12px;
    background: var(--pm-bg-tertiary);
    border-radius: var(--pm-radius-sm);
    border: 1px solid transparent;
}

.info-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--pm-text-muted);
    margin-bottom: 4px;
}

.info-item.has-copy .info-label {
    margin-bottom: 2px;
}

.info-label-text {
    min-width: 0;
}

.info-item-copy {
    margin-left: auto;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--pm-accent, #587899);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.info-item-copy:active {
    background: var(--pm-bg-hover, #eef3f8);
}

.info-item-copy.is-success {
    color: var(--pm-success, #10b981);
}

.info-item-copy i {
    font-size: 15px;
    line-height: 1;
}

.info-value {
    font-size: 13px;
    color: var(--pm-text-primary);
    font-weight: 500;
    word-break: break-word;
}

.info-value-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 12px;
    letter-spacing: 0.01em;
}

.info-item-accent {
    border-color: rgba(125, 155, 181, 0.22);
}

.info-item-success {
    border-color: rgba(16, 185, 129, 0.28);
}

.info-item-progress {
    border-color: rgba(59, 130, 246, 0.28);
}

.info-item-warning {
    border-color: rgba(245, 158, 11, 0.28);
}

.info-item-danger {
    border-color: rgba(239, 68, 68, 0.28);
}

.technical-section {
    margin-top: 0;
}

/* Legacy Accordion-Klassen (falls Cache): immer geöffnet / unsichtbar */
.technical-details {
    border: none;
    background: transparent;
    overflow: visible;
}

.technical-details[open],
.technical-details {
    display: block;
}

.technical-details summary {
    display: none !important;
}

.technical-info-grid {
    padding: 0;
}

/* Sheet Actions */
.sheet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.sheet-action-btn {
    flex: 1 1 calc(50% - 10px);
    min-width: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 12px;
    background: var(--pm-bg-tertiary);
    border: none;
    border-radius: var(--pm-radius-md);
    color: var(--pm-text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--pm-transition-fast);
}

.sheet-action-btn i {
    font-size: 20px;
}

.sheet-action-btn:active {
    background: var(--pm-bg-hover);
    transform: scale(0.95);
}

.sheet-action-btn.primary {
    background: var(--pm-accent);
    color: white;
}

.sheet-action-btn.primary:active {
    background: var(--pm-accent-dark);
}

/* Animations */
@keyframes slideOutLeft {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-30px); opacity: 0; }
}

@keyframes slideInRight {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(30px); opacity: 0; }
}

@keyframes slideInLeft {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Safe Area Support */
@supports (padding: env(safe-area-inset-bottom)) {
    .browser-content {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
    
    .preview-pagination {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
    
    .bottom-sheet-content {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .context-menu-content {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .modal-sheet {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   FEHLENDE KLASSEN - BUGFIX 05.02.2026
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Browser List Container */
.browser-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Modal Overlay (Backdrop) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--pm-modal-backdrop);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

/* Auth-Showstopper: zentrierte Karte, kein Bottom-Sheet */
.auth-showstopper-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.72);
    padding: 16px;
    animation: fadeIn 0.2s ease;
}

.auth-showstopper-card {
    position: relative;
    width: min(100%, 420px);
    margin: 0;
    padding: 0;
    border-radius: 16px;
    background: var(--pm-bg-secondary);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
}

.auth-showstopper-header {
    padding: 24px 20px 8px;
    text-align: center;
}

.auth-showstopper-header h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 500;
    color: var(--pm-text);
}

.auth-showstopper-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(165, 124, 82, 0.14);
    color: #A67C52;
}

.auth-showstopper-body {
    padding: 0 20px 20px;
    text-align: center;
}

.auth-showstopper-body p {
    font-size: 14px;
    line-height: 1.45;
    margin: 0 0 18px;
    color: var(--pm-text-muted);
    font-weight: 400;
}

body.auth-showstopper-open {
    overflow: hidden;
}

body.auth-showstopper-open #bottom_nav,
body.auth-showstopper-open .bottom-nav {
    visibility: hidden;
    pointer-events: none;
}

/* AI-DMS-Picker muss über der Dokumentvorschau liegen (Preview = 1000000) */
#ai_dms_activate_modal {
    position: fixed;
    inset: 0;
    z-index: 1000150;
    pointer-events: auto;
}

html.ai-dms-activate-open .po-helper-tip,
html.quarantine-release-confirm-open .po-helper-tip {
    display: none !important;
}

/* Quarantäne-Freigabe-Bestätigung über Vorschau und AI-DMS */
#quarantine_release_confirm_modal {
    position: fixed;
    inset: 0;
    z-index: 1000160;
    pointer-events: auto;
}

.quarantine-release-confirm-sheet {
    max-height: min(52dvh, 420px);
    min-height: 0;
    height: auto;
}

.quarantine-release-confirm-content p {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 400;
    color: var(--pm-text-primary);
}

.quarantine-release-confirm-error {
    color: #991b1b;
    font-weight: 500;
}

.quarantine-release-confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quarantine-release-confirm-actions .btn-primary,
.quarantine-release-confirm-actions .btn-secondary {
    width: 100%;
    justify-content: center;
    font-weight: 500;
}

/* Voice Search Button */
.search-voice {
    background: none;
    border: none;
    color: var(--pm-text-muted);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--pm-transition-fast);
    min-width: 44px;
    min-height: 44px;
}

.search-voice:active {
    background: var(--pm-accent-soft);
    color: var(--pm-accent);
}

.search-voice.recording {
    color: var(--pm-danger);
    animation: pulse 1s infinite;
}

.search-voice.transcribing {
    color: var(--pm-accent);
}

.search-voice.unsupported,
.search-voice:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Voice-Status: prominente Rückmeldung während Aufnahme und Transkription */
.voice-status {
    position: fixed;
    left: max(16px, var(--pm-safe-left));
    right: max(16px, var(--pm-safe-right));
    bottom: calc(var(--pm-bottom-nav-height) + var(--pm-safe-bottom) + 16px);
    z-index: 100002;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    min-height: 76px;
    border-radius: 22px;
    background: rgba(18, 24, 34, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.04);
    color: #fff;
    opacity: 0;
    transform: translateY(18px) scale(0.96);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.voice-status.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.voice-status-icon {
    position: relative;
    z-index: 1;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: linear-gradient(135deg, var(--pm-accent) 0%, var(--pm-accent-dark) 100%);
    color: #fff;
    font-size: 22px;
    box-shadow: 0 0 24px rgba(88, 120, 153, 0.42);
}

.voice-status.recording .voice-status-icon {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 0 28px rgba(239, 68, 68, 0.52);
}

.voice-status.transcribing .voice-status-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #5b21b6 100%);
}

.voice-status.success .voice-status-icon {
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
}

.voice-status.error .voice-status-icon,
.voice-status.cancelled .voice-status-icon {
    background: linear-gradient(135deg, #f97316 0%, #c2410c 100%);
}

.voice-status-pulse {
    position: absolute;
    left: 28px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: rgba(88, 120, 153, 0.18);
    opacity: 0;
}

.voice-status.recording .voice-status-pulse {
    background: rgba(239, 68, 68, 0.24);
    opacity: 1;
    animation: voice_status_pulse 1.1s ease-in-out infinite;
}

.voice-status.transcribing .voice-status-icon i {
    animation: voice_status_spin 0.9s linear infinite;
}

.voice-status-copy {
    min-width: 0;
}

.voice-status-title {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.voice-status-subtitle {
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.72);
}

@keyframes voice_status_pulse {
    0% { transform: scale(0.92); opacity: 0.78; }
    70% { transform: scale(1.42); opacity: 0; }
    100% { transform: scale(1.42); opacity: 0; }
}

@keyframes voice_status_spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

/* ============================================================
   2026-02-15: Follow-Up Suggestions fuer Mobile Chat
   ============================================================ */
.chat-suggestions {
    padding: 8px 16px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chat-suggestion-btn {
    padding: 8px 16px;
    /* FIX 2026-02-15: --pm-surface existiert nicht, --pm-bg-tertiary fuer korrekte Darkmode-Farbe */
    background: var(--pm-bg-tertiary);
    border: 1px solid var(--pm-border);
    border-radius: 20px;
    color: var(--pm-text, #334155);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-suggestion-btn:active {
    background: var(--pm-accent, #587899);
    color: white;
    border-color: var(--pm-accent, #587899);
    transform: scale(0.97);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TASKS VIEW — Phase 6.6 HITL Mobile Task Styles
   ═══════════════════════════════════════════════════════════════════════════ */

.task-filter-tabs,
.task-filter-tab {
    display: none !important;
}

.task-filter-tab {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 16px;
    background: var(--pm-bg-tertiary);
    border: 1px solid var(--pm-border);
    color: var(--pm-text-secondary);
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.task-filter-tab:focus-visible,
.task-card:focus-visible {
    outline: 2px solid var(--pm-accent);
    outline-offset: 2px;
}

.task-filter-tab.active {
    background: var(--pm-accent);
    border-color: var(--pm-accent);
    color: #fff;
}

.task-list {
    padding: 8px 16px 80px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-card {
    width: 100%;
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    border-radius: 12px;
    padding: 14px;
    color: inherit;
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: transform 0.1s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.task-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.task-card.overdue {
    border-left: 3px solid #A67C52;
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.task-card-time {
    font-size: 11px;
    color: var(--pm-text-muted);
}

.task-card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--pm-text);
    margin-bottom: 4px;
    line-height: 1.3;
}

.task-card-overdue {
    color: #A67C52;
}

.task-card-meta {
    font-size: 11px;
    color: var(--pm-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.task-four-eyes {
    margin-top: 6px;
    font-size: 11px;
    color: var(--pm-accent);
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-loading, .task-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    color: var(--pm-text-muted);
}

.task-claim-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 128px);
    padding: 48px 28px 72px;
    text-align: center;
    background: #f8f9fa;
}

.task-claim-avatar {
    width: 70px;
    height: 70px;
    border-radius: 15%;
    background: #e4e9ef;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-claim-avatar img,
.task-claim-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.task-claim-avatar-fallback {
    font-size: 22px;
    font-weight: 500;
    color: #4C6C8B;
    letter-spacing: 0.02em;
}

.task-claim-avatar-fallback[hidden] {
    display: none !important;
}

.task-claim-kicker {
    margin: 22px 0 0;
    font-size: 12px;
    font-weight: 400;
    color: #667085;
}

.task-claim-title {
    margin: 8px 0 0;
    font-size: 18px;
    font-weight: 400;
    color: #0f172a;
    line-height: 1.35;
    max-width: 22rem;
    word-break: break-word;
}

.task-claim-status {
    margin: 10px 0 0;
    font-size: 13.5px;
    font-weight: 400;
    color: #667085;
}

.task-claim-spinner {
    margin-top: 22px;
    color: #587899;
    font-size: 18px;
}

#task_result_screen_host {
    position: fixed;
    inset: 0;
    z-index: 10004000;
}

.task-result-screen {
    position: fixed;
    inset: 0;
    z-index: 10004000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 48px 28px calc(72px + var(--pm-safe-bottom, 0px));
    text-align: center;
    background: #f8f9fa;
}

.task-result-mark {
    width: 96px;
    height: 96px;
    border-radius: 15%;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    animation: task-result-mark-in 420ms ease-out;
}

.task-result-screen.is-approve .task-result-mark {
    background: #EEF3EF;
    color: #6B8F71;
}

.task-result-screen.is-reject .task-result-mark {
    background: #F4EBE9;
    color: #B57A72;
}

.task-result-screen.is-escalate .task-result-mark {
    background: #eef3f8;
    color: #587899;
}

.task-result-screen.is-already .task-result-mark {
    background: #eef3f8;
    color: #587899;
}

.task-result-kicker {
    margin: 22px 0 0;
    font-size: 12px;
    font-weight: 400;
    color: #667085;
}

.task-result-title {
    margin: 8px 0 0;
    font-size: 18px;
    font-weight: 400;
    color: #0f172a;
    line-height: 1.35;
}

.task-result-status {
    margin: 10px 0 0;
    font-size: 13.5px;
    font-weight: 400;
    color: #667085;
    max-width: 22rem;
}

@keyframes task-result-mark-in {
    from {
        transform: scale(0.84);
        opacity: 0.35;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .task-result-mark {
        animation: none;
    }
}

.task-offline-banner {
    background: #F6F0E8;
    color: #A67C52;
    border: 1px solid #E4D5C5;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 400;
    text-align: center;
    padding: 10px 12px;
    margin: 0 16px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Task Detail — App-CI Workspaces-SOT */
.task-detail-page {
    padding-bottom: 8px;
}

.task-detail-chrome {
    padding: 12px 16px 8px;
}

.task-detail-nav {
    display: flex;
    gap: 8px;
    width: 100%;
}

.task-detail-nav-pill,
.task-detail-back {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    font-weight: 400;
    color: #4C6C8B;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.task-detail-nav:not(.has-next) .task-detail-nav-pill {
    flex: 0 1 auto;
}

.task-detail-nav-pill span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-detail-nav-pill[hidden] {
    display: none !important;
}

.task-detail-nav-pill:hover,
.task-detail-nav-pill:focus-visible,
.task-detail-back:hover,
.task-detail-back:focus-visible {
    background: #eef3f8;
}

.task-detail-nav-pill:focus,
.task-detail-back:focus {
    outline: none;
}

.task-detail-nav-pill:focus-visible,
.task-detail-back:focus-visible {
    outline: 2px solid #587899;
    outline-offset: 2px;
}

.task-detail-nav-pill:disabled {
    opacity: 0.55;
    cursor: default;
}

.task-detail-header {
    padding: 8px 16px 12px;
}

.task-detail-title {
    font-size: 16px;
    font-weight: 500;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 8px;
}

.task-detail-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.task-prio-badge,
.task-status-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: 0;
}

.task-prio-badge.priority-normal,
.task-prio-badge.priority-low,
.task-status-label {
    background: #eef3f8;
    color: #4C6C8B;
}

.task-prio-badge.priority-high {
    background: #F6F0E8;
    color: #A67C52;
    border: 1px solid #E4D5C5;
}

.task-prio-badge.priority-urgent {
    background: #F4EBE9;
    color: #B57A72;
    border: 1px solid #E4D5C5;
}

.task-status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8CA8C4;
}

.task-status-dot.status-pending { background: #A67C52; }
.task-status-dot.status-in_progress { background: #587899; }
.task-status-dot.status-completed,
.task-status-dot.status-done { background: #6B8F71; }
.task-status-dot.status-rejected { background: #B57A72; }

.task-device-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 16px 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #F6F0E8;
    border: 1px solid #E4D5C5;
    color: #0f172a;
}

.task-device-banner i {
    color: #A67C52;
    margin-top: 2px;
}

.task-device-banner .task-device-title,
.task-device-banner span {
    display: block;
    font-weight: 400;
}

.task-device-banner .task-device-title {
    font-size: 13px;
    color: #0f172a;
}

.task-device-banner span {
    margin-top: 2px;
    font-size: 12px;
    color: #0f172a;
}

.task-device-banner.is-limit {
    background: #F3EBE3;
}

.task-device-banner.is-limit i {
    color: #9A704C;
}

.task-detail-desc {
    padding: 0 16px 12px;
    font-size: 13px;
    font-weight: 400;
    color: var(--pm-text-secondary);
    line-height: 1.5;
}

.task-hitl-timing {
    margin: 0 16px 12px;
    padding: 10px 14px;
    background: #eef3f8;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task-hitl-timing-row {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: #5b6b7f;
}

.task-hitl-timing-row .meta-label {
    font-weight: 400;
    color: #0f172a;
    margin-right: 4px;
}

.task-hitl-timing .task-sla-banner {
    margin: 2px 0 0;
}

.task-field-required {
    margin-left: 4px;
    color: #A67C52;
    font-weight: 500;
}

.task-hitl-auftrag {
    margin: 0 16px 16px;
    padding: 14px 16px;
    background: #eef3f8;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.task-hitl-auftrag-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.task-hitl-auftrag-head i {
    color: #587899;
    font-size: 14px;
}

.task-hitl-auftrag-title {
    font-size: 12px;
    font-weight: 500;
    color: #4C6C8B;
}

.task-hitl-auftrag-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-hitl-auftrag-text,
.task-hitl-auftrag-step {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: #0f172a;
}

.task-hitl-auftrag-text:first-child {
    font-size: 15px;
    font-weight: 500;
}

.task-detail-identity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 0 16px 12px;
}

.task-detail-identity-name,
.task-detail-identity-workflow {
    font-size: 12px;
    font-weight: 400;
    color: #667085;
    line-height: 1.35;
}

.task-postpone-hint {
    margin: 6px 0 0;
    font-size: 11px;
    font-weight: 400;
    color: #667085;
    text-align: center;
}

.task-reject-reason[hidden] {
    display: none !important;
}

.task-actions .task-reject-reason {
    padding: 0 0 4px;
}

.task-hitl-auftrag-step.is-continuation {
    padding-left: 16px;
    color: #5b6b7f;
}

.task-hitl-auftrag-status {
    margin: 10px 0 0;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.45;
    color: #5b6b7f;
}

.task-detail-meta {
    padding: 0 16px 16px;
    font-size: 11px;
    font-weight: 400;
    color: #5b6b7f;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-detail-meta .meta-label {
    font-weight: 400;
    color: #0f172a;
    margin-right: 4px;
}

.task-four-eyes-detail {
    padding: 0 16px 16px;
}

.four-eyes-label {
    font-size: 12px;
    font-weight: 400;
    color: var(--pm-accent, #587899);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.four-eyes-bar {
    height: 6px;
    background: var(--pm-bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.four-eyes-fill {
    height: 100%;
    background: var(--pm-accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.task-detail-doc,
.task-detail-doc-preview {
    padding: 0 16px 12px;
}

.task-detail-doc-preview.is-hero {
    padding: 0 16px 16px;
}

.task-doc-thumb-wrap {
    display: block;
    width: 100%;
    margin-bottom: 0;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    min-height: 280px;
    max-height: min(72vh, 520px);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.task-doc-thumb-wrap.is-thumb-loading {
    background: linear-gradient(
        90deg,
        var(--pm-skeleton-base, #eef3f8) 0%,
        var(--pm-skeleton-shine, #ffffff) 45%,
        var(--pm-skeleton-base, #eef3f8) 90%
    );
    background-size: 200% 100%;
    animation: browser-skeleton-shimmer 1.2s ease-in-out infinite;
}

.task-doc-thumb-wrap.is-thumb-loading > .task-doc-thumb-img {
    opacity: 0;
}

.task-doc-thumb-wrap:not(.is-thumb-loading) > .task-doc-thumb-img[data-po-thumb-hydrated="1"] {
    opacity: 1;
}

.task-doc-thumb-wrap:focus {
    outline: none;
}

.task-doc-thumb-wrap:focus-visible {
    outline: 2px solid var(--pm-accent, #587899);
    outline-offset: 2px;
}

.task-doc-thumb-img {
    width: 100%;
    display: block;
    object-fit: contain;
    max-height: min(72vh, 520px);
    pointer-events: none;
}

.task-doc-thumb-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    color: #8CA8C4;
    font-size: 28px;
}

.po-preview-overlay-host {
    pointer-events: none;
}

.po-preview-overlay-host .preview-modal {
    pointer-events: auto;
}

.preview-seed {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    user-select: none;
}

.preview-seed.is-loading {
    touch-action: none;
}

.preview-seed-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-seed-placeholder {
    width: min(72vw, 280px);
    aspect-ratio: 210 / 297;
    border-radius: 8px;
    background: linear-gradient(
        90deg,
        var(--pm-skeleton-base, #eef3f8) 0%,
        var(--pm-skeleton-shine, #ffffff) 45%,
        var(--pm-skeleton-base, #eef3f8) 90%
    );
    background-size: 200% 100%;
    animation: browser-skeleton-shimmer 1.2s ease-in-out infinite;
}

.preview-seed-progress {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    pointer-events: auto;
}

.preview-seed-progress-scrim {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
}

.preview-seed-progress-card {
    position: relative;
    z-index: 1;
    width: min(320px, calc(100% - 32px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 18px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-align: center;
}

.preview-seed-progress-icon {
    color: #587899;
    font-size: 22px;
}

.preview-seed-progress-title {
    color: #0f172a;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
}

.preview-seed-progress-card .preview-progress-track {
    width: 100%;
}

.preview-seed-progress-card .preview-progress-bar {
    background: #587899;
}

.preview-seed-progress-label {
    margin-top: 0;
    text-align: center;
    color: #667085;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}

.task-form-fields {
    padding: 0 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-form-field label,
.task-field-label {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #0f172a;
    margin-bottom: 4px;
}

.task-field-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.task-field-name {
    min-width: 0;
    flex: 1 1 auto;
}

.task-confidence {
    flex: 0 0 auto;
    margin-left: 8px;
    font-size: 11px;
    font-weight: 400;
    color: #5b6b7f;
}

.task-confidence.is-high { color: #6B8F71; }
.task-confidence.is-mid { color: #A67C52; }
.task-confidence.is-low { color: #B57A72; }

.task-ai-hint {
    font-size: 12px;
    font-weight: 400;
    color: var(--pm-text-muted, #9ca3af);
    margin-bottom: 4px;
}

.task-ai-hint.is-empty {
    color: #A67C52;
}

.task-binary-checks,
.task-reject-reason,
.task-capability-actions {
    padding: 0 16px 12px;
}

.task-capability-actions {
    display: grid;
    gap: 8px;
}

.task-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 6px;
    background: #eef3f8;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
}

.task-check-row input {
    width: 20px;
    height: 20px;
}

.task-sla-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #eef3f8;
    border: 1px solid rgba(15, 23, 42, 0.12);
    color: #4C6C8B;
    font-size: 13px;
    font-weight: 400;
}

.task-sla-banner.is-soon,
.task-sla-banner.is-expired {
    background: #F6F0E8;
    border-color: #E4D5C5;
    color: #A67C52;
}

.task-sla-banner.is-expired {
    background: #F3EBE3;
    color: #9A704C;
}

.task-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    background: var(--pm-bg-tertiary);
    border: 1px solid var(--pm-border);
    border-radius: 10px;
    color: var(--pm-text);
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.task-input:focus {
    border-color: var(--pm-accent);
}

select.task-input.hitl-doctype-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23587899' d='M1.2 1.2L6 6l4.8-4.8'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 8px;
}

textarea.task-input {
    resize: vertical;
    min-height: 44px;
}

.task-comment-box {
    padding: 0 16px 12px;
}

.task-comment-label {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #0f172a;
    margin-bottom: 6px;
}

.task-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 16px 8px;
    position: static;
    z-index: auto;
    background: transparent;
    border-top: 1px solid rgba(15, 23, 42, 0.12);
}

.task-actions-row {
    display: flex;
    gap: 8px;
}

.task-actions > .task-btn {
    flex: 0 0 auto;
    width: 100%;
}

.task-actions-row .task-btn {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
}

.task-btn {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s, opacity 0.15s, background 0.15s;
}

.task-btn:active {
    transform: scale(0.97);
}

.task-btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.task-btn-approve {
    background: #587899;
    color: #fff;
}

.task-btn-approve:hover {
    background: #4C6C8B;
}

.task-btn-approve:active {
    background: #405F7D;
}

.task-btn-reject,
.task-btn-escalate,
.task-btn-postpone,
.task-btn-outline,
.task-btn-locked {
    background: transparent;
    border-color: #e2e8f0;
    color: #4C6C8B;
}

.task-btn-reject {
    color: #B57A72;
    border-color: #E4D5C5;
}

.task-btn-locked {
    color: #5b6b7f;
}

/* Mobile Inbox */
.mobile-inbox-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 24px;
}

.mobile-inbox-filters {
    display: flex;
    gap: 8px;
    width: 100%;
    overflow: hidden;
    margin-bottom: 18px;
    padding-bottom: 2px;
}

.mobile-inbox-filter {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--pm-border, #e5e7eb);
    border-radius: 999px;
    background: var(--pm-bg-secondary, #fff);
    color: var(--pm-text-secondary, #4b5563);
    min-height: 38px;
    padding: 0 13px;
    font-size: 13px;
    font-weight: 500;
}

.mobile-inbox-filter span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-inbox-filter-count {
    flex: 0 0 auto;
    min-width: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--pm-bg-tertiary, #f3f4f6);
    color: var(--pm-text-muted, #6b7280);
    font-size: 11px;
    font-weight: 500;
}

.mobile-inbox-filter.active {
    border-color: #587899;
    color: #587899;
    background: #eef3f8;
}

.mobile-inbox-list,
.mobile-inbox-preview-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-inbox-row {
    position: relative;
    border: 1px solid var(--pm-border, #e5e7eb);
    border-radius: 18px;
    background: var(--pm-bg-secondary, #fff);
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
}

.mobile-inbox-row.message::before {
    content: attr(data-swipe-label);
    position: absolute;
    inset: 0;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 22px;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 140ms ease;
}

.mobile-inbox-row.message.is-swiping-delete::before,
.mobile-inbox-row.message.is-delete-ready::before {
    opacity: 1;
}

.mobile-inbox-row.message.is-deleting {
    opacity: 0.55;
    pointer-events: none;
}

.mobile-inbox-row.message.is-delete-committed {
    border-color: rgba(239, 68, 68, 0.55);
    transition: height 180ms ease, margin 180ms ease, opacity 140ms ease, border-color 140ms ease;
}

.mobile-inbox-row.message.is-delete-committed::before {
    opacity: 1;
}

.mobile-inbox-row.is-unread {
    border-color: #D4DDD6;
}

.mobile-inbox-row.is-overdue {
    border-color: #E4D5C5;
}

.mobile-inbox-row.is-target-unavailable {
    border-color: rgba(251, 191, 36, 0.32);
}

.mobile-inbox-row.is-opening {
    border-color: rgba(125, 155, 181, 0.44);
    box-shadow: 0 10px 28px rgba(88, 120, 153, 0.14);
}

.mobile-inbox-row.is-opening .mobile-inbox-row-main {
    cursor: wait;
    opacity: 0.78;
}

.mobile-inbox-row.is-opening .mobile-inbox-row-icon {
    background: rgba(59, 130, 246, 0.16);
    color: #7d9bb5;
}

.mobile-inbox-row-slide {
    position: relative;
    z-index: 1;
    background: var(--pm-bg-secondary, #fff);
    transition: transform 160ms ease;
    will-change: transform;
    touch-action: pan-y;
}

.mobile-inbox-row-body {
    display: block;
    width: 100%;
    padding: 12px;
}

.mobile-inbox-row-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.mobile-inbox-row-badges {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.mobile-inbox-row-when {
    flex: 0 0 auto;
    margin-left: auto;
    padding-top: 2px;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--pm-text-muted, #9ca3af);
    white-space: nowrap;
}

.mobile-inbox-row-main {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 0;
    touch-action: pan-y;
}

.mobile-inbox-row-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: var(--pm-bg-tertiary, #f3f4f6);
    color: var(--pm-accent, #587899);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.mobile-inbox-row-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.mobile-inbox-row-title {
    display: block;
    width: 100%;
    font-size: 14px;
    font-weight: 500;
    color: var(--pm-text-primary, #111827);
}

.mobile-inbox-row-message {
    display: -webkit-box;
    width: 100%;
    font-size: 13px;
    line-height: 1.35;
    color: var(--pm-text-secondary, #6b7280);
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mobile-inbox-row.is-expanded .mobile-inbox-row-message {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
}

.mobile-inbox-row-meta {
    font-size: 11px;
    color: var(--pm-text-muted, #9ca3af);
}

.mobile-inbox-row-foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-top: 2px;
    min-width: 0;
}

.mobile-inbox-due {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--pm-text-muted, #9ca3af);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-inbox-due.is-overdue {
    color: #A67C52;
}

.mobile-inbox-sender {
    display: block;
    flex: 0 1 auto;
    align-self: flex-end;
    max-width: 100%;
    margin-top: 0;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--pm-text-muted, #9ca3af);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.2;
    text-align: right;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-inbox-row-foot .mobile-inbox-due + .mobile-inbox-sender {
    max-width: 56%;
}

.mobile-inbox-opening {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-top: 2px;
    color: #7d9bb5;
    font-size: 12px;
    font-weight: 500;
}

.mobile-inbox-expand-hint {
    display: none;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-top: 2px;
    color: var(--pm-accent, #587899);
    font-size: 12px;
    font-weight: 500;
}

.mobile-inbox-row.has-expandable-message .mobile-inbox-expand-hint,
.mobile-inbox-row.is-expanded .mobile-inbox-expand-hint {
    display: inline-flex;
}

.mobile-inbox-expand-hint i {
    font-size: 10px;
}

.mobile-inbox-unread,
.mobile-inbox-overdue,
.mobile-inbox-priority,
.mobile-inbox-device,
.mobile-inbox-target-badge {
    display: inline-flex;
    align-items: center;
    width: auto;
    max-width: 100%;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    line-height: 1.15;
    font-weight: 400;
    text-transform: none;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-inbox-unread {
    background: #EEF3EF;
    color: #6B8F71;
    box-shadow: inset 0 0 0 1px #D4DDD6;
}

.mobile-inbox-overdue {
    background: #F6F0E8;
    color: #A67C52;
    box-shadow: inset 0 0 0 1px #E4D5C5;
}

.mobile-inbox-priority {
    background: var(--pm-bg-tertiary, #f3f4f6);
    color: var(--pm-text-muted, #6b7280);
}

.mobile-inbox-device {
    background: rgba(59, 130, 246, 0.10);
    color: #587899;
    text-transform: none;
}

.mobile-inbox-device.mobile-preferred {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.mobile-inbox-priority.priority-high {
    background: #F6F0E8;
    color: #A67C52;
    box-shadow: inset 0 0 0 1px #E4D5C5;
}

.mobile-inbox-priority.priority-urgent,
.mobile-inbox-priority.priority-critical {
    background: #F4EBE9;
    color: #B57A72;
    box-shadow: inset 0 0 0 1px #E4D5C5;
}

.mobile-inbox-target-badge {
    background: var(--pm-warning-bg, rgba(251, 191, 36, 0.15));
    color: var(--pm-warning, #b45309);
    text-transform: none;
}

.mobile-inbox-target-unavailable {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 12px 12px;
    padding: 10px 12px;
    border: 1px solid rgba(251, 191, 36, 0.24);
    border-radius: 14px;
    background: var(--pm-warning-bg, rgba(251, 191, 36, 0.12));
    color: var(--pm-text-secondary, #6b7280);
}

.mobile-inbox-target-unavailable i {
    color: var(--pm-warning, #f59e0b);
    margin-top: 2px;
}

.mobile-inbox-target-unavailable strong,
.mobile-inbox-target-unavailable span {
    display: block;
}

.mobile-inbox-target-unavailable strong {
    color: var(--pm-text-primary, #111827);
    font-size: 13px;
    font-weight: 500;
}

.mobile-inbox-target-unavailable span {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.35;
}

.mobile-inbox-workflow-detail {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 12px 12px;
    padding: 12px 14px;
    border: 1px solid rgba(239, 68, 68, 0.18);
    border-radius: 14px;
    background: rgba(239, 68, 68, 0.08);
    color: var(--pm-text-secondary, #6b7280);
}

.mobile-inbox-workflow-detail i {
    color: #dc2626;
    margin-top: 2px;
}

.mobile-inbox-workflow-detail strong,
.mobile-inbox-workflow-detail span,
.mobile-inbox-workflow-detail p {
    display: block;
}

.mobile-inbox-workflow-detail strong {
    color: var(--pm-text-primary, #111827);
    font-size: 13px;
    font-weight: 500;
}

.mobile-inbox-workflow-detail span {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.35;
}

.mobile-inbox-workflow-detail p {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.mobile-inbox-row-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 2px 0 0;
}

.mobile-inbox-row-actions button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid var(--pm-border, #e5e7eb);
    border-radius: 12px;
    background: var(--pm-bg-tertiary, #f1f3f5);
    color: var(--pm-text-secondary, #4b5563);
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-inbox-row-actions [data-inbox-delete].is-confirm {
    border-color: var(--pm-danger, #ef4444);
    color: var(--pm-danger, #ef4444);
    background: var(--pm-danger-bg, rgba(239, 68, 68, 0.1));
}

.mobile-inbox-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000175;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(15, 23, 42, 0.48);
    touch-action: none;
}

.mobile-inbox-confirm-card {
    width: min(100%, 22rem);
    background: var(--pm-bg-secondary, #fff);
    border: 1px solid var(--pm-border, #e5e7eb);
    border-radius: 16px;
    padding: 20px 18px 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.mobile-inbox-confirm-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 500;
    color: var(--pm-text-primary, #111827);
}

.mobile-inbox-confirm-card p {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 400;
    color: var(--pm-text-secondary, #4b5563);
}

.mobile-inbox-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.mobile-inbox-confirm-actions .btn-primary,
.mobile-inbox-confirm-actions .btn-secondary-outline {
    min-height: 44px;
    font-weight: 500;
}

.mobile-inbox-row.message.is-swipe-hint {
    pointer-events: none;
}

.mobile-inbox-row.message.is-swipe-hint .mobile-inbox-row-slide {
    transition: transform 320ms ease;
}

.mobile-inbox-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .mobile-inbox-row.message.is-swipe-hint .mobile-inbox-row-slide {
        transition: none !important;
        transform: none !important;
    }
}

.mobile-inbox-state,
.mobile-inbox-preview-zero {
    min-height: 220px;
    border: 1px dashed var(--pm-border, #d1d5db);
    border-radius: 20px;
    background: var(--pm-bg-secondary, #fff);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    padding: 28px 18px;
    color: var(--pm-text-secondary, #6b7280);
}

.mobile-inbox-state i,
.mobile-inbox-preview-zero i {
    font-size: 34px;
    color: var(--pm-primary, #4f46e5);
}

.mobile-inbox-state h3,
.mobile-inbox-preview-zero strong {
    margin: 0;
    font-size: 17px;
    color: var(--pm-text-primary, #111827);
}

.mobile-inbox-state p,
.mobile-inbox-preview-zero span {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
}

.mobile-inbox-game-link {
    border: 1px solid rgba(79, 70, 229, 0.24);
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.08);
    color: var(--pm-primary, #4f46e5);
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 750;
}

.mobile-inbox-preview-row {
    border: 1px solid var(--pm-border, #e5e7eb);
    border-radius: 14px;
    background: var(--pm-bg-secondary, #fff);
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    text-align: left;
}

.mobile-inbox-preview-row span:first-child {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: var(--pm-bg-tertiary, #f3f4f6);
    color: var(--pm-primary, #4f46e5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-inbox-preview-row strong {
    font-size: 13px;
    color: var(--pm-text-primary, #111827);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-inbox-preview-row small {
    font-size: 11px;
    color: var(--pm-text-muted, #6b7280);
    white-space: nowrap;
}

/* Dokument-Aufgaben: Dokument bleibt im Vordergrund, Aktionen liegen als mobile Overlays darüber. */
.preview-modal.mobile-document-task-preview .preview-content {
    padding-top: 74px;
    padding-bottom: calc(92px + var(--pm-safe-bottom, 0px));
}

.preview-modal.mobile-document-task-preview .bottom-sheet {
    display: none;
}

.mobile-document-task-hud {
    position: absolute;
    top: calc(58px + var(--pm-safe-top, 0px));
    left: 10px;
    right: 10px;
    z-index: 35;
    display: grid;
    grid-template-columns: 1fr 44px;
    gap: 10px;
    align-items: center;
    padding: 10px 10px 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    background: rgba(17, 24, 39, 0.86);
    backdrop-filter: blur(14px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.mobile-document-task-hud-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mobile-document-task-hud-main span,
.mobile-document-task-hud-main small {
    color: rgba(226, 232, 240, 0.72);
    font-size: 11px;
    line-height: 1.2;
}

.mobile-document-task-hud-main strong {
    overflow: hidden;
    color: #fff;
    font-size: 14px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-document-task-hud button,
.mobile-document-task-action-bar button,
.mobile-document-task-sheet button {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.mobile-document-task-hud button {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.mobile-document-task-action-bar {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: calc(12px + var(--pm-safe-bottom, 0px));
    z-index: 36;
    display: flex;
    gap: 8px;
    align-items: stretch;
    overflow: hidden;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.30);
    border-radius: 18px;
    background: rgba(17, 24, 39, 0.90);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.preview-modal.mobile-document-task-preview.is-document-task-details-open .mobile-document-task-action-bar {
    display: none;
}

.mobile-document-task-action-bar button,
.mobile-document-task-sheet-actions button {
    flex: 1 1 auto;
    min-height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 13px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.mobile-document-task-action-bar .mobile-document-task-primary,
.mobile-document-task-action-bar .mobile-document-task-danger,
.mobile-document-task-sheet-actions .mobile-document-task-primary,
.mobile-document-task-sheet-actions .mobile-document-task-danger {
    flex: 1 1 0;
}

.mobile-document-task-action-bar .mobile-document-task-secondary.is-danger,
.mobile-document-task-sheet-actions .mobile-document-task-secondary.is-danger {
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
}

.mobile-document-task-secondary {
    background: rgba(255, 255, 255, 0.12);
}

.mobile-document-task-primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.28);
}

.mobile-document-task-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.28);
}

/* Modal-Shell: über Preview (1e6) und Bottom-Nav (99999) */
body.po-mobile-modal-open {
    overflow: hidden;
}

body.po-mobile-modal-open #bottom_nav,
body.po-mobile-modal-open .bottom-nav,
body.po-chat-attach-sheet-open #bottom_nav,
body.po-chat-attach-sheet-open .bottom-nav,
body.po-scanner-sheet-open #bottom_nav,
body.po-scanner-sheet-open .bottom-nav,
body.po-scanner-sign-open #bottom_nav,
body.po-scanner-sign-open .bottom-nav {
    visibility: hidden;
    pointer-events: none;
}

/* Capture-Attach-Sheet (Start/Dokumente) — gleiche Klassen wie Chat-Sheet */
.chat-attach-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 100050;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    transition: opacity 0.18s ease;
    padding: 0;
}

.chat-attach-sheet-overlay.visible {
    opacity: 1;
}

.chat-attach-sheet {
    width: 100%;
    max-width: 560px;
    background: var(--pm-bg-secondary, #fff);
    border-radius: 22px 22px 0 0;
    padding: 0 16px calc(14px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
    transform: translateY(18px);
    transition: transform 0.2s ease, max-height 0.22s ease;
    max-height: min(52dvh, 420px);
    overflow: auto;
    overscroll-behavior: contain;
}

.chat-attach-sheet-overlay.visible .chat-attach-sheet {
    transform: translateY(0);
}

.chat-attach-sheet-overlay.is-expanded .chat-attach-sheet {
    max-height: min(78dvh, 640px);
}

.chat-attach-sheet-handle-wrap {
    display: flex;
    justify-content: center;
    padding: 10px 0 4px;
    cursor: grab;
    touch-action: none;
}

.chat-attach-sheet-handle {
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.18);
}

.chat-attach-sheet-header {
    display: block;
    padding: 4px 8px 14px;
}

.chat-attach-sheet-header h3 {
    margin: 0;
    text-align: center;
    font-size: 16px;
    font-weight: 650;
    color: var(--pm-text-primary);
}

.chat-attach-sheet-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-bottom: 8px;
}

.chat-attach-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 10px 14px;
    border: 1px solid var(--pm-border, rgba(15, 23, 42, 0.1));
    border-radius: 18px;
    background: var(--pm-bg-primary, #f8f9fa);
    color: var(--pm-text-primary);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    -webkit-tap-highlight-color: transparent;
}

.chat-attach-card:active {
    transform: scale(0.97);
    background: var(--pm-bg-hover, #eef2f7);
}

.chat-attach-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ececec;
    color: #1f2937;
    font-size: 18px;
}

.chat-attach-card-label {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

.chat-attach-sheet-more {
    margin-top: 10px;
    border-top: 1px solid var(--pm-border, rgba(15, 23, 42, 0.08));
    padding-top: 8px;
}

.chat-attach-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    border: none;
    background: transparent;
    color: var(--pm-text-primary);
    text-align: left;
    cursor: pointer;
}

.chat-attach-row:active {
    opacity: 0.75;
}

.chat-attach-row-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ececec;
    color: #1f2937;
    flex-shrink: 0;
}

.chat-attach-row-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-attach-row-title {
    font-size: 15px;
    font-weight: 600;
}

.chat-attach-row-sub {
    font-size: 12px;
    color: var(--pm-text-muted);
}

.chat-attach-row-chevron {
    color: var(--pm-text-muted);
    font-size: 12px;
}

.mobile-task-decision-prompt {
    position: fixed;
    inset: 0;
    z-index: 10000100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, var(--pm-safe-top, 0px)) 16px calc(16px + var(--pm-safe-bottom, 0px));
    background: rgba(15, 23, 42, 0.58);
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

.mobile-task-decision-prompt.is-keyboard-open {
    align-items: flex-end;
    padding-bottom: calc(12px + var(--mobile-keyboard-inset, 0px) + var(--pm-safe-bottom, 0px));
}

.mobile-task-decision-prompt-card {
    width: min(100%, 520px);
    max-height: min(86dvh, calc(100dvh - var(--pm-safe-top, 0px) - var(--pm-safe-bottom, 0px) - 32px));
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 24px;
    background: var(--pm-bg-secondary, #fff);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
    padding: 20px 18px 18px;
    margin-bottom: var(--mobile-keyboard-inset, 0px);
    transition: margin-bottom 0.2s ease;
}

.mobile-task-decision-prompt-head {
    display: grid;
    gap: 5px;
    margin-bottom: 14px;
}

.mobile-task-decision-prompt-head strong {
    color: var(--pm-text-primary, #0f172a);
    font-size: 17px;
}

.mobile-task-decision-prompt-head span {
    color: var(--pm-text-muted, #64748b);
    font-size: 13px;
    line-height: 1.45;
}

.mobile-task-decision-prompt-textarea {
    width: 100%;
    min-height: 124px;
    box-sizing: border-box;
    border: 1px solid var(--pm-border, rgba(148, 163, 184, 0.42));
    border-radius: 16px;
    padding: 12px 14px;
    font: inherit;
    color: var(--pm-text-primary, #0f172a);
    background: var(--pm-input-bg, #fff);
    resize: vertical;
}

.mobile-task-decision-prompt-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.mobile-task-decision-prompt-actions button {
    min-height: 46px;
    border: 0;
    border-radius: 15px;
    font: inherit;
    font-weight: 800;
}

.mobile-task-decision-prompt-cancel {
    background: #f1f5f9;
    color: #475569;
}

.mobile-task-decision-prompt-submit {
    background: linear-gradient(135deg, #587899, #405F7D);
    color: #fff;
}

.mobile-task-lock-card h3 {
    margin: 12px 0 0;
    color: var(--pm-text-primary);
}

.mobile-task-lock-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0 auto;
    background: linear-gradient(135deg, #587899, #405F7D);
    color: #fff;
    font-weight: 900;
    font-size: 22px;
    box-shadow: 0 16px 34px rgba(88, 120, 153, 0.28);
}

.mobile-task-lock-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-task-takeover-countdown {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px auto 4px;
    background: #eef3f8;
    color: #405F7D;
    font-size: 28px;
    font-weight: 900;
}

.mobile-document-task-annotation-bar {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(86px + var(--pm-safe-bottom, 0px));
    z-index: 37;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid rgba(125, 155, 181, 0.36);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.90);
    color: #dbeafe;
    font-size: 12px;
    font-weight: 750;
    backdrop-filter: blur(14px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.30);
}

.preview-modal.mobile-document-task-preview.is-mobile-annotating .mobile-document-task-annotation-bar {
    display: flex;
}

.mobile-document-task-annotation-bar span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-document-task-annotation-bar em {
    color: #93c5fd;
    font-style: normal;
}

.mobile-document-task-annotation-bar button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 11px;
    background: rgba(125, 155, 181, 0.20);
    color: #bfdbfe;
    font: inherit;
    font-weight: 850;
}

.mobile-document-task-action-bar button:disabled,
.mobile-document-task-sheet-actions button:disabled,
.mobile-conversation-actions button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.mobile-document-task-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 44;
    max-height: min(78vh, 620px);
    overflow-y: auto;
    padding: 10px 16px calc(18px + var(--pm-safe-bottom, 0px));
    border-radius: 24px 24px 0 0;
    background: var(--pm-bg-secondary, #111827);
    box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.45);
    transform: translateY(110%);
    transition: transform var(--pm-transition-normal, 250ms ease);
}

.mobile-document-task-sheet.is-open {
    transform: translateY(0);
}

.mobile-document-task-sheet-handle {
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: var(--pm-border, #374151);
    margin: 0 auto 12px;
}

.mobile-document-task-sheet-head {
    display: block;
    margin-bottom: 12px;
}

.mobile-document-task-sheet-head span,
.mobile-document-task-comment-label,
.mobile-document-task-meta-grid span {
    color: var(--pm-text-muted, #9ca3af);
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mobile-document-task-sheet-head strong {
    display: block;
    margin-top: 3px;
    color: var(--pm-text-primary, #f9fafb);
    font-size: 18px;
    line-height: 1.2;
}

.mobile-document-task-description {
    margin-bottom: 14px;
    color: var(--pm-text-secondary, #d1d5db);
    font-size: 13px;
    line-height: 1.45;
}

.desktop-connections-view.headerless {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 560px;
    margin: 0 auto;
    padding: 4px 0 8px;
}

.desktop-mode-tabs {
    position: sticky;
    top: 0;
    z-index: 2;
}

.desktop-mode-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.desktop-mode-copy {
    display: grid;
    gap: 10px;
}

.desktop-mode-intro {
    display: grid;
    gap: 6px;
}

.desktop-mode-intro-desc {
    margin: 0;
    color: var(--pm-text-secondary, #d1d5db);
    font-size: 13px;
    line-height: 1.45;
}

.desktop-connection-empty.is-batch-ready {
    border-color: rgba(34, 197, 94, 0.28);
    background: rgba(34, 197, 94, 0.06);
}

.desktop-connection-empty.is-live-empty {
    border-color: rgba(125, 155, 181, 0.28);
}

.desktop-connections-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 2px 2px;
}

.desktop-connections-hero-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(88, 120, 153, 0.14);
    color: var(--pm-accent, #587899);
    font-size: 20px;
}

.desktop-connections-kicker {
    margin: 4px 0 0;
    color: var(--pm-text-muted, #9ca3af);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.desktop-connections-hero-title {
    margin: 0;
    color: var(--pm-text-primary, #f9fafb);
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.2;
}

.desktop-connections-hero-desc {
    margin: 0;
    color: var(--pm-text-secondary, #d1d5db);
    font-size: 14px;
    line-height: 1.45;
}

.desktop-connections-section-title {
    margin: 0;
    color: var(--pm-text-primary, #f9fafb);
    font-size: 15px;
    font-weight: 800;
}

.desktop-connections-how,
.desktop-connections-status {
    display: grid;
    gap: 10px;
}

.desktop-connections-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.desktop-connections-step {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--pm-border);
    border-radius: 16px;
    background: var(--pm-bg-tertiary);
}

.desktop-connections-step-num {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(88, 120, 153, 0.16);
    color: var(--pm-accent, #587899);
    font-size: 13px;
    font-weight: 800;
}

.desktop-connections-step-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.desktop-connections-step-copy strong {
    color: var(--pm-text-primary);
    font-size: 14px;
    line-height: 1.3;
}

.desktop-connections-step-copy small {
    color: var(--pm-text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.desktop-connections-status-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.desktop-connections-refresh {
    width: 36px;
    height: 36px;
    padding: 0;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.desktop-connections-loading {
    margin: 0;
    padding: 16px 0;
    text-align: center;
    color: var(--pm-text-muted);
    font-size: 13px;
}

.desktop-connections-list {
    display: grid;
    gap: 10px;
    margin-top: 0;
}

.desktop-connection-card.is-connected {
    border-color: rgba(34, 197, 94, 0.35);
}

.desktop-connection-card.is-waiting {
    border-color: rgba(125, 155, 181, 0.35);
}

.desktop-connection-card.is-connected .desktop-connection-state {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
}

.desktop-connection-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--pm-border);
    border-radius: 18px;
    background: var(--pm-bg-tertiary);
}

.desktop-connection-main {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
    align-items: center;
}

.desktop-connection-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(88, 120, 153, 0.16);
    color: var(--pm-accent);
}

.desktop-connection-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.desktop-connection-copy strong,
.desktop-connection-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.desktop-connection-copy strong {
    color: var(--pm-text-primary);
    font-size: 15px;
}

.desktop-connection-copy small {
    color: var(--pm-text-muted);
    font-size: 12px;
}

.desktop-connection-state {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.desktop-connection-card.is-waiting .desktop-connection-state {
    background: rgba(125, 155, 181, 0.16);
    color: #bfdbfe;
}

.desktop-connection-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.desktop-connection-actions button {
    flex: 1 1 130px;
}

.desktop-connection-hint,
.desktop-connection-empty {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid rgba(125, 155, 181, 0.20);
    border-radius: 16px;
    background: rgba(125, 155, 181, 0.08);
    color: var(--pm-text-secondary);
    font-size: 13px;
    line-height: 1.35;
}

.desktop-connection-empty {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mobile-document-task-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.mobile-document-task-meta-grid div {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--pm-border, #374151);
    border-radius: 14px;
    background: var(--pm-bg-tertiary, #1f2937);
}

.mobile-document-task-meta-grid strong {
    display: block;
    overflow: hidden;
    margin-top: 3px;
    color: var(--pm-text-primary, #f9fafb);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-document-task-comment {
    width: 100%;
    min-height: 82px;
    margin: 6px 0 14px;
    padding: 11px 12px;
    border: 1px solid var(--pm-border, #374151);
    border-radius: 14px;
    background: var(--pm-bg-input, #111827);
    color: var(--pm-text-primary, #f9fafb);
    resize: vertical;
}

.mobile-document-task-sheet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mobile-conversation-panel {
    margin: 0 0 16px;
    display: grid;
    gap: 12px;
}

.mobile-conversation-history-card,
.mobile-conversation-composer-card {
    padding: 12px;
    border: 1px solid var(--pm-border, #374151);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.48);
}

.mobile-conversation-history-card {
    background: rgba(15, 23, 42, 0.34);
}

.mobile-conversation-composer-card {
    background: rgba(17, 24, 39, 0.72);
}

.mobile-conversation-annotation-tools {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.mobile-conversation-head,
.mobile-conversation-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.mobile-conversation-head > div,
.mobile-conversation-section-head > div {
    min-width: 0;
}

.mobile-conversation-head span,
.mobile-conversation-section-head span {
    color: var(--pm-text-muted, #9ca3af);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mobile-conversation-head strong,
.mobile-conversation-section-head strong {
    display: block;
    margin-top: 2px;
    color: var(--pm-text-primary, #f9fafb);
    font-size: 15px;
}

.mobile-conversation-refresh {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--pm-bg-tertiary, #1f2937);
    color: var(--pm-text-secondary, #d1d5db);
}

.mobile-annotation-toolbar,
.mobile-annotation-colors,
.mobile-conversation-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    margin-bottom: 10px;
}

.mobile-annotation-tool {
    min-width: 40px;
    height: 40px;
    border: 1px solid var(--pm-border, #374151);
    border-radius: 11px;
    background: var(--pm-bg-tertiary, #1f2937);
    color: var(--pm-text-primary, #f9fafb);
    font-size: 16px;
    font-weight: 850;
}

.mobile-conversation-actions button {
    min-height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.mobile-conversation-actions [data-mobile-conversation-send] {
    flex: 1 1 100%;
}

.mobile-annotation-reset-row {
    display: flex;
    margin: -2px 0 10px;
}

.mobile-annotation-clear {
    min-height: 34px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.09);
    color: var(--pm-text-secondary, #d1d5db);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.mobile-conversation-send {
    border: 1px solid rgba(125, 155, 181, 0.38);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(88, 120, 153, 0.22));
    color: #dbeafe;
    box-shadow: 0 10px 22px rgba(88, 120, 153, 0.16);
}

.mobile-annotation-tool.active {
    border-color: rgba(125, 155, 181, 0.72);
    background: rgba(88, 120, 153, 0.22);
    color: #bfdbfe;
}

.mobile-annotation-color {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.6);
}

.mobile-annotation-color.active {
    box-shadow: 0 0 0 3px rgba(125, 155, 181, 0.45);
}

.mobile-annotation-draft-count {
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(125, 155, 181, 0.14);
    color: #bfdbfe;
    font-size: 11px;
    font-weight: 750;
}

.mobile-conversation-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 8px 0 12px;
}

.mobile-conversation-state {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 14px;
    background: var(--pm-bg-tertiary, #1f2937);
    color: var(--pm-text-secondary, #d1d5db);
    font-size: 13px;
}

.mobile-conversation-message {
    position: relative;
    padding: 10px 11px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-left: 4px solid var(--conversation-author-accent, #7d9bb5);
    border-radius: 15px;
    background: linear-gradient(135deg, var(--conversation-author-bg, rgba(255, 255, 255, 0.055)), rgba(255, 255, 255, 0.045));
}

.mobile-conversation-message.has-annotations {
    cursor: pointer;
}

.mobile-conversation-message.has-annotations:focus-visible {
    outline: 2px solid rgba(125, 155, 181, 0.72);
    outline-offset: 2px;
}

.mobile-conversation-message-head {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.mobile-conversation-author-badge {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--conversation-author-accent, #7d9bb5);
    color: #0f172a;
    font-size: 11px;
    font-weight: 900;
}

.mobile-conversation-message-head strong {
    overflow: hidden;
    color: var(--pm-text-primary, #f9fafb);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-conversation-message-head time,
.mobile-conversation-message-annotation {
    color: var(--pm-text-muted, #9ca3af);
    font-size: 11px;
    white-space: nowrap;
}

.mobile-conversation-message-body {
    color: var(--pm-text-secondary, #d1d5db);
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.mobile-conversation-input {
    width: 100%;
    min-height: 86px;
    margin: 6px 0 10px;
    padding: 11px 12px;
    border: 1px solid var(--pm-border, #374151);
    border-radius: 14px;
    background: var(--pm-bg-input, #111827);
    color: var(--pm-text-primary, #f9fafb);
    resize: vertical;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TABLET-OPTIMIERUNG
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (min-width: 768px) {
    html.po-device-tablet {
        --pm-header-height: 64px;
        --pm-bottom-nav-height: 60px;
    }

    html.po-device-tablet .main-content {
        width: min(100%, 1120px);
        margin: 0 auto;
        padding: 22px 28px;
        padding-bottom: calc(var(--pm-bottom-nav-height) + 24px + var(--pm-safe-bottom));
    }

    /* Documents: auch auf Tablet keine doppelte Shell-Inset — Chrome hat eigenes Padding */
    html.po-device-tablet .main-content.browser-view-active {
        padding-left: 0;
        padding-right: 0;
        padding-top: 0;
    }

    html.po-device-tablet .browser-header,
    html.po-device-tablet .browser-controls {
        padding-left: 20px;
        padding-right: 20px;
    }

    html.po-device-tablet .documents-grid.grid-view,
    html.po-device-tablet .search-results-list.documents-grid.grid-view {
        padding-left: 20px;
        padding-right: 20px;
    }

    html.po-device-tablet .list-view .document-item {
        padding-left: 20px;
        padding-right: 20px;
    }

    html.po-device-tablet .app-header,
    html.po-device-tablet .browser-page-chrome {
        padding-left: max(24px, var(--pm-safe-left));
        padding-right: max(24px, var(--pm-safe-right));
    }

    html.po-device-tablet .header-title {
        font-size: 18px;
    }

    html.po-device-tablet .bottom-nav {
        left: 50%;
        width: min(100%, 760px);
        transform: translateX(-50%);
        border: 1px solid var(--pm-border);
        border-bottom: 0;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.24);
    }

    html.po-device-tablet .dashboard-inbox-entry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html.po-device-tablet .card-grid,
    html.po-device-tablet .quick-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html.po-device-tablet .documents-grid.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(150px, 180px));
        justify-content: center;
        align-items: stretch;
        gap: 16px;
    }

    html.po-device-tablet .grid-view .document-item {
        width: 100%;
        height: 100%;
        max-width: 180px;
        justify-self: center;
    }

    html.po-device-tablet .grid-view .doc-thumb {
        aspect-ratio: 3 / 4;
        padding: 8px;
    }

    html.po-device-tablet .pwa-install-content,
    html.po-device-tablet .pairing-content {
        max-width: 560px;
    }

    html.po-device-tablet #device_registration_modal > div {
        max-width: 440px !important;
    }
}

@media (min-width: 1000px) and (orientation: landscape) {
    html.po-device-tablet .main-content {
        width: min(100%, 1280px);
        padding-left: 36px;
        padding-right: 36px;
    }

    html.po-device-tablet .main-content.browser-view-active {
        padding-left: 0;
        padding-right: 0;
    }

    html.po-device-tablet .dashboard-segment-panel.active {
        gap: 18px;
    }
}

/* ── Audit-Quarantäne Preview / Sheet ─────────────────────────── */
.preview-quarantine-card {
    padding: 24px 20px 28px;
    gap: 12px;
    justify-content: flex-start;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.preview-quarantine-thumb {
    position: relative;
    width: min(180px, 46vw);
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    overflow: hidden;
    background: var(--pm-bg-secondary);
    border: 1px solid var(--pm-border);
    margin-bottom: 4px;
}
.preview-quarantine-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.7) brightness(0.92);
}
.preview-quarantine-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.42);
    color: #fecaca;
    font-size: 34px;
}
.preview-quarantine-title {
    margin: 0;
    color: #991b1b;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.3;
}
.preview-quarantine-body {
    margin: 0;
    max-width: 26rem;
    font-size: 13px;
    line-height: 1.45;
    color: var(--pm-text-muted);
    font-weight: 400;
}
.preview-quarantine-card .btn-primary,
.preview-quarantine-card .btn-secondary-outline {
    margin-top: 12px;
    min-height: 44px;
    min-width: min(280px, 78vw);
    padding: 0 16px;
    border-radius: 10px;
    font-weight: 500;
}

.sheet-quarantine-banner {
    display: none;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 14px;
    padding: 12px 12px;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.sheet-quarantine-banner > i {
    margin-top: 2px;
    font-size: 16px;
    color: #dc2626;
}
.sheet-quarantine-copy {
    min-width: 0;
    flex: 1 1 auto;
}
.sheet-quarantine-copy strong {
    display: block;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 4px;
}
.sheet-quarantine-copy p {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: #7f1d1d;
    font-weight: 400;
}
.sheet-quarantine-policy {
    margin-top: 8px !important;
    font-weight: 500 !important;
}
.sheet-quarantine-reasons {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(46vh, 420px);
    overflow-y: auto;
}
.sheet-quarantine-actions {
    margin-top: 12px;
}
.sheet-quarantine-release-btn {
    width: 100%;
    min-height: 44px;
    font-weight: 500;
    border-radius: 10px;
}
.sheet-quarantine-release-btn.is-error,
#btn_quarantine_release_ok.is-error {
    background: #b91c1c;
}
.sheet-quarantine-verdict,
.sheet-quarantine-why-heading,
.sheet-quarantine-pending,
.sheet-quarantine-load-failed,
.sheet-quarantine-unavailable,
.sheet-quarantine-more {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 400;
    color: #7f1d1d;
}
.sheet-quarantine-why-heading {
    font-weight: 500;
    margin-top: 4px;
}
.sheet-quarantine-findings,
.sheet-quarantine-controls {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sheet-quarantine-finding,
.sheet-quarantine-control {
    background: #fff;
    border: 1px solid #fecaca;
    border-left: 3px solid #f87171;
    border-radius: 8px;
    padding: 10px;
    font-weight: 400;
}
.sheet-quarantine-finding.is-mid {
    border-left-color: #b91c1c;
}
.sheet-quarantine-finding.is-lock-trigger {
    border-left-color: #dc2626;
}
.sheet-quarantine-finding-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.sheet-quarantine-finding-cat {
    font-size: 12px;
    font-weight: 500;
    color: #7f1d1d;
}
.sheet-quarantine-finding-score {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 500;
    color: #991b1b;
}
.sheet-quarantine-finding-text,
.sheet-quarantine-finding-rec,
.sheet-quarantine-finding-evidence,
.sheet-quarantine-finding-review,
.sheet-quarantine-control-note {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 400;
    color: #7f1d1d;
}
.sheet-quarantine-finding-rec,
.sheet-quarantine-finding-evidence {
    margin-top: 6px;
    padding: 8px 9px;
    background: #fef2f2;
    border-radius: 6px;
}
.sheet-quarantine-finding-rec-label {
    font-weight: 500;
}
.sheet-quarantine-finding-review {
    margin-top: 6px;
    font-weight: 500;
}
.sheet-quarantine-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sheet-quarantine-control-label {
    font-size: 12px;
    font-weight: 500;
    color: #7f1d1d;
}
.idp-props-section[data-props-section="audit"] .idp-props-section-title {
    font-weight: 500;
}
.sheet-quarantine-props .sheet-quarantine-finding,
.sheet-quarantine-props .sheet-quarantine-control {
    background: #fff;
}

.sheet-peek-action.is-quarantine-blocked,
.context-action.is-quarantine-blocked {
    opacity: 0.45;
    cursor: not-allowed;
}
.sheet-peek-action.is-quarantine-blocked.primary {
    background: #94a3b8;
}
.info-item-danger .info-value {
    color: #b91c1c;
    font-weight: 500;
}

/* Einmalige UI-Helper (Peek/Coach) — Clay-Karte wie Kulanz-Banner, Nudge bleibt Slate */
.po-helper-tip {
    position: fixed;
    z-index: 1000100;
    max-width: min(280px, calc(100vw - 24px));
    padding: 10px 12px;
    background: var(--pm-credit-alarm-surface, #F6F0E8);
    color: #0f172a;
    border: 1px solid var(--pm-credit-alarm-border, #E4D5C5);
    border-left: 3px solid var(--pm-credit-alarm-clay, #A67C52);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    pointer-events: none;
}

.bottom-sheet.is-helper-nudge:not(.expanded):not(.is-dragging) {
    transform: translateY(calc(100% - var(--pm-preview-sheet-peek) - 22px));
}

.bottom-sheet.is-helper-nudge:not(.expanded):not(.is-dragging) .handle-bar {
    background: #587899;
    animation: po-helper-handle-pulse 900ms ease-in-out 2;
}

@keyframes po-helper-handle-pulse {
    0%, 100% { opacity: 1; transform: scaleX(1); }
    50% { opacity: 0.72; transform: scaleX(1.2); }
}

.document-item.is-helper-nudge {
    outline: 2px solid #587899;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .bottom-sheet.is-helper-nudge:not(.expanded):not(.is-dragging) {
        transform: translateY(calc(100% - var(--pm-preview-sheet-peek)));
    }
    .bottom-sheet.is-helper-nudge:not(.expanded):not(.is-dragging) .handle-bar {
        animation: none;
    }
}

.document-cache-policy {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.document-cache-policy-chip {
    min-height: var(--pm-touch-target);
    padding: 10px 12px;
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-md);
    background: #ffffff;
    color: #4C6C8B;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.document-cache-policy-chip.is-selected {
    background: #587899;
    border-color: #587899;
    color: #ffffff;
}

.document-cache-policy-chip:focus-visible {
    outline: 2px solid #587899;
    outline-offset: 2px;
}

.document-cache-budget {
    margin-top: 10px;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    color: #667085;
}

.document-cache-budget-meter {
    height: 8px;
    background: #eef3f8;
    border-radius: 999px;
    overflow: hidden;
}

.document-cache-budget-meter-fill {
    display: block;
    height: 100%;
    width: 0;
    background: #587899;
}

.document-cache-budget.is-off .document-cache-budget-meter-fill {
    background: transparent;
}

.document-cache-budget-label {
    margin: 8px 0 0;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    color: #667085;
}
