@import url('https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css');

/* 
  TABLE OF CONTENTS
  -----------------
  1.  Reset & Variables
  2.  Layout (App, Sidebar container)
  3.  Sidebar & Navigation
  4.  Sticky Footer
  5.  Forms & Inputs
  6.  Buttons & Controls
  7.  Cards & Containers
  8.  Modals & Overlays
  9.  Semantic Search
  10. Text Review
  11. Utilities
*/

/* --- 1. Reset & Variables --- */

:root {
    /* Core Brand Colors */
    --rijssenbeek-blue: #1c355e;
    --rijssenbeek-blue-dark: #152847;
    --rijssenbeek-blue-soft: #2d4a7c;
    --rijssenbeek-gold: #c4a77d;
    --rijssenbeek-gold-soft: #d4b896;

    /* Brand Overlays */
    --rijssenbeek-blue-04: rgba(28, 53, 94, 0.04);
    --rijssenbeek-blue-05: rgba(28, 53, 94, 0.05);
    --rijssenbeek-blue-08: rgba(28, 53, 94, 0.08);
    --rijssenbeek-blue-12: rgba(28, 53, 94, 0.12);
    --rijssenbeek-blue-15: rgba(28, 53, 94, 0.15);
    --rijssenbeek-blue-25: rgba(28, 53, 94, 0.25);
    --rijssenbeek-gold-05: rgba(196, 167, 125, 0.05);
    --rijssenbeek-gold-06: rgba(196, 167, 125, 0.06);
    --rijssenbeek-gold-10: rgba(196, 167, 125, 0.1);
    --rijssenbeek-gold-12: rgba(196, 167, 125, 0.12);
    --rijssenbeek-gold-15: rgba(196, 167, 125, 0.15);
    --rijssenbeek-gold-18: rgba(196, 167, 125, 0.18);
    --rijssenbeek-gold-20: rgba(196, 167, 125, 0.2);
    --rijssenbeek-gold-25: rgba(196, 167, 125, 0.25);
    --rijssenbeek-gold-30: rgba(196, 167, 125, 0.3);

    /* Brand Gradients */
    --gradient-brand-primary: linear-gradient(135deg, var(--rijssenbeek-blue) 0%, var(--rijssenbeek-blue-dark) 100%);
    --gradient-brand-blue-soft: linear-gradient(135deg, var(--rijssenbeek-blue) 0%, var(--rijssenbeek-blue-soft) 100%);
    --gradient-brand-gold: linear-gradient(135deg, var(--rijssenbeek-gold) 0%, var(--rijssenbeek-gold-soft) 100%);

    /* Pilot Accent */
    --pilot-purple: #7c3aed;
    --pilot-purple-soft: #6366f1;
    --gradient-pilot: linear-gradient(135deg, var(--pilot-purple) 0%, var(--pilot-purple-soft) 100%);

    /* Theme Colors */
    --bg-app: #f8fafc;
    --bg-panel: #ffffff;
    --bg-element: #f1f5f9;

    /* Typography */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;

    /* Borders & Focus */
    --border-subtle: #e2e8f0;
    --border-default: #cbd5e1;
    --border-focus: var(--rijssenbeek-blue);

    /* Radii (Consolidated to 2px for standard, full for pills) */
    --radius: 2px;
    --radius-sm: var(--radius);
    --radius-md: var(--radius);
    --radius-lg: var(--radius);
    --radius-full: 9999px;
    --radius-pill: var(--radius-full);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.04), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --shadow-inner: inset 0 1px 2px 0 rgba(0, 0, 0, 0.02);

    /* Status Colors */
    --error: #ef4444;
    --success: #10b981;
    --info: #0ea5e9;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Transitions */
    --trans-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --trans-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --trans-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Spacing */
    --gap-sm: 8px;
    --gap-md: 16px;
    --gap-lg: 24px;
    --quick-nav-height: 52px;

    /* Code Block */
    --code-bg: #1e293b;
    --code-text: #e2e8f0;

    /* Sliders (Mapped to Brand) */
    --slider-track: #e2e8f0;
    --slider-thumb: var(--rijssenbeek-blue);
    --slider-cool: #94a3b8;
    --slider-neutral: #e2e8f0;
    --slider-warm: var(--rijssenbeek-gold);
}



body {
    font-family: "DM Sans", sans-serif;
    background: var(--bg-app);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--trans-base), color var(--trans-base), background var(--trans-base);
}

/* --- 2. Layout --- */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-app);
}

/* --- 3. Sidebar & Navigation --- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    /* Fixed width sidebar */
    height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
    /* Sidebar container doesn't scroll, only nav does */
    /* Removed shadow for cleaner, bordered look */
    transition: background-color var(--trans-base), border-color var(--trans-base);
}

.sidebar-header {
    padding: 24px 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: transparent;
    flex-shrink: 0;
    /* Stays fixed at top */
}

/* Pilot Badge in Sidebar */
.pilot-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--gradient-pilot);
    border-radius: var(--radius-full);
    color: white;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pilot-badge i {
    width: 12px;
    height: 12px;
    opacity: 0.9;
}

.pilot-badge-container {
    display: flex;
    justify-content: center;
    padding: 12px;
    margin: 0 12px;
    border-bottom: 1px solid var(--border-subtle);
}

/* Flask Bubbles Easter Egg */
.pilot-badge {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.pilot-badge:hover {
    transform: scale(1.05);
}

.pilot-badge:active {
    transform: scale(0.98);
}

.flask-bubbles {
    position: absolute;
    top: -8px;
    left: 4px;
    width: 20px;
    height: 10px;
    pointer-events: none;
    overflow: visible;
}

.bubble {
    position: absolute;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.50), rgba(124, 58, 237, 0.9));
    border-radius: 50%;
    animation: bubbleRise 1s ease-out forwards;
    box-shadow: inset 0 -1px 2px rgba(255, 255, 255, 0.4), 0 1px 3px rgba(124, 58, 237, 0.3);
}

@keyframes bubbleRise {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0.5);
    }
}

@keyframes bubbleWobble {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-3px);
    }

    75% {
        transform: translateX(3px);
    }
}

.sidebar-logo {
    width: 160px;
    height: auto;
}

.sidebar-nav {
    padding: 0px 12px;
    flex: 1;
    overflow-y: auto;
    /* Only the nav section scrolls */
    overflow-x: hidden;
}

.sidebar-actions {
    padding: 12px 12px 8px;
    display: flex;
    gap: 8px;
    justify-content: center;
    border-top: 1px solid var(--border-subtle);
    background: transparent;
}

.icon-button {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-panel);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--trans-fast);
    box-shadow: var(--shadow-sm);
    margin: 0;
}

.icon-button:hover,
.icon-button:focus-visible {
    outline: none;
    border-color: var(--border-focus);
    color: var(--border-focus);
    box-shadow: var(--shadow-md);
    background: var(--bg-element);
    transform: translateY(-2px);
}

.icon-button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.nav-group {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.nav-group:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.nav-group-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-tertiary);
    padding: 8px 12px 6px;
    text-transform: uppercase;
    margin-bottom: 2px;
    user-select: none;
}

.nav-group-label i.group-icon,
.nav-group-label svg.group-icon,
.nav-group-label .lucide:not(.chevron) {
    width: 14px;
    height: 14px;
    opacity: 0.6;
    flex-shrink: 0;
}

.nav-group-items {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 7px 12px;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    border-radius: var(--radius-md);
    margin-left: 0;
    color: var(--text-secondary);
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--trans-fast);
    position: relative;
    text-align: left;
}

.nav-item:hover {
    background: var(--rijssenbeek-blue-04);
    /* Very subtle blue tint */
    color: var(--rijssenbeek-blue);
    transform: translateX(4px);
    /* Subtle slide */
}

.nav-item.active {
    background: var(--rijssenbeek-gold-12);
    /* Slightly stronger gold background */
    border-left-color: var(--rijssenbeek-gold);
    color: var(--rijssenbeek-blue);
    font-weight: 700;
    transform: translateX(0);
    /* Active stays put */
}

.nav-item.active:hover {
    background: var(--rijssenbeek-gold-18);
}

.nav-item:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: -2px;
}





/* Form status indicator removed - not needed for this use case */



.nav-item i {
    flex-shrink: 0;
}

.nav-label {
    flex: 1;
    line-height: 1.3;
    word-break: break-word;
}


/* Sticky Footer Implementation */
/* --- 4. Sticky Footer --- */
.sticky-footer {
    position: fixed;
    bottom: 0;
    left: 240px;
    width: calc(100% - 240px);
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: none;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: none;
    z-index: 90;
    transition: left var(--trans-base), width var(--trans-base);
    box-sizing: border-box;
    pointer-events: none;
}

.sticky-footer>* {
    pointer-events: auto;
}

/* Footer Actions Left */
.footer-actions-left {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.footer-divider {
    width: 1px;
    height: 24px;
    background: var(--border-subtle);
    margin: 0 4px;
}

/* External Links Group */
.footer-external-links {
    display: flex;
    gap: 6px;
    align-items: center;
}

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

.footer-spacer {
    flex: 1;
}

.footer-generate-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.footer-toggle-prompt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-element);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--trans-fast);
}

.footer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--trans-fast);
}

.footer-link:hover {
    background: var(--rijssenbeek-blue);
    border-color: var(--rijssenbeek-blue);
    color: white;
}

/* Uniform Footer Button Style */
.footer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    /* Enforce uniform height */
    padding: 0 12px;
    /* Horizontal padding only */
    background: var(--bg-element);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--trans-fast);
    flex-shrink: 0;
    user-select: none;
    box-sizing: border-box;
    line-height: normal;
    /* Reset browser specific button styles */
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    vertical-align: middle;
}

.footer-btn:hover {
    background: var(--bg-panel);
    border-color: var(--border-focus);
    color: var(--text-primary);
}

.footer-btn.btn-danger:hover {
    background: #fef2f2;
    color: var(--error);
    border-color: var(--error);
}

/* Active State for Toggles */
.footer-btn:has(input:checked) {
    background: var(--rijssenbeek-gold-15);
    border-color: var(--rijssenbeek-gold);
    color: var(--rijssenbeek-blue);
}

/* Hide the actual checkbox input */
.hidden-checkbox {
    display: none;
}

.footer-btn i {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    display: block;
    /* Removes line-height interference */
}

.footer-btn:has(input:checked) i {
    opacity: 1;
    color: var(--rijssenbeek-blue);
}

.footer-btn:hover i {
    opacity: 1;
}

/* Wrapper for Relative Positioning */
.relative-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    height: 36px;
    /* Match button height */
}

/* Pseudonymization Drawer - Positioned Absolute above the Button */
.pseudonymization-drawer {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 12px;
    width: 340px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 16px;
    display: none;
    animation: slideUp 0.15s ease-out;
    cursor: default;
    /* Reset cursor from label parent */
}

.pseudonymization-drawer.is-visible {
    display: block;
}

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

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

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.drawer-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--rijssenbeek-blue);
}

.drawer-title i {
    width: 16px;
    height: 16px;
    color: var(--rijssenbeek-gold);
}

.drawer-close {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-tertiary);
    border-radius: var(--radius-sm);
    transition: all var(--trans-fast);
}

.drawer-close:hover {
    background: var(--bg-element);
    color: var(--text-primary);
}

.drawer-content {
    font-size: 13px;
}

.drawer-content .help-text {
    font-size: 12px;
    margin-bottom: 12px;
}

.drawer-content .field-group {
    margin-bottom: 12px;
}

.drawer-content label {
    font-size: 12px;
    margin-bottom: 6px;
}

.drawer-content textarea {
    font-size: 13px;
    padding: 10px;
}

.drawer-content .storage-note {
    font-size: 11px;
    margin-top: 6px;
}

.drawer-content .history-controls {
    padding: 10px;
    margin-top: 8px;
}

/* Encyclopedia Result Badge (Handbook Link) */
.result-footer-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    background-color: var(--rijssenbeek-gold-10);
    border: 1px solid var(--rijssenbeek-gold);
    border-radius: var(--radius-md);
    color: var(--rijssenbeek-blue);
    font-size: 13px;
    font-weight: 500;
}

