:root {
    --primary-green: #004716;
    --text-dark: #252424;
    --text-muted: #666666;
    --bg-white: #ffffff;
    --bg-light: #f4f4f4;
    --border-color: #dddddd;
    --accent-dot: #004716;
    --white: #ffffff;
    --transition: all 0.2s ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
}

.container-full {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--primary-green);
    padding: 1.5rem 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-image {
    height: 50px;
    width: auto;
    display: block;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9rem;
    margin-left: 2rem;
    letter-spacing: 1px;
    transition: var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-green);
}

/* Hero Strip */
.hero-strip {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), #004716;
    color: var(--white);
    padding: 6rem 2rem;
    text-align: left;
}

.hero-content {
    max-width: 1200px;
}

/* Info Link im Footer */
.footer-info-link {
    color: rgba(255,255,255,0.65);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}
.footer-info-link:hover { color: #fff; }

/* Info Modal */
.info-modal {
    width: min(780px, 94vw);
    max-height: 88vh;
}

.info-modal-body {
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.info-section {
    border-bottom: 1px solid var(--border-color);
}
.info-section:last-child { border-bottom: none; }

.info-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    user-select: none;
    transition: background 0.15s;
}
.info-section-header:hover { background: var(--bg-light); }

.info-chevron {
    font-size: 1.1rem;
    transition: transform 0.2s;
    color: var(--text-muted);
}
.info-section-header.open .info-chevron { transform: rotate(180deg); }

.info-section-body {
    display: none;
    padding: 0.25rem 1.25rem 1rem 1.25rem;
    font-size: 0.88rem;
    line-height: 1.7;
    color: #333;
}
.info-section-body.visible { display: block; }

.info-section-body ul { padding-left: 1.2rem; }
.info-section-body li { margin-bottom: 0.3rem; }
.info-section-body p { margin-bottom: 0.25rem; }
.info-section-body code {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.85rem;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}
.info-table th, .info-table td {
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.65rem;
    text-align: left;
}
.info-table th { background: var(--bg-light); font-weight: 600; }

.hero-strip h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.hero-strip p {
    font-weight: 600;
    letter-spacing: 2px;
}

/* AI Training Notice */
.ai-training-notice {
    padding: 0.65rem 1rem;
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: 6px;
    color: #713f12;
    font-size: 0.82rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.ai-notice-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

/* Dashboard Layout */
.dashboard-container {
    max-width: 1200px;
    margin: -4rem auto 4rem;
    padding: 0 2rem;
    position: relative;
    z-index: 10;
}

.dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Cards */
.controls-card,
.content-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 2rem;
}

.controls-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
}

.controls-card-row {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.upload-area {
    flex: 1;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-shrink: 0;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover {
    border-color: var(--primary-green);
    background: rgba(0, 71, 22, 0.02);
}

.upload-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.file-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Buttons */
button {
    font-family: 'Oswald', sans-serif;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    width: auto;
    min-width: 200px;
    text-transform: uppercase;
    transition: var(--transition);
}

.primary-btn {
    background: var(--primary-green);
    color: var(--white);
}

.primary-btn:hover {
    background: #003310;
}

.secondary-btn {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.secondary-btn:hover {
    background: var(--border-color);
}

.secondary-btn:disabled,
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: #e0e0e0;
    color: #999999;
}

.secondary-btn:disabled:hover {
    background: #e0e0e0;
}

/* Tabs */
.tabs-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 1rem;
    font-size: 0.9rem;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: var(--text-dark);
}

.tab-btn.active {
    color: var(--primary-green);
    border-bottom-color: var(--primary-green);
}

.tab-btn:disabled,
.tabs-nav.loading .tab-btn {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

.tabs-nav.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        var(--primary-green) 0%, 
        rgba(0, 71, 22, 0.3) 50%, 
        var(--primary-green) 100%);
    background-size: 200% 100%;
    animation: loading-bar 1.5s ease-in-out infinite;
}

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

.tabs-nav {
    position: relative;
}

