/* Reset i zmienne globalne */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --primary-color: #0891b2;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --bg-secondary: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Dark mode support - for system preference */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0f172a;
        --bg-secondary: #1e293b;
        --card-bg: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --border-color: #334155;
        --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    }
}

html {
    overflow: hidden;
    height: 100%;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    padding-top: 27px;
    padding-bottom: 25px;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
body::-webkit-scrollbar {
    display: none;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.1rem 1rem 0.1rem 1rem;
}

/* MODERN (obecny) styl konsoli */
.console-modern .floating-console-panel {
    background: #c0c0c0;
    border-radius: 0;
    box-shadow: 2px 2px 0 #fff, 4px 4px 0 #808080;
    border: 2px solid #808080;
    outline: 2px solid #fff;
}
.console-modern .floating-console-header {
    background: linear-gradient(180deg, #e4e4e4 0%, #bdbdbd 100%);
    color: #000;
    font-family: 'MS Sans Serif', 'Consolas', 'Courier New', monospace;
}
.console-modern .floating-console-logs {
    background: #fff;
    color: #000;
    font-family: 'MS Sans Serif', 'Consolas', 'Courier New', monospace;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2px;
    margin-top: 0.1rem;
    position: relative;
}

header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.2px;
}

header p {
    color: var(--text-secondary);
    font-size: 0.8rem;
}
/* Main sections */
.etl-heading {
    margin-bottom: 1.5rem;
    color: #2d3748;
    font-size: 1.8rem;
}
/* Sections */
section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

section h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}
/* Model Status */
.model-status {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 12px;
}

.model-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 6px;
}

.model-name {
    font-weight: 500;
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}
/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

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

.btn-primary:hover {
    background-color: #0e7490;
}

.btn:disabled {
    background-color: var(--secondary-color);
    opacity: 0.5;
    cursor: not-allowed;
}

.analysis-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
/* Footer */
footer {
    text-align: center;
    margin-top: 12px;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}
/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .analysis-buttons {
        grid-template-columns: 1fr;
    }
}
/* ETL PANEL STYLES */
.etl-panel {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 12px;
    overflow: hidden;
}

 .etl-sidebar {
     background: #f8f9fa;
     padding: 25px;
}

.etl-sidebar h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #2d3748;
}

.etl-main {
    padding: 30px;
}

/* Summary Items */
.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    border-left: 4px solid var(--primary-color);
}

.summary-item strong {
    color: #4a5568;
}

.summary-item span {
    color: #2d3748;
    font-weight: 600;
}

.summary-data-list {
    margin-top: 12px;
    font-size: 13px;
    color: #718096;
    line-height: 1.6;
}

/* Estimate Box */
.estimate-box {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
}

.estimate-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: #2d3748;
    font-size: 15px;
}

.estimate-grid {
    display: grid;
    gap: 8px;
}

.estimate-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #e2e8f0;
}

.estimate-label {
    font-size: 13px;
    color: #4a5568;
}

.estimate-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
}

/* Fieldset */
.etl-fieldset {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 12px;
}

.etl-fieldset legend {
    font-weight: 600;
    font-size: 16px;
    color: #2d3748;
    padding: 0 10px;
}

/* Checkbox Items */
.checkbox-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f7fafc;
    border-radius: 6px;
    margin-bottom: 12px;
    cursor: pointer;
}

.checkbox-item:hover {
    background: #edf2f7;
}

.checkbox-item input {
    margin-right: 10px;
}

.checkbox-item label {
    flex: 1;
    cursor: pointer;
    font-size: 14px;
}

/* Disabled state for checkbox items */
.checkbox-item input:disabled {
    pointer-events: none;
    opacity: 0.55;
    cursor: not-allowed;
}

.checkbox-item input:disabled + label,
.checkbox-item input:disabled ~ label {
    opacity: 0.55;
    cursor: not-allowed;
    color: #a0aec0;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.badge-size {
    background: #bee3f8;
    color: #2c5282;
}

/* ETL Buttons */
.etl-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}


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

.etl-btn-abort {
    background: var(--danger-color);
    color: white;
}

.etl-btn-verify-mode {
    background: #0891b2;
    color: white;
}

.etl-btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.etl-btn-secondary:hover {
    background: #f0f4f8;
}

.etl-btn-danger {
    background: white;
    color: var(--danger-color);
    border: 2px solid var(--danger-color);
}

/* Committee select options spacing */
#etlCommitteeSelect option {
    padding: 4px 4px;
    line-height: 1.5;
}

/* Uniform styling for all select/input controls */
.form-control,
select,
input[type="number"] {
    padding: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
    outline: none;
}

.form-control:focus,
select:focus,
input[type="number"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Disabled state for all form controls */
.form-control:disabled,
select:disabled,
input[type="number"]:disabled,
input:disabled {
    pointer-events: none;
    opacity: 0.55;
    background-color: #f3f4f6;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

/* Floating Status Bar */
#floatingStatusBar {
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
}

#consoleSection {
    transition: background 0.2s ease;
}

#consoleSection:hover {
    background: rgba(255, 255, 255, 0.1);
}

#consoleSection:active {
    background: rgba(255, 255, 255, 0.15);
}


