/* --- THEME VARIABLEN --- */
/* --- LOCAL FONTS --- */
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/space-grotesk-700.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/inter-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/inter-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/inter-700.woff2') format('woff2');
}

:root {
    /* --- COMMON VARIABLES (Can be overridden by themes) --- */
    --font-stack-base: 'Segoe UI', Helvetica, Arial, sans-serif;
    --font-stack-headings: 'Segoe UI', Helvetica, Arial, sans-serif;

    --border-width: 1px;
    --border-radius: 4px;
    --border-radius-pill: 24px;
    --border-radius-circle: 50%;

    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.1);
    --shadow-hard: none;

    /* --- CLASSIC THEME (Default) --- */
    --bg-body: #f4f7f6;
    --bg-sidebar: #2c3e50;
    --bg-brand: #1a252f;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-nav-hover: #34495e;
    --bg-nav-active: #3e5871;
    --bg-header: #ffffff;
    --bg-table-header: #f8f9fa;
    --bg-table-hover: #fbfbfb;

    --bg-box-light: #f9f9f9;
    /* New variable for the white boxes */
    --border-box-light: #eee;

    --text-main: #333333;
    --text-light: #ecf0f1;
    /* Muted-Text auf HELLEM Hintergrund — #546e7a = ~6.6:1 auf #fff, WCAG AA konform */
    --text-muted: #546e7a;
    /* Content subtext, dunkler als früher (#7f8c8d → 4.6:1) für bessere Lesbarkeit */
    --text-sub: #4a5560;
    /* Eigenes helles Muted für dunklen Sidebar-BG */
    --text-sidebar-muted: #bdc3c7;

    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --primary-text: #ffffff;

    --border-color: #dfe6e9;

    /* Status Colors */
    --status-green-bg: #e8f5e9;
    --status-green-text: #2e7d32;
    --status-green-border: #c8e6c9;

    --status-red-bg: #ffebee;
    --status-red-text: #c62828;
    --status-red-border: #ffcdd2;

    --status-blue-bg: #e3f2fd;
    --status-blue-text: #1565c0;
    --status-blue-border: #bbdefb;

    --status-gray-bg: #f5f5f5;
    --status-gray-text: #666666;
    --status-gray-border: #dddddd;

    --status-orange-bg: #fff3e0;
    --status-orange-text: #ef6c00;
    --status-orange-border: #ffe0b2;

    --status-yellow-bg: #fffde7;
    --status-yellow-text: #fbc02d;
    --status-yellow-border: #fff9c4;
}

/* --- LUCIDE ICON HELPERS --- */
.lucide-inline {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
    display: inline-block;
    flex-shrink: 0;
}

.lucide-spin {
    animation: lucide-spin 1s linear infinite;
}

@keyframes lucide-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* --- GLOBAL --- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-stack-base);
    height: 100vh;
    display: flex;
    overflow: hidden;
    background: var(--bg-body);
    color: var(--text-main);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-stack-headings);
}

/* SIDEBAR */
.sidebar {
    width: 250px;
    background: var(--bg-sidebar);
    color: var(--text-light);
    /* Watch out for contrast in SEO theme */
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: var(--border-width) solid var(--border-color);
}

/* SEO Sachsen Adjustments for Sidebar */