.result-footer-badge i {
    width: 16px;
    height: 16px;
    color: var(--rijssenbeek-gold);
}

/* Clickable link variant */
.result-footer-badge-link {
    text-decoration: none;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.result-footer-badge-link:hover {
    background-color: var(--rijssenbeek-gold-20);
    border-color: var(--rijssenbeek-blue);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(28, 53, 94, 0.15);
}

.result-footer-badge-link .external-link-icon {
    width: 14px;
    height: 14px;
    opacity: 0.6;
    margin-left: auto;
}

.result-footer-badge-link:hover .external-link-icon {
    opacity: 1;
}

/* RAG Source Links */
.kv-rag-source-anchor {
    color: var(--rijssenbeek-blue);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--trans-fast);
}

.kv-rag-source-anchor:hover {
    text-decoration: underline;
    color: var(--rijssenbeek-blue);
}

/* Agentic RAG Inline Citations */
.citation-link {
    color: var(--rijssenbeek-blue);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--trans-fast);
}

.citation-link:hover {
    color: var(--rijssenbeek-gold);
    text-decoration: underline;
}

.highlight-citation {
    background-color: var(--rijssenbeek-gold-15) !important;
    border-color: var(--rijssenbeek-gold) !important;
    transition: background-color var(--trans-base), border-color var(--trans-base);
}

@media (max-width: 768px) {

    /* On mobile, drawer needs to be fixed/full width usually */
    .pseudonymization-drawer {
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: 80px;
        width: auto;
        max-width: none;
        margin-bottom: 0;
    }

    .footer-actions-left {
        gap: 6px;
    }

    .footer-btn span {
        display: none;
    }

    .footer-btn {
        padding: 8px;
    }

    .footer-divider {
        display: none;
    }
}

/* === Sidebar Settings Section === */
.sidebar-settings {
    margin: 8px 12px;
    padding: 8px;
    background: var(--bg-element);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
    /* Stays fixed at bottom, doesn't scroll away */
}

.sidebar-settings-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--rijssenbeek-blue);
    text-transform: uppercase;
    margin-bottom: 2px;
    padding-bottom: 6px;
    border-bottom: none;
}

.sidebar-settings-header .settings-icon {
    width: 12px;
    height: 12px;
    opacity: 0.7;
}

.sidebar-settings-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all var(--trans-fast);
}

.settings-toggle:hover {
    background: var(--rijssenbeek-blue-04);
    color: var(--text-primary);
}

.settings-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--rijssenbeek-blue);
    cursor: pointer;
}

.settings-toggle i,
.settings-toggle svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
    flex-shrink: 0;
}

.settings-toggle:has(input:checked) {
    color: var(--rijssenbeek-blue);
}

.settings-toggle:has(input:checked) i,
.settings-toggle:has(input:checked) svg {
    opacity: 1;
}

.settings-actions {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
}

.settings-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--trans-fast);
}

.settings-btn:hover {
    background: var(--bg-element);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.settings-btn.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: var(--danger);
}

.settings-btn i,
.settings-btn svg {
    width: 12px;
    height: 12px;
}

/* === Sidebar Footer with External Links === */
.sidebar-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Changed from space-between to center */
    background: var(--bg-app);
    gap: 12px;
    flex-shrink: 0;
    /* Stays fixed at bottom, doesn't scroll away */
}

.sidebar-external-links {
    display: flex;
    gap: 8px;
}

.sidebar-external-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: all var(--trans-fast);
}

.sidebar-external-links a:hover {
    background: var(--rijssenbeek-blue-08);
    color: var(--rijssenbeek-blue);
}

.sidebar-external-links a i,
.sidebar-external-links a svg {
    width: 14px;
    height: 14px;
}

.version-badge {
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 500;
}

/* === Minimal Sticky Footer === */
.sticky-footer-minimal {
    justify-content: flex-end;
    padding: 12px 24px;
}

.sticky-footer-minimal .btn-generate {
    min-width: 160px;
}

.main-content {
    margin-left: 240px;
    width: calc(100% - 240px);
    min-height: 100vh;
    padding-bottom: 80px;
    transition: margin-left var(--trans-base), width var(--trans-base);
}

/* Nav Icon styling */
.nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

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

/* Header Row in Sidebar */
.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Primary Button */
.btn-primary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding: 12px 28px;
    background: var(--gradient-brand-primary);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-md);
    font-family: "DM Sans", sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px var(--rijssenbeek-blue-25), 0 2px 4px -1px var(--rijssenbeek-blue-15);
    transition: all var(--trans-base);
    position: relative;
    /* For loading spinner positioning */
}

.btn-primary:hover {
    box-shadow: 0 10px 15px -3px rgba(196, 167, 125, 0.4), 0 4px 6px -2px var(--rijssenbeek-gold-20);
    background: var(--rijssenbeek-gold);
    color: var(--rijssenbeek-blue);
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 260px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .sticky-footer {
        left: 0;
        width: 100%;
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
    }

    .footer-secondary-actions {
        width: 100%;
        justify-content: center;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .btn-secondary span {
        display: none;
    }

    .sidebar-toggle-tab {
        display: none;
    }

    .mobile-menu-toggle {
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 101;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        background: var(--border-focus);
        color: white;
        border: none;
        border-radius: var(--radius-md);
        cursor: pointer;
        box-shadow: var(--shadow-md);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.visible {
        opacity: 1;
        pointer-events: all;
    }
}

/* Medium screens - Laptops and smaller desktops */
@media (min-width: 769px) and (max-width: 1200px) {
    .sidebar {
        width: 200px;
    }

    .sidebar-nav::after {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
        width: calc(100% - 200px);
    }

    .sticky-footer {
        left: 200px;
        width: calc(100% - 200px);
    }

    .sidebar-toggle-tab {
        left: 200px;
    }

    .nav-item {
        padding: 6px 10px;
        font-size: 12px;
    }

    .nav-group-label {
        font-size: 9px;
        padding: 4px 10px 4px;
    }

    .container {
        margin: 24px 16px;
        padding: 24px 32px;
    }
}

@media (max-width: 768px) {
    .nav-group {
        margin-bottom: 10px;
        padding-bottom: 6px;
    }

    .nav-group-label {
        padding: 6px 10px 4px;
        margin-bottom: 0;
    }
}

/* Container - Main Content Card */
.container {
    max-width: 1200px;
    margin: 40px auto;
    background: var(--bg-panel);
    padding: 40px 48px;
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-lg);
    transition: background-color var(--trans-base);
}

@media (min-width: 1024px) {
    .container {
        margin: 32px auto;
        min-height: auto;
        border-radius: var(--radius);
    }
}

/* Content Layout - Full Width */
.content-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.form-sections {
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%;
}

/* Typography */
h1 {
    font-family: "DM Serif Display", serif;
    font-size: 28px;
    font-weight: 400;
    margin-bottom: 0;
    color: var(--rijssenbeek-blue);
}

h2 {
    font-family: "DM Sans", sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin-top: 0;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--rijssenbeek-blue);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Section headers - no longer sticky */
.section h2 {
    padding-top: 4px;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.section-description {
    margin: -6px 0 24px 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: none;
}

.auto-save-status {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: -2px 0 16px;
    text-align: right;
}

.tool-result-panel {
    background: var(--bg-element);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 24px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand h1 {
    margin: 0;
}

.brand img {
    width: 68px;
    height: auto;
}

.brand-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.header-subtitle {
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* Result Container - Enhanced */
#promptContainer {
    margin: 32px 0 0;
    padding: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: var(--bg-element);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    display: none;
    animation: fadeIn 0.4s ease-out;
    transition: border-color var(--trans-base), box-shadow var(--trans-base);
}

#promptContainer.has-content {
    display: block !important;
    border-color: var(--success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

#promptContainer h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px 0;
    font-size: 16px;
    color: var(--rijssenbeek-blue);
    /* Neutral color for empty state */
}

/* Green styling only when there's content */
#promptContainer.has-content h2 {
    color: var(--success);
}

#promptContainer.has-content h2::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.prompt-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.prompt-action-btn,
.search-show-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--trans-fast);
}

.prompt-action-btn {
    font-weight: 600;
    color: var(--text-primary);
}

.prompt-action-btn:hover {
    background: var(--rijssenbeek-blue);
    color: white;
    border-color: var(--rijssenbeek-blue);
}

.prompt-action-btn.copied {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

#gegenereerdePrompt {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 13px;
    padding: 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    min-height: 200px;
    resize: vertical;
}

/* Panels */
.pseudonymization-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.online-sources-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pseudonymization-content {
    display: none;
    flex-direction: column;
    gap: 18px;
    margin-top: 6px;
}

.pseudonymization-content.is-visible {
    display: flex;
}

.panel-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 700;
}

.panel-heading {
    margin: 2px 0 0 0;
    font-family: "DM Sans", sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--rijssenbeek-blue);
    /* Same in dark mode */
}

.panel-description {
    margin: 4px 0 4px 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.toggle-caption {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.tab-navigation {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 30px;
    padding-bottom: 0;
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    /* Larger click area */
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    color: var(--text-secondary);
    font-family: "DM Sans", sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.tab-button:hover {
    color: var(--border-focus);
    background: var(--bg-element);
}

.tab-button.active {
    color: var(--rijssenbeek-blue);
    font-weight: 700;
    background: var(--bg-element);
    border-bottom-color: var(--rijssenbeek-gold);
}

@media (max-width: 768px) {
    .tab-navigation {
        justify-content: flex-start;
        gap: 20px;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }

    .tab-button {
        flex: 0 0 auto;
        font-size: 14px;
    }
}

.section {
    display: none;
    max-width: none;
    width: 100%;
    margin: 0 0 32px 0;
    animation: fadeIn 0.4s ease-out;
    padding-bottom: 8px;
    scroll-margin-top: calc(var(--quick-nav-height) + 24px);
}

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

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

label {
    display: block;
    margin-top: 24px;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--rijssenbeek-blue);
    font-size: 14px;
}

.section>label:first-of-type {
    margin-top: 0;
}

.checklist label,
.slider-container label {
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
}

/* --- 5. Forms & Inputs --- */
/* Consolidated Form Styles */
textarea,
input[type="text"],
input[type="number"],
input[type="password"],
select {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    border: 2px solid var(--border-subtle);
    border-radius: 0;
    background-color: #ffffff;
    font-family: "DM Sans", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    transition: all var(--trans-fast);
    box-shadow: var(--shadow-inner);
}

textarea {
    min-height: 140px;
    padding: 16px;
    resize: vertical;
    line-height: 1.6;
}

input[type="text"],
input[type="number"],
input[type="password"] {
    padding: 14px 16px;
}

select {
    padding: 14px 48px 14px 16px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='18' height='18' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 18px;
}

select::-ms-expand {
    display: none;
}

textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: var(--rijssenbeek-gold);
    box-shadow: 0 0 0 4px var(--rijssenbeek-gold-25);
    /* Unified Focus Ring */
    background: var(--bg-panel);
}

textarea::placeholder,
input::placeholder {
    color: var(--text-tertiary);
    opacity: 1;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
    /* LINT FIX */
}


.field-group {
    background: var(--bg-app);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--trans-base);
}

.field-group:hover {
    box-shadow: var(--shadow-md);
}

/* First label in field-group should not have top margin */
.field-group>label:first-child {
    margin-top: 0;
}

.section-subtitle {
    margin: 0 0 16px;
    font-family: "DM Sans", sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--rijssenbeek-blue);
    letter-spacing: 0.02em;
}

.split-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.split-row .field-block {
    flex: 1 1 320px;
}

.field-group.split-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.field-group.split-row .field-block {
    flex: 1 1 320px;
}

.field-group .field-block {
    margin-bottom: 20px;
}

.field-group .field-block:last-child {
    margin-bottom: 0;
}

.field-group:last-child {
    margin-bottom: 0;
}

/* Accordion Field Groups */
.field-group.accordion {
    overflow: hidden;
}

.field-group.accordion .accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 4px 0;
    margin: -4px 0 0;
    user-select: none;
    transition: color var(--trans-fast);
}

.field-group.accordion .accordion-header:hover {
    color: var(--rijssenbeek-blue);
}