/* Chat Bubble Widget */
.chat-bubble-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.chat-bubble-toggle {
    width: 60px;
    height: 60px;
    min-width: 60px;
    max-width: 60px;
    min-height: 60px;
    max-height: 60px;
    border-radius: 50%;
    background: var(--primary-green);
    color: var(--white);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 71, 22, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
}

.chat-bubble-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 71, 22, 0.4);
}

.chat-bubble-toggle .chat-icon {
    display: block;
    line-height: 1;
    width: 1em;
    height: 1em;
}

.chat-bubble-toggle .chat-close-icon {
    display: none;
    font-size: 1.8rem;
    line-height: 1;
    width: 1em;
    height: 1em;
}

.chat-bubble-toggle.active .chat-icon {
    display: none;
}

.chat-bubble-toggle.active .chat-close-icon {
    display: block;
}

.chat-bubble-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 520px;
    height: 600px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.chat-bubble-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chat-header {
    padding: 1rem 1.5rem;
    background: var(--primary-green);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.chat-header h3 {
    font-size: 1rem;
    margin: 0;
}

.chat-header button {
    background: transparent;
    color: var(--white);
    border: none;
    width: auto;
    padding: 5px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.chat-header button:hover {
    transform: rotate(180deg);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #fbfbfb;
}

.message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    border-radius: 8px;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.assistant {
    align-self: flex-start;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-green);
}

.message.user {
    align-self: flex-end;
    background: var(--primary-green);
    color: var(--white);
}

.message.assistant .msg-content p {
    margin: 0 0 0.5rem 0;
}

.message.assistant .msg-content p:last-child {
    margin-bottom: 0;
}

.message.assistant .msg-content ul,
.message.assistant .msg-content ol {
    margin: 0.25rem 0 0.5rem 0;
    padding-left: 1.2rem;
}

.message.assistant .msg-content li {
    margin-bottom: 0.2rem;
}

.message.assistant .msg-content strong {
    color: var(--primary-green);
    font-weight: 600;
}

.message.assistant .msg-content h1,
.message.assistant .msg-content h2,
.message.assistant .msg-content h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0.6rem 0 0.3rem 0;
    color: var(--dark-green);
}

.message.assistant .msg-content h1:first-child,
.message.assistant .msg-content h2:first-child,
.message.assistant .msg-content h3:first-child {
    margin-top: 0;
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--white);
    border-radius: 0 0 12px 12px;
}

#chat-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    box-sizing: border-box;
}

#chat-input:focus {
    outline: none;
    border-color: var(--primary-green);
}

#send-chat-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--primary-green);
    color: var(--white);
    border-radius: 6px;
    transition: background 0.2s ease;
    min-width: auto;
}

#send-chat-btn:hover {
    background: #003310;
}

/* Effizienz-Footer-Bereich */
.footer-efficiency {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 1rem 2rem;
}
.footer-efficiency:empty {
    display: none;
}
.footer-efficiency .efficiency-card {
    display: block;
    margin-top: 0;
}
.footer-efficiency .efficiency-pill {
    font-size: 0.78rem;
    padding: 0.25rem 0.7rem;
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.15);
}
.footer-efficiency .efficiency-pill:hover,
.footer-efficiency .efficiency-card.open .efficiency-pill {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9);
}
.footer-efficiency .efficiency-body {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    margin-top: 0.4rem;
    min-width: 0;
}
.footer-efficiency .efficiency-col h4 { color: rgba(255,255,255,0.85); }
.footer-efficiency .efficiency-stat { font-size: 1.1rem; color: var(--white); }
.footer-efficiency .efficiency-label { color: rgba(255,255,255,0.5); }
.footer-efficiency .efficiency-savings { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.05); }
.footer-efficiency .ki-col { background: rgba(0, 71, 22, 0.3); }
.footer-efficiency .manual-col { background: rgba(245, 127, 23, 0.15); }

/* Hazard-Tags in Schutzmaßnahmen-Tabelle */
.hazard-tag {
    display: inline-block;
    background: #edf7f0;
    color: var(--primary-green);
    border: 1px solid rgba(0,71,22,0.2);
    border-radius: 3px;
    padding: 0.1rem 0.4rem;
    font-size: 0.78rem;
    margin: 0.1rem 0.2rem 0.1rem 0;
}
.hazard-tags-cell {
    line-height: 1.8;
}