/* Floating Buttons */
.floating-btn {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: white;
    border: none;
    font-size: 26px;
    cursor: grab;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 2100;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.floating-btn:active {
    cursor: grabbing;
}

.floating-btn.dragging {
    opacity: 0.8;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* AI Chat Button */
.btn-ai-chat {
    display: none;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

/* Export Button */
.btn-export {
    display: none;
    top: 90px;
    left: 20px;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

/* Import Button */
.btn-import {
    display: none;
    top: 160px;
    left: 20px;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

/* Help Button */
.btn-help {
    display: none;
    top: 230px;
    left: 20px;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

/* About Button */
.btn-rodo {
    display: none;
    top: 300px;
    left: 20px;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

/* Language Button */
.btn-language {
    display: none;
    top: 370px;
    left: 20px;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

/* Reset Memory Button */
.btn-reset-memory {
    display: none;
    top: 440px;
    left: 20px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* ETL Utility Classes */
.etl-summary-column {
    flex-direction: column;
    align-items: flex-start;
}

.etl-section-hint {
    font-size: 12px;
    color: #718096;
    margin-bottom: 8px;
}

.etl-rodo-box {
    background: #f8f9fa;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    opacity: 0.7;
}

.etl-rodo-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: not-allowed;
    font-size: 14px;
}

.etl-rodo-label input {
    cursor: not-allowed;
}

.etl-rodo-span {
    font-weight: 600;
    color: #718096;
}

.etl-rodo-description {
    font-size: 12px;
    color: #718096;
    margin-top: 6px;
    line-height: 1.4;
}

.etl-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.etl-input-label {
    font-size: 14px;
}

.etl-number-input {
    width: 65px;
    padding: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.etl-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

.etl-checkbox-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}


.etl-radio-group {
    display: flex;
    gap: 15px;
}

.etl-radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.term-count {
    font-size: 0.8em;
    opacity: 0.6;
}

.etl-select-margin {
    margin-bottom: 15px;
}

.etl-fieldset-margin {
    margin-top: 12px;
}

.etl-committee-select {
    font-size: 13px;
    line-height: 4;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    text-overflow: ellipsis;
}

.etl-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.estimate-row-last {
    border: none;
}

/* Floating Console Panel */
.floating-console-panel {
    position: fixed;
    bottom: 70px;
    right: 20px;
    width: 400px;
    max-height: 500px;
    background: #c0c0c0;
    border-radius: 0;
    box-shadow: 2px 2px 0 #fff, 4px 4px 0 #808080;
    display: none;
    z-index: 998;
    overflow: hidden;
    border: 2px solid #808080;
    outline: 2px solid #fff;
}

.floating-console-header {
    background: linear-gradient(180deg, #e4e4e4 0%, #bdbdbd 100%);
    color: #000;
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'MS Sans Serif', 'Consolas', 'Courier New', monospace;
    font-size: 1rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #808080;
    box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
}

.floating-console-title {
    font-weight: bold;
    font-size: 1rem;
    color: #000;
    letter-spacing: 1px;
    text-shadow: 1px 1px 0 #fff;
}

.floating-console-close {
    background: #e4e4e4;
    color: #000;
    border: 2px solid #808080;
    border-radius: 0;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 8px;
    margin-left: 8px;
    box-shadow: 1px 1px 0 #fff, 2px 2px 0 #808080;
    transition: background 0.2s;
}
.floating-console-close:hover {
    background: #bdbdbd;
    color: #000;
}

.floating-console-logs {
    padding: 10px;
    max-height: 440px;
    overflow-y: auto;
    background: #fff;
    font-family: 'MS Sans Serif', 'Consolas', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #000;
    border-top: 2px solid #808080;
    box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
}

/* Progress & Logs Section */
.api-progress-container {
    margin: 2rem 0;
}

.api-progress-bar-wrapper {
    background: #e2e8f0;
    border-radius: 10px;
    height: 25px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.api-progress-bar {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    width: 0%;
    transition: width 0.3s;
}

.api-progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.api-logs {
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    padding: 0.75rem;
    border-radius: 0;
    font-family: 'MS Sans Serif', 'Consolas', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #000;
    box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
    border: 2px solid #808080;
}

.api-status-box {
    padding: 1rem;
    background: #f7fafc;
    border-radius: 5px;
    border-left: 4px solid #667eea;
    display: none;
    margin: 2rem 0;
}

.api-status-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.api-status-details {
    font-size: 0.9rem;
    color: #666;
}

/* AI Status Lamp — zunifikowana z .floating-lamp (10x10, diodowe cieniowanie) */
.status-lamp {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64748b;
    background-image: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.1) 30%, transparent 60%);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.status-lamp.checking {
    background-color: #f6ad55;
    box-shadow: 0 0 8px rgba(246, 173, 85, 0.6), inset 0 -2px 3px rgba(0,0,0,0.25);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-lamp.success {
    background-color: #48bb78;
    box-shadow: 0 0 8px rgba(72, 187, 120, 0.6), inset 0 -2px 3px rgba(0,0,0,0.25);
}

.status-lamp.error {
    background-color: #f56565;
    box-shadow: 0 0 8px rgba(245, 101, 101, 0.6), inset 0 -2px 3px rgba(0,0,0,0.25);
}

.status-lamp.warning {
    background-color: #ecc94b;
    box-shadow: 0 0 8px rgba(236, 201, 75, 0.6), inset 0 -2px 3px rgba(0,0,0,0.25);
}

.status-lamp:hover::after {
    content: attr(data-model);
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10000;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}



.chat-config {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}

.chat-config-row {
    margin-bottom: 12px;
}

.chat-config-row:last-child {
    margin-bottom: 0;
}

.chat-config-row label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.chat-config-row select,
.chat-config-row input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
}

.chat-config-row select:focus,
.chat-config-row input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.chat-api-link {
    display: inline-block;
    font-size: 0.8rem;
    color: #10b981;
    text-decoration: none;
    margin-top: 4px;
}

.chat-api-link:hover {
    text-decoration: underline;
}

.chat-check-models-btn {
    width: 100%;
    padding: 8px 12px;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-check-models-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.chat-check-models-btn:active {
    transform: translateY(0);
}

/* Filter checkbox row */
.chat-filter-row {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.chat-filter-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
}

.chat-filter-checkbox input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #3b82f6;
    margin: 0;
}

.chat-filter-checkbox:hover span {
    color: #1f2937;
}

/* Model select wrapper with favorite button */
.model-select-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.model-select-wrapper select {
    flex: 1;
}

.toggle-favorite-btn {
    background: transparent;
    border: 1px solid rgba(8, 145, 178, 0.3);
    color: #fbbf24;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    opacity: 0.4;
}

.toggle-favorite-btn:hover {
    opacity: 0.8;
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.1);
}

.toggle-favorite-btn.active {
    opacity: 1;
    border-color: rgba(251, 191, 36, 0.6);
    background: rgba(251, 191, 36, 0.15);
}

.chat-favorites-section {
    margin-top: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
}

.chat-favorites-toggle {
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    font-size: 0.875rem;
    color: #374151;
}

.chat-favorites-toggle:hover {
    background: #f9fafb;
}

.favorites-list {
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.favorite-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    background: #f9fafb;
}

.favorite-item:hover {
    background: #f3f4f6;
}

.favorite-name {
    font-size: 0.875rem;
    color: #374151;
}

.favorite-remove {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.favorite-remove:hover {
    background: #fef3c7;
    transform: scale(1.2);
}

.favorites-empty {
    padding: 12px;
    text-align: center;
    font-size: 0.875rem;
    color: #9ca3af;
}

.favorites-help {
    padding: 8px 12px;
    font-size: 0.75rem;
    color: #6b7280;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

#chatMessages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: messageSlideIn 0.2s ease-out;
}

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

.chat-message.chat-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.chat-assistant {
    align-self: flex-start;
}

.chat-message.chat-system {
    align-self: center;
    max-width: 100%;
    justify-content: center;
}

.chat-message-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border-radius: 50%;
    background: #f3f4f6;
}

.chat-user .chat-message-icon {
    background: #dbeafe;
}

.chat-assistant .chat-message-icon {
    background: #d1fae5;
}

.chat-message-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-user .chat-message-content {
    background: #2563eb;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-assistant .chat-message-content {
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.chat-system .chat-message-content {
    background: #fef3c7;
    color: #92400e;
    border-radius: 6px;
    text-align: center;
    font-size: 0.85rem;
}

.chat-code {
    background: #1e293b;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: white;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

#chatInput {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: none;
    min-height: 42px;
    max-height: 120px;
}

#chatInput:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

#sendChatBtn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

#sendChatBtn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Floating Status Bar */
.floating-status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 25px;
    background: #2d3748;
    border-top: 2px solid #1a202c;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 10px;
    z-index: 2000;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
    font-size: 0.8rem;
    color: #e2e8f0;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* === SETTINGS — panele ustawień === */
.console-style-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 12px;
}

.console-style-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
}

.console-style-header h3 {
    margin: 0;
    font-size: 0.95rem;
}

.console-style-body {
    padding: 12px 14px;
}

.console-style-description {
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.console-style-description p {
    margin: 0;
}

.settings-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.settings-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #0891b2;
}

.settings-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.settings-radio-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-secondary);
}

.settings-radio-label:hover {
    border-color: var(--primary-color);
    background: var(--card-bg);
}

.settings-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.settings-radio-label input[type="radio"]:checked + span {
    color: var(--primary-color);
}

.settings-radio-label span {
    flex: 1;
    line-height: 1.4;
}

.settings-radio-label span strong {
    font-size: 0.95rem;
    display: block;
    margin-bottom: 2px;
}

.settings-radio-label span small {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
}

/* Przyciski w ustawieniach (styl, język, import/export, reset) */
.console-style-btn {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.console-style-btn:hover {
    background: #edf2f7;
}

.console-style-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.console-style-btn-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.console-style-btn-danger:hover {
    background: var(--danger-color);
    color: white;
}

/* === TOP INFO BAR — pasek informacyjny na górze === */
.top-info-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 25px;
    background: #2d3748;
    border-bottom: 2px solid #1a202c;
    display: flex;
    align-items: center;
    overflow: hidden;
    z-index: 2000;
    font-size: 0.8rem;
    color: #e2e8f0;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
}

.top-info-text {
    white-space: nowrap;
    position: absolute;
    color: #e2e8f0;
    letter-spacing: 0.5px;
    font-weight: bold;
    animation: scrollLeft 16s linear forwards;
}

.top-info-text.reset {
    animation: none;
}

@keyframes scrollLeft {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

/* === FLOATING STATUS BAR — zunifikowane komponenty === */

/* Sekcja — kontener inline */
.status-bar-section {
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

#versionSection { cursor: pointer; }
#versionSection:hover .status-bar-label { color: var(--primary-color, #0891b2); }

/* Label tekstowy (Baza:, AI:, Load:, Memory:, wersja) */
.status-bar-label {
    font-weight: 600;
    color: #cbd5e0;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Kontener na lampki */
.status-bar-lamps {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Lampka diodowa — zunifikowany styl 10x10 z cieniowaniem */
.floating-lamp {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
    background-image: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.1) 30%, transparent 60%);
}

.floating-lamp-ok {
    background-color: #48bb78;
    box-shadow: 0 0 8px rgba(72, 187, 120, 0.6), inset 0 -2px 3px rgba(0,0,0,0.25);
}

.floating-lamp-warning {
    background-color: #f6ad55;
    box-shadow: 0 0 8px rgba(246, 173, 85, 0.6), inset 0 -2px 3px rgba(0,0,0,0.25);
}

.floating-lamp-error {
    background-color: #f56565;
    box-shadow: 0 0 8px rgba(245, 101, 101, 0.6), inset 0 -2px 3px rgba(0,0,0,0.25);
}

.floating-lamp-warn {
    background-color: #ecc94b;
    box-shadow: 0 0 8px rgba(236, 201, 75, 0.6), inset 0 -2px 3px rgba(0,0,0,0.25);
}

.floating-lamp-info {
    background-color: #4299e1;
    box-shadow: 0 0 8px rgba(66, 153, 225, 0.6), inset 0 -2px 3px rgba(0,0,0,0.25);
}

.floating-lamp-idle {
    background-color: #64748b;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3), inset 0 -2px 3px rgba(0,0,0,0.25);
}

/* Console lamp blink */
.floating-lamp-blink {
    animation: lampBlink 0.8s ease-in-out infinite;
}

@keyframes lampBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* HDD-style blink: rapid irregular flicker */
.floating-lamp-hdd {
    animation: hddBlink 0.3s ease-in-out infinite;
}

@keyframes hddBlink {
    0%   { background-color: #48bb78; box-shadow: 0 0 8px rgba(72, 187, 120, 0.6), inset 0 -2px 3px rgba(0,0,0,0.25); }
    40%  { background-color: #2f855a; box-shadow: 0 0 3px rgba(47, 133, 90, 0.3), inset 0 -2px 3px rgba(0,0,0,0.25); }
    60%  { background-color: #48bb78; box-shadow: 0 0 10px rgba(72, 187, 120, 0.8), inset 0 -2px 3px rgba(0,0,0,0.25); }
    100% { background-color: #2f855a; box-shadow: 0 0 4px rgba(47, 133, 90, 0.4), inset 0 -2px 3px rgba(0,0,0,0.25); }
}

/* Live status blink: gray → green every 0.5s */
.floating-lamp-live-blink {
    animation: liveBlink 1s ease-in-out infinite;
}

@keyframes liveBlink {
    0%, 49% { 
        background-color: #64748b; 
        box-shadow: 0 0 2px rgba(0, 0, 0, 0.3), inset 0 -2px 3px rgba(0,0,0,0.25); 
    }
    50%, 100% { 
        background-color: #48bb78; 
        box-shadow: 0 0 8px rgba(72, 187, 120, 0.6), inset 0 -2px 3px rgba(0,0,0,0.25); 
    }
}

/* Checking status blink: blue pulse during sampling */
.floating-lamp-checking {
    animation: checkingBlink 1s ease-in-out infinite;
}

@keyframes checkingBlink {
    0%, 100% { 
        background-color: #4299e1; 
        box-shadow: 0 0 8px rgba(66, 153, 225, 0.8), inset 0 -2px 3px rgba(0,0,0,0.25); 
    }
    50% { 
        background-color: #63b3ed; 
        box-shadow: 0 0 12px rgba(99, 179, 237, 1), inset 0 -2px 3px rgba(0,0,0,0.25); 
    }
}

/* Separator pionowy między sekcjami */
.status-bar-separator {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.15);
}

/* Spacer (flex grow) */
.status-bar-spacer {
    flex: 1;
}

/* Konsola — klikalny element */
.status-bar-console {
    cursor: pointer;
    padding: 0 8px;
    border-radius: 3px;
    transition: background 0.2s;
}

.status-bar-console:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Live — klikalny element */
.status-bar-live {
    cursor: pointer;
    padding: 0 8px;
    border-radius: 3px;
    transition: background 0.2s;
}

.status-bar-live:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Pasek progresu — zunifikowany (Load + Memory) */
.progress-track {
    flex: 1;
    height: 10px;
    background: #808080;
    border-radius: 0;
    overflow: hidden;
    min-width: 60px;
    max-width: 100px;
    border: 1px solid #404040;
}

.progress-bar {
    height: 100%;
    background: #48bb78;
    border-radius: 0;
    transition: width 0.3s ease;
}

.progress-percent {
    font-size: 0.7rem;
    color: #90cdf4;
    font-weight: 600;
    min-width: 28px;
    text-align: right;
}

/* Cache bar */
.cache-bar {
    display: flex;
    align-items: center;
    gap: 1px;
    height: 10px;
    border: 1px solid #404040;
    overflow: hidden;
}

.cache-segment {
    width: 7px;
    height: 100%;
    background: #808080;
    transition: background 0.3s ease;
    cursor: default;
}

.cache-segment.partial {
    background: #ecc94b;
}

.cache-segment.cached {
    background: #48bb78;
}

.cache-segment.disabled {
    background: #444;
    opacity: 0.4;
    cursor: not-allowed;
}

/* ETL Detail Panel (top-right corner) */
.etl-detail-panel {
    position: fixed;
    top: 30px;
    right: 10px;
    width: 280px;
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 8px;
    padding: 10px 12px;
    z-index: 2100;
    font-size: 0.75rem;
    color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: width 0.3s ease, box-shadow 0.3s ease;
}


.etl-detail-header {
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 6px;
    color: #90cdf4;
}

.etl-detail-content {
    max-height: 80vh;
    overflow-y: auto;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.etl-detail-content::-webkit-scrollbar {
    width: 6px;
}

.etl-detail-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.etl-detail-content::-webkit-scrollbar-thumb {
    background: rgba(144, 205, 244, 0.3);
    border-radius: 3px;
}

.etl-detail-content::-webkit-scrollbar-thumb:hover {
    background: rgba(144, 205, 244, 0.5);
}


.etl-detail-stage {
    margin-bottom: 6px;
    color: #cbd5e0;
}

.etl-detail-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.etl-detail-progress .progress-track {
    flex: 1;
    max-width: none;
}

.etl-detail-stats {
    color: #a0aec0;
    font-size: 0.7rem;
}

.etl-detail-links {
    color: #90cdf4;
    font-size: 0.7rem;
    margin-top: 2px;
}

/* Info Panel Sections */
.etl-detail-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #4a5568;
}

.etl-detail-section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.etl-detail-section-title {
    font-weight: 600;
    font-size: 0.75rem;
    margin-bottom: 6px;
    color: #a0aec0;
}

.etl-detail-section-hidden {
    display: none !important;
}

/* ============================================
   LIVE STREAM MODAL
   ============================================ */

.live-stream-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-stream-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.live-stream-modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    background: #2d3748;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #4a5568;
    overflow: hidden;
    z-index: 10001;
}

.live-stream-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #1a202c;
    border-bottom: 1px solid #4a5568;
}

.live-stream-modal-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #90cdf4;
}

.live-stream-modal-close {
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.live-stream-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fc8181;
}

.live-stream-modal-body {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: #000;
}

.live-stream-modal-body iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .live-stream-modal-content {
        width: 95%;
        max-width: none;
    }
}

#sendChatBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* ============================================
   NAVIGATION SECTIONS - WARIANT 2 BOTTOM NAV
   ============================================ */

/* Main sections container */
.app-sections-container {
    position: relative;
    min-height: 600px;
    padding-bottom: 80px; /* Space for bottom nav */
    overflow: hidden;
}

/* Individual sections */
.app-section {
    display: none;
    position: relative;
    animation: fadeIn 0.4s ease-in-out;
}

.app-section.active {
    display: block;
}

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

/* Bottom Navigation Bar (Carousel) */
.bottom-nav {
    position: fixed;
    bottom: 50px; /* Above floating status bar */
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 8px;
    z-index: 900;
    overflow: hidden;
    max-width: calc(3 * 95px + 2 * 5px + 16px + 100px); /* 3 items visible + 100px */
    cursor: grab;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.nav-carousel {
    display: flex;
    gap: 5px;
    will-change: transform;
}

.nav-carousel.animating {
    transition: transform 0.3s ease;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
    min-width: 75px;
    flex-shrink: 0;
    user-select: none;
}

.nav-item:hover {
    background: #f8f9fa;
}

.nav-item.active {
    background: #0891b2;
    color: white;
    border-color: #0891b2;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.nav-icon {
    font-size: 1.4rem;
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    display: block;
}

/* ============================================
   SEKCJA 2: PODSUMOWANIE
   ============================================ */

/* Fetch Overview — Zlecone vs Pobrane */
.fetch-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.fetch-overview-col h4 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
}

.fetch-overview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.fetch-overview-table td {
    padding: 4px 8px;
    border-bottom: 1px solid #e9ecef;
}

.fetch-overview-table td:first-child {
    color: #6c757d;
    white-space: nowrap;
}

.fetch-overview-table td:last-child {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.fetch-overview-separator td {
    font-weight: 600;
    font-size: 0.8rem;
    color: #495057;
    padding-top: 10px;
    border-bottom: 2px solid #dee2e6;
}

.fetch-overview-table .fov-checked {
    color: #198754;
}

.fetch-overview-table .fov-unchecked {
    color: #adb5bd;
}

.fetch-overview-table .fov-value {
    font-weight: 600;
}

.summary-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 25px;
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s;
}

.summary-card {
    cursor: pointer;
}

.summary-card:hover {
    transform: translateY(-5px);
}

.summary-card.active {
    outline: 3px solid #fff;
    outline-offset: -3px;
    transform: translateY(-5px);
}

/* Summary Data Table */
.summary-table-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 20px 0;
    overflow: hidden;
}

.summary-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.summary-table-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.summary-table-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0 5px;
    line-height: 1;
}

.summary-table-close:hover {
    color: #dc3545;
}

.summary-table-wrap {
    max-height: 500px;
    overflow: auto;
}

.summary-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.summary-table-wrap th {
    position: sticky;
    top: 0;
    background: #667eea;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.summary-table-wrap td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-table-wrap tr:hover {
    background: #f0f4ff;
}

.summary-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.summary-content {
    flex: 1;
}

.summary-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.summary-value {
    font-size: 2.5rem;
    font-weight: bold;
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.summary-value-main {
    font-size: 2.5rem;
    font-weight: bold;
}

.summary-value-sql {
    font-size: 1.2rem;
    opacity: 0.7;
    font-weight: normal;
}

.summary-value-sql::before {
    content: '(SQL: ';
    opacity: 0.5;
}

.summary-value-sql::after {
    content: ')';
    opacity: 0.5;
}

.summary-info {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.summary-info p {
    margin: 10px 0;
    font-size: 1rem;
}

.summary-placeholder {
    text-align: center;
    padding: 40px;
    background: #fff3cd;
    border-radius: 12px;
    margin-top: 30px;
}

.summary-placeholder p {
    font-size: 1.1rem;
    color: #856404;
}

/* ============================================
   SEKCJA 3: AI ASYSTENT (FULL SCREEN)
   ============================================ */

.ai-two-columns {
    display: flex;
    gap: 20px;
}

.ai-column {
    flex: 1;
    min-width: 0;
}

.ai-column h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #667eea;
}

.ai-column-chat {
    flex: 1;
}

.ai-column-modules {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ai-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    flex: 1;
}

.ai-modules-grid .prediction-card {
    min-height: auto;
}

.ai-modules-grid .prediction-card-header {
    padding: 1rem;
}

.ai-modules-grid .prediction-card-icon {
    font-size: 1.5rem;
}

.ai-modules-grid .prediction-card-header h3 {
    font-size: 0.9rem;
}

.ai-modules-grid .prediction-card-header p {
    font-size: 0.75rem;
}

.ai-modules-grid.predictions-grid--has-expanded {
    display: flex;
    flex-direction: column;
}

.ai-modules-grid .prediction-card--expanded {
    flex: 1;
}

.ai-modules-grid .prediction-card--expanded .prediction-card-header {
    padding: 1.2rem;
}

.ai-modules-grid .prediction-card--expanded .prediction-card-icon {
    font-size: 2rem;
}

.ai-modules-grid .prediction-card--expanded .prediction-card-header h3 {
    font-size: 1.1rem;
}

/* ============================================
   INVESTIGATION ENGINE — Conspiracy Detector
   ============================================ */

/* IDDQD unlock animation */
@keyframes inv-unlock {
    0%   { opacity: 0; transform: scale(0.3) rotate(-10deg); filter: blur(10px) hue-rotate(0deg); }
    40%  { opacity: 1; transform: scale(1.08) rotate(2deg); filter: blur(0) hue-rotate(180deg); }
    60%  { transform: scale(0.95) rotate(-1deg); filter: hue-rotate(360deg); }
    80%  { transform: scale(1.02) rotate(0.5deg); }
    100% { transform: scale(1) rotate(0deg); filter: blur(0) hue-rotate(0deg); }
}

.inv-unlock-reveal {
    animation: inv-unlock 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Card accent */
.prediction-card--investigation {
    border: 2px solid transparent;
    background: linear-gradient(var(--card-bg, #fff), var(--card-bg, #fff)) padding-box,
                linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%) border-box;
    position: relative;
    overflow: hidden;
}

.prediction-card--investigation::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(102,126,234,0.05), rgba(118,75,162,0.05));
    pointer-events: none;
    z-index: 0;
}

.prediction-card--investigation .prediction-card-header {
    position: relative;
    z-index: 1;
}

/* Animated icon container */
.inv-icon-animated {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: inv-wobble 3s ease-in-out infinite;
}

.inv-header-gif {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #764ba2;
    box-shadow: 0 0 12px rgba(118,75,162,0.4);
}

.prediction-card--expanded .inv-header-gif {
    width: 56px;
    height: 56px;
}

@keyframes inv-wobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

/* Stats row */
.inv-stats-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.inv-stat {
    flex: 1;
    min-width: 80px;
    text-align: center;
    background: var(--inv-stat-bg, #f8f9fa);
    border-radius: 10px;
    padding: 12px 8px;
    border: 1px solid var(--inv-stat-border, #e9ecef);
}

.inv-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--inv-accent, #667eea);
}

.inv-stat-value.inv-flagged {
    color: #e74c3c;
}

.inv-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
    margin-top: 4px;
}

/* AI Section */
.inv-ai-section {
    margin-bottom: 16px;
}

.inv-ai-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
}

.inv-ai-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102,126,234,0.4);
}

.inv-ai-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.inv-ai-btn-icon {
    font-size: 1.3rem;
}

.inv-ai-hint {
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
    margin-top: 8px;
    text-align: center;
}

.inv-ai-result {
    margin-top: 12px;
}

.inv-ai-report {
    background: var(--inv-report-bg, #f8f4ff);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--inv-report-border, #d6bcfa);
    line-height: 1.6;
    font-size: 0.9rem;
}

/* Tabs */
.inv-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--inv-tab-border, #e9ecef);
    padding-bottom: 0;
}

.inv-tab {
    padding: 8px 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted, #6c757d);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    white-space: nowrap;
}

.inv-tab:hover {
    color: var(--inv-accent, #667eea);
}

.inv-tab.active {
    color: var(--inv-accent, #667eea);
    border-bottom-color: var(--inv-accent, #667eea);
    font-weight: 600;
}

.inv-tab-content {
    display: none;
}

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

/* Clusters */
.inv-cluster-card {
    background: var(--inv-cluster-bg, #fff);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--inv-cluster-border, #e9ecef);
    transition: box-shadow 0.2s;
}

.inv-cluster-card:hover {
    box-shadow: 0 3px 12px rgba(102,126,234,0.15);
}

.inv-cluster-header {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 8px;
}

.inv-cluster-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.inv-cluster-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary, #1a202c);
}

.inv-cluster-meta {
    font-size: 0.78rem;
    color: var(--text-muted, #6c757d);
    margin-top: 2px;
}

.inv-cluster-bar-bg {
    height: 6px;
    background: var(--inv-bar-bg, #e9ecef);
    border-radius: 3px;
    margin-bottom: 8px;
    overflow: hidden;
}

.inv-cluster-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.inv-cluster-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inv-cluster-detail {
    font-size: 0.78rem;
    color: var(--text-secondary, #4a5568);
}

/* Rhetoric */
.inv-rhetoric-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inv-rhetoric-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inv-rhetoric-label {
    flex: 1;
    font-size: 0.85rem;
    min-width: 180px;
    color: var(--text-primary, #1a202c);
}

.inv-rhetoric-bar-bg {
    flex: 2;
    height: 8px;
    background: var(--inv-bar-bg, #e9ecef);
    border-radius: 4px;
    overflow: hidden;
}

.inv-rhetoric-bar {
    height: 100%;
    background: linear-gradient(90deg, #f093fb, #f5576c);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.inv-rhetoric-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--inv-accent, #667eea);
    min-width: 40px;
    text-align: right;
}

/* Motifs */
.inv-motifs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inv-motif-chip {
    background: var(--inv-motif-bg, #f0f4ff);
    border: 1px solid var(--inv-motif-border, #c3d4f7);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.2s;
}

.inv-motif-chip:hover {
    transform: scale(1.03);
}

.inv-motif-chip.inv-motif-cross {
    border-color: #f093fb;
    background: var(--inv-motif-cross-bg, #fdf0ff);
}

.inv-motif-phrase {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary, #1a202c);
}

.inv-motif-count {
    font-size: 0.72rem;
    color: var(--text-muted, #6c757d);
}

.inv-motif-badge {
    font-size: 0.65rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    align-self: flex-start;
    font-weight: 600;
}

/* Concept Map */
.inv-concept-map-container {
    min-height: 400px;
    border-radius: 12px;
    border: 1px solid var(--inv-cluster-border, #e9ecef);
    overflow: hidden;
    background: var(--inv-map-bg, #fafaff);
}

.investigation-concept-svg {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.concept-label {
    font-size: 9px;
    fill: var(--text-primary, #1a202c);
    pointer-events: none;
    font-weight: 500;
}

.concept-node:hover circle {
    fill-opacity: 1;
    stroke-width: 3;
    filter: drop-shadow(0 0 6px rgba(102,126,234,0.5));
}

/* Flagged speeches */
.inv-flagged-card {
    background: var(--inv-cluster-bg, #fff);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--inv-cluster-border, #e9ecef);
    border-left: 4px solid #e74c3c;
}

.inv-flagged-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.inv-flagged-rank {
    font-weight: 700;
    font-size: 1rem;
    color: #e74c3c;
    min-width: 30px;
}

.inv-flagged-speaker {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary, #1a202c);
}

.inv-flagged-party {
    font-size: 0.78rem;
    background: var(--inv-stat-bg, #f0f4ff);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--inv-accent, #667eea);
    font-weight: 500;
}

.inv-flagged-score {
    margin-left: auto;
    font-weight: 600;
    font-size: 0.85rem;
}

.inv-flagged-sentiment {
    font-size: 0.85rem;
}

.inv-flagged-cats {
    font-size: 0.78rem;
    color: var(--text-secondary, #4a5568);
    margin-bottom: 6px;
}

.inv-flagged-text {
    font-size: 0.82rem;
    color: var(--text-primary, #1a202c);
    line-height: 1.5;
    font-style: italic;
    background: var(--inv-stat-bg, #f8f9fa);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 6px;
}

.inv-flagged-rhetoric {
    font-size: 0.75rem;
    color: #764ba2;
    font-weight: 500;
}

/* Investigate button */
.inv-investigate-btn {
    margin-left: auto;
    padding: 6px 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.inv-investigate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
    filter: brightness(1.1);
}

.inv-investigate-btn:active {
    transform: translateY(0);
}

/* Dark theme overrides */
[data-theme="dark"] .prediction-card--investigation {
    --card-bg: #1a202c;
    --inv-stat-bg: #2d3748;
    --inv-stat-border: #4a5568;
    --inv-accent: #90a0f0;
    --inv-cluster-bg: #2d3748;
    --inv-cluster-border: #4a5568;
    --inv-bar-bg: #4a5568;
    --inv-tab-border: #4a5568;
    --inv-motif-bg: #2d3748;
    --inv-motif-border: #4a5568;
    --inv-motif-cross-bg: #3d2748;
    --inv-report-bg: #2a1f3d;
    --inv-report-border: #5b3a8a;
    --inv-map-bg: #1e2130;
    --inv-edge-color: #90a0f0;
    --inv-node-fill: #90a0f0;
    --inv-node-stroke: #7b8ce0;
}

[data-theme="dark"] .inv-cluster-name,
[data-theme="dark"] .inv-rhetoric-label,
[data-theme="dark"] .inv-motif-phrase,
[data-theme="dark"] .inv-flagged-speaker,
[data-theme="dark"] .inv-flagged-text,
[data-theme="dark"] .concept-label {
    color: #e2e8f0;
}

[data-theme="dark"] .inv-header-gif {
    border-color: #90a0f0;
    box-shadow: 0 0 12px rgba(144,160,240,0.4);
}

@media (max-width: 768px) {
    .ai-two-columns {
        flex-direction: column;
    }
}

.ai-chat-fullscreen {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 500px;
}

.chat-messages-fullscreen {
    flex: 1;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    border: 2px solid #e9ecef;
}

.models-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.models-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #667eea;
}

/* ============================================
   SEKCJA 4: WYKRESY (tile → expand pattern)
   ============================================ */

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.chart-card {
    background: #F7F7FC;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Bottom color strip for chart cards — same as prediction cards */
.chart-card:not(.chart-card--expanded) {
    border-bottom: 30px solid #079BBB;
}

.chart-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

/* Tile mode (collapsed): icon + title centered */
.chart-card:not(.chart-card--expanded) .chart-card-header {
    flex: 1;
    flex-direction: column;
    text-align: center;
    padding: 2rem 1rem 1.5rem;
}

.chart-card:not(.chart-card--expanded) .chart-card-icon {
    font-size: 3rem;
    margin-bottom: 0.25rem;
}

.chart-card:not(.chart-card--expanded) .chart-card-header h4 {
    font-size: 0.95rem;
}

.chart-card:not(.chart-card--expanded) .chart-card-header p {
    font-size: 0.75rem;
    opacity: 0.7;
    margin: 4px 0 0;
    color: #94a3b8;
}

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

.chart-card-header h4 {
    margin: 0;
    color: #ccc;
    font-size: 0.9rem;
    font-weight: 500;
}

.chart-card-header p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.8rem;
}

.chart-card-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Expand / Collapse states */
.chart-card--hidden {
    display: none !important;
}

.chart-card--expanded {
    grid-column: 1 / -1;
    cursor: default;
    min-height: 400px;
    padding: 16px;
}

.chart-card--expanded:hover {
    transform: none;
}

.chart-card--expanded .chart-card-header {
    flex-direction: row;
    text-align: left;
    padding: 0 0 12px;
    justify-content: flex-start;
}

.chart-card--expanded .chart-card-icon {
    font-size: 2rem;
}

.chart-card--expanded .chart-card-header h4 {
    font-size: 1.1rem;
}

.charts-grid--has-expanded {
    grid-template-columns: 1fr;
}

/* Back button for charts */
.chart-back-btn {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.chart-back-btn:hover {
    background: rgba(102, 126, 234, 0.25);
    color: #a5b4fc;
}

/* Chart body (hidden in tile mode) */
.chart-card-body {
    padding: 0;
    overflow: hidden;
}

.chart-card--expanded .chart-card-body {
    position: relative;
    width: 100%;
    min-height: 400px;
}

/* Kontener canvasa — wymuszony rozmiar */
.chart-card--expanded .chart-card-body canvas {
    display: block;
    width: 100% !important;
    height: 400px !important;
}

/* === Spinner podczas ładowania wykresu === */
.chart-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10;
    border-radius: 8px;
    gap: 10px;
}

.chart-spinner-ring {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: chart-spin 0.7s linear infinite;
}

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

.chart-spinner-label {
    color: #aaa;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
}

/* Controls row inside expanded chart */
.chart-card-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.heatmap-controls {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.chart-refresh-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 6px 18px;
    cursor: pointer;
    font-size: 1.2rem;
    color: #aaa;
    transition: all 0.2s;
}

.chart-refresh-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.chart-no-data {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.02);
    border: 2px dashed rgba(255,255,255,0.08);
    border-radius: 8px;
    margin: 8px;
}

.chart-no-data-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.chart-no-data-title {
    font-size: 1rem;
    color: #cbd5e1;
    margin-bottom: 8px;
    font-weight: 500;
}

.chart-no-data-hint {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 16px;
}

.chart-no-data-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.chart-no-data-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 2px;
    padding: 8px 16px;
    color: #a5b4fc;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.chart-no-data-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    color: #c7d2fe;
}

.chart-select {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: #ccc;
    font-size: 0.85rem;
    padding: 4px 8px;
    cursor: pointer;
}
.chart-select:focus {
    outline: none;
    border-color: #667eea;
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Panel kontrolny wykresów */
.charts-control-panel {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
}

.charts-control-header {
    background: rgba(102, 126, 234, 0.1);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.charts-control-header h3 {
    margin: 0;
    color: #ccc;
    font-size: 1rem;
    font-weight: 500;
}

.charts-control-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.charts-btn-small {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 2px;
    padding: 6px 12px;
    color: #ccc;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.charts-btn-small:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.charts-control-body {
    padding: 20px;
}

.charts-control-hint {
    color: #94a3b8;
    font-size: 0.85rem;
    margin: 0 0 16px 0;
}

.charts-order-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.charts-order-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: move;
    transition: all 0.2s;
    user-select: none;
}

.charts-order-item:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(102, 126, 234, 0.3);
}

.charts-order-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.charts-order-item.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.charts-order-drag-handle {
    color: #64748b;
    font-size: 1.2rem;
    cursor: grab;
}

.charts-order-drag-handle:active {
    cursor: grabbing;
}

.charts-order-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.charts-order-label {
    flex: 1;
    color: #ccc;
    font-size: 0.85rem;
    cursor: pointer;
}

.charts-order-icon {
    font-size: 1.1rem;
    opacity: 0.7;
}

.chart-item-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.chart-item-btn {
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 4px;
    padding: 4px 8px;
    color: #a5b4fc;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.chart-item-btn:hover {
    background: rgba(102, 126, 234, 0.25);
    border-color: #667eea;
    transform: scale(1.05);
}

.chart-item-btn:active {
    transform: scale(0.95);
}

.chart-item-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 768px) {
    .charts-order-list {
        grid-template-columns: 1fr;
    }
    
    .charts-control-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .charts-control-actions {
        width: 100%;
    }
    
    .charts-btn-small {
        flex: 1;
    }
}


/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .bottom-nav {
        bottom: 60px;
        padding: 5px;
        max-width: calc(3 * 85px + 2 * 3px + 10px + 100px);
    }

    .nav-carousel {
        gap: 3px;
    }

    .nav-item {
        padding: 8px 12px;
        min-width: 70px;
    }
    
    .nav-icon {
        font-size: 1.5rem;
    }
    
    .nav-label {
        font-size: 0.75rem;
        font-weight: 700;
        -webkit-text-stroke: 0.3px currentColor;
        text-align: center;
        display: block;
    }

    .floating-status-bar {
        font-size: 0.85rem;
        font-weight: 700;
        -webkit-text-stroke: 0.4px currentColor;
    }

    .status-bar-label {
        font-weight: 700;
        -webkit-text-stroke: 0.4px currentColor;
    }

    .top-info-bar {
        font-size: 0.85rem;
        font-weight: 700;
        -webkit-text-stroke: 0.4px currentColor;
    }

    .top-info-text {
        font-weight: 700;
        -webkit-text-stroke: 0.4px currentColor;
    }

    .summary-container {
        grid-template-columns: 1fr;
    }
    
    .summary-card {
        padding: 20px;
    }

    .summary-value {
        font-size: 2rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .summary-value-main {
        font-size: 2rem;
    }

    .summary-value-sql {
        font-size: 1rem;
    }
}

/* ================================
   TOAST NOTIFICATIONS
   ================================ */

.toast-container {
    position: fixed;
    top: 30px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary-color);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    min-width: 300px;
}

.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-hide {
    opacity: 0;
    transform: translateX(400px);
}

/* Typy toastów */
.toast-info {
    border-left-color: var(--primary-color);
}

.toast-success {
    border-left-color: var(--success-color);
}

.toast-warning {
    border-left-color: var(--warning-color);
}

.toast-error {
    border-left-color: var(--danger-color);
}

/* Ikona */
.toast-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

/* Treść */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 14px;
}

.toast-message {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Przycisk zamykania */
.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* Responsywność */
@media (max-width: 768px) {
    .toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        min-width: auto;
    }
}

/* ================================
   MOBILE: ETL panel & main layout
   ================================ */

@media (max-width: 768px) {
    .container {
        padding: 0.1rem 0.5rem;
        max-width: 100vw;
    }

    /* ETL panel: stack sidebar + main vertically */
    .etl-panel {
        grid-template-columns: 1fr;
    }

    .etl-sidebar {
        padding: 15px;
    }

    .etl-main {
        padding: 15px;
    }

    .etl-fieldset {
        padding: 10px;
    }

    .etl-number-input {
        width: 60px;
        font-size: 13px;
    }

    .etl-input-group {
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Sections container */
    .app-sections-container {
        min-height: auto;
        padding-bottom: 90px;
    }

    /* Settings panels */
    .console-style-panel {
        margin-bottom: 10px;
    }

    .console-style-body {
        padding: 10px;
    }

    /* Fetch Overview table */
    .fetch-overview-table {
        font-size: 12px;
    }

    .fetch-overview-table th,
    .fetch-overview-table td {
        padding: 4px 6px;
    }

}

/* ============================================
   PREDICTIONS SECTION
   ============================================ */

.predictions-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 12px;
}

.predictions-header h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.predictions-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.predictions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Prediction Cards - tryb kafelek (zwinięty) */
.prediction-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Bottom color strip — domyślnie (30px border) */
.prediction-card:not(.prediction-card--expanded) {
    border-bottom: 30px solid #079BBB;
}

/* Orange bottom strip — profil parlamentarzysty, klubu, komisji */
.prediction-card--orange:not(.prediction-card--expanded) {
    border-bottom-color: #ffcc80;
}

/* Pastelowy czerwony — analiza agresji (HOT) */
.prediction-card--hot:not(.prediction-card--expanded) {
    border-bottom-color: #ef9a9a;
}

/* Pastelowy niebieski — wykrywanie anomalii, analiza online */
.prediction-card--blue:not(.prediction-card--expanded) {
    border-bottom-color: #90caf9;
}

/* HOT ribbon — skośna wstążka w prawym górnym rogu */
.prediction-card-ribbon {
    position: absolute;
    top: 14px;
    right: -32px;
    background: #e53935;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 4px 40px;
    transform: rotate(45deg);
    z-index: 10;
    box-shadow: 0 2px 6px rgba(229, 57, 53, 0.4);
    line-height: 1;
}

.prediction-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

/* Zwinięta karta: header jako kafelek z ikoną — flex:1 wypełnia całą kartę */
.prediction-card:not(.prediction-card--expanded) .prediction-card-header {
    flex: 1;
    flex-direction: column;
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    border-bottom: none;
}

.prediction-card:not(.prediction-card--expanded) .prediction-card-icon {
    font-size: 3rem;
    margin-bottom: 0.25rem;
}

.prediction-card:not(.prediction-card--expanded) .prediction-card-header h3 {
    font-size: 0.95rem;
}

.prediction-card:not(.prediction-card--expanded) .prediction-card-header p {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Expand / Collapse states */
.prediction-card--hidden {
    display: none !important;
}

.prediction-card--expanded {
    grid-column: 1 / -1;
    cursor: default;
    min-height: 400px;
}

.prediction-card--expanded .prediction-card-body {
    min-height: 350px;
}

.prediction-card--expanded:hover {
    transform: none;
}

.predictions-grid--has-expanded {
    grid-template-columns: 1fr;
}

/* Przycisk cofnij */
.prediction-back-btn {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.prediction-back-btn:hover {
    background: #667eea;
    color: white;
}

.prediction-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border-bottom: 1px solid var(--border-color);
}

.prediction-card-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.prediction-card-header h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.prediction-card-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.prediction-card-body {
    padding: 1.5rem;
    min-height: 200px;
}

.prediction-content {
    width: 100%;
}

/* Loading State */
.prediction-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.prediction-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Discipline List */
.discipline-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.discipline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.discipline-club {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.discipline-club strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.discipline-votes {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.discipline-gauge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 150px;
}

.gauge-bar {
    flex: 1;
    height: 12px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.gauge-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease;
}

.gauge-value {
    font-weight: bold;
    font-size: 0.9rem;
    min-width: 45px;
    text-align: right;
}

/* Rebels List */
.rebels-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rebel-item {
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid;
}

.rebel-item.rebel-high {
    background: rgba(239, 68, 68, 0.05);
    border-left-color: #ef4444;
}

.rebel-item.rebel-medium {
    background: rgba(245, 158, 11, 0.05);
    border-left-color: #f59e0b;
}

.rebel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.rebel-icon {
    font-size: 1.25rem;
}

.rebel-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rebel-info strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.rebel-club {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.rebel-metric {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.rebel-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--danger-color);
}

.rebel-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.rebel-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 2.25rem;
}

/* Coalition Matrix */
.coalition-matrix {
    overflow-x: auto;
}

.coalition-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.coalition-table th {
    background: var(--bg-color);
    padding: 0.5rem;
    text-align: center;
    font-weight: 600;
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
}

.coalition-table td {
    padding: 0.75rem 0.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    font-weight: 600;
}

.coalition-cell {
    transition: transform 0.2s;
    cursor: pointer;
}

.coalition-cell:hover {
    transform: scale(1.1);
}

.coalition-self {
    background: var(--bg-color);
    color: var(--text-secondary);
    font-weight: normal;
}

.coalition-legend {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

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

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 8px;
    transition: background 0.2s;
}

.activity-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.activity-rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    min-width: 40px;
    text-align: center;
}

.activity-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.activity-info strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.activity-club {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.activity-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.activity-speeches {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
}

.activity-trend {
    font-size: 0.85rem;
    font-weight: 600;
}

.activity-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Utility States */
.prediction-no-data,
.prediction-error,
.prediction-info {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

.prediction-info {
    background: rgba(16, 185, 129, 0.05);
    border-radius: 8px;
    color: var(--success-color);
}

/* === Nowe moduły predykcyjne === */

/* Subtitle */
.pred-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.pred-subtitle-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.pred-subtitle-row .pred-subtitle {
    margin-bottom: 0;
}

.pred-subtitle-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Stats grid */
.pred-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.pred-stat-box {
    text-align: center;
    padding: 1rem 0.5rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.pred-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pred-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Polarization */
.polarization-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.polarization-item {
    padding: 0.75rem;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.polarization-title {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.polarization-bar-container {
    margin-bottom: 0.35rem;
}

.polarization-bar {
    display: flex;
    height: 22px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--border-color);
}

.polarization-za {
    background: #48bb78;
    color: white;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    transition: width 0.3s;
}

.polarization-przeciw {
    background: #f56565;
    color: white;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    transition: width 0.3s;
}

.polarization-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.polarization-result {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
}

.result-passed {
    background: rgba(72, 187, 120, 0.15);
    color: #48bb78;
}

.result-rejected {
    background: rgba(245, 101, 101, 0.15);
    color: #f56565;
}

/* Activity rank */
.activity-rank-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.activity-rank-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    background: rgba(0,0,0,0.02);
    border: 1px solid var(--border-color);
}

.activity-rank-pos {
    font-size: 1.1rem;
    min-width: 32px;
    text-align: center;
    font-weight: 700;
    color: var(--text-secondary);
}

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

.activity-rank-info strong {
    display: block;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-rank-breakdown {
    display: flex;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.activity-rank-breakdown span {
    white-space: nowrap;
}

.activity-rank-bar-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 100px;
}

.activity-rank-bar-wrap .gauge-bar {
    flex: 1;
}

.activity-rank-score {
    font-size: 0.8rem;
    font-weight: 700;
    color: #667eea;
    min-width: 36px;
    text-align: right;
}

/* Legislation timeline */
.legislation-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.legislation-month {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.legislation-month-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 70px;
    text-align: right;
}

.legislation-month-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 28px;
    text-align: right;
}

/* === Profile Modules === */

.profile-selector {
    margin-bottom: 1.25rem;
}

.profile-selector label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.profile-combobox {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    appearance: auto;
    cursor: pointer;
    transition: border-color 0.2s;
}

.profile-combobox:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.profile-details {
    min-height: 40px;
}

.profile-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.06), rgba(118, 75, 162, 0.06));
    border-radius: 10px;
}

.profile-avatar {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.profile-header-info h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text-primary);
}

.profile-header-info p {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.profile-email {
    font-size: 0.8rem !important;
    color: #667eea !important;
}

.profile-badge {
    margin-left: auto;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.badge-active {
    background: rgba(72, 187, 120, 0.15);
    color: #48bb78;
}

.badge-inactive {
    background: rgba(245, 101, 101, 0.15);
    color: #f56565;
}

/* Recent list (votes, sessions) */
.profile-recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.profile-recent-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    background: rgba(0,0,0,0.02);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
}
.mp-vote-clickable {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.mp-vote-clickable:hover { background: rgba(8,145,178,0.08); border-color: var(--primary-color, #0891b2); }
.mp-vote-active { background: rgba(8,145,178,0.12); border-color: var(--primary-color, #0891b2); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.mp-vote-detail {
    background: var(--bg-secondary, #1e1e2e);
    border: 1px solid var(--primary-color, #0891b2);
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 0.6rem 0.8rem;
    font-size: 0.78rem;
    margin-top: -0.4rem;
}
.mp-vote-detail-title {
    color: var(--text-primary, #e0e0e0);
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
}
.mp-vote-detail-topic {
    color: var(--text-secondary, #999);
    font-size: 0.74rem;
    margin-bottom: 6px;
}
.mp-vote-detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-secondary, #aaa);
    font-size: 0.75rem;
}
.mp-vote-detail-row strong { color: var(--text-primary, #e0e0e0); }
.mp-votes-more-btn {
    background: transparent;
    border: 1px solid var(--border-color, #444);
    color: var(--text-secondary, #999);
    border-radius: 6px;
    padding: 5px 16px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.mp-votes-more-btn:hover { border-color: var(--primary-color, #0891b2); color: var(--primary-color, #0891b2); }

.profile-recent-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.profile-recent-date {
    font-size: 0.7rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* Vote badges */
.profile-vote-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.vote-yes { background: rgba(72,187,120,0.15); color: #48bb78; }
.vote-no { background: rgba(245,101,101,0.15); color: #f56565; }
.vote-abstain { background: rgba(236,201,75,0.15); color: #d69e2e; }
.vote-absent { background: rgba(160,174,192,0.15); color: #a0aec0; }

/* Members list */
.profile-members-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 400px;
    overflow-y: auto;
}

.profile-member-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
}

.profile-member-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.profile-member-stats {
    font-size: 0.7rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.profile-member-item .profile-badge {
    margin-left: 0;
    padding: 0.1rem 0.4rem;
    font-size: 0.65rem;
}

/* ===== Kontrowersyjne wypowiedzi ===== */
.controversial-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.controversial-stat {
    flex: 1;
    min-width: 90px;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border: 1px solid var(--border-color, #333);
}
.controversial-stat--negative {
    border-color: #e74c3c44;
    background: #e74c3c11;
}
.controversial-stat--positive {
    border-color: #27ae6044;
    background: #27ae6011;
}
.controversial-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary, #e0e0e0);
}
.controversial-stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary, #999);
    margin-top: 2px;
}

.controversial-party-ranking {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}
.controversial-party-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}
.controversial-party-name {
    min-width: 60px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
}
.controversial-party-bar-bg {
    flex: 1;
    height: 10px;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 5px;
    overflow: hidden;
}
.controversial-party-bar {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}
.controversial-party-pct {
    min-width: 60px;
    text-align: right;
    color: var(--text-secondary, #999);
    font-size: 0.72rem;
}

.controversial-speech-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
}
.controversial-speech-item {
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 8px;
    padding: 10px 12px;
    border-left: 3px solid #e74c3c;
}
.controversial-speech-item--aggressive {
    border-left-color: #e67e22;
}
.controversial-speech-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    font-size: 0.78rem;
}
.controversial-speech-rank {
    font-weight: 700;
    color: #e74c3c;
    min-width: 24px;
}
.controversial-speech-speaker {
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
}
.controversial-speech-party {
    background: var(--accent-color, #4a90d9);
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
}
.controversial-speech-date {
    color: var(--text-secondary, #999);
    font-size: 0.7rem;
    margin-left: auto;
}
.controversial-speech-score {
    font-weight: 700;
    font-size: 0.75rem;
}
.controversial-speech-bar-bg {
    height: 4px;
    background: var(--bg-tertiary, #2a2a3e);
    border-radius: 2px;
    margin: 4px 0;
    overflow: hidden;
}
.controversial-speech-bar {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    border-radius: 2px;
}
.controversial-speech-text {
    font-size: 0.75rem;
    color: var(--text-secondary, #bbb);
    line-height: 1.4;
    margin-top: 4px;
    padding: 6px 8px;
    background: var(--bg-tertiary, #16161e);
    border-radius: 4px;
    border: 1px solid var(--border-color, #333);
}
.controversial-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0;
}
.controversial-keyword {
    background: #e74c3c33;
    color: #e74c3c;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
}

/* ===== Sprzeczne głosowania ===== */
.contradictory-club-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.contradictory-club-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 6px;
    font-size: 0.8rem;
}
.contradictory-club-name {
    min-width: 60px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
}
.contradictory-club-rebels {
    color: var(--text-secondary, #999);
}
.contradictory-club-votes {
    margin-left: auto;
    color: #e67e22;
    font-weight: 600;
}

.contradictory-rebels-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
}
.contradictory-rebel-item {
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 8px;
    padding: 10px 12px;
    border-left: 3px solid #e67e22;
}
.contradictory-rebel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    font-size: 0.8rem;
}
.contradictory-rebel-rank {
    font-weight: 700;
    color: #e67e22;
    min-width: 24px;
}
.contradictory-rebel-name {
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
}
.contradictory-rebel-party {
    background: var(--accent-color, #4a90d9);
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
}
.contradictory-rebel-count {
    margin-left: auto;
    color: #e74c3c;
    font-weight: 700;
    font-size: 0.82rem;
}
.contradictory-rebel-conflicts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0;
}
.contradictory-conflict-badge {
    background: #e67e2233;
    color: #e67e22;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
}
.contradictory-rebel-titles {
    margin-top: 6px;
}
.contradictory-title-item {
    font-size: 0.72rem;
    color: var(--text-secondary, #999);
    padding: 3px 0;
    border-bottom: 1px solid var(--border-color, #222);
    line-height: 1.3;
}
.contradictory-title-item:last-child {
    border-bottom: none;
}

/* ===== Ryzyko odejścia z klubu ===== */
.defection-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.defection-stat {
    flex: 1;
    min-width: 90px;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border: 1px solid var(--border-color, #333);
}
.defection-stat--high { border-color: #e74c3c44; background: #e74c3c11; }
.defection-stat--medium { border-color: #e67e2244; background: #e67e2211; }
.defection-stat-value { font-size: 1.4rem; font-weight: 700; color: var(--text-primary, #e0e0e0); }
.defection-stat-label { font-size: 0.72rem; color: var(--text-secondary, #999); margin-top: 2px; }
.defection-legend { margin-bottom: 12px; }
.defection-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow-y: auto;
}
.defection-item {
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 8px;
    padding: 10px 12px;
    border-left: 3px solid #27ae60;
}
.defection-item--high { border-left-color: #e74c3c; }
.defection-item--medium { border-left-color: #e67e22; }
.defection-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    font-size: 0.8rem;
}
.defection-rank { font-weight: 700; color: #e74c3c; min-width: 24px; }
.defection-name { font-weight: 600; color: var(--text-primary, #e0e0e0); }
.defection-party {
    background: var(--accent-color, #4a90d9);
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
}
.defection-score { margin-left: auto; font-weight: 700; font-size: 0.85rem; }
.defection-bar-bg {
    height: 6px;
    background: var(--bg-tertiary, #2a2a3e);
    border-radius: 3px;
    margin: 4px 0;
    overflow: hidden;
}
.defection-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}
.defection-factors {
    display: flex;
    gap: 12px;
    font-size: 0.72rem;
    color: var(--text-secondary, #999);
}
.defection-factor { cursor: help; }

/* ===== Prognoza wyniku głosowania ===== */
.vote-pred-simulation { margin-bottom: 16px; }
.vote-pred-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
}
.vote-pred-result--pass { background: #27ae6022; border: 1px solid #27ae6044; }
.vote-pred-result--fail { background: #e74c3c22; border: 1px solid #e74c3c44; }
.vote-pred-result-label { font-size: 0.8rem; color: var(--text-secondary); }
.vote-pred-result-value { font-size: 1.3rem; font-weight: 700; color: var(--text-primary, #e0e0e0); }
.vote-pred-confidence { margin-left: auto; font-size: 0.8rem; color: var(--text-secondary); }
.vote-pred-breakdown {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.vote-pred-count {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--bg-secondary, #1e1e2e);
}
.vote-pred-count--yes { color: #27ae60; }
.vote-pred-count--no { color: #e74c3c; }
.vote-pred-count--abstain { color: #95a5a6; }
.vote-pred-clubs { display: flex; flex-direction: column; gap: 8px; }
.vote-pred-club-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
}
.vote-pred-club-name {
    min-width: 110px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
}
.vote-pred-club-name small { font-weight: 400; color: var(--text-secondary); }
.vote-pred-club-bars { flex: 1; }
.vote-pred-bar-stack {
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-tertiary, #2a2a3e);
}
.vote-pred-bar-yes { background: #27ae60; }
.vote-pred-bar-no { background: #e74c3c; }
.vote-pred-bar-abstain { background: #95a5a6; }
.vote-pred-club-pcts {
    min-width: 100px;
    text-align: right;
    font-size: 0.7rem;
}
.vote-pred-recent { display: flex; flex-direction: column; gap: 4px; }
.vote-pred-recent-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 4px;
    font-size: 0.75rem;
}
.vote-pred-recent-result {
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.68rem;
    min-width: 70px;
    text-align: center;
}
.vote-pred-recent-result--pass { background: #27ae6033; color: #27ae60; }
.vote-pred-recent-result--fail { background: #e74c3c33; color: #e74c3c; }
.vote-pred-recent-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary, #e0e0e0);
}
.vote-pred-recent-votes { color: var(--text-secondary); font-size: 0.7rem; }
.vote-pred-recent-date { color: var(--text-secondary); font-size: 0.7rem; }

/* ===== Barometr napięcia ===== */
.tension-trend-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}
.tension-trend-banner--hot { background: #e74c3c22; border: 1px solid #e74c3c44; }
.tension-trend-banner--cool { background: #27ae6022; border: 1px solid #27ae6044; }
.tension-trend-banner--stable { background: var(--bg-secondary, #1e1e2e); border: 1px solid var(--border-color, #333); }
.tension-trend-emoji { font-size: 1.8rem; }
.tension-trend-label { font-size: 0.85rem; color: var(--text-primary, #e0e0e0); }
.tension-trend-slope { font-size: 0.72rem; color: var(--text-secondary); }

.tension-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 120px;
    padding: 8px 4px;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
}
.tension-chart-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 16px;
    height: 100%;
    justify-content: flex-end;
}
.tension-chart-bar {
    width: 100%;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.5s ease;
}
.tension-chart-label {
    font-size: 0.55rem;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
}

.tension-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 250px;
    overflow-y: auto;
}
.tension-detail-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 4px;
    font-size: 0.75rem;
}
.tension-detail-month { font-weight: 600; min-width: 55px; color: var(--text-primary); }
.tension-detail-score { font-weight: 700; min-width: 50px; }
.tension-detail-neg, .tension-detail-pos { font-size: 0.7rem; }
.tension-detail-count { margin-left: auto; color: var(--text-secondary); font-size: 0.68rem; }

.tension-forecast {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.tension-forecast-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 6px;
    border: 1px dashed #3498db44;
}
.tension-forecast-month { font-weight: 600; color: var(--text-primary); font-size: 0.8rem; }
.tension-forecast-score { font-weight: 700; font-size: 0.85rem; }
.tension-forecast-badge {
    background: #3498db33;
    color: #3498db;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 600;
}

/* ===== Prognoza koalicji ===== */
.coalition-matrix-wrap {
    overflow-x: auto;
    margin-bottom: 12px;
}
.coalition-matrix {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.72rem;
}
.coalition-matrix th {
    padding: 4px 6px;
    background: var(--bg-secondary, #1e1e2e);
    color: var(--text-primary, #e0e0e0);
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}
.coalition-cell {
    padding: 4px 6px;
    text-align: center;
    color: var(--text-primary, #e0e0e0);
    font-weight: 600;
    border: 1px solid var(--border-color, #333);
}
.coalition-cell--self {
    background: transparent !important;
    color: var(--text-secondary);
}
.coalition-trends { display: flex; flex-direction: column; gap: 6px; }
.coalition-trend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 6px;
    font-size: 0.78rem;
}
.coalition-trend-pair { font-weight: 600; color: var(--text-primary); min-width: 110px; }
.coalition-trend-emoji { font-size: 1rem; }
.coalition-trend-dir { font-size: 0.72rem; }
.coalition-trend-agreement { margin-left: auto; color: var(--text-secondary); font-size: 0.72rem; }

.coalition-pair-ranking { display: flex; flex-direction: column; gap: 4px; }
.coalition-pair-section { font-size: 0.78rem; color: var(--text-primary); padding: 4px 0; }
.coalition-pair-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-primary);
}
.coalition-pair-item--allies { background: #27ae6011; }
.coalition-pair-item--rivals { background: #e74c3c11; }

/* ===== Predykcja aktywności ===== */
.activity-fc-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.activity-fc-stat {
    flex: 1;
    min-width: 90px;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border: 1px solid var(--border-color, #333);
}
.activity-fc-stat--rising { border-color: #27ae6044; background: #27ae6011; }
.activity-fc-stat--falling { border-color: #e74c3c44; background: #e74c3c11; }
.activity-fc-stat-value { font-size: 1.4rem; font-weight: 700; color: var(--text-primary, #e0e0e0); }
.activity-fc-stat-label { font-size: 0.72rem; color: var(--text-secondary, #999); margin-top: 2px; }

.activity-fc-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 350px;
    overflow-y: auto;
}
.activity-fc-item {
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 8px;
    padding: 8px 12px;
    border-left: 3px solid var(--border-color, #333);
}
.activity-fc-item--rising { border-left-color: #27ae60; }
.activity-fc-item--falling { border-left-color: #e74c3c; }
.activity-fc-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.8rem;
}
.activity-fc-rank { font-weight: 700; min-width: 24px; color: var(--text-secondary); }
.activity-fc-name { font-weight: 600; color: var(--text-primary, #e0e0e0); }
.activity-fc-party {
    background: var(--accent-color, #4a90d9);
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
}
.activity-fc-trend { margin-left: auto; font-weight: 700; font-size: 0.82rem; }
.activity-fc-details {
    display: flex;
    gap: 12px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== Auto-podsumowanie posiedzeń ===== */
.session-summary-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.session-summary-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
}
.session-summary-btn {
    padding: 8px 16px;
    background: var(--primary-color, #0891b2);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.session-summary-btn:hover { background: #0e7490; }
.session-summary-hint {
    font-size: 0.72rem;
    color: var(--text-secondary);
    background: var(--bg-secondary, #1e1e2e);
    padding: 6px 10px;
    border-radius: 6px;
    border-left: 3px solid #f39c12;
}
.session-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.session-stat {
    flex: 1;
    min-width: 80px;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border-color, #333);
}
.session-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary, #e0e0e0);
}
.session-stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary, #999);
    margin-top: 2px;
}
.session-speakers { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.session-speaker-row { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; }
.session-speaker-name { min-width: 120px; font-weight: 600; color: var(--text-primary); }
.session-speaker-bar-bg { flex: 1; height: 8px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden; }
.session-speaker-bar { height: 100%; background: var(--primary-color, #0891b2); border-radius: 4px; }
.session-speaker-count { min-width: 60px; text-align: right; color: var(--text-secondary); font-size: 0.72rem; }
.session-parties { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.session-party-tag { background: var(--bg-secondary); padding: 4px 10px; border-radius: 12px; font-size: 0.75rem; color: var(--text-primary); }
.session-sentiment-bar { display: flex; height: 24px; border-radius: 6px; overflow: hidden; margin-bottom: 12px; font-size: 0.7rem; }
.session-sent-pos { background: #27ae6033; color: #27ae60; display: flex; align-items: center; justify-content: center; }
.session-sent-neu { background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; }
.session-sent-neg { background: #e74c3c33; color: #e74c3c; display: flex; align-items: center; justify-content: center; }
.session-ai-summary {
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border-color, #333);
    border-left: 3px solid var(--primary-color, #0891b2);
}
.session-ai-text { font-size: 0.82rem; line-height: 1.6; color: var(--text-primary); }

/* ===== Klasyfikacja tematyczna ===== */
.topic-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.topic-stat {
    flex: 1;
    min-width: 80px;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border-color, #333);
}
.topic-stat-value { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); }
.topic-stat-label { font-size: 0.7rem; color: var(--text-secondary); margin-top: 2px; }
.topic-chart { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.topic-chart-row { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; }
.topic-chart-name { min-width: 120px; font-weight: 600; color: var(--text-primary); }
.topic-chart-bar-bg { flex: 1; height: 14px; background: var(--bg-secondary); border-radius: 7px; overflow: hidden; }
.topic-chart-bar { height: 100%; border-radius: 7px; transition: width 0.5s ease; }
.topic-chart-count { min-width: 40px; text-align: right; color: var(--text-secondary); font-weight: 600; }
.topic-party-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-bottom: 16px; }
.topic-party-card { background: var(--bg-secondary); border-radius: 8px; padding: 10px; }
.topic-party-title { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); padding-left: 8px; margin-bottom: 6px; }
.topic-party-list { display: flex; flex-wrap: wrap; gap: 4px; }
.topic-party-item { font-size: 0.7rem; color: var(--text-secondary); background: var(--bg-color); padding: 2px 6px; border-radius: 4px; }
.topic-examples { display: flex; flex-direction: column; gap: 12px; }
.topic-example-group { }
.topic-example-title { font-size: 0.82rem; font-weight: 700; margin-bottom: 4px; }
.topic-example-item { background: var(--bg-secondary); border-radius: 6px; padding: 8px 10px; margin-bottom: 4px; }
.topic-example-header { display: flex; gap: 6px; font-size: 0.75rem; margin-bottom: 3px; color: var(--text-primary); }
.topic-example-party { background: var(--accent-color, #4a90d9); color: #fff; padding: 0 5px; border-radius: 3px; font-size: 0.65rem; }
.topic-example-date { color: var(--text-secondary); margin-left: auto; font-size: 0.68rem; }
.topic-example-text { font-size: 0.72rem; color: var(--text-secondary); line-height: 1.35; }

/* ===== Sprzeczności posła ===== */
.contradiction-info { font-size: 0.72rem; color: var(--text-secondary); margin-bottom: 8px; }
.contradiction-list { display: flex; flex-direction: column; gap: 8px; max-height: 400px; overflow-y: auto; }
.contradiction-item { background: var(--bg-secondary, #1e1e2e); border-radius: 8px; padding: 10px 12px; border-left: 3px solid #9b59b6; }
.contradiction-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.8rem; margin-bottom: 4px; }
.contradiction-rank { font-weight: 700; color: #9b59b6; min-width: 24px; }
.contradiction-name { font-weight: 600; color: var(--text-primary); }
.contradiction-party { background: var(--accent-color, #4a90d9); color: #fff; padding: 1px 6px; border-radius: 4px; font-size: 0.68rem; }
.contradiction-count { margin-left: auto; font-weight: 700; color: #e74c3c; font-size: 0.82rem; }
.contradiction-swing { margin-left: auto; font-weight: 700; color: #e67e22; font-size: 0.82rem; }
.contradiction-titles { margin-top: 4px; }
.contradiction-title-text { font-size: 0.72rem; color: var(--text-secondary); padding: 2px 0; border-bottom: 1px solid var(--border-color, #222); line-height: 1.3; }
.contradiction-title-text:last-child { border-bottom: none; }
.contradiction-shift { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 600; margin-top: 4px; }
.contradiction-arrow { color: var(--text-secondary); font-size: 1rem; }
.contradiction-topic { font-size: 0.72rem; color: #9b59b6; margin-top: 4px; line-height: 1.3; font-style: italic; }

/* ===== WIP Overlay (sekcja w budowie) ===== */
.wip-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}
.wip-overlay.hidden { display: none; }
.wip-modal {
    background: var(--bg-secondary, #1e1e2e);
    border: 1px solid var(--border-color, #333);
    border-radius: 16px;
    padding: 32px 40px;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    animation: wipFadeIn 0.3s ease;
}
@keyframes wipFadeIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
.wip-icon { font-size: 3rem; margin-bottom: 12px; }
.wip-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary, #e0e0e0);
    margin: 0 0 10px;
}
.wip-text {
    font-size: 0.85rem;
    color: var(--text-secondary, #999);
    line-height: 1.6;
    margin: 0 0 20px;
}
.wip-close-btn {
    background: var(--primary-color, #0891b2);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 28px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.wip-close-btn:hover { background: #0e7490; transform: translateY(-1px); }
.wip-close-btn:active { transform: translateY(0); }

/* ===== Changelog Modal ===== */
.changelog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 1000025;
    display: flex;
    align-items: center;
    justify-content: center;
}
.changelog-modal {
    max-width: 540px;
    width: 92%;
    text-align: left;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.changelog-modal .wip-icon { text-align: center; }
.changelog-modal .wip-title { text-align: center; margin-bottom: 16px; }
.changelog-content {
    overflow-y: auto;
    flex: 1;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.changelog-entry {
    border-left: 3px solid var(--primary-color, #0891b2);
    padding-left: 12px;
}
.changelog-version-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.changelog-badge {
    background: var(--primary-color, #0891b2);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}
.changelog-date {
    font-size: 0.75rem;
    color: var(--text-secondary, #888);
}
.changelog-desc {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
    margin-bottom: 5px;
}
.changelog-items {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
}
.changelog-items li {
    font-size: 0.8rem;
    color: var(--text-primary, #ccc);
    line-height: 1.6;
}
.changelog-modal .wip-close-btn { display: block; width: 100%; }

/* ===== Raport AI ===== */
.ai-report { }
.report-header { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--border-color, #333); }
.report-title { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); }
.report-date { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }
.report-section { margin-bottom: 16px; }
.report-section-title { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border-color, #333); }
.report-stats-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.report-stat { flex: 1; min-width: 80px; background: var(--bg-secondary); border-radius: 8px; padding: 10px; text-align: center; border: 1px solid var(--border-color); }
.report-stat-val { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); display: block; }
.report-stat-lbl { font-size: 0.68rem; color: var(--text-secondary); }
.report-club-list { display: flex; flex-direction: column; gap: 4px; }
.report-club-row { display: flex; justify-content: space-between; padding: 4px 8px; background: var(--bg-secondary); border-radius: 4px; font-size: 0.78rem; }
.report-club-name { font-weight: 600; color: var(--text-primary); }
.report-club-count { color: var(--text-secondary); }
.report-speakers { display: flex; flex-direction: column; gap: 3px; }
.report-speaker-row { display: flex; gap: 8px; align-items: center; padding: 3px 8px; background: var(--bg-secondary); border-radius: 4px; font-size: 0.78rem; color: var(--text-primary); }
.report-speaker-party { background: var(--accent-color, #4a90d9); color: #fff; padding: 0 5px; border-radius: 3px; font-size: 0.65rem; }
.report-speaker-count { margin-left: auto; color: var(--text-secondary); font-size: 0.72rem; }
.report-discipline { display: flex; flex-direction: column; gap: 3px; }
.report-disc-row { display: flex; justify-content: space-between; padding: 3px 8px; background: var(--bg-secondary); border-radius: 4px; font-size: 0.78rem; color: var(--text-primary); }
.report-sentiment { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--bg-secondary); border-radius: 8px; }
.report-sent-score { font-size: 1.5rem; font-weight: 700; }
.report-sent-label { font-size: 0.82rem; color: var(--text-secondary); }
.report-ai-box { background: var(--bg-secondary); border-radius: 8px; padding: 12px; border-left: 3px solid #9b59b6; }
.report-ai-text { font-size: 0.82rem; line-height: 1.6; color: var(--text-primary); }

/* ===== WebLLM Chat ===== */
.webllm-panel { display: flex; flex-direction: column; gap: 10px; }
.webllm-status { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--bg-secondary); border-radius: 8px; }
.webllm-status-icon { font-size: 1.5rem; }
.webllm-status-title { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.webllm-status-detail { font-size: 0.72rem; color: var(--text-secondary); }
.webllm-progress { height: 8px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden; }
.webllm-progress-bar { height: 100%; background: linear-gradient(90deg, #3498db, #2ecc71); border-radius: 4px; transition: width 0.3s; }
.webllm-progress-text { font-size: 0.72rem; color: var(--text-secondary); text-align: center; }
.webllm-controls { display: flex; gap: 8px; align-items: center; }
.webllm-controls select { flex: 1; }
.webllm-btn { padding: 8px 16px; border: none; border-radius: 6px; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.webllm-btn-load { background: var(--primary-color, #0891b2); color: #fff; }
.webllm-btn-load:hover { background: #0e7490; }
.webllm-btn-load:disabled { opacity: 0.5; cursor: not-allowed; }
.webllm-btn-send { background: #27ae60; color: #fff; min-width: 70px; }
.webllm-btn-send:hover:not(:disabled) { background: #219a52; }
.webllm-btn-send:disabled { opacity: 0.4; cursor: not-allowed; }
.webllm-info { font-size: 0.72rem; color: var(--text-secondary); background: var(--bg-secondary); padding: 8px 10px; border-radius: 6px; line-height: 1.5; }
.webllm-chat { display: flex; flex-direction: column; gap: 8px; }
.webllm-messages { max-height: 400px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px; background: var(--bg-secondary); border-radius: 8px; min-height: 100px; }
.webllm-msg { display: flex; gap: 8px; padding: 8px; border-radius: 6px; }
.webllm-msg-user { background: rgba(8, 145, 178, 0.13); border: 1px solid rgba(8, 145, 178, 0.2); }
.webllm-msg-ai { background: var(--bg-color, #121212); border: 1px solid var(--border-color, #333); }
.webllm-msg-icon { font-size: 1.2rem; min-width: 24px; }
.webllm-msg-text { font-size: 0.82rem; line-height: 1.5; color: var(--text-primary); }
.webllm-input-area { display: flex; gap: 8px; }
.webllm-input { flex: 1; padding: 8px 12px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-primary); font-size: 0.82rem; resize: none; }
.webllm-input:focus { outline: none; border-color: var(--primary-color); }
.webllm-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.webllm-quick-title { font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; }
.webllm-quick-btn { padding: 4px 10px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 12px; font-size: 0.72rem; color: var(--text-primary); cursor: pointer; transition: all 0.2s; }
.webllm-quick-btn:hover { background: rgba(8, 145, 178, 0.13); border-color: var(--primary-color, #0891b2); }

/* ===== AI Charts Module ===== */
.aicharts-panel { display: flex; flex-direction: column; gap: 10px; }
.aicharts-info { font-size: 0.78rem; color: var(--text-secondary, #999); background: var(--bg-secondary, #1e1e2e); padding: 10px 12px; border-radius: 8px; line-height: 1.5; border-left: 3px solid #3498db; }
.aicharts-input-area { display: flex; gap: 8px; align-items: flex-start; }
.aicharts-input { flex: 1; padding: 10px 14px; background: var(--bg-secondary, #1e1e2e); border: 1px solid var(--border-color, #333); border-radius: 8px; color: var(--text-primary, #e0e0e0); font-size: 0.85rem; resize: none; font-family: inherit; }
.aicharts-input:focus { outline: none; border-color: #3498db; box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15); }
.aicharts-btn-gen { padding: 10px 20px; background: linear-gradient(135deg, #3498db, #2980b9); color: #fff; border: none; border-radius: 8px; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.aicharts-btn-gen:hover { background: linear-gradient(135deg, #2980b9, #2471a3); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3); }
.aicharts-btn-gen:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.aicharts-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.aicharts-quick-title { font-size: 0.75rem; color: var(--text-secondary, #999); font-weight: 600; }
.aicharts-quick-btn { padding: 5px 12px; background: var(--bg-secondary, #1e1e2e); border: 1px solid var(--border-color, #333); border-radius: 14px; font-size: 0.74rem; color: var(--text-primary, #e0e0e0); cursor: pointer; transition: all 0.2s; }
.aicharts-quick-btn:hover { background: rgba(52, 152, 219, 0.13); border-color: #3498db; color: #3498db; }
.aicharts-status { margin-top: 4px; }
.aicharts-result { margin-top: 4px; }
.aicharts-chart-wrap { background: var(--bg-secondary, #1e1e2e); border-radius: 10px; padding: 16px; border: 1px solid var(--border-color, #333); }
.aicharts-chart-title { font-size: 1rem; font-weight: 700; color: var(--text-primary, #e0e0e0); text-align: center; margin-bottom: 12px; }
.aicharts-chart-wrap canvas { max-height: 350px; }
.aicharts-chart-desc { font-size: 0.82rem; color: var(--text-secondary, #999); text-align: center; margin-top: 10px; line-height: 1.5; }
.aicharts-sql-details { margin-top: 10px; }
.aicharts-sql-details summary { font-size: 0.75rem; color: var(--text-secondary, #999); cursor: pointer; user-select: none; }
.aicharts-sql-details summary:hover { color: #3498db; }
.aicharts-sql-code { font-size: 0.75rem; background: var(--bg-color, #121212); color: #7ec8e3; padding: 10px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin-top: 6px; border: 1px solid var(--border-color, #333); }
.aicharts-chart-meta { font-size: 0.68rem; color: var(--text-secondary, #666); text-align: right; margin-top: 8px; }
.aicharts-history { margin-top: 8px; }
.aicharts-history-list { display: flex; flex-direction: column; gap: 4px; }
.aicharts-history-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--bg-secondary, #1e1e2e); border-radius: 6px; cursor: pointer; transition: all 0.2s; font-size: 0.78rem; }
.aicharts-history-item:hover { background: rgba(52, 152, 219, 0.1); }
.aicharts-history-icon { font-size: 1rem; }
.aicharts-history-title { flex: 1; color: var(--text-primary, #e0e0e0); font-weight: 500; }
.aicharts-history-meta { font-size: 0.68rem; color: var(--text-secondary, #666); }

/* AI Badge */
.ai-badge {
    display: inline-flex; align-items: center; gap: 2px;
    font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    padding: 2px 7px; border-radius: 10px; vertical-align: middle; margin-left: 6px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    color: #fff; box-shadow: 0 0 8px rgba(139, 92, 246, 0.35);
    animation: aiBadgePulse 3s ease-in-out infinite;
}
@keyframes aiBadgePulse {
    0%, 100% { box-shadow: 0 0 8px rgba(139, 92, 246, 0.35); }
    50% { box-shadow: 0 0 14px rgba(139, 92, 246, 0.6); }
}

/* Anti-Polish Detection Module */
.antipolish-summary { display: flex; flex-direction: column; gap: 16px; }
.antipolish-summary h4 { font-size: 1.1rem; color: var(--text-primary); margin: 0; }
.antipolish-subtitle { font-size: 0.82rem; color: var(--text-secondary); margin: 0; }
.antipolish-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
.antipolish-stat { display: flex; flex-direction: column; align-items: center; padding: 12px; background: var(--bg-secondary); border-radius: 8px; border: 1px solid var(--border-color); }
.antipolish-stat-val { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); }
.antipolish-stat-label { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }
.antipolish-stat.severity-high { border-color: #e53e3e; }
.antipolish-stat.severity-medium { border-color: #dd6b20; }
.antipolish-stat.severity-low { border-color: #ecc94b; }
.antipolish-categories h5, .antipolish-clubs h5, .antipolish-speakers h5, .antipolish-flagged h5 { font-size: 0.9rem; color: var(--text-primary); margin: 0 0 8px 0; }
.antipolish-cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.antipolish-cat { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-secondary); border-radius: 6px; }
.antipolish-cat-icon { font-size: 1.1rem; }
.antipolish-cat-name { flex: 1; font-size: 0.82rem; color: var(--text-primary); }
.antipolish-cat-count { font-weight: 700; font-size: 0.9rem; color: var(--text-primary); }
.antipolish-club-list { display: flex; flex-direction: column; gap: 6px; }
.antipolish-club-row { display: flex; align-items: center; gap: 10px; }
.antipolish-club-name { width: 70px; font-size: 0.8rem; font-weight: 600; color: var(--text-primary); text-align: right; }
.antipolish-club-bar { flex: 1; height: 8px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden; }
.antipolish-club-fill { height: 100%; background: linear-gradient(90deg, #e53e3e, #dd6b20); border-radius: 4px; transition: width 0.5s; }
.antipolish-club-cnt { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); min-width: 30px; }
.antipolish-speaker-list { display: flex; flex-direction: column; gap: 4px; }
.antipolish-speaker-row { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 4px; }
.antipolish-speaker-row:nth-child(odd) { background: var(--bg-secondary); }
.antipolish-speaker-rank { font-size: 0.72rem; color: var(--text-secondary); font-weight: 700; min-width: 24px; }
.antipolish-speaker-name { flex: 1; font-size: 0.82rem; color: var(--text-primary); }
.antipolish-speaker-cnt { font-size: 0.72rem; color: var(--text-secondary); }
.antipolish-list { display: flex; flex-direction: column; gap: 10px; }
.antipolish-item { padding: 12px; background: var(--bg-secondary); border-radius: 8px; border: 1px solid var(--border-color); }
.antipolish-item.severity-high { border-left: 3px solid #e53e3e; }
.antipolish-item.severity-medium { border-left: 3px solid #dd6b20; }
.antipolish-item.severity-low { border-left: 3px solid #ecc94b; }
.antipolish-item-header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.antipolish-item-speaker { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); }
.antipolish-item-club { font-size: 0.72rem; padding: 1px 6px; background: var(--bg-color); border-radius: 4px; color: var(--text-secondary); }
.antipolish-item-date { font-size: 0.72rem; color: var(--text-secondary); margin-left: auto; }
.antipolish-item-severity { font-size: 0.68rem; font-weight: 700; }
.severity-tag-high { color: #e53e3e; }
.severity-tag-medium { color: #dd6b20; }
.severity-tag-low { color: #ecc94b; }
.antipolish-item-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.antipolish-tag { font-size: 0.68rem; padding: 2px 6px; border: 1px solid; border-radius: 4px; background: transparent; }
.antipolish-item-text { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 6px; }
.antipolish-item-matches { font-size: 0.7rem; color: var(--text-secondary); }
.antipolish-item-matches code { font-size: 0.68rem; background: rgba(229, 62, 62, 0.15); color: #e53e3e; padding: 1px 4px; border-radius: 3px; }
.antipolish-ai { margin-top: 4px; }
.antipolish-ai-result { padding: 12px; background: var(--bg-secondary); border-radius: 8px; border: 1px solid var(--primary-color, #6366f1); margin-top: 8px; }
.antipolish-ai-result h5 { margin: 0 0 8px; font-size: 0.9rem; }
.antipolish-ai-text { font-size: 0.82rem; line-height: 1.6; color: var(--text-primary); }
.antipolish-disclaimer { font-size: 0.72rem; color: var(--text-secondary); font-style: italic; padding: 8px; background: rgba(236, 201, 75, 0.1); border-radius: 6px; border-left: 3px solid #ecc94b; margin: 0; }

/* Ghost Voting Module */
.ghost-summary { display: flex; flex-direction: column; gap: 16px; }
.ghost-summary h4 { font-size: 1.1rem; color: var(--text-primary); margin: 0; }
.ghost-subtitle { font-size: 0.82rem; color: var(--text-secondary); margin: 0; }
.ghost-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.ghost-stat { display: flex; flex-direction: column; align-items: center; padding: 12px; background: var(--bg-secondary); border-radius: 8px; border: 1px solid var(--border-color); }
.ghost-stat-critical { border-color: #e53e3e; background: rgba(229, 62, 62, 0.06); }
.ghost-stat-val { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); }
.ghost-stat-label { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; text-align: center; }
.ghost-explanation { font-size: 0.78rem; color: var(--text-secondary); padding: 10px 12px; background: var(--bg-secondary); border-radius: 6px; border-left: 3px solid var(--primary-color, #0891b2); }
.ghost-explanation ul { margin: 4px 0 0 16px; padding: 0; }
.ghost-explanation li { margin-bottom: 2px; }
.ghost-clubs h5, .ghost-mps h5, .ghost-events h5 { font-size: 0.9rem; color: var(--text-primary); margin: 0 0 8px 0; }
.ghost-club-list { display: flex; flex-direction: column; gap: 6px; }
.ghost-club-row { display: flex; align-items: center; gap: 10px; }
.ghost-club-name { width: 70px; font-size: 0.8rem; font-weight: 600; color: var(--text-primary); text-align: right; }
.ghost-club-bar { flex: 1; height: 8px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden; }
.ghost-club-fill { height: 100%; background: linear-gradient(90deg, #805ad5, #e53e3e); border-radius: 4px; transition: width 0.5s; }
.ghost-club-cnt { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); min-width: 30px; }
.ghost-mp-list { display: flex; flex-direction: column; gap: 4px; }
.ghost-mp-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 4px; }
.ghost-mp-row:nth-child(odd) { background: var(--bg-secondary); }
.ghost-mp-rank { font-size: 0.72rem; color: var(--text-secondary); font-weight: 700; min-width: 24px; }
.ghost-mp-name { flex: 1; font-size: 0.82rem; color: var(--text-primary); font-weight: 500; }
.ghost-mp-club { font-size: 0.7rem; padding: 1px 6px; background: var(--bg-color); border-radius: 4px; color: var(--text-secondary); }
.ghost-mp-count { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); min-width: 30px; text-align: right; }
.ghost-mp-crit { font-size: 0.72rem; min-width: 36px; }
.ghost-event-list { display: flex; flex-direction: column; gap: 10px; }
.ghost-event { padding: 12px; background: var(--bg-secondary); border-radius: 8px; border: 1px solid var(--border-color); }
.ghost-critical { border-left: 3px solid #e53e3e; }
.ghost-warning { border-left: 3px solid #dd6b20; }
.ghost-info { border-left: 3px solid #ecc94b; }
.ghost-event-header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.ghost-event-mp { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); }
.ghost-event-club { font-size: 0.7rem; padding: 1px 6px; background: var(--bg-color); border-radius: 4px; color: var(--text-secondary); }
.ghost-event-date { font-size: 0.72rem; color: var(--text-secondary); margin-left: auto; }
.ghost-event-dist { font-size: 0.72rem; font-weight: 700; }
.ghost-event-detail { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ghost-event-absent, .ghost-event-voted { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: 6px; background: var(--bg-color); }
.ghost-label-absent { font-size: 0.78rem; font-weight: 600; color: #e53e3e; }
.ghost-label-voted { font-size: 0.78rem; font-weight: 600; color: #48bb78; }
.ghost-event-nr { font-size: 0.68rem; color: var(--text-secondary); }
.ghost-event-title { font-size: 0.72rem; color: var(--text-secondary); line-height: 1.4; }
.ghost-event-arrow { font-size: 1.1rem; flex-shrink: 0; }
.ghost-disclaimer { font-size: 0.72rem; color: var(--text-secondary); font-style: italic; padding: 8px; background: rgba(236, 201, 75, 0.1); border-radius: 6px; border-left: 3px solid #ecc94b; margin: 0; }

/* Web Intel Module */
.webintel-panel { display: flex; flex-direction: column; gap: 14px; }
.webintel-panel h4 { font-size: 1.1rem; color: var(--text-primary); margin: 0; }
.webintel-desc { font-size: 0.82rem; color: var(--text-secondary); margin: 0; }
.webintel-input-area { display: flex; gap: 8px; align-items: flex-end; }
.webintel-input { flex: 1; padding: 8px 12px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-primary); font-size: 0.85rem; resize: none; font-family: inherit; }
.webintel-input:focus { outline: none; border-color: var(--primary-color); }
.webintel-input:disabled { opacity: 0.5; }
.webintel-quick, .webintel-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.webintel-quick-title { font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; width: 100%; }
.webintel-quick-btn { padding: 4px 10px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 12px; font-size: 0.72rem; color: var(--text-primary); cursor: pointer; transition: all 0.2s; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.webintel-quick-btn:hover { background: rgba(99, 102, 241, 0.15); border-color: #6366f1; }
.webintel-results { margin-top: 4px; }
.webintel-result { padding: 16px; background: var(--bg-secondary); border-radius: 10px; border: 1px solid var(--border-color); }
.webintel-result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.webintel-result-q { font-size: 0.85rem; font-weight: 600; color: var(--primary-color, #6366f1); }
.webintel-result-time { font-size: 0.68rem; color: var(--text-secondary); }
.webintel-result-text { font-size: 0.85rem; line-height: 1.7; color: var(--text-primary); }
.webintel-queries { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 10px; }
.webintel-queries-label { font-size: 0.7rem; color: var(--text-secondary); }
.webintel-query-tag { font-size: 0.68rem; padding: 2px 8px; background: rgba(99, 102, 241, 0.12); color: #818cf8; border-radius: 10px; }
.webintel-sources { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-color); }
.webintel-sources h6 { font-size: 0.82rem; color: var(--text-primary); margin: 0 0 8px; }
.webintel-source-list { display: flex; flex-direction: column; gap: 4px; }
.webintel-source-link { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--primary-color, #6366f1); text-decoration: none; padding: 4px 8px; border-radius: 4px; transition: background 0.2s; }
.webintel-source-link:hover { background: rgba(99, 102, 241, 0.1); text-decoration: underline; }
.webintel-source-icon { font-size: 0.7rem; }
.webintel-history-section { margin-top: 8px; }
.webintel-history-section h6 { font-size: 0.82rem; color: var(--text-primary); margin: 0 0 6px; }
.webintel-history-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-radius: 6px; cursor: pointer; transition: background 0.2s; }
.webintel-history-item:hover { background: var(--bg-secondary); }
.webintel-history-q { font-size: 0.78rem; color: var(--text-primary); }
.webintel-history-meta { font-size: 0.68rem; color: var(--text-secondary); white-space: nowrap; }

/* Empty State */
.predictions-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.predictions-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.predictions-empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.predictions-empty-state p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
}

.predictions-empty-actions {
    display: flex;
    gap: 1rem;
}

.prediction-btn-primary,
.prediction-btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.prediction-btn-primary {
    background: #667eea;
    color: white;
}

.prediction-btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

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

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

/* Online Analysis Styles */
.prediction-load-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.prediction-load-btn:hover {
    background: #059669;
}

.prediction-load-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.online-analyzer-intro {
    text-align: center;
    padding: 2rem 1rem;
}

.online-analyzer-intro p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.online-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.online-source-tag {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.online-articles-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.online-article-item {
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    border-left: 3px solid #667eea;
    transition: transform 0.2s;
}

.online-article-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.online-article-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.online-article-source {
    font-weight: 600;
    color: #667eea;
    font-size: 0.85rem;
}

.online-article-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.online-article-title {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.online-article-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.online-sentiment {
    font-weight: 600;
}

.online-relevance {
    color: var(--text-secondary);
}

.online-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.online-keyword-tag {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
}

.online-summary {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.online-summary strong {
    color: var(--text-primary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .predictions-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    
    .coalition-table {
        font-size: 0.75rem;
    }
    
    .coalition-table th,
    .coalition-table td {
        padding: 0.4rem;
    }
}

/* ============================================
   HELP SYSTEM v3.0
   Marker mode — blocks everything except ESC
   ============================================ */

/* Body when help is active */
.help-active {
    overflow: hidden !important;
}

/* Transparent shield over entire page */
.help-shield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000000;
    cursor: help;
    display: none;
    background: transparent;
}

/* Highlighted element — NO z-index, stays below shield (shield is transparent) */
.help-highlighted {
    outline: 4px solid #facc15 !important;
    outline-offset: 4px;
    box-shadow: 0 0 0 10px rgba(250, 204, 21, 0.35),
                0 0 30px rgba(250, 204, 21, 0.5),
                inset 0 0 0 2px rgba(250, 204, 21, 0.2) !important;
    border-radius: 6px;
    background-color: rgba(250, 204, 21, 0.08) !important;
    transition: outline 0.15s, box-shadow 0.15s, background-color 0.15s;
}

/* === TOOLTIP === */
.help-tooltip {
    position: fixed;
    background: #1a1a2e;
    color: #e0e0e0;
    border: 2px solid #facc15;
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    max-width: 380px;
    min-width: 260px;
    z-index: 1000010;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 16px rgba(250, 204, 21, 0.2);
    display: none;
    animation: helpTooltipIn 0.25s ease;
    font-family: inherit;
}

@keyframes helpTooltipIn {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.help-tooltip-close {
    position: absolute;
    top: 0.5rem;
    right: 0.6rem;
    background: transparent;
    border: none;
    font-size: 1.3rem;
    color: #888;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    z-index: 1000011;
}
.help-tooltip-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.help-tooltip-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #facc15;
    margin: 0 0 0.5rem 0;
    padding-right: 2rem;
}

.help-tooltip-desc {
    font-size: 0.92rem;
    color: #ccc;
    line-height: 1.55;
    margin: 0;
}

/* === Mobile === */
@media (max-width: 768px) {
    .help-tooltip {
        max-width: 90vw;
        min-width: 220px;
        padding: 1rem;
    }
    .help-tooltip-title { font-size: 1rem; }
    .help-tooltip-desc { font-size: 0.85rem; }
}

/* === Help Exit Button (mobile / touch) === */
.help-exit-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1000020;
    background: #ef4444;
    color: #fff;
    border: 2px solid #fca5a5;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
    animation: helpExitIn 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.help-exit-btn:hover { background: #dc2626; }
.help-exit-btn:active { transform: scale(0.95); }
@keyframes helpExitIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===================== KEY VAULT & PIN MODAL ===================== */

/* Inline vault status (next to API key input) */
.vault-status-inline {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.vault-lock-icon {
    font-size: 0.85rem;
}

.vault-btn-inline {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 4px;
    transition: all 0.15s;
}
.vault-btn-inline:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Vault settings panel (in Settings section) */
.vault-settings-panel {
    padding: 4px 0;
}

.vault-settings-row {
    margin-bottom: 10px;
}

.vault-settings-row label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.vault-mode-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
}
.vault-mode-select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.vault-settings-descriptions {
    margin-bottom: 10px;
}

.vault-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
    padding: 6px 10px;
    background: rgba(16, 185, 129, 0.05);
    border-left: 3px solid #10b981;
    border-radius: 0 6px 6px 0;
}

.vault-settings-actions {
    display: flex;
    gap: 8px;
}

/* PIN Modal overlay */
.pin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    animation: pinFadeIn 0.2s ease;
}

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

.pin-modal {
    background: white;
    border-radius: 16px;
    padding: 28px 32px;
    width: 340px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: pinSlideIn 0.25s ease;
}

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

.pin-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.pin-modal-icon {
    font-size: 1.5rem;
}

.pin-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.pin-modal-desc {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 18px;
    line-height: 1.4;
}

.pin-input-group {
    margin-bottom: 14px;
}

.pin-input-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
}

.pin-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.2rem;
    font-family: monospace;
    letter-spacing: 6px;
    text-align: center;
    transition: border-color 0.2s;
}

.pin-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.pin-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.82rem;
    margin-bottom: 14px;
}

.pin-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.pin-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.pin-btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}
.pin-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.pin-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}
.pin-btn-secondary:hover {
    background: #e5e7eb;
}

.pin-remember-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #64748b;
    width: 100%;
    margin-top: 4px;
    cursor: pointer;
}

.pin-remember-label input[type="checkbox"] {
    accent-color: #10b981;
}

/* Dark mode adjustments for vault */
@media (prefers-color-scheme: dark) {
    .pin-modal {
        background: #1e293b;
        color: #e2e8f0;
    }
    .pin-modal-header h3 { color: #f1f5f9; }
    .pin-modal-desc { color: #94a3b8; }
    .pin-input-group label { color: #cbd5e1; }
    .pin-input {
        background: #0f172a;
        border-color: #334155;
        color: #e2e8f0;
    }
    .pin-input:focus { border-color: #10b981; }
    .pin-error { background: #450a0a; border-color: #7f1d1d; color: #fca5a5; }
    .pin-btn-secondary { background: #334155; color: #e2e8f0; border-color: #475569; }
    .pin-btn-secondary:hover { background: #475569; }
    .vault-status-inline { color: #94a3b8; }
    .vault-btn-inline { background: #334155; color: #e2e8f0; border-color: #475569; }
    .vault-btn-inline:hover { background: #475569; }
    .vault-mode-select { background: #0f172a; color: #e2e8f0; border-color: #334155; }
    .vault-desc { background: rgba(16, 185, 129, 0.08); color: #94a3b8; }
}

/* =====================================================
   ANALIZA AGRESJI PARLAMENTARNEJ
   ===================================================== */

/* Zakładki */
.aggr-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--border-color, #333);
    padding-bottom: 0;
}
.aggr-tab {
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #aaa);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    border-radius: 6px 6px 0 0;
}
.aggr-tab:hover { color: var(--text-primary, #e0e0e0); background: var(--bg-secondary, #1e1e2e); }
.aggr-tab--active {
    color: var(--text-primary, #e0e0e0);
    border-bottom-color: #e74c3c;
    background: var(--bg-secondary, #1e1e2e);
}

/* Podsumowanie */
.aggr-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 8px;
}
.aggr-stat {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    background: var(--bg-color, #151520);
}
.aggr-stat--red { border-left: 3px solid #e74c3c; }
.aggr-stat--blue { border-left: 3px solid #3498db; }
.aggr-stat-value { font-size: 1.2rem; font-weight: 700; color: var(--text-primary, #e0e0e0); }
.aggr-stat-label { font-size: 0.72rem; color: var(--text-secondary, #aaa); margin-top: 2px; }

/* Opis */
.aggr-desc {
    font-size: 0.8rem;
    color: var(--text-secondary, #aaa);
    margin: 0 0 12px;
    line-height: 1.4;
}

/* Ranking - wspólne */
.aggr-ranking { display: flex; flex-direction: column; gap: 10px; }
.aggr-rank-item {
    padding: 10px;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 8px;
    border: 1px solid var(--border-color, #333);
}
.aggr-rank-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.aggr-rank-pos { font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); min-width: 28px; }
.aggr-rank-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.aggr-rank-party { font-size: 0.72rem; padding: 1px 6px; background: var(--bg-color); border-radius: 4px; color: var(--text-secondary); }
.aggr-rank-value { font-size: 0.82rem; font-weight: 700; color: #e74c3c; margin-left: auto; }
.aggr-rank-rate { font-size: 0.72rem; color: var(--text-secondary); }

/* Paski */
.aggr-rank-bar-bg { height: 6px; background: var(--bg-color, #151520); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.aggr-rank-bar { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.aggr-rank-bar--red { background: linear-gradient(90deg, #e74c3c, #c0392b); }
.aggr-rank-bar--orange { background: linear-gradient(90deg, #f39c12, #e67e22); }
.aggr-rank-bar--blue { background: linear-gradient(90deg, #3498db, #2980b9); }
.aggr-rank-bar--green { background: linear-gradient(90deg, #27ae60, #2ecc71); }

/* Przykłady */
.aggr-examples { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.aggr-example {
    padding: 8px;
    background: var(--bg-color, #151520);
    border-radius: 6px;
    border-left: 3px solid #e74c3c33;
    font-size: 0.78rem;
}
.aggr-example-arrow { margin-bottom: 6px; }
.aggr-example-reaction { padding-top: 6px; border-top: 1px dashed var(--border-color, #333); }
.aggr-example-first { /* inicjacja */ }
.aggr-example-speaker { font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.aggr-example-text { color: var(--text-secondary); line-height: 1.4; font-style: italic; }
.aggr-example-date { font-size: 0.7rem; color: var(--text-secondary); margin-top: 4px; opacity: 0.7; }

/* Słowa kluczowe */
.aggr-keywords { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.aggr-keyword {
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 3px;
    background: #e74c3c22;
    color: #e74c3c;
    border: 1px solid #e74c3c44;
    font-weight: 600;
}
.aggr-keyword--calm {
    background: #27ae6022;
    color: #27ae60;
    border-color: #27ae6044;
    font-style: italic;
    font-weight: 500;
}

/* Frazy spokoju */
.aggr-calm-summary {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 10px;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 8px;
}
.aggr-calm-stat { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }

.aggr-calm-phrases { display: flex; flex-direction: column; gap: 6px; }
.aggr-calm-phrase-item {
    padding: 8px 10px;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 6px;
}
.aggr-calm-phrase-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.aggr-calm-phrase-rank { font-size: 0.72rem; font-weight: 700; color: var(--text-secondary); min-width: 24px; }
.aggr-calm-phrase-text { font-size: 0.82rem; color: var(--text-primary); font-style: italic; flex: 1; }
.aggr-calm-phrase-count { font-size: 0.82rem; font-weight: 700; color: #3498db; }
.aggr-calm-phrase-speakers { font-size: 0.72rem; color: var(--text-secondary); }

.aggr-calm-used-phrases { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }

/* Werdykt szablonowości */
.aggr-scripted-verdict {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 8px;
    border: 1px solid var(--border-color, #333);
}
.aggr-verdict { font-size: 0.82rem; line-height: 1.5; margin: 6px 0 0; }
.aggr-verdict--scripted { color: #f39c12; }
.aggr-verdict--organic { color: #27ae60; }

/* ===================== EMOGAME — Rocket mini-game ===================== */

#emogame-container {
    position: fixed;
    inset: 0;
    z-index: 999990;
    pointer-events: none;
    overflow: hidden;
}

#emogame-ship {
    position: absolute;
    font-size: 28px;
    user-select: none;
    pointer-events: none;
    transition: transform 0.05s linear;
    filter: drop-shadow(0 0 6px rgba(255, 200, 50, 0.6));
    z-index: 999995;
}

.emogame-bullet {
    position: absolute;
    color: #0f0;
    font-size: 16px;
    pointer-events: none;
    text-shadow: 0 0 4px #0f0;
}

.emogame-flash {
    animation: emogameFlash 0.2s linear !important;
}

@keyframes emogameFlash {
    0%   { filter: brightness(300%) drop-shadow(0 0 8px #fff); }
    100% { filter: brightness(100%); }
}

.emogame-hole {
    position: absolute;
    width: 40px;
    height: 40px;
    background: #000;
    pointer-events: none;
    filter: blur(2px);
    z-index: 999991;
}

.emogame-fragment {
    position: absolute;
    pointer-events: none;
    z-index: 999992;
}

.emogame-smoke {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(3px);
    opacity: 1;
    transition: opacity 1s linear, transform 1s linear;
    z-index: 999992;
}

.emogame-spark {
    position: absolute;
    width: 3px;
    height: 3px;
    pointer-events: none;
    border-radius: 50%;
    opacity: 1;
    transition: opacity 0.4s linear;
    z-index: 999992;
}

#emogame-hint {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.85rem;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    pointer-events: none;
    z-index: 999999;
    transition: opacity 1s ease;
    white-space: nowrap;
}

#emogame-hint b {
    color: #facc15;
}

#emogame-close {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 999999;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.85);
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    pointer-events: auto;
    backdrop-filter: blur(4px);
    transition: background 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}
#emogame-close:hover { background: #dc2626; transform: scale(1.1); }
#emogame-close:active { transform: scale(0.95); }

/* =============================================================================
   Consent Banner (GDPR)
   ============================================================================= */
.consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100000;
    background: var(--card-bg, #1e1e2e);
    border-top: 1px solid var(--border-color, #333);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}
.consent-banner--visible {
    opacity: 1;
    transform: translateY(0);
}
.consent-banner--hidden {
    opacity: 0;
    transform: translateY(100%);
}
.consent-text {
    font-size: 0.9rem;
    color: var(--text-secondary, #a0a0b0);
    flex: 1;
}
.consent-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.consent-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.consent-btn--accept {
    background: var(--primary-color, #667eea);
    color: #fff;
}
.consent-btn--accept:hover {
    filter: brightness(1.15);
}
.consent-btn--reject {
    background: transparent;
    color: var(--text-secondary, #a0a0b0);
    border: 1px solid var(--border-color, #444);
}
.consent-btn--reject:hover {
    background: rgba(255, 255, 255, 0.05);
}
@media (max-width: 600px) {
    .consent-banner {
        flex-direction: column;
        text-align: center;
        padding: 14px 16px;
    }
    .consent-buttons {
        width: 100%;
        justify-content: center;
    }
}