.field-group.accordion .accordion-header .section-subtitle {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-group.accordion .accordion-header .accordion-icon {
    transition: transform var(--trans-base);
    color: var(--text-tertiary);
}

.field-group.accordion.collapsed .accordion-header .accordion-icon {
    transform: rotate(-90deg);
}

.field-group.accordion .accordion-content {
    max-height: 2000px;
    opacity: 1;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    margin-top: 16px;
}

.field-group.accordion.collapsed .accordion-content {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    overflow: hidden;
}

.inline-checkbox {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inline-checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px 0;
}

/* Custom Checkbox Styling */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-panel);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all var(--trans-fast);
}

input[type="checkbox"]:hover {
    border-color: var(--border-focus);
}

input[type="checkbox"]:checked {
    background: var(--rijssenbeek-blue);
    border-color: var(--rijssenbeek-blue);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 45%;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* Toggle Switch Style */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Custom Radio Button Styling */
input[type="radio"] {
    /* Visually hide the radio itself, letting the parent card handle the UI */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 0;
    height: 0;
    opacity: 0;
    position: absolute;
    margin: 0;
    /* Defensive reset to prevent generic input styles from bleeding in */
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    min-width: 0;
    pointer-events: none;
    /* Let clicks pass to the label */
    z-index: -1;
    /* Ensure it stays behind */
}

/* Ensure the card shows focus when the hidden radio is focused */
.radio-option:has(input:focus-visible) {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
    border-color: var(--border-focus);
}

.toggle-switch input[type="checkbox"] {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: var(--bg-element);
    border: 1px solid var(--border-subtle);
}

.toggle-switch input[type="checkbox"]::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-tertiary);
    border: none;
    transform: none;
    transition: all var(--trans-fast);
}

.toggle-switch input[type="checkbox"]:checked {
    background: var(--rijssenbeek-blue);
    border-color: var(--rijssenbeek-blue);
}

.toggle-switch input[type="checkbox"]:checked::after {
    left: 23px;
    background: white;
    border: none;
    transform: none;
}

/* Inline Toggle Layout Pattern */
.inline-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.inline-toggle-label {
    flex: 1;
    padding: 0;
}

.inline-toggle-label label {
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--rijssenbeek-blue);
    font-size: 14px;
}

.inline-toggle-label .help-text {
    margin-bottom: 0;
}

.inline-toggle-row .toggle-switch {
    flex-shrink: 0;
}

/* Toggle Status Label (Aan/Uit) for inline toggles */
.inline-toggle-row .toggle-status {
    font-size: 12px;
    font-weight: 600;
    min-width: 28px;
    text-align: left;
    align-self: center;
    line-height: 24px;
    transition: all var(--trans-fast);
}

/* Default state: Uit (unchecked) - faded */
.inline-toggle-row .toggle-status::after {
    content: 'Uit';
}

.inline-toggle-row:has(input:not(:checked)) .toggle-status {
    color: var(--text-tertiary);
    opacity: 0.5;
}

/* Checked state: Aan - prominent */
.inline-toggle-row:has(input:checked) .toggle-status::after {
    content: 'Aan';
}

.inline-toggle-row:has(input:checked) .toggle-status {
    color: var(--rijssenbeek-blue);
    opacity: 1;
}

/* Panel Toggle Labels */
.global-anonymize-toggle,
.online-sources-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    padding: 8px 0;
}

.step-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--text-primary);
}

.step-heading i {
    color: var(--rijssenbeek-blue);
}

.hint-icon {
    margin-left: auto;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-element);
    color: var(--text-tertiary);
    border: 1px solid var(--border-subtle);
    cursor: help;
    font-size: 13px;
    transition: all var(--trans-fast);
}

.hint-icon:hover {
    color: var(--border-focus);
    border-color: var(--border-focus);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-group.horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
}

.radio-group.horizontal .radio-option {
    flex: 1 1 120px;
    min-width: 100px;
}

/* Clean radio button styling */
.radio-option {
    display: flex !important;
    flex-direction: row !important;
    /* Force row layout to match Prijsvoorstel */
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    /* Ensure title and meta are split */
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--trans-fast), border-color var(--trans-fast);
    position: relative;
    width: 100%;
    /* Ensure it fills the flex item */
    box-sizing: border-box;
}

.radio-option:hover {
    background: var(--bg-element);
    border-color: var(--border-default);
}

.radio-option:has(input:checked),
.radio-option.selected {
    background: var(--rijssenbeek-gold-10);
    border-color: var(--rijssenbeek-gold);
}

/* Ensure container adds no extra chrome */
.radio-group,
.radio-group.horizontal {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.subfield {
    margin-top: 8px;
}

.subfield label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

.subfield .radio-group {
    margin-top: 0;
}

#vast_tarief_container {
    display: block;
}

.fixed-rate-input {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        margin-top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0;
    gap: 8px;
    flex-direction: column;
    margin-bottom: 24px;
}

.fixed-rate-input.active {
    display: flex;
    max-height: 180px;
    opacity: 1;
    margin-top: 24px;
    margin-bottom: 24px;
}

.fixed-rate-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.fixed-rate-row input {
    flex: 1 1 220px;
}

.fixed-rate-percentage {
    padding: 10px 12px;
    background: var(--bg-element);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    font-weight: 700;
    min-width: 72px;
    text-align: center;
    color: var(--text-primary);
}

.radio-option:has(input:focus-visible) {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.radio-content {
    display: flex !important;
    /* Force flex */
    flex-direction: row !important;
    /* Force row to match Prijsvoorstel */
    align-items: center;
    justify-content: space-between;
    flex: 1;
    gap: 8px;
    width: 100%;
    /* Ensure it fills the card */
    /* Remove any potential borders/backgrounds from content wrapper */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

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

.radio-meta {
    color: var(--text-secondary);
    font-size: 13px;
}

.custom-tarief {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        margin-top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0;
}

.custom-tarief.active {
    max-height: 180px;
    opacity: 1;
    margin-top: 16px;
}

.radio-group.field-error {
    border: 1px solid var(--error);
    border-radius: var(--radius);
    padding: 6px;
}

.price-summary {
    margin-top: 16px;
}

.price-summary-card {
    background: var(--bg-element);
    border: 2px solid var(--rijssenbeek-blue);
    padding: 24px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.price-summary-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--rijssenbeek-blue);
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}

.summary-row.strong {
    padding-top: 12px;
    border-top: 2px solid var(--rijssenbeek-blue);
    margin-top: 4px;
    font-size: 17px;
}

.summary-row.strong span:last-child {
    font-weight: 700;
    color: var(--border-focus);
}

/* Removed duplicate form styles and placeholders */

.checklist {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: var(--gap-sm);
}


.checklist label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 15px;
    cursor: pointer;
    color: var(--text-primary);
    transition: color var(--trans-fast);
    font-weight: 400;
}

.checklist label:hover {
    color: var(--border-focus);
}

.checklist input[type="checkbox"] {
    /* Inherits global 20px size */
    margin-top: 0;
}

.checklist:hover,
.checklist:focus-within {
    border-color: var(--border-focus);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: var(--gap-md) 0 var(--gap-lg);
    flex-wrap: wrap;
}

.slider-group {
    margin-top: var(--gap-md);
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.checklist+label,
.slider-container+label,
textarea+label {
    margin-top: var(--gap-lg);
}

.slider-label {
    flex: 0 0 120px;
    font-size: 14px;
    font-weight: 600;
    color: var(--rijssenbeek-blue);
}

.slider-label.left {
    text-align: right;
}

.slider-label.right {
    text-align: left;
    color: var(--text-secondary);
    font-weight: 500;
}

.preset-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: var(--gap-md) 0 var(--gap-lg);
}

.preset-buttons {
    display: flex;
    gap: 8px;
}

.preset-chip {
    border: 1px solid var(--border-subtle);
    background: var(--bg-element);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--trans-fast);
    box-shadow: var(--shadow-sm);
}

.preset-chip:hover {
    background: var(--bg-element);
    color: var(--border-focus);
    transform: translateY(-1px);
    border-color: var(--border-focus);
    box-shadow: var(--shadow-md);
}

.preset-chip:active {
    transform: translateY(0);
}

input[type="range"] {
    flex: 1;
    appearance: none;
    -webkit-appearance: none;
    height: 6px;
    background: var(--slider-track);
    border-radius: var(--radius-full);
    cursor: pointer;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--slider-thumb);
    border: 3px solid var(--bg-panel);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    margin-top: -9px;
    transition: transform var(--trans-fast);
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--slider-thumb);
    border: 3px solid var(--bg-panel);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    transition: transform var(--trans-fast);
}

input[type="range"]:active::-webkit-slider-thumb {
    transform: scale(1.1);
    background: var(--rijssenbeek-gold);
}

input[type="range"]:focus {
    outline: none;
}

/* Persona feedback styling */
.persona-feedback {
    margin: 6px 0 var(--gap-md) 0;
    padding: 14px 16px;
    background: var(--rijssenbeek-gold-10);
    /* Subtle gold background */
    border-left: 4px solid var(--rijssenbeek-gold);
    font-size: 0.95rem;
    color: var(--rijssenbeek-blue);
    font-weight: 600;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    transition: all var(--trans-base);
}

/* --- 6. Buttons & Controls --- */
button.generate {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 40px auto 0 auto;
    padding: 18px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    background-color: var(--border-focus);
    color: var(--text-inverse);
    border: 2px solid var(--border-focus);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--trans-base);
    box-shadow: var(--shadow-lg);
}

button.generate:hover {
    background-color: var(--bg-panel);
    color: var(--border-focus);
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

button.generate:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

#promptContainer {
    display: none;
    max-width: none;
    width: 100%;
    margin: 0;
}

#gegenereerdePrompt {
    background: var(--code-bg);
    color: var(--code-text);
    font-family: "Monaco", "Consolas", monospace;
    font-size: 14px;
    padding: 20px;
    border-radius: var(--radius);
    border: none;
    margin-top: 10px;
}

.prompt-highlight {
    border: 2px solid rgba(46, 125, 50, 0.8) !important;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.copy-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--border-focus);
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
    background: rgba(14, 165, 233, 0.1);
    padding: 10px;
    border-left: 4px solid var(--info);
}

@media print {
    body {
        background: #ffffff;
    }

    .sidebar,
    .fab,
    .sidebar-overlay {
        display: none !important;
    }

}

.notification {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 20px;
    background: var(--bg-panel);
    border-left: 4px solid;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    font-weight: 500;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.notification.success {
    border-color: var(--success);
    color: var(--text-primary);
}

.notification.success i {
    color: var(--success);
}

.notification.error {
    border-color: var(--error);
    color: var(--text-primary);
}

.notification.error i {
    color: var(--error);
}

.notification.info {
    border-color: var(--info);
    color: var(--text-primary);
}

.notification.info i {
    color: var(--info);
}

.auto-save-notification {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: var(--bg-element);
    border-left: 4px solid var(--info);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    transition: opacity 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.dismiss-auto-save {
    margin-left: auto;
    padding: 4px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.dismiss-auto-save:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

@keyframes slideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

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

.error-message {
    color: var(--error);
    font-size: 13px;
    margin-top: 6px;
    display: none;
    font-weight: 600;
    align-items: center;
    gap: 6px;
}

.error-message::before {
    content: "!";
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 16px;
    height: 16px;
    background: var(--error);
    color: white;
    border-radius: 50%;
    font-size: 11px;
}

.field-error {
    border-color: var(--error) !important;
    background-color: rgba(211, 47, 47, 0.08) !important;
}

@media (max-width: 768px) {
    .container {
        padding: 24px;
    }

    .radio-group.horizontal {
        flex-direction: column;
    }

    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    h1 {
        font-size: 24px;
    }

    .slider-container {
        gap: 10px;
        flex-direction: column;
        align-items: stretch;
    }

    .slider-label {
        text-align: left !important;
        flex: auto;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    .radio-content {
        gap: 6px;
    }

    .radio-meta {
        display: block;
        margin-left: 0;
        margin-top: 2px;
    }

    .fiel-group {
        padding-bottom: 20px;
        margin-bottom: 20px;
    }
}

.custom-replacements-panel {
    width: 100%;
    margin: 6px 0 0 0;
    box-sizing: border-box;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
}

.custom-replacements-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.heading-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-pill);
    background: var(--bg-app);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle);
}

.custom-panel-title {
    margin: 2px 0 0 0;
    font-weight: 700;
    color: var(--border-focus);
}

.custom-replacements-body {
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
}

.summary-badge {
    margin-left: auto;
    padding: 3px 8px;
    background: var(--rijssenbeek-gold-20);
    color: var(--border-focus);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius-pill);
}