.brand {
    padding: 20px;
    font-size: 18px;
    font-weight: bold;
    background: var(--bg-brand);
    border-bottom: 1px solid var(--bg-nav-hover);
    letter-spacing: 0.5px;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.nav-item {
    padding: 12px 20px;
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: 0.2s;
    font-size: 13px;
    color: var(--text-sidebar-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
    opacity: 1;
}

.nav-sub {
    padding-left: 40px;
    font-size: 12px;
}

.nav-item:hover {
    background: var(--bg-nav-hover);
    color: white;
    /* Default fallback */
}

.nav-item.active {
    background: var(--bg-nav-active);
    border-left-color: var(--primary-color);
    font-weight: 600;
    color: white;
}

.nav-divider {
    height: 1px;
    background: var(--bg-nav-hover);
    margin: 10px 0;
}

/* CONTENT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    background: var(--bg-header);
    padding: 15px 25px;
    border-bottom: var(--border-width) solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    box-sizing: border-box;
}

/* SEO.SACHSEN needs more height to accommodate thick borders and shadows */

/* Fix button and input sizing in SEO.SACHSEN top-bar */

.view {
    display: none;
    padding: 25px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.view.active {
    display: block;
    position: relative;
    overflow-x: auto;
}

/* INPUTS & BUTTONS */
.start-bar {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 900px;
}

input.main-url-input,
input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
    flex: 1;
    padding: 10px;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    background: var(--bg-input);
    color: var(--text-main);
    font-family: var(--font-stack-base);
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-app-region: no-drag !important;
    pointer-events: auto !important;
}

button.primary-btn {
    padding: 10px 25px;
    background: var(--primary-color);
    color: var(--primary-text);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

button.primary-btn:hover {
    background: var(--primary-hover);
}

button.primary-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
}

button.secondary-btn {
    /* Base styles for secondary buttons created dynamically */
    padding: 8px 15px;
    cursor: pointer;
    border-radius: var(--border-radius);
    font-size: 13px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

/* TABLES */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    font-size: 13px;
    margin-top: 10px;
}

.data-table th {
    background: var(--bg-table-header);
    text-align: left;
    padding: 12px 15px;
    color: var(--text-sub);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--status-gray-border);
    color: var(--text-main);
    vertical-align: top;
    word-wrap: break-word;
}

.data-table tr:hover {
    background: var(--bg-table-hover);
}

/* Resizable Columns – Trennlinie läuft durch gesamte Tabelle */
.col-resizable th,
.col-resizable td {
    border-right: 1px solid var(--border-color);
}

.col-resizable th:last-child,
.col-resizable td:last-child {
    border-right: none;
}

/* Unsichtbarer, breiter Griff über der Trennlinie */
.resize-handle {
    position: absolute;
    top: 0;
    right: -4px;
    width: 9px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    z-index: 20;
    background: transparent;
}

.resize-handle:hover::after,
.resize-handle.dragging::after {
    content: '';
    display: block;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: #4a90d9;
}

/* SETTINGS STYLES */
.settings-panel {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    max-width: 700px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-group select,
.form-group input {
    width: 100%;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.settings-box {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    background: var(--bg-card);
}

.box-title {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
    color: var(--text-sub);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--bg-body);
}

/* SWITCH */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(18px);
}

/* BADGES */
.badge {
    padding: 3px 8px;
    border-radius: var(--border-radius);
    font-size: 11px;
    font-weight: bold;
    display: inline-block;
    white-space: nowrap;
}

.badge-green {
    background: var(--status-green-bg);
    color: var(--status-green-text);
    border: 1px solid var(--status-green-border);
}

.badge-red {
    background: var(--status-red-bg);
    color: var(--status-red-text);
    border: 1px solid var(--status-red-border);
}

.badge-blue {
    background: var(--status-blue-bg);
    color: var(--status-blue-text);
    border: 1px solid var(--status-blue-border);
}

.badge-gray {
    background: var(--status-gray-bg);
    color: var(--status-gray-text);
    border: 1px solid var(--status-gray-border);
}

.badge-orange {
    background: var(--status-orange-bg);
    color: var(--status-orange-text);
    border: 1px solid var(--status-orange-border);
}

.badge-yellow {
    background: var(--status-yellow-bg);
    color: var(--status-yellow-text);
    border: 1px solid var(--status-yellow-border);
}

.url-cell-wrap {
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.url-cell {
    color: var(--primary-color);
    text-decoration: none;
    flex: 1;
    min-width: 0;
    white-space: normal !important;
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.4;
    margin-bottom: 2px;
}

.ext-link-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    margin-top: 1px;
    background: none;
    border: none;
    border-radius: 3px;
    color: var(--text-muted, #aaa);
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s, color 0.15s;
    line-height: 1;
}
.ext-link-btn:hover {
    opacity: 1;
    color: var(--primary-color);
}

/* PSI-Anbindung */
.api-key-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.api-key-wrapper .api-key-input {
    flex: 1;
    padding-right: 40px;
}

.api-key-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s;
}

.api-key-toggle:hover {
    color: var(--text-main);
}

.api-key-input {
    font-family: monospace;
    letter-spacing: 1px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 13px;
}

.warning-box {
    background: var(--status-orange-bg);
    color: var(--status-orange-text);
    padding: 10px;
    border-radius: var(--border-radius);
    font-size: 12px;
    margin-top: 10px;
    border: 1px solid var(--status-orange-border);
    display: none;
}

/* --- PROJEKT DASHBOARD STYLES --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    border: 1px solid transparent;
    border-left: 4px solid var(--primary-color);
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.project-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-main);
}

.project-url {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-date {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.delete-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--status-red-text);
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
    border-radius: 50%;
    font-weight: bold;
    opacity: 0;
    transition: 0.2s;
}

.delete-icon:hover {
    background: var(--status-red-bg);
    opacity: 1 !important;
    transform: scale(1.1);
}

.project-card:hover .delete-icon {
    opacity: 0.4;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.modal-box {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 6px;
    width: 450px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* Helper Text */
.form-hint,
p,
label {
    color: var(--text-main);
}

h2,
h3,
h4 {
    color: var(--text-main);
}

.box-title {
    color: var(--text-sub);
}

.box-light {
    background: var(--bg-box-light) !important;
    border: 1px solid var(--border-box-light) !important;
}

/* Specific fix for Structure Filter */
#filterStructure {
    max-width: 200px;
}