/* Footer */
.main-footer {
    background: var(--text-dark);
    color: var(--white);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    margin-left: 1.5rem;
    opacity: 0.7;
    transition: var(--transition);
}

.footer-links a:hover {
    opacity: 1;
}

/* Tables & Lists */
.placeholder-msg {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
}

.hidden {
    display: none;
}

/* Search Bar */
.search-bar {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    font-family: inherit;
}

/* Accordion Styles */
.accordion {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.accordion-header {
    background: #f8f8f8;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.accordion-header:hover {
    background: #f0f0f0;
}

.accordion-content {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--white);
}

.hazard-detail-section {
    margin-bottom: 1.5rem;
}

.hazard-detail-section:last-child {
    margin-bottom: 0;
}

.hazard-detail-section h4 {
    color: var(--primary-green);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.25rem;
}

.hazard-detail-section p,
.hazard-detail-section div {
    font-size: 0.9rem;
    color: var(--text-dark);
}

.hazard-detail-section ul {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.hazard-detail-section li {
    margin-bottom: 0.25rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

table thead {
    background: var(--primary-green);
    color: var(--white);
}

table thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

table tbody tr:hover {
    background: #f8f8f8;
}

table tbody td {
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}

table tbody td strong {
    color: var(--primary-green);
    font-weight: 600;
}

table tbody td code {
    background: #f0f0f0;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

/* Protective Measures Table Styling */
.protective-measures-table thead th {
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.protective-measures-table tbody td {
    vertical-align: middle;
}

.status-indicator {
    flex-shrink: 0;
}

.reference-box {
    background: #f0f0f0;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    display: block;
    font-size: 0.9rem;
    color: var(--text-dark);
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    white-space: normal;
}

/* AMD Table Styling */
.adm-table thead th {
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.adm-table tbody td {
    vertical-align: top;
    padding: 1rem;
}

.adm-table tbody td:first-child {
    font-weight: 600;
}

.adm-table th:last-child,
.adm-table td:last-child {
    width: 130px;
    max-width: 150px;
}

.adm-exams {
    position: relative;
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: help;
    line-height: 1.6;
}

.adm-exams::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 110%;
    left: 0;
    background: rgba(17, 17, 17, 0.95);
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    white-space: pre-line;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 15;
    max-width: 520px;
    min-width: 240px;
    pointer-events: none;
}

.adm-exams:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.adm-hover-tooltip {
    position: fixed;
    background: rgba(17, 17, 17, 0.95);
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    white-space: pre-line;
    z-index: 2000;
    pointer-events: none;
    max-width: 520px;
    min-width: 220px;
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease, transform 0.12s ease;
}

/* Check Items für Vollständigkeit */
.check-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--white);
    border-left: 4px solid var(--border-color);
    border-radius: 4px;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.check-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transform: translateX(2px);
}

.check-item .icon-check,
.check-item .icon-ok,
.check-item .icon-success {
    border-left-color: #004716;
    background: #f0f9f4;
}

.check-item .icon-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.check-item .icon-error {
    border-left-color: #f85149;
    background: #fef2f2;
}

.check-item span {
    margin-right: 0.75rem;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Score Display */
.score-display {
    color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 2rem;
}

.score-display.score-green {
    background: linear-gradient(135deg, var(--primary-green) 0%, #006b2e 100%);
    box-shadow: 0 4px 6px rgba(0, 71, 22, 0.2);
}

.score-display.score-yellow {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 6px rgba(217, 119, 6, 0.2);
}

.score-display.score-red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.2);
}

/* Status Message Styling */
#status-msg {
    margin-top: 0;
    padding: 0;
    border-radius: 8px;
    text-align: center;
    width: 100%;
}

#status-msg.hidden {
    display: none;
}

#status-msg.analysis-mode {
    background: linear-gradient(135deg, rgba(0, 71, 22, 0.1) 0%, rgba(0, 71, 22, 0.05) 100%);
    border: 2px solid var(--primary-green);
    border-radius: 8px;
    padding: 1rem;
}