.custom-replacements-body label {
    margin-top: 0;
    margin-bottom: 8px;
}

.custom-replacements-body textarea {
    min-height: 80px;
    font-size: 14px;
    background: var(--bg-panel);
}

.custom-replacements-body textarea:disabled {
    background: var(--bg-app);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.history-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 12px 0;
    flex-wrap: wrap;
}

.history-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.history-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 0.85rem;
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel);
    border-radius: var(--radius-full);
    cursor: pointer;
    color: var(--text-primary);
    transition: all var(--trans-fast);
}

.history-btn.ghost {
    background: transparent;
    border-color: var(--border-subtle);
    color: var(--text-secondary);
    box-shadow: none;
}

.history-btn:hover:not(:disabled) {
    background: var(--bg-element);
    border-color: var(--border-focus);
    transform: translateY(-1px);
}

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

.history-status {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--border-focus);
    padding: 6px 12px;
    background: var(--bg-element);
    border-radius: var(--radius-sm);
}

.history-controls.disabled {
    opacity: 0.55;
}

.help-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 6px 0 0 0;
    font-style: italic;
    line-height: 1.4;
}

.storage-note {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin: 8px 0 0 0;
    background: var(--rijssenbeek-gold-10);
    /* Subtle gold background */
    border-left: 4px solid var(--rijssenbeek-gold);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
}

.modelreglement-suggestion {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--bg-element);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.modelreglement-suggestion strong {
    color: var(--border-focus);
}

.modelreglement-hint {
    display: block;
    color: var(--text-secondary);
    margin-top: 4px;
}

.reglement-reference-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.reglement-reference-row input {
    flex: 1;
}

.reglement-insert-button {
    padding: 10px 14px;
    background: var(--rijssenbeek-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--trans-fast), transform var(--trans-fast), box-shadow var(--trans-fast);
    min-width: 110px;
}

.reglement-insert-button:disabled {
    background: var(--border-subtle);
    color: var(--text-secondary);
    cursor: not-allowed;
    box-shadow: none;
}

.reglement-insert-button:not(:disabled):hover,
.reglement-insert-button:not(:disabled):focus-visible {
    background: #123c6b;
    box-shadow: var(--shadow-lg);
}

.reglement-insert-button:not(:disabled):active {
    transform: translateY(1px);
}

/* -------------------------------------------------------------------------- */
/*                          Bepalingen Picker                                 */
/* -------------------------------------------------------------------------- */

.bepalingen-picker {
    position: fixed;
    width: 340px;
    max-height: 450px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: pickerFadeIn 0.15s ease-out;
}

.bepalingen-picker.active {
    display: flex;
}

@keyframes pickerFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.bepalingen-picker-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--rijssenbeek-blue);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.bepalingen-picker-header i {
    width: 18px;
    height: 18px;
}

.bepalingen-picker-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--trans-fast);
}

.bepalingen-picker-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.bepalingen-picker-close i {
    width: 16px;
    height: 16px;
}

.bepalingen-picker-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-app);
}

.bepalingen-picker-search i {
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
}

.bepalingen-picker-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    padding: 0;
    box-shadow: none;
}

.bepalingen-picker-search input::placeholder {
    color: var(--text-tertiary);
}

.bepalingen-picker-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 300px;
}

.bepalingen-picker-card {
    padding: 10px 12px;
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--trans-fast);
}

.bepalingen-picker-card:hover {
    background: var(--bg-element);
    border-color: var(--rijssenbeek-gold);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.bepalingen-picker-card-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
}

.bepalingen-picker-card-header strong {
    color: var(--rijssenbeek-blue);
    font-size: 13px;
}

.bepalingen-picker-card-titel {
    color: var(--text-secondary);
    font-size: 12px;
    font-style: italic;
}

.bepalingen-picker-card-preview {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bepalingen-picker-hint {
    padding: 8px 12px;
    background: var(--bg-app);
    border-top: 1px solid var(--border-subtle);
    font-size: 11px;
    color: var(--text-tertiary);
    text-align: center;
}

.bepalingen-picker-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* -------------------------------------------------------------------------- */
/*                               Encyclopedie                                 */
/* -------------------------------------------------------------------------- */

#encyclopedie .search-bar-container {
    display: flex;
    align-items: center;
    position: relative;
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0 12px;
    box-shadow: var(--shadow-sm);
    transition: all var(--trans-fast);
}

#encyclopedie .search-bar-container:focus-within {
    border-color: var(--rijssenbeek-gold);
    box-shadow: 0 0 0 3px var(--rijssenbeek-gold-25);
}

#encyclopedie .search-icon {
    color: var(--text-tertiary);
    width: 20px;
    height: 20px;
}

#encyclopedie .search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    width: 100%;
    box-shadow: none;
    /* Reset global input shadow */
}

#encyclopedie .search-input:focus {
    box-shadow: none;
    /* Ensure no shadow on focus */
    background: transparent;
    /* Keep transparent background */
    border-color: transparent;
}

#encyclopedie .search-clear-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--trans-fast);
}

#encyclopedie .search-clear-btn:hover {
    background: var(--bg-element);
    color: var(--text-primary);
}

#encyclopedie .source-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.filter-separator {
    color: var(--border-subtle);
    font-weight: 300;
    margin: 0 4px;
    user-select: none;
}

#encyclopedie .results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

#encyclopedie .btn-export {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--trans-fast);
}

#encyclopedie .btn-export:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-focus);
}

#encyclopedie .btn-export:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-element);
}

#encyclopedie .btn-export i {
    width: 16px;
    height: 16px;
}

#encyclopedie .results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    min-height: 200px;
}

#encyclopedie .result-card {
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all var(--trans-fast);
    position: relative;
}

#encyclopedie .result-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-focus);
    transform: translateY(-2px);
}

#encyclopedie .result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

#encyclopedie .result-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--rijssenbeek-blue);
    background: var(--rijssenbeek-blue-08);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

#encyclopedie .result-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

#encyclopedie .result-copy-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--trans-fast);
}

#encyclopedie .result-copy-btn:hover {
    background: var(--bg-element);
    color: var(--rijssenbeek-blue);
    border-color: var(--rijssenbeek-blue);
}

#encyclopedie .result-copy-btn.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

#encyclopedie .result-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Empty State */
#encyclopedie .empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-tertiary);
    text-align: center;
}

#encyclopedie .transposition-mini {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-subtle);
}

#encyclopedie .transposition-mini-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

#encyclopedie .transposition-mini-head {
    margin-bottom: 6px;
}

#encyclopedie .transposition-mini-th {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    letter-spacing: 0.6px;
}

#encyclopedie .transposition-mini-td {
    min-height: 26px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 6px 6px;
    border-radius: var(--radius-sm);
    background: rgba(28, 53, 94, 0.03);
    border: 1px solid rgba(28, 53, 94, 0.06);
}

#encyclopedie .transposition-mini-td[data-current="1"] {
    background: rgba(28, 53, 94, 0.06);
    border-color: rgba(28, 53, 94, 0.12);
}

#encyclopedie .transposition-mini-chip {
    appearance: none;
    border: 1px solid rgba(28, 53, 94, 0.18);
    background: white;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--trans-fast);
}

#encyclopedie .transposition-mini-chip:hover {
    border-color: var(--rijssenbeek-blue);
    color: var(--rijssenbeek-blue);
    background: var(--rijssenbeek-blue-04);
}

#encyclopedie .transposition-mini-empty {
    font-size: 12px;
    color: var(--text-tertiary);
}

#encyclopedie .empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Easter Egg: Norbot */
.norbot-container {
    position: fixed;
    /* Fixed to viewport for right corner positioning */
    bottom: -200px;
    /* Start hidden */
    right: 200px;
    /* Position in right corner */
    left: auto;
    transform: none;
    width: 140px;
    z-index: 1000;
    /* Above other content */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    transition: bottom 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0s linear 0.5s;
    pointer-events: none;
    visibility: hidden;
    /* Hidden until triggered - prevents spoiling easter egg when scrolling */
}

.norbot-container.visible {
    pointer-events: auto;
    visibility: visible;
    transition: bottom 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0s linear 0s;
    /* bottom value is set by JS for randomness */
}

/* Ensure sidebar footer covers Norbot */
.sidebar-footer {
    position: relative;
    z-index: 10;
    /* Higher than Norbot */
    background: var(--bg-panel);
    /* Ensure opacity needed to hide him */
}


.norbot-image {
    width: 120px;
    height: auto;
    cursor: pointer;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    transition: transform 0.2s ease;
}

.norbot-image:hover {
    transform: scale(1.05);
    /* Just scale, no rotate */
}

.norbot-bubble {
    background: var(--bg-panel);
    color: var(--rijssenbeek-blue);
    padding: 8px 12px;
    border-radius: 12px 12px 12px 12px;
    /* Changed: left corner now rounded, right corner now pointed */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-subtle);
    margin-bottom: -5px;
    margin-right: 20px;
    /* Shift left slightly to connect with avatar */
    width: 160px;
    font-size: 11px;
    line-height: 1.3;
    text-align: center;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    transition: all 0.3s ease 0.2s;
}

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

/* Comic bubble tail - points to the right toward avatar */
.norbot-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 75px;
    left: auto;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 10px solid var(--bg-panel);
    transform: rotate(-20deg);
}

.norbot-bubble::before {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 73px;
    left: auto;
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 12px solid var(--border-subtle);
    transform: rotate(-20deg);
    z-index: -1;
}

/* -------------------------------------------------------------------------- */
/*                          QUICK WINS & VERBETERPUNTEN                       */
/* -------------------------------------------------------------------------- */

/* QW8: Contrast-verhoging help-text (WCAG AA compliant) */
.help-text {
    color: #475569;
    /* Verhoogd contrast van #64748b */
}

/* Sticky header shadow removed - headers are no longer sticky */

/* Input with icon (klok, euro) */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    pointer-events: none;
    z-index: 1;
}

.input-with-icon input {
    padding-left: 44px;
}

.input-with-icon input:focus+.input-icon,
.input-with-icon:focus-within .input-icon {
    color: var(--rijssenbeek-gold);
}

/* 4.1 Midden: Resultaat container altijd zichtbaar met empty state */
#promptContainer.prompt-container-visible {
    display: block !important;
    margin: 48px 0 0;
    padding: 32px 24px 24px;
    background: var(--bg-element);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    /* Horizontal separator line above result */
    border-top: 3px solid var(--rijssenbeek-gold);
    position: relative;
}

#promptContainer.prompt-container-visible.has-content {
    border-color: var(--success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

#promptContainer .prompt-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 16px;
    color: var(--text-tertiary);
}

#promptContainer .prompt-empty-state .empty-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
}

#promptContainer .prompt-empty-state p {
    margin: 0;
    font-size: 14px;
    max-width: 280px;
}

#promptContainer.has-content .prompt-empty-state {
    display: none;
}

#promptContainer.has-content #promptActions,
#promptContainer.has-content #gegenereerdePrompt {
    display: flex !important;
}

#promptContainer.has-content #gegenereerdePrompt {
    display: block !important;
}

/* QW2: Loading state op Genereer-knop */
.btn-primary.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-primary.is-loading span {
    opacity: 0;
}

.btn-primary.is-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
}

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

/* 4.5 Hoog: Footer toggles disabled state */
.footer-btn:disabled,
.footer-btn:has(input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.footer-btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 4.3 Midden: Field-groups visuele nesting-indicatie */
.field-group .field-group {
    margin-left: 0;
    border-left: 3px solid var(--rijssenbeek-gold);
    padding-left: 20px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

/* 4.4 Midden: Consistentere code-styling resultaat */
#gegenereerdePrompt {
    font-family: 'SF Mono', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    background: var(--code-bg);
    color: var(--code-text);
    border: none;
    padding: 20px;
    border-radius: var(--radius-md);
}

/* 4.6 Midden: Notification dismiss-optie */
.notification {
    padding-right: 40px;
}

.notification .notification-dismiss {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-tertiary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--trans-fast);
}