.btn-action-view,
.btn-action-delete,
.btn-action-generic {
    padding: 6px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 13px;
    border: 1px solid transparent;
    transition: all 0.2s;
    /* Defaults for Classic/Dark */
    color: white;
}

.btn-action-view {
    background: var(--status-blue-border);
    color: var(--status-blue-text);
    border-color: var(--status-blue-text);
}

.btn-action-delete {
    background: var(--status-red-border);
    color: var(--status-red-text);
    border-color: var(--status-red-text);
}

.btn-action-view {
    background: #3498db;
    color: white;
    border: none;
}

.btn-action-delete {
    background: #e74c3c;
    color: white;
    border: none;
}

/* Fix for Live Log Reset Button & Inputs in Index.html */
.input-reset-override {
    border: var(--border-width) solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
    padding: 6px !important;
}

.btn-reset-override {
    background: var(--status-gray-bg) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
}

/* --- CONTENT WRITER EDITOR --- */
.cw-editor-toolbar .editor-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
}

.cw-editor-toolbar .editor-btn:hover {
    background: var(--bg-nav-hover);
    color: white;
    border-color: var(--primary-color);
}

.cw-editor-toolbar .editor-btn.active {
    background: var(--primary-color);
    color: white;
}

.cw-editor-content {
    background: var(--bg-card);
    color: var(--text-main);
    overflow-y: auto;
}

.cw-editor-content:empty:before {
    content: attr(placeholder);
    color: var(--text-muted);
    font-style: italic;
}

/* Proportional Header Styling in Editor */
.cw-editor-content h1 {
    font-size: 24px;
    margin-top: 20px;
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.cw-editor-content h2 {
    font-size: 20px;
    margin-top: 18px;
    margin-bottom: 12px;
    color: var(--text-main);
    font-weight: 700;
}

.cw-editor-content h3 {
    font-size: 18px;
    margin-top: 15px;
    margin-bottom: 10px;
    color: var(--text-main);
    font-weight: 600;
}

.cw-editor-content p {
    margin-bottom: 15px;
    line-height: 1.7;
}

.cw-editor-content ul, .cw-editor-content ol {
    margin-bottom: 15px;
    padding-left: 25px;
}

.cw-editor-content li {
    margin-bottom: 5px;
}

/* =========================================================
   ONPAGE AUDIT
   ========================================================= */

.audit-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.audit-empty p {
    font-size: 15px;
    margin: 0;
}

.audit-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
    padding: 20px 24px;
    background: var(--bg-box-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 20px;
}

.audit-meta-url {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    word-break: break-all;
    margin-bottom: 6px;
}

.audit-meta-info {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.audit-meta-info .audit-dot {
    opacity: 0.5;
}

.audit-scores {
    display: flex;
    gap: 12px;
}

.audit-score-card {
    min-width: 110px;
    padding: 14px 18px;
    border-radius: 10px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--border-color);
    position: relative;
    transition: transform 0.15s ease;
}

.audit-score-card.audit-score-overall {
    min-width: 130px;
    background: var(--primary-color);
    color: var(--primary-text);
    border-color: var(--primary-color);
}

.audit-score-card.audit-score-overall .audit-score-label,
.audit-score-card.audit-score-overall .audit-score-sub {
    color: var(--primary-text);
    opacity: 0.85;
}

.audit-score-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.audit-score-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-main);
}

.audit-score-value::after {
    content: '%';
    font-size: 16px;
    font-weight: 500;
    opacity: 0.6;
    margin-left: 2px;
}