.analysis-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.analysis-status strong {
    font-size: 1.3rem;
    color: var(--primary-green);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.analysis-status .timer {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-green);
    font-family: 'Courier New', monospace;
    background: rgba(0, 71, 22, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.loading-hint {
    font-size: 0.95rem;
    color: #f59e0b;
    font-style: italic;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.success-message {
    display: block;
    padding: 1rem;
    background: #f0f9f4;
    color: #004716;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 8px;
    border-left: 4px solid #16a34a;
}

.cost-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.3rem 0.8rem;
    background: #f8f9fa;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 400;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.1);
    cursor: help;
    vertical-align: middle;
}

/* Effizienz-Vergleich — kleiner Pill-Button */
.efficiency-card {
    margin-top: 0.4rem;
    display: inline-block;
}
.efficiency-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.22rem 0.65rem;
    background: #f8f9fa;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.1);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
    line-height: 1.4;
    vertical-align: middle;
}
.efficiency-pill:hover,
.efficiency-card.open .efficiency-pill {
    background: #edf7f0;
    color: var(--primary-green);
    border-color: #b2dfdb;
}
.eff-arrow {
    font-size: 0.6rem;
    opacity: 0.45;
    display: inline-block;
    transition: transform 0.2s;
}
.efficiency-card.open .eff-arrow {
    transform: rotate(180deg);
    opacity: 0.7;
}
.efficiency-body {
    display: none;
    margin-top: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background: var(--bg-white);
    min-width: 320px;
}
.efficiency-card.open .efficiency-body {
    display: block;
}
.efficiency-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.efficiency-col {
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}
.efficiency-col h4 {
    margin: 0 0 0.8rem 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ki-col {
    background: #f0f9f4;
    border: 1px solid #c8e6c9;
}
.ki-col h4 { color: var(--primary-green); }
.manual-col {
    background: #fff8e1;
    border: 1px solid #ffe082;
}
.manual-col h4 { color: #f57f17; }
.efficiency-stat {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-top: 0.6rem;
}
.efficiency-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}
.efficiency-savings {
    text-align: center;
    padding: 0.8rem;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border-radius: 8px;
    color: var(--primary-green);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}
.efficiency-tasks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.task-group h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
}
.task-group ul {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
}
@media (max-width: 768px) {
    .efficiency-grid,
    .efficiency-tasks {
        grid-template-columns: 1fr;
    }
    cursor: help;
}

.error-message {
    display: block;
    padding: 1rem;
    background: #fef2f2;
    color: #f85149;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 8px;
    border-left: 4px solid #f85149;
}

/* Vollständigkeit: OK?-Ampelzelle (rot/gelb/grün) */
.ok-cell {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    vertical-align: middle;
}

.ok-cell.ok-green {
    background: #16a34a;
    border-color: #15803d;
}

.ok-cell.ok-yellow {
    background: #f59e0b;
    border-color: #d97706;
}

.ok-cell.ok-red {
    background: #ef4444;
    border-color: #dc2626;
}

.ok-cell.ok-unknown {
    background: #e5e7eb;
    border-color: #cbd5e1;
}

.status-badge.status-check {
    background: #f0f9f4 !important;
    color: #004716 !important;
    border-color: #004716 !important;
}

.status-badge.status-warning {
    background: #fffbeb !important;
    color: #f59e0b !important;
    border-color: #f59e0b !important;
}

.status-badge.status-error {
    background: #fef2f2 !important;
    color: #f85149 !important;
    border-color: #f85149 !important;
}

.score-display h3 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.score-display p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Data Table Container */
.data-table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 1400px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .hero-strip {
        padding: 3rem 1.5rem;
    }
    .hero-strip h1 {
        font-size: 2.2rem;
    }
    .dashboard-container {
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Hero */
    .hero-strip {
        padding: 2rem 1rem;
    }
    .hero-strip h1 {
        font-size: 1.7rem;
    }

    /* Notice */
/* Dashboard */
    .dashboard-container {
        margin: 1rem auto 2rem !important;
        padding: 0 1rem;
    }

    .controls-card,
    .content-card {
        padding: 1.25rem 1rem;
    }

    /* Upload + Buttons: stack statt nebeneinander */
    .controls-card-row {
        flex-direction: column;
        gap: 1rem;
    }

    .upload-area {
        width: 100%;
        padding: 1.25rem;
    }

    /* Buttons: volle Breite, kompakter */
    .action-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.6rem;
    }

    .action-buttons button,
    button.primary-btn,
    button.secondary-btn {
        width: 100%;
        min-width: 0 !important;
        max-width: 100%;
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
        box-sizing: border-box;
    }

    /* Tabs: kleinere Schrift, kein Überlauf */
    .tabs-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        font-size: 0.72rem;
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
        letter-spacing: 0;
    }

    /* Score */
    .score-display h3 {
        font-size: 2rem;
    }
    .score-display p {
        font-size: 0.9rem;
    }

    /* Tabellen */
    table thead th,
    table tbody td {
        padding: 0.6rem 0.75rem;
        font-size: 0.82rem;
    }

    /* Footer */
    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        font-size: 0.78rem;
    }

    /* Chat Bubble */
    .chat-bubble-widget {
        bottom: 1rem;
        right: 1rem;
    }

    .chat-bubble-container {
        width: calc(100vw - 2rem);
        right: 0;
        left: 0;
        bottom: 75px;
        height: 480px;
    }

    .chat-bubble-toggle {
        width: 52px;
        height: 52px;
        min-width: 52px;
        max-width: 52px;
        font-size: 1.3rem;
    }

    /* Modal */
    .modal, .info-modal {
        width: 100vw;
        max-height: 92vh;
        border-radius: 12px 12px 0 0;
        align-self: flex-end;
    }
    .modal-overlay {
        align-items: flex-end;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.hidden { display: none; }

.modal {
    background: var(--bg-white);
    width: min(900px, 90vw);
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 3px solid var(--primary-green);
}

.modal-header h3 { font-family: 'Oswald', sans-serif; }

.modal-close {
    border: none;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
}

.modal-body {
    padding: 1rem 1.25rem;
    overflow: auto;
}

.modal-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem 1.25rem 1.25rem;
    justify-content: flex-end;
}
/* Typing indicator */
.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
}