.notification .notification-dismiss:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

/* QW4: Aria labels on sliders - visual feedback */
input[type="range"]:focus-visible {
    outline: 2px solid var(--rijssenbeek-gold);
    outline-offset: 4px;
    border-radius: var(--radius-full);
}

/* Extra: Verbeterde slider styling met focus visibility */
input[type="range"]::-webkit-slider-thumb:focus {
    box-shadow: 0 0 0 4px rgba(196, 167, 125, 0.4);
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .notification,
    .norbot-container,
    .norbot-bubble {
        animation: none;
        transition: none;
    }
}

/* ========================================
   Contextual Pseudonymization Panels
   ======================================== */
.pseudo-panel {
    margin-top: 8px;
    border-radius: var(--radius-md);
    background: transparent;
}



.pseudo-panel .pseudo-content {
    display: none;
    padding: 12px;
    margin-top: 8px;
    background: var(--bg-element);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    animation: slideDown 0.15s ease-out;
}

.pseudo-panel .pseudo-content.is-visible {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

.pseudo-panel .pseudo-content .help-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.pseudo-panel .pseudo-content textarea {
    width: 100%;
    min-height: 60px;
    padding: 10px;
    font-size: 13px;
    font-family: "DM Sans", sans-serif;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-panel);
    color: var(--text-primary);
    resize: vertical;
    transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
    box-sizing: border-box;
}

.pseudo-panel .pseudo-content textarea:focus {
    outline: none;
    border-color: var(--rijssenbeek-gold);
    box-shadow: 0 0 0 3px var(--rijssenbeek-gold-20);
}

.pseudo-panel .pseudo-content textarea::placeholder {
    color: var(--text-tertiary);
}

/* ========================================
   Article Suggestions
   ======================================== */
.suggestions-container {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-subtle);
}

.suggestions-container>label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.suggestion-card {
    padding: 12px;
    background: var(--bg-element);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--trans-fast);
}

.suggestion-card:hover {
    background: var(--bg-panel);
    border-color: var(--rijssenbeek-gold);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.suggestion-card.is-added {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    cursor: default;
}

.suggestion-card.is-added:hover {
    transform: none;
    box-shadow: none;
}

.suggestion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.suggestion-artikel {
    font-size: 13px;
    font-weight: 700;
    color: var(--rijssenbeek-blue);
}

.suggestion-check {
    width: 16px;
    height: 16px;
    color: var(--success);
}

.suggestion-preview {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

@media (max-width: 768px) {
    .suggestions-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Confirmation Modal
   ======================================== */
.confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.2s ease;
}

.confirm-modal {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    text-align: center;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

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

.confirm-modal-icon {
    color: var(--warning);
    margin-bottom: 16px;
}

.confirm-modal-message {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-modal-cancel,
.confirm-modal-confirm {
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans-fast);
    border: none;
}

.confirm-modal-cancel {
    background: var(--bg-element);
    color: var(--text-secondary);
}

.confirm-modal-cancel:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.confirm-modal-confirm {
    background: var(--danger);
    color: white;
}

.confirm-modal-confirm:hover {
    background: hsl(0, 75%, 55%);
}

.confirm-modal-confirm:focus {
    outline: 2px solid var(--danger);
    outline-offset: 2px;
}

/* ========================================
   Article Preview Modal (Encyclopedia)
   ======================================== */
.article-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.2s ease;
    padding: 24px;
}

.article-preview-modal {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

.article-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.article-preview-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--rijssenbeek-blue);
    margin: 0;
}

.article-preview-close {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-tertiary);
    border-radius: var(--radius-sm);
    transition: all var(--trans-fast);
}

.article-preview-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.article-preview-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.article-preview-content pre {
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

.article-preview-footer {
    display: flex;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
}

.article-preview-copy {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--rijssenbeek-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.article-preview-copy:hover {
    background: var(--rijssenbeek-blue-dark);
}

.article-preview-copy.copied {
    background: var(--success);
}

/* Rich Checklist Items */
.checklist {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    cursor: pointer;
}

.checklist-item:hover .checklist-label {
    color: var(--rijssenbeek-blue);
}

.checklist-item input[type="checkbox"] {
    accent-color: var(--rijssenbeek-gold);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checklist-checkbox {
    display: flex;
    align-items: flex-start;
    margin-top: 3px;
    /* Align with title baseline */
}

.checklist-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.checklist-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.checklist-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ========================================
   Pseudonimiseren Standalone Tool
   ======================================== */
#pseudonimiseren .pseudo-output-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--rijssenbeek-gold);
}

#pseudonimiseren .pseudo-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

#pseudonimiseren .pseudo-output-header label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

#pseudonimiseren #pseudo_output_text {
    background: var(--bg-element);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-primary);
    width: 100%;
    box-sizing: border-box;
}

#pseudonimiseren .pseudo-replacements {
    margin-top: 1.25rem;
    padding: 16px;
    background: var(--bg-element);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

#pseudonimiseren .pseudo-replacements label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: block;
}

#pseudonimiseren .pseudo-replacements-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

#pseudonimiseren .pseudo-replacements-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#pseudonimiseren .pseudo-replacements-list li:last-child {
    border-bottom: none;
}

#pseudonimiseren .pseudo-replacements-list .original {
    color: var(--text-secondary);
    font-style: italic;
}

#pseudonimiseren .pseudo-replacements-list .replacement {
    color: var(--rijssenbeek-gold);
    font-weight: 600;
    font-family: monospace;
    background: var(--rijssenbeek-gold-10);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

#pseudonimiseren .pseudo-replacements-list .no-replacements {
    color: var(--text-tertiary);
    font-style: italic;
}

#pseudonimiseren .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 24px;
    background: var(--rijssenbeek-blue);
    border: none;
    border-radius: var(--radius-md);
    font-family: "DM Sans", sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--trans-fast);
}

#pseudonimiseren .btn-primary:hover {
    background: #152844;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

#pseudonimiseren .btn-primary i {
    width: 18px;
    height: 18px;
}

/* Button auto-width modifier */
.btn-auto-width {
    width: auto !important;
}

/* Inline link style */
.inline-link {
    color: var(--rijssenbeek-blue);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color var(--trans-fast);
}

.inline-link:hover {
    color: var(--rijssenbeek-gold);
    text-decoration: underline;
}

/* Radio Group Styling */
.radio-group.horizontal {
    display: flex;
    gap: 12px;
}

.radio-option {
    flex: 1;
    position: relative;
    cursor: pointer;
    display: flex;
}

.radio-option input {
    position: absolute;
    opacity: 0;
}

.radio-content {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-panel);
    width: 100%;
    transition: all var(--trans-fast);
}

.radio-option input:checked+.radio-content {
    border-color: var(--rijssenbeek-blue);
    background-color: rgba(28, 53, 94, 0.05);
}

.radio-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.radio-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.inline-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

/* ===================================
   SEMANTIC SEARCH STYLES
   =================================== */

/* Search Input Wrapper */
#semantisch_zoeken .section-description {
    margin-bottom: 28px;
}

#search_input_container {
    background: rgba(241, 245, 249, 0.55);
    border-color: var(--border-subtle);
    padding: 24px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 84px;
}

.search-input-icon {
    position: absolute;
    left: 20px;
    width: 22px;
    height: 22px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-input-wrapper input {
    min-height: 84px;
    padding-left: 60px;
    padding-right: 92px;
    font-size: 15px;
}

.search-clear-btn {
    position: absolute;
    right: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--trans-fast);
}

.search-clear-btn:hover {
    background: var(--bg-element);
    color: var(--text-primary);
}

/* Optimize Button (inside search input) */
.search-optimize-btn {
    position: absolute;
    right: 50px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--rijssenbeek-gold);
    cursor: pointer;
    transition: all var(--trans-fast);
}

.search-optimize-btn:hover {
    background: var(--rijssenbeek-gold-12);
    color: var(--rijssenbeek-blue);
    transform: scale(1.1);
}

.search-optimize-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.search-optimize-btn .animate-spin {
    animation: spin 1s linear infinite;
}

/* Optimized Query Preview */
.search-optimized-preview {
    margin-top: 10px;
    padding: 14px 16px;
    background: var(--rijssenbeek-gold-06);
    border: 1px solid var(--rijssenbeek-gold-25);
    border-radius: var(--radius-md);
    animation: fadeSlideIn 0.25s ease-out;
}

.search-optimized-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--rijssenbeek-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.search-optimized-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.search-optimized-actions {
    display: flex;
    gap: 8px;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

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

/* Filter Chips */
.search-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

#semantisch_zoeken .filter-separator {
    color: var(--border-default);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--trans-fast);
}

.filter-chip:hover {
    border-color: var(--rijssenbeek-blue);
    color: var(--rijssenbeek-blue);
}

.filter-chip.active {
    background: var(--rijssenbeek-blue);
    border-color: var(--rijssenbeek-blue);
    color: white;
}

/* KG Toggle inline with filter chips */
.search-kg-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-left: 8px;
    height: 32px;
    /* Match chip height */
    width: auto;
}

.search-kg-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    user-select: none;
    line-height: 1;
}

/* Inline search options (recency etc.) */
.search-options-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 8px;
}

/* Search Options */
.search-options {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 10px;
}

.search-option-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    user-select: none;
}

.search-option-toggle input[type="checkbox"] {
    accent-color: var(--rijssenbeek-blue);
    width: 14px;
    height: 14px;
}

/* Search Stats */
.search-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(180deg, rgba(28, 53, 94, 0.03), rgba(28, 53, 94, 0.01));
    border: 1px solid rgba(28, 53, 94, 0.08);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 14px;
}

.search-stats-badges {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

.search-stats-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel);
    color: var(--rijssenbeek-blue);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.search-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 16px;
    margin: 0 0 16px;
}

.search-overview-card {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px;
}

.search-overview-card-summary {
    background: rgba(28, 53, 94, 0.045);
    border-color: rgba(28, 53, 94, 0.12);
}

.search-overview-card-docs {
    background: var(--bg-element);
}

.search-overview-heading {
    margin-bottom: 12px;
}

.search-overview-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--rijssenbeek-blue);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.search-overview-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Loading State */
.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 48px 24px;
    background: rgba(241, 245, 249, 0.65);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.search-loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--rijssenbeek-blue);
    border-radius: 50%;
    animation: search-spin 1s linear infinite;
}

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

/* Generic spinner helper (used by loader icons) */
.spinning,
.spin {
    animation: spin 1s linear infinite;
}

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

.search-loading-text {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Search Results Container */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.search-results-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.search-results-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.search-results-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

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

.search-results:hover,
.search-results:focus,
.search-results:focus-within {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Shared card foundation for search-related surfaces */
.search-result-card,
.top-document-card,
.ai-summary-card {
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.search-result-card,
.top-document-card {
    transition: transform var(--trans-fast), box-shadow var(--trans-fast), border-color var(--trans-fast);
}

/* Search Result Card */
.search-result-card {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    margin-bottom: 10px !important;
    isolation: isolate;
}

/* Result number badge - inline at end of header for AI summary reference */
.search-result-number,
.top-document-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.search-result-number {
    background: var(--bg-element);
    border: 1px solid var(--border-subtle);
    color: var(--text-tertiary);
    margin-left: 8px;
}

.search-result-card:last-child {
    margin-bottom: 0 !important;
}

.search-result-card:hover {
    border-color: var(--rijssenbeek-blue);
    box-shadow: var(--shadow-md);
    z-index: 1;
    /* Lift hovered card above siblings */
}

.search-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-element);
}

.search-result-header .search-result-open {
    margin-left: auto;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.search-result-source {
    font-size: 14px;
    font-weight: 600;
    color: var(--rijssenbeek-blue);
    min-width: 0;
}

.search-result-type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result-passages {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--rijssenbeek-blue);
    background: var(--rijssenbeek-blue-08);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 500;
}

.search-result-score {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: help;
}

.relevance-dots {
    /* Hidden - using percentage instead */
    display: none;
}

.relevance-percent {
    font-size: 12px;
    font-weight: 700;
}

.relevance-label {
    /* Hidden - only show dots for cleaner UI */
    display: none;
}

.search-result-score.high {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.search-result-score.medium {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.search-result-score.low {
    background: rgba(107, 114, 128, 0.1);
    border-color: var(--text-tertiary);
    color: var(--text-secondary);
}

/* Match Reasons (result transparency) */
.search-result-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-element);
    border-bottom: 1px solid var(--border-subtle);
}

.match-reason {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: var(--rijssenbeek-blue-08);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--rijssenbeek-blue);
    font-weight: 500;
}