.audit-score-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Farbstufen für Kategorie-Karten je nach Score */
.audit-score-card.is-good .audit-score-value { color: #27ae60; }
.audit-score-card.is-medium .audit-score-value { color: #f39c12; }
.audit-score-card.is-bad .audit-score-value { color: #e74c3c; }

.audit-score-overall.is-good { background: #27ae60; border-color: #27ae60; }
.audit-score-overall.is-medium { background: #f39c12; border-color: #f39c12; }
.audit-score-overall.is-bad { background: #e74c3c; border-color: #e74c3c; }

.audit-score-overall.is-good .audit-score-value,
.audit-score-overall.is-medium .audit-score-value,
.audit-score-overall.is-bad .audit-score-value {
    color: #fff;
}

/* Kategorien-Grid */
.audit-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.audit-category {
    background: var(--bg-box-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.audit-category-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
}

.audit-category-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.audit-check-table {
    width: 100%;
    border-collapse: collapse;
}

.audit-check-table tr {
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.1s ease;
}

.audit-check-table tr:last-child {
    border-bottom: none;
}

.audit-check-table tr:hover {
    background: rgba(52, 152, 219, 0.06);
}

.audit-check-table tr.is-clean {
    cursor: default;
}

.audit-check-table tr.is-clean:hover {
    background: transparent;
}

.audit-check-table td {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-main);
    vertical-align: middle;
}

.audit-check-label {
    font-weight: 500;
}

.audit-check-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.3;
}

.audit-severity-dots {
    display: inline-flex;
    gap: 2px;
    white-space: nowrap;
}

.audit-severity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    display: inline-block;
}

.audit-severity-dot.is-on {
    background: #f39c12;
}

.audit-check-count {
    text-align: right;
    font-weight: 600;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.audit-check-status {
    width: 30px;
    text-align: center;
}

.audit-check-status .status-ok {
    color: #27ae60;
}

.audit-check-status .status-warn {
    color: #e74c3c;
}

.audit-check-status .status-info {
    color: #f39c12;
}

/* Inline Sub-Views (Drilldown / Compare) */
.audit-subview-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.audit-subview-actions { display: flex; gap: 8px; }

.audit-back-btn,
.audit-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main, var(--text-color));
    background: var(--panel-bg, #fff);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.05s;
}

.audit-back-btn:hover,
.audit-action-btn:hover {
    border-color: var(--accent-color);
    background: var(--panel-alt-bg, #f8f9fb);
}

.audit-back-btn:focus-visible,
.audit-action-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.audit-action-btn { color: var(--accent-color); }
.audit-action-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.audit-subview-title {
    background: var(--panel-bg, #fff);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 14px;
}

.audit-subview-title h3 {
    margin: 0 0 6px;
    font-size: 17px;
    color: var(--text-main, var(--text-color));
    font-weight: 700;
}

.audit-subview-title p {
    margin: 0 0 8px;
    color: var(--text-main, var(--text-color));
    font-size: 13px;
    line-height: 1.45;
}

.audit-subview-count {
    color: var(--accent-color);
    font-weight: 700;
}

.audit-subview-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.audit-subview-meta-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 700;
    color: var(--text-muted);
}

.audit-subview-table-wrap {
    background: var(--panel-bg, #fff);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.audit-drilldown-table {
    width: 100%;
    border-collapse: collapse;
}

.audit-drilldown-table td.url-cell {
    word-break: break-all;
    font-family: monospace;
    font-size: 12px;
}

.audit-th-left {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--panel-alt-bg, #f8f9fb);
    border-bottom: 1px solid var(--border-color);
}

.audit-th-right {
    text-align: right;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--panel-alt-bg, #f8f9fb);
    border-bottom: 1px solid var(--border-color);
}

/* SEOSachsen-Theme Overrides */

/* Drilldown-Modal (Legacy — nicht mehr benutzt, bleibt für Migration leer) */
.audit-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 40px;
}

.audit-modal {
    background: var(--bg-main, #fff);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 1000px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.audit-modal-head {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 14px;
}

.audit-modal-title {
    flex: 1;
}

.audit-modal-title h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: var(--text-main);
}

.audit-modal-title p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.audit-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
}

.audit-modal-close:hover {
    color: var(--text-main);
}

.audit-modal-body {
    overflow-y: auto;
    padding: 0;
    flex: 1;
}

.audit-modal-body table {
    width: 100%;
    border-collapse: collapse;
}

.audit-modal-body th,
.audit-modal-body td {
    padding: 10px 22px;
    font-size: 13px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.audit-modal-body th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.02);
    position: sticky;
    top: 0;
}

.audit-modal-body td.url-cell {
    word-break: break-all;
    max-width: 450px;
}

/* Vergleichs-UI */
.audit-compare-picker {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: end;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
}

.audit-compare-picker label {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.audit-compare-picker select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-box-light);
    color: var(--text-main);
    font-size: 13px;
}

.audit-compare-arrow {
    color: var(--text-muted);
    padding-bottom: 8px;
}

.audit-compare-summary {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.audit-compare-summary-item strong {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    font-weight: 500;
}

.audit-compare-summary-item span {
    font-size: 15px;
    color: var(--text-main);
    font-weight: 600;
}

.audit-compare-warning {
    padding: 12px 22px;
    background: #fef9e7;
    border-bottom: 1px solid #f1c40f;
    color: #7d6608;
    font-size: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.audit-delta {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.audit-delta.is-better { color: #27ae60; }
.audit-delta.is-worse { color: #e74c3c; }
.audit-delta.is-same { color: var(--text-muted); }

/* ===== KI-ASSISTENT — MODE B: URL-OPTIMIERUNG ===== */

.ai-mode-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

.ai-mode-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.ai-mode-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-mode-card.is-active {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.18);
    background: var(--panel-alt-bg, var(--panel-bg));
}

.ai-mode-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(52, 152, 219, 0.12);
    color: var(--accent-color);
    border: 1px solid rgba(52, 152, 219, 0.25);
}

.ai-mode-card.is-active .ai-mode-icon {
    background: rgba(52, 152, 219, 0.22);
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.ai-mode-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.ai-mode-title { font-size: 15px; font-weight: 600; color: var(--text-color); }
.ai-mode-desc { font-size: 13px; color: var(--text-color); opacity: 0.85; line-height: 1.45; }

/* Toolbar / Filter / Batch */
.ai-optimize-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
    background: var(--panel-alt-bg, var(--panel-bg));
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.ai-optimize-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.ai-optimize-filters label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.ai-optimize-filters select {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--panel-bg);
    color: var(--text-color);
    font-size: 13px;
}

.ai-optimize-actions { display: flex; gap: 10px; align-items: center; }

/* Batch-Progress */
.ai-batch-progress {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

.ai-batch-progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.ai-batch-progress-fill {
    height: 100%;
    background: var(--accent-color);
    transition: width 0.25s ease-out;
}

.ai-batch-progress-label {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.ai-batch-progress-done { color: #27ae60; font-weight: 600; }

/* URL-Liste */
.ai-optimize-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-url-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.ai-url-head {
    display: flex;
    gap: 14px;
    padding: 12px 14px;
    align-items: center;
    justify-content: space-between;
}

.ai-url-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.ai-url-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    word-break: break-all;
    line-height: 1.35;
}

.ai-url-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ai-url-meta {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-url-score {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
    min-width: 32px;
    text-align: center;
    padding: 4px 10px;
    background: var(--panel-alt-bg, rgba(0, 0, 0, 0.04));
    border-radius: 6px;
}

.ai-url-generate { font-size: 13px; }

/* Severity Badges */
.ai-issue-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 3px 10px 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid transparent;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-issue-badge::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
}

/* Starke Kontraste: dunkler Text auf hellem Pastell-BG + farbiger Border + Indikator-Punkt */
.ai-issue-badge.is-critical { background: #fde8e8; color: #7a1c14; border-color: #c0392b; }
.ai-issue-badge.is-critical::before { background: #c0392b; }
.ai-issue-badge.is-high     { background: #fdecd6; color: #703d05; border-color: #c56a0a; }
.ai-issue-badge.is-high::before { background: #c56a0a; }
.ai-issue-badge.is-medium   { background: #fdf3c7; color: #5a4a00; border-color: #a68400; }
.ai-issue-badge.is-medium::before { background: #a68400; }
.ai-issue-badge.is-low      { background: #e0f2ee; color: #0b4d40; border-color: #16a085; }
.ai-issue-badge.is-low::before { background: #16a085; }

.ai-sev-badge {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 700;
}
.ai-sev-badge.is-critical { background: #c0392b; color: #fff; }
.ai-sev-badge.is-high     { background: #e67e22; color: #fff; }
.ai-sev-badge.is-medium   { background: #f1c40f; color: #000; }
.ai-sev-badge.is-low      { background: #16a085; color: #fff; }

/* Empfehlungs-Panel */
.ai-url-panel { border-top: 1px solid var(--border-color); }
.ai-url-panel:empty { border-top: none; }

.ai-rec {
    padding: 14px 16px;
    background: var(--panel-alt-bg, rgba(52, 152, 219, 0.03));
}

.ai-rec-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.ai-rec-body {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-color);
    word-break: break-word;
}

.ai-rec-body code {
    background: var(--border-color);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
}

.ai-rec-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.ai-rec-error {
    padding: 14px 16px;
    color: #7a1c14;
    background: #fde8e8;
    border-left: 3px solid #c0392b;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-rec-pending {
    padding: 14px 16px;
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mini-Markdown Headings in AI Antwort */
.ai-md-h1, .ai-md-h2, .ai-md-h3 {
    display: block;
    margin: 10px 0 4px;
    color: var(--text-color);
}
.ai-md-h1 { font-size: 15px; }
.ai-md-h2 { font-size: 14px; }
.ai-md-h3 { font-size: 13px; }

/* Inline-Thread */
.ai-url-thread-container {
    margin-top: 12px;
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
}

.ai-thread-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px 2px;
}

.ai-thread-msg {
    font-size: 13px;
    line-height: 1.45;
    padding: 8px 12px;
    border-radius: 10px;
    max-width: 85%;
}

.ai-thread-msg-user {
    align-self: flex-end;
    background: var(--accent-color);
    color: #fff;
}

.ai-thread-msg-assistant {
    align-self: flex-start;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    word-break: break-word;
}

.ai-thread-msg-typing {
    align-self: flex-start;
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

.ai-thread-input-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: flex-end;
}

.ai-thread-input {
    flex: 1;
    min-height: 38px;
    max-height: 120px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--panel-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
}

.ai-thread-send {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* ======================================================================
   PRÄSENTATION WIZARD (view-presentation)
   ====================================================================== */

#view-presentation .pres-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

#view-presentation .pres-project-hint {
    font-size: 13px;
    color: var(--text-sub, #666);
    background: var(--card-bg, #f7f7f7);
    border: 1px solid var(--border-color, #ddd);
    padding: 6px 12px;
    border-radius: 6px;
}

/* Stepper */
#view-presentation .pres-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    padding: 10px 14px;
}

#view-presentation .pres-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: default;
    color: var(--text-sub, #777);
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
}

#view-presentation .pres-step.is-active {
    background: #C9237A;
    color: #fff;
}

#view-presentation .pres-step.is-done {
    color: #1e7e34;
    cursor: pointer;
}

#view-presentation .pres-step.is-done:hover {
    background: rgba(30, 126, 52, 0.08);
}

#view-presentation .pres-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.08);
    font-weight: 700;
    font-size: 12px;
}

#view-presentation .pres-step.is-active .pres-step-num {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

#view-presentation .pres-step.is-done .pres-step-num {
    background: rgba(30, 126, 52, 0.15);
    color: #1e7e34;
}

#view-presentation .pres-step-sep {
    flex: 1;
    min-width: 10px;
    height: 1px;
    background: var(--border-color, #ddd);
}

/* Body */
#view-presentation .pres-body {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 18px;
    min-height: 380px;
}

#view-presentation .pres-panel {
    display: none;
}

#view-presentation .pres-panel.is-active {
    display: block;
}

#view-presentation .pres-panel h3 {
    margin: 0 0 6px 0;
    font-size: 20px;
    color: var(--text-color, #2c3e50);
}

#view-presentation .pres-intro {
    color: var(--text-sub, #666);
    margin: 0 0 18px 0;
    font-size: 14px;
    line-height: 1.5;
}

#view-presentation .pres-hint {
    display: inline-block;
    font-size: 13px;
    color: var(--text-sub, #666);
}

#view-presentation .pres-hint[data-kind="warn"] { color: #b06c00; }
#view-presentation .pres-hint[data-kind="error"] { color: #c0392b; }
#view-presentation .pres-hint[data-kind="ok"] { color: #1e7e34; }

/* Step 1: Compare Picker */
#view-presentation .pres-compare-picker {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 18px;
    align-items: end;
    margin-bottom: 14px;
}

#view-presentation .pres-compare-picker label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub, #666);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

#view-presentation .pres-compare-picker select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color, #ccc);
    border-radius: 6px;
    background: var(--input-bg, #fff);
    color: var(--text-color, #333);
    font-size: 14px;
}

#view-presentation .pres-compare-arrow {
    font-size: 22px;
    font-weight: 700;
    color: #C9237A;
    padding-bottom: 8px;
}

#view-presentation .pres-no-compare {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -4px 0 14px 0;
    font-size: 13px;
    color: var(--text-sub, #666);
    cursor: pointer;
    user-select: none;
}

#view-presentation .pres-no-compare input {
    margin: 0;
    cursor: pointer;
}

#view-presentation .pres-compare-picker.is-single {
    grid-template-columns: 1fr;
}

#view-presentation .pres-compare-picker.is-single .pres-compare-arrow,
#view-presentation .pres-compare-picker.is-single #presCrawlBBox {
    display: none;
}

#view-presentation .pres-gsc-grid.is-single {
    grid-template-columns: 1fr;
}

#view-presentation .pres-gsc-grid.is-single .pres-gsc-hide-b {
    display: none;
}

/* Step 2: GSC Grid */
#view-presentation .pres-gsc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

#view-presentation .pres-gsc-grid label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub, #666);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

#view-presentation .pres-gsc-grid input,
#view-presentation .pres-gsc-notes textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color, #ccc);
    border-radius: 6px;
    background: var(--input-bg, #fff);
    color: var(--text-color, #333);
    font-size: 14px;
    font-family: inherit;
}

#view-presentation .pres-gsc-notes label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub, #666);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

#view-presentation .pres-gsc-notes textarea {
    min-height: 80px;
    resize: vertical;
}

/* Step 3 + 4: AI / Own sections */
#view-presentation .pres-ai-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

#view-presentation .pres-ai-sections {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}

#view-presentation .pres-ai-section {
    background: var(--bg-color, #fafafa);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    padding: 12px;
}

#view-presentation .pres-ai-label {
    display: block;
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 13px;
    color: #C9237A;
    margin-bottom: 6px;
}

#view-presentation .pres-ai-section textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color, #ccc);
    border-radius: 6px;
    background: var(--input-bg, #fff);
    color: var(--text-color, #333);
    font-size: 13px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    min-height: 140px;
}

/* Step 5: Summary */
#view-presentation .pres-summary {
    margin-bottom: 18px;
}

#view-presentation .pres-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

#view-presentation .pres-summary-card {
    background: var(--bg-color, #fafafa);
    border: 1px solid var(--border-color, #ddd);
    border-left: 4px solid #FFD600;
    border-radius: 6px;
    padding: 14px;
}

#view-presentation .pres-summary-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--text-sub, #777);
}

#view-presentation .pres-summary-value {
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color, #2c3e50);
    margin: 4px 0 6px 0;
    line-height: 1.1;
}

#view-presentation .pres-summary-sub {
    font-size: 12px;
    color: var(--text-sub, #666);
    line-height: 1.4;
}

#view-presentation .pres-export-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* Footer */
#view-presentation .pres-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--border-color, #eee);
}

#view-presentation .pres-step-indicator {
    font-weight: 600;
    color: var(--text-sub, #666);
    font-size: 13px;
}

#view-presentation .pres-footer .primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Responsive tweak */
@media (max-width: 1100px) {
    #view-presentation .pres-ai-sections,
    #view-presentation .pres-summary-grid {
        grid-template-columns: 1fr;
    }
    #view-presentation .pres-gsc-grid,
    #view-presentation .pres-compare-picker {
        grid-template-columns: 1fr;
    }
    #view-presentation .pres-compare-arrow { display: none; }
}

/* Skipped state (stepper + summary) */
#view-presentation .pres-step.is-skipped .pres-step-num {
    background: #9aa0a6;
    border-color: #5f6368;
}
#view-presentation .pres-step.is-skipped .pres-step-label {
    color: #9aa0a6;
    text-decoration: line-through;
}