.typing-dots span {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary-green);
    animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%            { transform: translateY(-6px); opacity: 1; }
}

.cas-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 8px;
    vertical-align: middle;
    font-family: monospace;
}

/* Prozent-Anteil pro Kapitel */
.chapter-pct {
    font-size: 0.72rem;
    font-weight: 600;
    font-family: monospace;
}
.pct-green { color: #16a34a; }
.pct-yellow { color: #d97706; }
.pct-red { color: #dc2626; }

/* Zeile für irrelevante Kapitel */
.chapter-row.chapter-irrelevant {
    opacity: 0.4;
}

.chapter-row.chapter-irrelevant td {
    text-decoration: line-through;
    color: #9ca3af;
}

.chapter-row.chapter-irrelevant .ok-cell {
    filter: grayscale(1);
}

/* Score-Untertitel bei aktiven/inaktiven Kapiteln */
.score-display .score-subtitle {
    font-size: 0.8rem;
    opacity: 0.85;
    margin-top: 0.25rem;
}

/* === Deep-Links: Seitenreferenz → PDF öffnen === */
.page-deep-link {
    color: var(--primary-green);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color 0.15s;
}
.page-deep-link:hover {
    color: #003310;
}
.page-deep-link::after {
    content: ' ↗';
    font-size: 0.75em;
    opacity: 0.5;
}

/* === Multi-File Upload === */
.upload-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.multi-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}
.multi-file-item {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.multi-file-item.primary {
    background: #f0f9f4;
    border-color: var(--primary-green);
    color: var(--primary-green);
    font-weight: 600;
}
.multi-file-item.clickable {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.multi-file-item.clickable:hover {
    background: #e8f5e9;
    border-color: var(--primary-green);
    color: var(--primary-green);
}

/* === AMD G-Satz-zentrierte Tabelle === */
.adm-gsatz-table thead th {
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.adm-gsatz-table tbody td {
    vertical-align: top;
    padding: 0.85rem 1rem;
}
.adm-gsatz-info {
    text-align: right;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 0.5rem 0.5rem 0;
}
.gsatz-substances {
    cursor: help;
    line-height: 1.6;
}

/* Vorsorge-Art Badges */
.vorsorge-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.4;
}
.vorsorge-pflicht {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}
.vorsorge-angebot {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}
.vorsorge-wunsch {
    background: #f0f9f4;
    color: #16a34a;
    border: 1px solid #86efac;
}

/* === Ausblenden-Buttons (✕) === */
.btn-ignore-chapter,
.btn-group-ignore {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    padding: 4px 8px;
    min-width: 0;
    width: auto;
    display: inline-block;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-ignore-chapter:hover,
.btn-group-ignore:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.btn-ignore-chapter.active,
.btn-group-ignore.active {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #6b7280;
}

/* Gruppen-Header-Zeile */
.chapter-group-row {
    background: #f8f9fa;
    border-top: 2px solid var(--primary-green);
}
.chapter-group-row td {
    padding: 0.5rem 1rem;
}
.group-label {
    color: var(--primary-green);
    font-size: 0.88rem;
    letter-spacing: 0.3px;
}

/* === Ordner-Upload Link === */
.folder-upload-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.82rem;
    color: var(--primary-green);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s;
}

.folder-upload-link:hover {
    color: #003310;
}

/* === KI Live Status Panel === */
.ki-live-panel {
    width: 100%;
    background: linear-gradient(135deg, rgba(0, 71, 22, 0.06) 0%, rgba(0, 71, 22, 0.03) 100%);
    border: 1.5px solid rgba(0, 71, 22, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
}

.ki-live-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.ki-live-panel-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--primary-green);
    font-family: 'Oswald', sans-serif;
}

.ki-live-timer {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-green);
    font-family: 'Courier New', monospace;
    background: rgba(0, 71, 22, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.ki-live-steps {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.ki-live-step {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.5rem;
    border-radius: 5px;
    border: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
    min-height: 44px;
}

.ki-live-step.step-pending {
    background: rgba(0, 0, 0, 0.02);
}

.ki-live-step.step-running {
    background: rgba(0, 71, 22, 0.07);
    border-color: rgba(0, 71, 22, 0.18);
}

.ki-live-step.step-done {
    background: rgba(22, 163, 74, 0.06);
    border-color: rgba(22, 163, 74, 0.22);
}

.ki-live-step.step-failed {
    background: rgba(220, 38, 38, 0.05);
    border-color: rgba(220, 38, 38, 0.2);
}

.ki-step-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ki-step-icon.icon-pending {
    border: 2px solid #ccc;
    background: #fff;
}

.ki-step-icon.icon-running {
    border: 2.5px solid var(--primary-green);
    border-top-color: transparent;
    animation: ki-spin 0.75s linear infinite;
    background: transparent;
}

.ki-step-icon.icon-done {
    background: #16a34a;
}

.ki-step-icon.icon-failed {
    background: #dc2626;
}

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

.ki-step-text {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
    flex: 1;
}

.ki-step-name {
    font-size: 0.77rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: 'Oswald', sans-serif;
    color: var(--text-dark);
    line-height: 1.2;
}

.ki-step-detail {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.ki-step-detail.detail-running { color: var(--primary-green); }
.ki-step-detail.detail-done    { color: #16a34a; font-weight: 600; }
.ki-step-detail.detail-failed  { color: #dc2626; font-weight: 600; }

/* Gruppen-Score Badge in Vollständigkeit */
.group-score {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 12px;
    white-space: nowrap;
}
.group-score-green  { background: rgba(22,163,74,0.12);  color: #15803d; }
.group-score-yellow { background: rgba(202,138,4,0.12);  color: #a16207; }
.group-score-red    { background: rgba(220,38,38,0.10);  color: #b91c1c; }

/* Norm-Referenzen: nicht klickbar, aber mit Tooltip */
.norm-ref {
    color: var(--text-muted);
    font-size: 0.82rem;
    border-bottom: 1px dashed #aaa;
    cursor: help;
}