/* Show More Results Button */
.search-show-more {
    display: flex;
    justify-content: center;
    padding: 12px;
    margin-top: 8px;
}

.search-show-more-btn {
    padding: 10px 20px;
    background: var(--bg-element);
}

.search-show-more-btn:hover {
    background: var(--bg-panel);
    border-color: var(--rijssenbeek-blue);
    color: var(--rijssenbeek-blue);
}

/* Additional (lower-scored) results - subtle muted style */
.search-result-card.additional {
    opacity: 0.85;
    /* Same border as regular cards, just slightly muted */
}

.search-result-body {
    padding: 14px;
}

.search-result-text {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-primary);
}

.search-result-text mark {
    background: var(--rijssenbeek-gold-30);
    color: inherit;
    padding: 1px 3px;
    border-radius: 2px;
}

.search-result-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-element);
}

.search-result-location {
    font-size: 12px;
    color: var(--text-tertiary);
}

.search-result-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-result-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--rijssenbeek-blue);
    border: none;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all var(--trans-fast);
    text-decoration: none;
}

.search-result-action:hover {
    background: var(--rijssenbeek-gold);
    color: var(--rijssenbeek-blue);
}

.search-result-open {
    background: var(--bg-panel);
    border: 1px solid var(--rijssenbeek-blue);
    color: var(--rijssenbeek-blue);
}

.search-result-open:hover {
    background: var(--rijssenbeek-blue);
    color: white;
}

.search-selection-summary {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px solid rgba(28, 53, 94, 0.08);
}

.search-selection-summary-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.search-selection-summary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    background: var(--bg-panel);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.search-selection-summary-btn:hover:not(:disabled) {
    border-color: var(--rijssenbeek-blue);
    color: var(--rijssenbeek-blue);
}

.search-selection-summary-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.search-result-tools {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.search-result-select {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-result-select-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.search-result-select-control {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(28, 53, 94, 0.14);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--trans-fast);
}

.search-result-select-control:hover {
    border-color: rgba(28, 53, 94, 0.24);
    color: var(--rijssenbeek-blue);
    background: rgba(28, 53, 94, 0.04);
}

.search-result-card.is-selected {
    border-color: rgba(28, 53, 94, 0.24);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.search-result-card.is-selected .search-result-select-control {
    background: var(--rijssenbeek-blue);
    border-color: var(--rijssenbeek-blue);
    color: white;
}

/* Search 2 simple mode: list-style results instead of boxed cards */
.search2-body.search-mode-simple .search-stats,
.search2-body.search-mode-research .search-stats {
    display: inline-flex;
    width: fit-content;
    padding: 0;
    margin: 0 0 8px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.search2-body.search-mode-simple .search-results-list,
.search2-body.search-mode-research .search-results-list {
    gap: 0;
}

.search2-body.search-mode-simple .search-result-card,
.search2-body.search-mode-research .search-result-card {
    margin: 0 !important;
    padding: 18px 0 20px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(28, 53, 94, 0.10);
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.search2-body.search-mode-simple .search-result-card:first-child,
.search2-body.search-mode-research .search-result-card:first-child {
    border-top: 1px solid rgba(28, 53, 94, 0.10);
}

.search2-body.search-mode-simple .search-result-card:hover,
.search2-body.search-mode-research .search-result-card:hover {
    border-color: rgba(28, 53, 94, 0.16);
    box-shadow: none;
    z-index: auto;
}

.search2-body.search-mode-simple .search-result-header,
.search2-body.search-mode-research .search-result-header {
    gap: 14px;
    padding: 0;
    border-bottom: 0;
    background: transparent;
    align-items: flex-start;
}

.search2-body.search-mode-simple .search-result-score,
.search2-body.search-mode-research .search-result-score {
    flex-shrink: 0;
    padding: 3px 10px;
    background: rgba(16, 185, 129, 0.08);
}

.search2-body.search-mode-simple .search-result-score.medium,
.search2-body.search-mode-research .search-result-score.medium {
    background: rgba(245, 158, 11, 0.08);
}

.search2-body.search-mode-simple .search-result-score.low,
.search2-body.search-mode-research .search-result-score.low {
    background: rgba(148, 163, 184, 0.10);
}

.search2-body.search-mode-simple .search-result-meta,
.search2-body.search-mode-research .search-result-meta {
    flex: 1;
    min-width: 0;
    gap: 6px;
}

.search2-body.search-mode-simple .search-result-source,
.search2-body.search-mode-research .search-result-source {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--rijssenbeek-blue);
}

.search2-body.search-mode-simple .search-result-article,
.search2-body.search-mode-research .search-result-article {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(28, 53, 94, 0.06);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
}

.search2-body.search-mode-simple .search-result-action,
.search2-body.search-mode-research .search-result-action {
    flex-shrink: 0;
}

.search2-body.search-mode-simple .search-result-open,
.search2-body.search-mode-research .search-result-open {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(28, 53, 94, 0.14);
    color: var(--rijssenbeek-blue);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.search2-body.search-mode-simple .search-result-open:hover,
.search2-body.search-mode-research .search-result-open:hover {
    background: rgba(28, 53, 94, 0.06);
    border-color: rgba(28, 53, 94, 0.24);
    color: var(--rijssenbeek-blue);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.search2-body.search-mode-simple .search-result-body,
.search2-body.search-mode-research .search-result-body {
    padding: 10px 0 0 54px;
}

.search2-body.search-mode-simple .search-result-text,
.search2-body.search-mode-research .search-result-text {
    max-width: 92ch;
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-primary);
}

.search2-body.search-mode-simple .search-result-card.additional {
    opacity: 0.72;
}

.search2-body.search-mode-simple .search-result-select {
    display: none;
}

.search2-body.search-mode-research .search-overview {
    grid-template-columns: minmax(0, 1fr);
}

.search2-body.search-mode-research .search-overview-card {
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(28, 53, 94, 0.08);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.03);
}

.search2-body.search-mode-research .search-result-card.is-selected {
    border-color: rgba(28, 53, 94, 0.2);
    background: rgba(28, 53, 94, 0.02);
    box-shadow: none;
}

.search2-body.search-mode-research .search-result-select-control {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.search2-body.search-mode-research .search-result-card.is-selected .search-result-select-control {
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.search2-body.search-mode-research .search-selection-summary {
    margin-top: 12px;
    padding-top: 12px;
}

.search2-body.search-mode-research .search-results-section-header {
    margin-bottom: 4px;
}

.search2-body.search-mode-research .search-results-subtitle {
    margin-top: 2px;
}

@media (max-width: 768px) {
    .search2-body.search-mode-simple .search-result-header,
    .search2-body.search-mode-research .search-result-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }

    .search2-body.search-mode-simple .search-result-body,
    .search2-body.search-mode-research .search-result-body {
        padding-left: 0;
    }

    .search2-body.search-mode-simple .search-result-open,
    .search2-body.search-mode-research .search-result-open,
    .search2-body.search-mode-research .search-result-select-control {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

    .search2-body.search-mode-simple .search-result-text,
    .search2-body.search-mode-research .search-result-text {
        max-width: 100%;
        font-size: 14px;
        line-height: 1.7;
    }

    .search-selection-summary {
        align-items: stretch;
    }

    .search-selection-summary-btn {
        width: 100%;
    }

    .search-result-tools {
        gap: 8px;
    }
}

/* Empty States */
.search-empty-state,
.search-initial-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 48px 24px;
    text-align: center;
}

.search-empty-state .empty-icon,
.search-initial-state .empty-icon {
    width: 56px;
    height: 56px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.search-empty-state p,
.search-initial-state p {
    font-size: 17px;
    color: var(--text-secondary);
    margin: 0;
}

.search-initial-state {
    background: rgba(241, 245, 249, 0.65);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-lg);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .search-filter-chips {
        gap: 6px;
    }

    .filter-chip {
        height: 28px;
        padding: 0 10px;
        font-size: 12px;
    }

    .search-result-header {
        flex-direction: column;
        gap: 8px;
    }

    .search-result-score {
        align-self: flex-start;
    }
}

/* === Prijsvoorstel Radio Buttons - Horizontal Layout === */
#prijsvoorstel .radio-group.horizontal .radio-option {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
}

#prijsvoorstel .radio-content {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    width: 100% !important;
    /* Hard reset of global styles */
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

#prijsvoorstel .radio-option input:checked+.radio-content {
    background: transparent;
    border: none;
}

#prijsvoorstel .radio-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

#prijsvoorstel .radio-meta {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
}



/* === Fix Prijsvoorstel Checkbox Ruimte === */
/* Herstel naar full width maar behoud redelijke padding */
#prijsvoorstel .field-group:has(#prijs_overeenkomst_toggle),
#prijsvoorstel .field-group:has(#prijs_vast_tarief_toggle) {
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
    padding: 4px 24px;
}

#prijsvoorstel .field-group:has(#prijs_overeenkomst_toggle) .help-text {
    margin-bottom: 12px;
}

/* === Sidebar Vereenvoudiging === */
/* Verberg nav-iconen in normale view (expanded) voor rustiger beeld */
.sidebar:not(.collapsed) .nav-icon,
.sidebar:not(.collapsed) .nav-group-label i.group-icon {
    display: none;
}

/* Pas gap aan omdat icoon weg is in expanded view */
.sidebar:not(.collapsed) .nav-item {
    gap: 0;
}

.sidebar:not(.collapsed) .nav-group-label {
    gap: 4px;
}

/* === Encyclopedie Filter Fix === */
/* Hergebruikt de generieke .filter-chip en vult alleen encyclopedie-specifieke afwijkingen aan */
#encyclopedie .filter-chip {
    height: 32px;
    padding: 0 14px;
    line-height: normal;
    justify-content: center;
    box-sizing: border-box;
    user-select: none;
}

#encyclopedie .filter-chip input {
    margin: 0;
    width: 0;
    height: 0;
    opacity: 0;
    position: absolute;
}

/* Hover state */
#encyclopedie .filter-chip:hover {
    border-color: var(--rijssenbeek-blue);
    color: var(--rijssenbeek-blue);
}

/* Active state (Voor Button .active EN Label:has(:checked)) */
#encyclopedie .filter-chip.active,
#encyclopedie .filter-chip:has(input:checked) {
    background: var(--rijssenbeek-blue);
    border-color: var(--rijssenbeek-blue);
    color: white;
}

/* =========================================
   Skeleton Loading States
   ========================================= */

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, var(--bg-element) 4%, var(--bg-panel) 25%, var(--bg-element) 36%);
    background-size: 1000px 100%;
}

.skeleton-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--gap-md);
    margin-bottom: var(--gap-md);
    box-shadow: var(--shadow-sm);
}

.skeleton-header {
    height: 24px;
    width: 70%;
    margin-bottom: var(--gap-sm);
    border-radius: var(--radius-sm);
}

.skeleton-meta {
    display: flex;
    gap: var(--gap-sm);
    margin-bottom: var(--gap-md);
}

.skeleton-badge {
    height: 20px;
    width: 60px;
    border-radius: var(--radius-full);
}

.skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
}

.skeleton-text:last-child {
    width: 80%;
}

/* =========================================
   Keyboard Shortcuts
   ========================================= */

.keyboard-hint {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-left: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

.sticky-footer .keyboard-hint {
    margin-left: 12px;
}

.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.section-title-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    vertical-align: middle;
    margin-left: 6px;
}


/* --- 10. Utilities --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.hidden {
    display: none !important;
}

/* ==========================================
   HOME / LANDING PAGE
   ========================================== */