#view-presentation .pres-summary-card.is-skipped {
    opacity: 0.55;
    border-left-color: #9aa0a6;
    background: repeating-linear-gradient(
        45deg,
        var(--bg-color, #fafafa),
        var(--bg-color, #fafafa) 8px,
        rgba(0,0,0,0.04) 8px,
        rgba(0,0,0,0.04) 16px
    );
}
#view-presentation .pres-summary-card.is-skipped .pres-summary-value {
    color: #9aa0a6;
    font-style: italic;
}

/* Footer center group (skip button + step indicator) */
#view-presentation .pres-footer-center {
    display: flex;
    align-items: center;
    gap: 14px;
}

#view-presentation .pres-footer-center #presSkip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Orientation selector (step 5) — Classic look */
#view-presentation .pres-orientation {
    margin: 14px 0 10px 0;
    padding: 14px 16px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e3e3e3);
    border-radius: var(--border-radius, 6px);
}

#view-presentation .pres-orientation-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 10px;
    color: var(--text-main, #2c3e50);
}

#view-presentation .pres-orientation-options {
    display: inline-flex;
    gap: 0;
    flex-wrap: wrap;
    border: 1px solid var(--border-color, #e3e3e3);
    border-radius: var(--border-radius, 6px);
    overflow: hidden;
    background: var(--bg-body, #f7f7f7);
}

#view-presentation .pres-orientation-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    color: var(--text-main, #2c3e50);
    background: transparent;
    border-right: 1px solid var(--border-color, #e3e3e3);
    transition: background 0.15s ease, color 0.15s ease;
}
#view-presentation .pres-orientation-pill:last-child {
    border-right: none;
}
#view-presentation .pres-orientation-pill input[type="radio"] {
    display: none;
}
#view-presentation .pres-orientation-pill:hover {
    background: rgba(201, 35, 122, 0.08);
}
#view-presentation .pres-orientation-pill:has(input:checked) {
    background: var(--primary-color, #C9237A);
    color: var(--primary-text, #fff);
    font-weight: 600;
}

/* ===== THEMEN-CLUSTER – Shell Layout ===== */
.cluster-shell {
    display: flex;
    height: calc(100vh - 60px); /* Abzüglich Top-Bar */
    overflow: hidden;
}

.cluster-sidebar {
    width: 260px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    background: var(--bg-card);
    overflow-y: auto;
    overflow-x: hidden;
}

.cluster-sidebar-inner { padding-bottom: 20px; }

.cluster-main {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-body);
}