/* Hide the white container when landing page is active */
.container:has(.section--home[style*="block"]),
.container:has(#home[style*="block"]) {
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

/* Make section--home take full available space and center content */
/* Make section--home take full available space and center content */
.section--home {
    /* Default handled by .section (display: none) */
    width: 100%;
    min-height: calc(100vh - 40px);
    position: relative;
    margin: 0;
    padding: 0;
}

/* Upgrade display:block (from JS) to display:flex for centering */
.section--home[style*="display: block"],
.section--home[style*="display:block"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Reset parent containers when home is active */
.form-sections:has(.section--home[style*="block"]),
.content-grid:has(.section--home[style*="block"]),
.container:has(.section--home[style*="block"]) {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

.home-container {
    /* Removed absolute positioning */
    position: relative;
    text-align: center;
    max-width: 640px;
    width: calc(100% - 48px);
    padding: 0 20px;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Remove .home-title - no longer used */

.home-subtitle {
    font-size: 1rem;
    /* Engraved text effect */
    color: #a8b5c4;
    margin: 0 0 32px 0;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.7),
        0 -1px 1px rgba(0, 0, 0, 0.04);
    letter-spacing: 0.02em;
}

.home-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

@media (max-width: 768px) {
    .home-actions {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .section--home {
        min-height: auto;
        padding: 32px 16px;
    }
}

/* Engraved button effect - appears pressed into background */
.home-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 28px 20px;
    /* Inset/engraved background */
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    /* Inset shadow for debossed effect */
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.04),
        inset 0 -1px 0 rgba(255, 255, 255, 0.5);
}

.home-action-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(28, 53, 94, 0.15);
    box-shadow:
        0 4px 16px rgba(28, 53, 94, 0.08),
        inset 0 -1px 0 rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

.home-action-btn:focus-visible {
    outline: 2px solid var(--rijssenbeek-blue);
    outline-offset: 2px;
}

.home-action-btn:active {
    transform: translateY(0);
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Engraved icon - blue-gray with subtle depth */
.home-action-icon {
    width: 40px;
    height: 40px;
    color: #8fa3b8;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.6));
}

/* Engraved label text */
.home-action-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #6b7d92;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Engraved description */
.home-action-desc {
    font-size: 0.8rem;
    color: #9ca8b6;
    line-height: 1.4;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5);
}

.home-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #b0bac6;
    margin: 0;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5);
}


.home-hint i,
.home-hint svg {
    opacity: 0.6;
}

.home-version {
    display: block;
    font-size: 0.625rem;
    color: #c8d0da;
    margin-top: 1rem;
    letter-spacing: 0.5px;
}

/* Sidebar Home Button */
/* Sidebar Home Button - Icon Only, Centered, No Border */
.sidebar-home-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* Center icon */
    width: 100% !important;
    /* Full width to center relative to sidebar */
    height: 40px !important;
    padding: 0 !important;
    margin: 0 0 12px 0 !important;
    /* Remove horizontal margin */
    background: transparent;
    border: none !important;
    /* No border */
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--trans-fast);
}

.sidebar-home-btn span {
    display: none !important;
    /* Hide text */
}

.sidebar-home-btn:hover {
    background: var(--rijssenbeek-blue-04);
    color: var(--rijssenbeek-blue);
    border-color: var(--rijssenbeek-blue);
}

.sidebar-home-btn:focus-visible {
    outline: 2px solid var(--rijssenbeek-blue);
    outline-offset: -2px;
}

.sidebar-home-btn.active {
    background: var(--rijssenbeek-gold-12);
    border-color: var(--rijssenbeek-gold);
    color: var(--rijssenbeek-blue);
}

.sidebar-home-btn i,
.sidebar-home-btn svg {
    width: 20px !important;
    /* Slightly larger icon */
    height: 20px !important;
    flex-shrink: 0;
    margin: 0 !important;
}

/* --- User Badge (Sidebar Top) --- */
.sidebar-user-badge {
    padding: 0.25rem 0rem;
    text-align: center;
    border-bottom: none;
    width: 100%;
}

.sidebar-user-name {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 0.25rem;
}

.user-meta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.user-meta-row-actions {
    gap: 6px;
}

.autosave-chip {
    appearance: none;
    border: 1px solid var(--border-subtle);
    background: var(--bg-element);
    color: var(--text-secondary);
    font-size: 0;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--trans-fast);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.autosave-chip:hover {
    border-color: var(--border-focus);
    color: var(--text-primary);
}

.autosave-chip.is-off {
    opacity: 0.7;
}

.sidebar-user-role {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-user-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: all var(--trans-fast);
}

button.sidebar-user-action {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.sidebar-user-action:hover {
    color: var(--rijssenbeek-blue);
    background: var(--bg-element);
}

.sidebar-logout:hover {
    color: #dc2626;
    background: #fee2e2;
}

/* ========================================
   PILOT FEEDBACK WIDGET (Compact, Right-positioned)
   ======================================== */

.pilot-widget {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    font-family: "DM Sans", sans-serif;
}

/* Trigger Button (collapsed state) */
.pilot-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    background: var(--gradient-pilot);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transition: all var(--trans-fast);
}

.pilot-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.pilot-norbot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    padding: 2px;
    display: block;
    object-fit: contain;
    image-rendering: auto;
    image-rendering: -webkit-optimize-contrast;
    -ms-interpolation-mode: bicubic;
}

.pilot-trigger-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.pilot-trigger-text strong {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    opacity: 0.9;
}

.pilot-trigger-sub {
    font-size: 12px;
    font-weight: 500;
}

/* Feedback Panel (expanded state) */
.pilot-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    animation: pilotSlideIn 0.25s ease-out;
}

@keyframes pilotSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

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

.pilot-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--gradient-pilot);
    color: white;
}

.pilot-panel-norbot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    padding: 3px;
    display: block;
    object-fit: contain;
    image-rendering: auto;
    image-rendering: -webkit-optimize-contrast;
    -ms-interpolation-mode: bicubic;
}

.pilot-panel-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.pilot-panel-title strong {
    font-size: 15px;
    font-weight: 700;
}

.pilot-panel-title span {
    font-size: 12px;
    opacity: 0.85;
}

.pilot-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: background var(--trans-fast);
}

.pilot-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.pilot-close i {
    width: 16px;
    height: 16px;
}

/* Form Styles */
.pilot-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pilot-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pilot-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pilot-field select,
.pilot-field textarea {
    padding: 12px;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-element);
    transition: border-color var(--trans-fast), box-shadow var(--trans-fast), background var(--trans-fast);
}

.pilot-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.pilot-field textarea {
    resize: vertical;
    min-height: 100px;
}

.pilot-field select:focus,
.pilot-field textarea:focus {
    outline: none;
    border-color: var(--pilot-purple);
    background: white;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.pilot-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 0;
}

.pilot-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--pilot-purple);
    cursor: pointer;
}

.pilot-checkbox span {
    line-height: 1.3;
}

.pilot-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: var(--gradient-pilot);
    border: none;
    border-radius: 10px;
    color: white;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.pilot-submit:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #4f46e5 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.pilot-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pilot-submit i {
    width: 16px;
    height: 16px;
}

/* Emoji Rating Buttons */
.pilot-rating {
    display: flex;
    gap: 8px;
}

.rating-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--bg-element);
    border: 2px solid var(--border-subtle);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--trans-fast);
    opacity: 0.6;
}

.rating-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    border-color: var(--pilot-purple);
}

.rating-btn.selected {
    opacity: 1;
    background: rgba(124, 58, 237, 0.1);
    border-color: var(--pilot-purple);
    transform: scale(1.1);
}

/* Hide trigger when panel is open */
.pilot-widget.is-open .pilot-trigger {
    display: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .pilot-widget {
        top: auto;
        bottom: 16px;
        right: 16px;
    }

    .pilot-panel {
        position: fixed;
        top: auto;
        bottom: 70px;
        right: 16px;
        left: 16px;
        width: auto;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }

    .pilot-trigger-text {
        display: none;
    }

    .pilot-trigger {
        padding: 8px;
        border-radius: 50%;
    }

    .pilot-norbot {
        width: 36px;
        height: 36px;
    }
}

/* ==========================================================================
   ARTICLE AUTOCOMPLETE
   ========================================================================== */

.article-autocomplete-dropdown {
    position: fixed;
    z-index: 10000;
    width: 360px;
    max-height: 360px;
    background: #ffffff;
    border: 1px solid var(--border-default, #cbd5e1);
    border-radius: var(--radius, 2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: inherit;
}

.article-autocomplete-header {
    padding: 10px 14px;
    background: var(--bg-element, #f1f5f9);
    border-bottom: 1px solid var(--border-subtle, #e2e8f0);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-autocomplete-results {
    max-height: 280px;
    overflow-y: auto;
}

.article-autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}

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

.article-autocomplete-item:hover,
.article-autocomplete-item.selected {
    background: var(--bg-element, #f1f5f9);
}

.article-autocomplete-item .item-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary, #0f172a);
}

.article-autocomplete-item .item-preview {
    font-size: 12px;
    color: var(--text-tertiary, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.article-autocomplete-hint {
    padding: 8px 14px;
    background: var(--bg-element, #f1f5f9);
    border-top: 1px solid var(--border-subtle, #e2e8f0);
    font-size: 11px;
    color: var(--text-tertiary, #94a3b8);
    text-align: center;
}

.article-autocomplete-hint kbd {
    display: inline-block;
    padding: 1px 5px;
    background: #fff;
    border: 1px solid var(--border-subtle, #e2e8f0);
    border-radius: 2px;
    font-size: 10px;
    margin: 0 2px;
}

/* ==========================================================================
   PRIVACY REVIEW MODAL - Simplified, professional design
   ========================================================================== */

.privacy-review-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.privacy-review-modal.active {
    opacity: 1;
    visibility: visible;
}

.privacy-review-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.privacy-review-content {
    position: relative;
    width: 600px;
    max-width: 90vw;
    max-height: 80vh;
    background: #ffffff;
    border: 1px solid var(--border-default, #cbd5e1);
    border-radius: var(--radius, 2px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

/* Header */
.privacy-review-header {
    position: relative;
    display: flex;
    align-items: center;
    padding: 20px 50px 16px 20px;
    background: var(--bg-element, #f8fafc);
}

.privacy-review-header h2 {
    margin: 0;
    padding-bottom: 0;
    border-bottom: none;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
}

.privacy-review-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--text-tertiary, #94a3b8);
    cursor: pointer;
    border-radius: var(--radius, 2px);
}

.privacy-review-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary, #0f172a);
}

/* Body */
.privacy-review-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Summary section */
.privacy-review-summary {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}

.privacy-review-summary .no-replacements {
    margin: 0;
    color: var(--warning, #d97706);
    font-size: 14px;
}

.privacy-review-summary .replacement-intro {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #0f172a);
}

.privacy-review-summary .replacement-list {
    margin: 0;
    padding: 0 0 0 20px;
    font-size: 13px;
    color: var(--text-secondary, #475569);
}

.privacy-review-summary .replacement-list li {
    margin-bottom: 4px;
}

.privacy-review-summary .replacement-list del {
    color: var(--error, #dc2626);
    text-decoration: line-through;
}

.privacy-review-summary .replacement-list strong {
    color: var(--text-primary, #0f172a);
}

/* Text preview */
.privacy-review-text {
    padding: 14px;
    background: var(--bg-element, #f8fafc);
    border: 1px solid var(--border-subtle, #e2e8f0);
    border-radius: var(--radius, 2px);
    font-size: 13px;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.privacy-review-text mark {
    background: var(--rijssenbeek-gold-30);
    color: inherit;
    padding: 0 2px;
    border-radius: 1px;
}

/* Footer */
.privacy-review-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-subtle, #e2e8f0);
    background: var(--bg-element, #f8fafc);
}

.privacy-review-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    cursor: pointer;
}

.privacy-review-checkbox input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.privacy-review-checkbox span {
    font-size: 14px;
    color: var(--text-primary, #0f172a);
    line-height: 1.4;
}

.privacy-review-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.privacy-review-cancel,
.privacy-review-confirm {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius, 2px);
    cursor: pointer;
    transition: all 0.1s ease;
}

.privacy-review-cancel {
    background: transparent;
    border: 1px solid var(--border-default, #cbd5e1);
    color: var(--text-secondary, #475569);
}

.privacy-review-cancel:hover {
    background: var(--bg-element, #f1f5f9);
    border-color: var(--text-tertiary, #94a3b8);
}

.privacy-review-confirm {
    background: var(--rijssenbeek-blue, #1c355e);
    border: 1px solid var(--rijssenbeek-blue, #1c355e);
    color: #ffffff;
}

.privacy-review-confirm:hover:not(:disabled) {
    background: var(--rijssenbeek-blue-dark);
}

.privacy-review-confirm:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* === AI Summary Component === */
.ai-summary-container {
    margin: 0;
}

.search-overview-card-summary .ai-summary-container,
.search-overview-card-summary .ai-summary-optin,
.search-overview-card-summary .ai-summary-card.ai-summary-optin {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.top-documents-container {
    margin: 0;
}

.top-documents-header {
    display: none;
}

.top-documents-title {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
    color: var(--text-primary);
}

.top-documents-subtitle {
    margin: 3px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.top-documents-strip {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-document-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px 0;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(28, 53, 94, 0.08) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    text-decoration: none;
}

.top-document-card:hover {
    transform: none;
    border-bottom-color: rgba(28, 53, 94, 0.18);
    box-shadow: none !important;
}

.top-document-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--rijssenbeek-blue-08);
    border: 1px solid rgba(28, 53, 94, 0.12);
    color: var(--rijssenbeek-blue);
    font-weight: 700;
    border-radius: 999px;
    flex-shrink: 0;
}

.top-document-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.top-document-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-document-context {
    font-size: 12px;
    color: var(--text-secondary);
}

.top-document-link-icon {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

@media (max-width: 1100px) {
    .search-overview {
        grid-template-columns: 1fr;
    }
}

.ai-summary-card {
    background: rgba(28, 53, 94, 0.045);
    border-radius: var(--radius-md);
    border-color: rgba(28, 53, 94, 0.12);
    box-shadow: none;
}

.ai-summary-close,
.ai-summary-optin-dismiss {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--trans-fast);
    flex-shrink: 0;
}

.ai-summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(28, 53, 94, 0.03);
    border-bottom: 1px solid rgba(28, 53, 94, 0.1);
}

.ai-summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--gradient-brand-blue-soft);
    border-radius: var(--radius-sm);
    color: white;
    flex-shrink: 0;
}

.ai-summary-icon i {
    width: 16px;
    height: 16px;
}

.ai-summary-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--rijssenbeek-blue);
    flex: 1;
}

.ai-summary-close {
    padding: 6px;
}

.ai-summary-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.ai-summary-content {
    padding: 16px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
}

.ai-summary-footer {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.55);
    border-top: 1px solid rgba(28, 53, 94, 0.08);
}

.ai-summary-disclaimer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-tertiary);
}

.ai-summary-disclaimer i {
    opacity: 0.6;
}

/* Loading State */
.ai-summary-loading .ai-summary-header {
    background: linear-gradient(135deg, rgba(28, 53, 94, 0.05) 0%, rgba(28, 53, 94, 0.02) 100%);
}

.ai-summary-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--rijssenbeek-blue);
    border-radius: 50%;
    animation: ai-spin 0.8s linear infinite;
}

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

.ai-summary-skeleton {
    padding: 16px;
}

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, var(--bg-element) 0%, #e8ecf0 50%, var(--bg-element) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-line:last-child {
    margin-bottom: 0;
}

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

    100% {
        background-position: -200% 0;
    }
}

/* Success State - Gold accents (consistent with opt-in) */
.ai-summary-success {
    border-color: rgba(196, 167, 125, 0.5);
    background: linear-gradient(135deg, rgba(196, 167, 125, 0.05) 0%, rgba(28, 53, 94, 0.02) 100%);
}

.ai-summary-success .ai-summary-icon {
    background: var(--gradient-brand-gold);
}

/* Error State */
.ai-summary-error {
    border-color: rgba(239, 68, 68, 0.2);
}

.ai-summary-error .ai-summary-header {
    background: rgba(239, 68, 68, 0.03);
}

.ai-summary-error .ai-summary-icon {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

.ai-summary-error .ai-summary-title {
    color: var(--error);
}

.ai-summary-error-text {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Opt-In State */
.ai-summary-optin {
    padding: 2px 0 0;
}

.search-overview-card-summary .ai-summary-optin {
    display: flex;
    justify-content: flex-start;
}

.search-overview-card-summary .ai-summary-optin-content {
    padding: 0 !important;
}

.search-overview-card-summary .ai-summary-optin-icon,
.search-overview-card-summary .ai-summary-optin-dismiss {
    display: none !important;
}

.search-overview-card-summary .ai-summary-optin-warning i {
    display: none !important;
}

.ai-summary-optin-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 0;
    justify-content: flex-start;
}

.ai-summary-optin-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.ai-summary-optin-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.45;
}

.ai-summary-optin-warning {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.ai-summary-optin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    background: var(--rijssenbeek-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans-fast);
    flex-shrink: 0;
    white-space: nowrap;
}

.ai-summary-optin-btn:hover {
    background: var(--rijssenbeek-blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(28, 53, 94, 0.25);
}

.ai-summary-optin-btn:active {
    transform: translateY(0);
}

.ai-summary-optin-btn i {
    width: 14px;
    height: 14px;
}

/* Responsive: Stack on mobile */
@media (max-width: 640px) {
    .top-documents-strip {
        display: flex;
        flex-direction: column;
    }

    .ai-summary-optin-content {
        flex-wrap: wrap;
    }

    .ai-summary-optin-text {
        flex: 1 1 100%;
        order: 1;
    }

    .ai-summary-optin-btn {
        order: 2;
        width: 100%;
        justify-content: center;
        margin-top: 4px;
    }
}

/* ========================================
   Kritische Vragen RAG Feature
   ======================================== */

/* Generate button */
.kv-rag-generate-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.kv-rag-generate-btn i {
    width: 16px;
    height: 16px;
}

/* Progress indicator */
.kv-rag-progress {
    padding: 16px;
    background: var(--bg-element);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.kv-rag-progress-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    text-align: center;
}

/* Minimalist Claims Display */
.kv-rag-claims-details {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
}

.kv-rag-claims-summary {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.kv-rag-claims-summary:hover {
    color: var(--text-primary);
}

.kv-rag-claims-list {
    margin-top: 12px;
    padding-left: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.kv-rag-claim-item {
    margin-bottom: 4px;
}

/* Minimalist Questions Display */
.kv-rag-questions-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kv-rag-question-simple {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.kv-rag-question-simple:last-child {
    border-bottom: none;
}

.kv-rag-question-content {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.kv-rag-bullet {
    color: var(--rijssenbeek-gold);
    font-size: 16px;
    line-height: 1.5;
}

.kv-rag-question-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
}

.kv-rag-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-left: 20px;
    /* Align with text */
    margin-top: 4px;
}

.kv-rag-source-link {
    font-size: 12px;
    color: var(--text-tertiary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.kv-rag-source-link i {
    color: var(--text-tertiary);
}

.kv-rag-suggestion {
    margin-left: 20px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kv-rag-suggestion i {
    color: var(--rijssenbeek-blue);
    opacity: 0.6;
}

/* Error state */
.kv-rag-error {
    padding: 12px;
    color: #dc2626;
    font-size: 13px;
    background: rgba(239, 68, 68, 0.05);
    border-radius: var(--radius-sm);
}

/* Responsive */
@media (max-width: 768px) {
    .kv-rag-question-header {
        flex-direction: column;
        gap: 8px;
    }

    .kv-rag-claim-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* --- 10. Text Review --- */

.review-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    gap: 16px;
    color: var(--text-secondary);
}

.review-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--rijssenbeek-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.review-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-top: 16px;
    line-height: 1.7;
}

.review-content h1 {
    font-size: 18px;
    color: var(--rijssenbeek-blue);
    border-bottom: 2px solid var(--rijssenbeek-gold);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.review-content h2 {
    font-size: 16px;
    margin-top: 24px;
    background: var(--rijssenbeek-blue-04);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--rijssenbeek-blue);
}

.review-content h3 {
    font-size: 14px;
    font-weight: 700;
    margin-top: 16px;
    color: var(--text-primary);
}

.review-content ul {
    list-style-type: none;
    padding-left: 0;
}

.review-content li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
}

.review-content li::before {
    content: "•";
    position: absolute;
    left: 4px;
    color: var(--rijssenbeek-gold);
    font-weight: bold;
}

.review-content strong {
    color: var(--rijssenbeek-blue);
}

.review-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

/* Sectioned Review Layout */
.review-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.review-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.review-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--rijssenbeek-blue);
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--rijssenbeek-gold);
}

.review-section-title i {
    color: var(--rijssenbeek-gold);
}

/* Score section */
.review-section-score .review-score-content {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Improvements list */
.review-improvements-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.review-improvement-item {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.review-improvement-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.improvement-quote {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.improvement-quote i {
    margin-top: 3px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.improvement-quote del {
    color: var(--error);
    text-decoration: line-through;
}

.improvement-arrow {
    color: var(--rijssenbeek-gold);
    font-size: 16px;
    font-weight: bold;
    margin: 4px 0 4px 22px;
}

.improvement-suggestion {
    font-size: 14px;
    line-height: 1.6;
    color: var(--success);
    margin-left: 22px;
    margin-bottom: 8px;
}

.improvement-explanation {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-left: 22px;
}

.improvement-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Rewrite section */
.review-section-rewrite .review-rewrite-content {
    background: var(--bg-element);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.review-section-rewrite .review-rewrite-content p {
    margin: 0 0 12px 0;
}

.review-section-rewrite .review-rewrite-content p:last-child {
    margin-bottom: 0;
}

/* Kennisbank search controls for Adviesbrief */
.kennisbank-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.kennisbank-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-secondary, #6b7280);
    font-size: 0.875rem;
}

/* Spinning animation for loader icons */
.spinning {
    animation: spin 1s linear infinite;
}

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

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

/* Kennisbank search controls for Adviesbrief */
.kennisbank-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.kennisbank-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-secondary, #6b7280);
    font-size: 0.875rem;
}

/* Spinning animation for loader icons */
.spinning {
    animation: spin 1s linear infinite;
}

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

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

/* Kennisbank controls container */
.kennisbank-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 10px;
    gap: 15px;
}

/* Kennisbank search button - primary blue style */
.kennisbank-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--gradient-brand-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(28, 53, 94, 0.2);
    transition: all var(--trans-fast);
}

.kennisbank-search-btn:hover {
    background: var(--rijssenbeek-gold);
    color: var(--rijssenbeek-blue);
    box-shadow: 0 4px 8px var(--rijssenbeek-gold-30);
    transform: translateY(-1px);
}

.kennisbank-search-btn:active {
    transform: translateY(0);
}

.advies-prompt-intro {
    margin-bottom: 12px;
}

.advies-terminal-shell {
    background: #101826;
    border: 1px solid #243246;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.advies-terminal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: #162133;
    border-bottom: 1px solid #243246;
}

.advies-terminal-label {
    color: #e2e8f0;
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.advies-terminal-meta {
    color: #94a3b8;
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 500;
}

.advies-terminal-input {
    display: block;
    width: 100%;
    min-height: 420px;
    padding: 18px 20px;
    border: none;
    background: #101826;
    background-color: #101826;
    color: #edf3ff;
    -webkit-text-fill-color: #edf3ff;
    -webkit-appearance: none;
    appearance: none;
    color-scheme: dark;
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 13px;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
    tab-size: 4;
    caret-color: #f8fafc;
}

.advies-terminal-input::placeholder {
    color: #94a3b8;
}

.advies-terminal-input:focus {
    background: #101826;
    background-color: #101826;
    color: #edf3ff;
    -webkit-text-fill-color: #edf3ff;
    box-shadow: inset 0 0 0 1px rgba(196, 167, 125, 0.75);
}

.advies-terminal-input::selection {
    background: rgba(196, 167, 125, 0.35);
    color: #f8fafc;
}

.kennisbank-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.kennisbank-search-btn i {
    width: 16px;
    height: 16px;
}