/* Sidebar Sektionen */
.csi-section {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

.csi-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.csi-label {
    display: block;
    font-size: 11px;
    color: var(--text-sub);
    margin-bottom: 3px;
}

.csi-select, .csi-input {
    width: 100%;
    padding: 5px 8px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-input);
    color: var(--text-main);
}

.csi-radio-group { display: flex; flex-direction: column; gap: 4px; }
.csi-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-main);
    cursor: pointer;
    padding: 2px 0;
}
.csi-radio input { cursor: pointer; accent-color: var(--primary-color); }

/* Canvas-Zoom-Bar */
.cluster-zoom-bar {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
}

.cluster-canvas-hint {
    position: absolute;
    bottom: 12px;
    left: 12px;
    font-size: 10px;
    color: var(--text-sub);
    pointer-events: none;
}

/* ===== THEMEN-CLUSTER – Views ===== */
.cluster-view-tabs {
    display: flex;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.cluster-tab-btn {
    background: var(--bg-card);
    border: none;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 5px;
    border-right: 1px solid var(--border-color);
    transition: background 0.15s;
}

.cluster-tab-btn:last-child { border-right: none; }

.cluster-tab-btn:hover { background: var(--bg-table-hover); }

.cluster-tab-btn.active {
    background: var(--primary-color);
    color: var(--primary-text);
}

.cluster-view-pane { width: 100%; }

/* Bubble Chart */
.cluster-bubbles-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: center;
    padding: 32px 16px;
    min-height: 300px;
}

.cluster-bubble {
    border-radius: 50%;
    border: 2px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 16px;
    text-align: center;
    position: relative;
}

.cluster-bubble:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.cluster-bubble-label {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
    max-width: 90%;
}

.cluster-bubble-count {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 4px;
}

.cluster-bubble-gsc {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid;
    margin-top: 5px;
}

/* URL-Zeilen im Detail-Panel */
.cluster-url-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border-color);
}

.cluster-url-row:last-child { border-bottom: none; }

.cluster-mode-btn {
    background: var(--bg-card);
    border: none;
    padding: 5px 10px;
    font-size: 11px;
    cursor: pointer;
    color: var(--text-sub);
    border-right: 1px solid var(--border-color);
    transition: background 0.15s;
    font-weight: 500;
}
.cluster-mode-btn:last-child { border-right: none; }
.cluster-mode-btn:hover { background: var(--bg-table-hover); }
.cluster-mode-btn.active { background: var(--primary-color); color: var(--primary-text); }

.cluster-zoom-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: background 0.15s;
}
.cluster-zoom-btn:hover { background: var(--bg-table-hover); }

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

