/* Import centralized 5-color palette system */
@import url('./variables.css');

:root {
    /*
     * Nomikos AI - Dynamic Color Palette System
     * These CSS variables are dynamically set by ThemeConfig.applyTheme()
     * Default values shown here are overridden at runtime by the active palette
     */

    /* Background and surface colors */
    --bg: #f8f9fb;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --muted: #5a6578;

    /* Text colors */
    --text: #1a2332;
    --text-secondary: #4a5568;
    --text-inverse: #ffffff;    /* For text on dark/colored backgrounds */

    /* Primary palette colors - set dynamically by ThemeConfig */
    --accent: #1a3a6e;           /* Primary color from palette */
    --accent-2: #2d5a94;         /* Secondary color from palette */
    --accent-3: #4a7ab8;         /* Tertiary color from palette */
    --accent-gold: #8ba4c9;      /* Accent/highlight color from palette */
    --accent-gold-light: #c4d4e8;

    /* Derived accent colors - automatically computed from --accent */
    --accent-soft: rgba(26, 58, 110, 0.06);
    --accent-softer: rgba(26, 58, 110, 0.03);
    --accent-medium: rgba(26, 58, 110, 0.12);

    /* Borders */
    --border: #e1e5eb;
    --border-light: #eef1f5;

    /* Shadows - RGB triplet for use with rgba() */
    --shadow-color: 26, 58, 110;
    --shadow-xs: 0 1px 2px rgba(var(--shadow-color), 0.04);
    --shadow-sm: 0 2px 8px rgba(var(--shadow-color), 0.06);
    --shadow: 0 8px 24px rgba(var(--shadow-color), 0.08), 0 2px 8px rgba(var(--shadow-color), 0.04);
    --shadow-lg: 0 16px 48px rgba(var(--shadow-color), 0.12), 0 4px 12px rgba(var(--shadow-color), 0.06);
    --shadow-glow: 0 0 0 3px rgba(var(--shadow-color), 0.08);

    /* Border radii */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --pill-radius: 999px;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Gradients - set dynamically by ThemeConfig based on palette */
    --header-bg: linear-gradient(180deg, #ffffff 0%, #f8f9fb 100%);
    --button-primary: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-3) 100%);
    --button-primary-hover: linear-gradient(135deg, var(--accent-2) 0%, var(--accent-3) 50%, var(--accent-gold) 100%);
    --surface-gradient: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(248,249,251,0.8) 100%);

    /* Semantic status colors */
    --success: #16a34a;
    --success-bg: rgba(34, 197, 94, 0.15);
    --warning: #ca8a04;
    --warning-bg: rgba(234, 179, 8, 0.15);
    --error: #dc2626;
    --error-bg: rgba(220, 38, 38, 0.08);
    --info: var(--accent-3);
    --info-bg: var(--accent-soft);

    /* Brand logo sizing - centralized for consistency */
    --brand-logo-max-height: 44px;
    --brand-logo-header-height: 48px;
    --brand-logo-mobile-height: 28px;
    --brand-logo-small-mobile-height: 24px;
}

/* Dark mode overrides */
body.dark-mode {
    --bg: #1a1a2e;
    --surface: #16213e;
    --surface-elevated: #1e3a5f;
    --muted: #a0aec0;
    --text: #eef1f5;
    --text-secondary: #a0aec0;
    --border: #2a3f5f;
    --border-light: #1e3a5f;
    --header-bg: linear-gradient(180deg, #16213e 0%, #1a1a2e 100%);
    --surface-gradient: linear-gradient(180deg, rgba(22, 33, 62, 1) 0%, rgba(26, 26, 46, 0.8) 100%);
    --shadow-color: 10, 15, 30;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Elegant background pattern - uses palette colors */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 0%, var(--accent-softer) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(var(--shadow-color), 0.02) 0%, transparent 40%),
        radial-gradient(ellipse at 40% 100%, var(--accent-softer) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, h5, h6 {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.page-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 40px 32px 80px;
    position: relative;
    z-index: 1;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    margin: 0;
    width: 100%;
    max-width: none;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow:
        0 1px 3px rgba(var(--shadow-color), 0.04),
        0 4px 12px rgba(var(--shadow-color), 0.06);
}

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

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--button-primary);
    display: grid;
    place-items: center;
    color: #fff;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

.brand-logo {
    max-height: var(--brand-logo-max-height);
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.brand-title {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
    color: var(--accent);
}

.brand-sub {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
    max-width: 320px;
    line-height: 1.4;
}

.page-title {
    flex: 1;
    text-align: center;
}

.page-title h1 {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--accent);
    margin: 0;
    letter-spacing: 0.02em;
}

/* Clickable logo link */
.brand-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* Tutorial button */
.tutorial-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    margin-left: 16px;
}

.tutorial-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent-2);
    color: var(--accent);
}

/* New header layout for feature pages */
.repo-top-bar,
.feature-top-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: center;
    width: 100%;
    max-width: none;
    margin: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: start;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-center:hover {
    transform: translateY(-2px);
}

.header-center .brand-logo {
    height: var(--brand-logo-header-height);
    transition: filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-center:hover .brand-logo {
    filter: brightness(1.03);
}

.header-center .page-title {
    flex: none;
    text-align: center;
    margin-left: 0;
}

.header-center .page-title h1,
.header-center .page-title h2 {
    font-family: "Inter", sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
    letter-spacing: 0.01em;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-center:hover .page-title h1,
.header-center:hover .page-title h2 {
    opacity: 0.85;
}

.back-btn {
    padding: 8px 14px;
}

/* Repository page styles */
.repository-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.repository-page .page-shell {
    flex: 1;
}

.repo-footer {
    margin-top: auto;
}

.repo-footer .footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    max-width: none;
    margin: 0;
}

.repo-footer .footer-brand {
    display: none;
}

.top-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-self: end;
}

.ghost-btn, .pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 10px 18px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.ghost-btn:focus-visible, .pill-btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-glow);
}

.pill-btn {
    background: var(--button-primary);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-sm);
}

.ghost-btn:hover {
    border-color: var(--accent-2);
    background: var(--accent-softer);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.pill-btn:hover {
    transform: translateY(-1px);
    background: var(--button-primary-hover);
    box-shadow: var(--shadow);
}

.ghost-btn:active, .pill-btn:active {
    transform: translateY(0);
}

/* Button Utility Classes */
.btn-full-width {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.btn-danger {
    background: var(--error, #dc2626);
    border-color: var(--error, #dc2626);
    color: var(--text-inverse, #fff);
}

.btn-danger:hover {
    background: var(--error-dark, #b91c1c);
    border-color: var(--error-dark, #b91c1c);
}

.ghost-btn.btn-danger {
    background: transparent;
    color: var(--error, #dc2626);
    border-color: var(--error, #dc2626);
}

.ghost-btn.btn-danger:hover {
    background: rgba(220, 38, 38, 0.08);
    color: var(--error-dark, #b91c1c);
}

/* Icon-only button (close, remove, etc.) */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--muted, #5a6578);
    font-size: 1rem;
    line-height: 1;
    border-radius: var(--radius-sm, 6px);
    transition: background 0.15s, color 0.15s;
}

.btn-icon:hover {
    background: var(--accent-softer, rgba(21, 39, 66, 0.06));
    color: var(--text, #1a2332);
}

.btn-icon:focus-visible {
    outline: none;
    box-shadow: var(--shadow-glow);
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 48px 0 64px;
    margin-bottom: 32px;
}

.hero-content {
    max-width: 720px;
    margin: 0 auto;
}

.hero-title {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 600;
    color: var(--accent);
    margin: 0 0 24px;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.hero-accent {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-number {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
}

/* Features Section */
.features-section {
    margin-bottom: 64px;
}

.section-title {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--accent);
    text-align: center;
    margin: 0 0 32px;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    justify-items: stretch;
}

.home-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-align: left;
    line-height: 1.5;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    min-height: 180px;
}

.home-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(21, 39, 66, 0.02) 100%);
    opacity: 0;
    transition: opacity var(--transition);
}

.home-tile:hover {
    transform: translateY(-4px);
    border-color: var(--accent-2);
    box-shadow: var(--shadow-lg);
}

.home-tile:hover::before {
    opacity: 1;
}

.home-tile:hover .tile-arrow {
    opacity: 1;
    transform: translateX(4px);
}

.home-tile:hover .tile-icon {
    background: var(--accent);
    color: white;
}

.home-tile:active {
    transform: translateY(-2px);
}

.home-tile:focus-visible {
    outline: none;
    box-shadow: var(--shadow-glow), var(--shadow);
}

.tile-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: all var(--transition);
    position: relative;
    z-index: 1;
}

.tile-icon svg {
    width: 26px;
    height: 26px;
}

.tile-label {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.tile-description {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.55;
    position: relative;
    z-index: 1;
    flex: 1;
}

.tile-arrow {
    position: absolute;
    bottom: 24px;
    right: 24px;
    color: var(--accent-2);
    opacity: 0;
    transition: all var(--transition);
    z-index: 1;
}

/* Trust Section */
.trust-section {
    padding: 32px 0;
    border-top: 1px solid var(--border-light);
}

.trust-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.trust-item svg {
    color: var(--accent-gold);
    flex-shrink: 0;
}

/* Tutorial Overlay */
.home-tutorial-overlay {
    position: fixed;
    inset: 0;
    background: rgba(21, 39, 66, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
}

.home-tutorial-overlay.active { display: flex; }

.tutorial-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 28px;
    max-width: 640px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    position: relative;
}

.tutorial-card h3 {
    margin-top: 0;
    color: var(--accent);
}

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

.tutorial-steps li {
    background: var(--accent-softer);
    border: 1px solid var(--border);
    padding: 14px 16px;
    border-radius: var(--radius);
    font-weight: 500;
    color: var(--text);
    transition: all var(--transition-fast);
}

.tutorial-steps li:hover {
    background: var(--accent-soft);
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    border: none;
    background: var(--surface);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.close-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

/* Auth Modal */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(21, 39, 66, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    padding: 20px;
}

.auth-modal-overlay.active { display: flex; }

.auth-modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 28px;
    width: min(420px, 100%);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    animation: modalSlideIn 0.25s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-modal h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.4rem;
    color: var(--accent);
}

.form-group {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
}

.form-group input {
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: all var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-2);
    box-shadow: var(--shadow-glow);
}

.form-group input::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

.form-group select {
    padding: 12px 14px;
    padding-right: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: all var(--transition-fast);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' 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 12px center;
}

.form-group select:focus {
    outline: none;
    border-color: var(--accent-2);
    box-shadow: var(--shadow-glow);
}

.form-group select:hover {
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Tutorial Close Button - Full Screen Tutorial */
.tutorial-close-btn {
    position: fixed;
    top: 20px;
    right: 24px;
    font-size: 1.5rem;
    color: #ffffff;
    background: var(--button-primary);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

.tutorial-close-btn:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-lg);
}

.tutorial-callout {
    position: absolute;
    z-index: 10000;
    pointer-events: none;
}

.tutorial-arrow {
    position: absolute;
    width: 80px;
    height: 80px;
}

.tutorial-arrow svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: var(--accent-gold);
    stroke-width: 3;
    stroke-linecap: round;
}

.tutorial-label {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 100%);
    color: var(--accent);
    padding: 14px 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    max-width: 280px;
    box-shadow: var(--shadow);
    line-height: 1.5;
}

.tutorial-label-title {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.tutorial-highlight {
    position: absolute;
    border: 2px solid var(--accent-gold);
    border-radius: var(--radius);
    box-shadow: 0 0 24px rgba(154, 123, 79, 0.3), inset 0 0 16px rgba(154, 123, 79, 0.08);
    pointer-events: none;
    z-index: 9998;
    background: rgba(255, 255, 255, 0.03);
}

.home-tutorial-instruction {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    color: var(--text);
    padding: 16px 28px;
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 10001;
    border: 1px solid var(--border-light);
}

/* Generic Tutorial Overlay (for unified tutorial system) */
.tutorial-overlay {
    position: fixed;
    inset: 0;
    background: rgba(21, 39, 66, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    z-index: 10000;
    overflow: auto;
}

.tutorial-overlay.active { display: block; }

.tutorial-instruction {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    color: var(--text);
    padding: 16px 28px;
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 10001;
    border: 1px solid var(--border-light);
}

/* Auth Modal Header */
.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.auth-modal-close {
    border: none;
    background: var(--accent-softer);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.auth-modal-close:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.auth-error {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 0.9rem;
}

.auth-hint {
    margin: 12px 0 0;
    color: var(--muted);
    font-weight: 500;
    font-size: 0.85rem;
    text-align: center;
}

/* Repository Page Styles */
.repository-page .page-shell {
    padding-top: 36px;
}

.repository-shell {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 20px;
}

.repo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.repo-title {
    margin: 0;
    font-size: 1.5rem;
    color: var(--accent);
}

.repo-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.repo-controls {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

#documents-filter-controls {
    display: none;
    padding: 16px;
    background: var(--accent-softer);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.repo-status {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    color: var(--muted);
    font-weight: 500;
    font-size: 0.875rem;
}

#documents-loading {
    display: none;
    text-align: center;
    padding: 48px;
    background: var(--accent-softer);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

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

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

/* Repository Layout - Full Width */
.repo-layout {
    display: block;
}

.repo-full-width {
    width: 100%;
    max-width: 100%;
}

/* Two-column layout for repository with folder navigator */
.repo-two-column {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    align-items: start;
}

/* Folder Navigator Sidebar */
.folder-navigator-sidebar {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 180px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.folder-navigator-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    max-height: 100%;
    overflow: hidden;
}

.folder-navigator-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-light);
    background: var(--accent-softer);
}

.folder-navigator-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.folder-navigator-header h3 svg {
    color: var(--accent);
}

.folder-nav-collapse-btn {
    padding: 6px;
    border-radius: var(--radius-sm);
}

.folder-nav-collapse-btn svg {
    transition: transform 0.2s ease;
}

.folder-navigator-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    min-height: 200px;
}

.folder-nav-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    color: var(--muted);
    font-size: 0.85rem;
}

/* Folder Tree Styles */
.folder-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.folder-tree-item {
    margin-bottom: 2px;
}

.folder-tree-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.folder-tree-header:hover {
    background: var(--accent-softer);
}

.folder-tree-header.selected {
    background: var(--accent-soft);
    color: var(--accent);
}

.folder-tree-expand {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.folder-tree-expand svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
    color: var(--muted);
}

.folder-tree-item.expanded > .folder-tree-header .folder-tree-expand svg {
    transform: rotate(90deg);
}

.folder-tree-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.folder-tree-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.folder-tree-icon svg {
    width: 16px;
    height: 16px;
    color: var(--accent-gold);
}

.folder-tree-item.expanded > .folder-tree-header .folder-tree-icon svg {
    color: var(--accent);
}

.folder-tree-label {
    font-size: 0.85rem;
    color: var(--text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-tree-count {
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--accent-softer);
    padding: 2px 6px;
    border-radius: var(--pill-radius);
    margin-left: auto;
}

.folder-tree-children {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-left: 24px;
    display: none;
}

.folder-tree-item.expanded > .folder-tree-children {
    display: block;
}

/* Templates folder special styling */
.folder-tree-item.templates-folder > .folder-tree-header .folder-tree-icon svg {
    color: var(--success);
}

/* Folder Navigator Footer */
.folder-navigator-footer {
    padding: 12px;
    border-top: 1px solid var(--border-light);
    background: var(--accent-softer);
}

.folder-nav-selection-info {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.folder-nav-clear-btn {
    width: 100%;
    font-size: 0.8rem;
    padding: 8px 12px;
}

/* Expand button when sidebar is collapsed */
.folder-nav-expand-btn {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 8px;
    cursor: pointer;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: var(--shadow-sm);
    z-index: 100;
    transition: all 0.2s ease;
}

.folder-nav-expand-btn:hover {
    background: var(--accent-softer);
    border-color: var(--accent-2);
}

.folder-nav-expand-btn svg {
    color: var(--accent);
}

/* Collapsed state */
.repo-two-column.sidebar-collapsed {
    grid-template-columns: 1fr;
}

.repo-two-column.sidebar-collapsed .folder-navigator-sidebar {
    display: none;
}

.repo-two-column.sidebar-collapsed + .folder-nav-expand-btn {
    display: flex;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .repo-two-column {
        grid-template-columns: 1fr;
    }

    .folder-navigator-sidebar {
        position: relative;
        top: 0;
        max-height: none;
        margin-bottom: 20px;
    }
}

/* Folder Dropdown */
.folder-dropdown-container {
    position: relative;
    display: inline-block;
}

.folder-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
}

.folder-dropdown-toggle .dropdown-chevron {
    transition: transform 0.2s ease;
}

.folder-dropdown-container.open .dropdown-chevron {
    transform: rotate(180deg);
}

.folder-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.folder-dropdown-container.open .folder-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.folder-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 0.875rem;
    color: var(--text);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background 0.15s ease;
}

.folder-dropdown-item:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

.folder-dropdown-item:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
}

.folder-dropdown-item:hover {
    background: var(--accent-softer);
}

.folder-dropdown-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.folder-dropdown-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.folder-dropdown-item.active svg {
    opacity: 1;
}

.folder-dropdown-item .folder-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 10px;
}

/* CLM-style Layout (legacy - for backward compatibility) */
.clm-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}

.clm-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 16px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

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

.clm-sidebar-header h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clm-new-folder-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.clm-folder-tree {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.clm-folder-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text);
    transition: all 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.clm-folder-item:hover {
    background: var(--accent-softer);
}

.clm-folder-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.clm-folder-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.clm-folder-item.active svg {
    opacity: 1;
}

.clm-folder-item .folder-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 10px;
}

.clm-folder-children {
    margin-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.clm-folder-children.collapsed {
    display: none;
}

.clm-main {
    flex: 1;
    min-width: 0;
}

.repo-breadcrumb {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: var(--muted);
    min-height: 1.2em;
    min-width: 80px;
    transition: opacity 0.2s ease-in-out;
}

/* Loading skeleton for empty breadcrumb */
.repo-breadcrumb:empty {
    background: linear-gradient(90deg, var(--border-light) 25%, var(--surface-alt) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: breadcrumb-skeleton 1.5s ease-in-out infinite;
    border-radius: 4px;
    opacity: 0.6;
}

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

/* Fade in when content is populated */
.repo-breadcrumb:not(:empty) {
    animation: breadcrumb-fade-in 0.3s ease-in-out;
}

@keyframes breadcrumb-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================================
   Loading Skeletons for Table and Dropdowns
   ============================================================ */

/* Skeleton table row */
.skeleton-table-row {
    pointer-events: none;
}

.skeleton-table-row td {
    padding: 14px 12px;
}

.skeleton-cell {
    height: 16px;
    background: linear-gradient(90deg, var(--border-light) 25%, var(--surface-alt, #f5f7fa) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-cell.skeleton-title {
    width: 60%;
    max-width: 200px;
}

.skeleton-cell.skeleton-date {
    width: 80px;
}

.skeleton-cell.skeleton-status {
    width: 70px;
    height: 24px;
    border-radius: 12px;
}

.skeleton-cell.skeleton-expand {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

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

/* Staggered animation for multiple skeleton rows */
.skeleton-table-row:nth-child(1) .skeleton-cell { animation-delay: 0s; }
.skeleton-table-row:nth-child(2) .skeleton-cell { animation-delay: 0.1s; }
.skeleton-table-row:nth-child(3) .skeleton-cell { animation-delay: 0.2s; }
.skeleton-table-row:nth-child(4) .skeleton-cell { animation-delay: 0.3s; }
.skeleton-table-row:nth-child(5) .skeleton-cell { animation-delay: 0.4s; }

/* Filter dropdown loading skeleton */
.filter-skeleton {
    padding: 8px 12px;
}

.filter-skeleton-item {
    height: 32px;
    background: linear-gradient(90deg, var(--border-light) 25%, var(--surface-alt, #f5f7fa) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
    margin-bottom: 8px;
}

.filter-skeleton-item:last-child {
    margin-bottom: 0;
}

.filter-skeleton-item:nth-child(1) { animation-delay: 0s; width: 100%; }
.filter-skeleton-item:nth-child(2) { animation-delay: 0.1s; width: 85%; }
.filter-skeleton-item:nth-child(3) { animation-delay: 0.2s; width: 90%; }

/* Table container loading state */
#documents-table-container.loading {
    position: relative;
    min-height: 200px;
}

#documents-table-container.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
    z-index: 2;
}

/* Fade in animation for table content */
.documents-table {
    animation: table-fade-in 0.3s ease-in-out;
}

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

/* File Metadata Modal */
.file-metadata-modal-content {
    max-width: 600px;
    width: 90%;
}

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

.metadata-section {
    background: var(--accent-softer);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
}

.metadata-section h4 {
    margin: 0 0 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metadata-section-full {
    grid-column: 1 / -1;
}

.metadata-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.metadata-label {
    font-size: 0.85rem;
    color: var(--muted);
}

.metadata-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}

.version-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.version-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8rem;
}

.version-history-item .version-label {
    font-weight: 600;
    color: var(--accent);
}

.version-history-item .version-date {
    color: var(--muted);
}

.muted-text {
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 12px;
}

@media (max-width: 900px) {
    .clm-layout {
        grid-template-columns: 1fr;
    }

    .clm-sidebar {
        position: static;
        max-height: none;
    }

    .metadata-grid {
        grid-template-columns: 1fr;
    }
}

/* Documents Table - Professional Styling */
#documents-table-container {
    overflow-x: auto;
    margin: 0 -24px;
    padding: 0 24px;
}

.documents-table {
    width: 100%;
    min-width: 900px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.documents-table th,
.documents-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.documents-table th {
    background: var(--accent-softer);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.documents-table th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.documents-table th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.documents-table th:hover {
    background: var(--accent-soft);
    color: var(--text);
}

.documents-table th .sort-indicator {
    margin-left: 6px;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.documents-table th.sort-asc .sort-indicator,
.documents-table th.sort-desc .sort-indicator {
    opacity: 1;
    color: var(--accent);
}

.documents-table tbody tr {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.documents-table tbody tr:hover {
    background: var(--accent-softer);
}

.documents-table tbody tr.selected {
    background: rgba(21, 39, 66, 0.06);
}

.documents-table tbody tr:last-child td {
    border-bottom: none;
}

.documents-table .filename-cell,
.documents-table .title-cell {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

/* Status Icons */
.status-icon {
    font-size: 1rem;
    cursor: default;
    transition: transform var(--transition-fast);
    display: inline-block;
}

.status-icon:hover {
    transform: scale(1.15);
}

.status-icon-not-sent,
.status-icon-not-signed {
    opacity: 0.35;
}

.status-icon-sent,
.status-icon-signed {
    opacity: 1;
}

/* Renewal Button */
.renewal-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.renewal-btn:hover {
    border-color: var(--accent-2);
    background: var(--accent-softer);
    transform: translateY(-1px);
    box-shadow: var(--shadow-xs);
}

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

.renewal-btn-disabled:hover {
    transform: none;
    border-color: var(--border);
    background: var(--surface);
    box-shadow: none;
}

/* Repository Controls */
.repo-controls-wide {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.repo-controls-wide .form-group {
    flex: 1;
    min-width: 160px;
    margin-bottom: 0;
}

.repo-controls-wide .form-group-btn {
    flex: 0 0 auto;
    min-width: auto;
    margin-bottom: 0;
}

/* Align Clear filters button with input fields */
.repo-controls-wide .form-group-btn label {
    display: none;
}

.repo-controls-wide .form-group-btn .ghost-btn {
    padding: 12px 18px;
    height: auto;
}

/* Responsive Styles */
@media (max-width: 900px) {
    .top-bar {
        position: static;
        margin-top: 0;
        border-radius: 0;
    }

    .hero-section {
        padding: 32px 0 48px;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat-divider {
        display: none;
    }

    .home-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 20px;
    }

    .trust-content {
        gap: 32px;
    }

    .brand-sub {
        display: none;
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding: 24px 16px 48px;
    }

    .top-bar {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .brand {
        justify-content: center;
    }

    .top-actions {
        justify-content: center;
    }

    .hero-section {
        padding: 24px 0 40px;
    }

    .hero-title {
        font-size: 1.875rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 24px;
    }

    .home-grid {
        grid-template-columns: 1fr;
    }

    .home-tile {
        padding: 24px 20px;
        min-height: auto;
    }

    .tile-icon {
        width: 48px;
        height: 48px;
    }

    .tile-label {
        font-size: 1.2rem;
    }

    .trust-content {
        flex-direction: column;
        gap: 16px;
    }

    .repository-shell {
        padding: 20px;
    }

    .repo-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .documents-table th,
    .documents-table td {
        padding: 12px 8px;
    }
}

/* ===========================
   Draft from Prompt Page
   =========================== */

.dfp-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.dfp-page .page-shell {
    flex: 1;
    padding-top: 36px;
}

/* DFP Main Content - Two Column Layout */
.dfp-main {
    display: grid;
    grid-template-columns: clamp(280px, 30vw, 420px) 1fr;
    gap: clamp(16px, 2vw, 24px);
    align-items: start;
}

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

/* Quick Start Panel */
.dfp-quickstart {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 100px;
}

.dfp-quickstart-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dfp-quickstart-icon {
    font-size: 1.5rem;
}

.dfp-quickstart-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--accent);
}

.dfp-quickstart-intro {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}

.dfp-quickstart-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dfp-quickstart-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: left;
    transition: all var(--transition);
}

.dfp-quickstart-btn:hover {
    background: var(--surface-hover);
    border-color: var(--accent-2);
    transform: translateX(4px);
}

.dfp-quickstart-btn.active {
    background: var(--accent-subtle);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-subtle);
}

.dfp-quickstart-btn-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.dfp-quickstart-btn-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dfp-quickstart-btn-text strong {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 600;
}

.dfp-quickstart-btn-text small {
    font-size: 0.75rem;
    color: var(--muted);
}

.dfp-quickstart-footer {
    margin: 0;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.5;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.dfp-quickstart-footer strong {
    color: var(--accent);
}

@media (max-width: 1024px) {
    .dfp-quickstart {
        position: static;
    }

    .dfp-quickstart-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .dfp-quickstart-buttons {
        grid-template-columns: 1fr;
    }
}

/* Quick Start Divider */
.dfp-quickstart-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* My Templates Section */
.dfp-my-templates {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dfp-my-templates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dfp-my-templates-header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 600;
}

.dfp-save-template-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.75rem;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.dfp-save-template-btn:hover {
    background: var(--accent);
    color: var(--bg);
}

.dfp-my-templates-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dfp-empty-templates {
    margin: 0;
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
    padding: 12px 8px;
    background: var(--bg);
    border-radius: var(--radius);
}

.dfp-custom-template-item {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
}

.dfp-custom-template-item:hover {
    transform: translateX(4px);
}

.dfp-custom-template-item.active {
    box-shadow: 0 0 0 2px var(--accent-subtle);
}

.dfp-custom-template-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    cursor: pointer;
    text-align: left;
    transition: all var(--transition);
}

.dfp-custom-template-btn:hover {
    background: var(--surface-hover);
    border-color: var(--accent-2);
}

.dfp-custom-template-name {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}

.dfp-custom-template-preview {
    font-size: 0.7rem;
    color: var(--muted);
}

.dfp-delete-template-btn {
    padding: 0 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all var(--transition);
}

.dfp-delete-template-btn:hover {
    background: var(--error);
    color: var(--bg);
    border-color: var(--error);
}

/* Recent Prompts Section */
.dfp-recent-prompts {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dfp-recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dfp-recent-header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 600;
}

.dfp-clear-recent-btn {
    padding: 2px 8px;
    font-size: 0.7rem;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.dfp-clear-recent-btn:hover {
    background: var(--error);
    color: var(--bg);
    border-color: var(--error);
}

.dfp-recent-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dfp-empty-recent {
    margin: 0;
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
    padding: 10px 8px;
}

.dfp-recent-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: left;
    transition: all var(--transition);
}

.dfp-recent-item:hover {
    background: var(--surface-hover);
    border-color: var(--accent-2);
    transform: translateX(4px);
}

.dfp-recent-item.active {
    background: var(--accent-subtle);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-subtle);
}

.dfp-recent-preview {
    font-size: 0.8rem;
    color: var(--text);
    line-height: 1.3;
}

.dfp-recent-time {
    font-size: 0.65rem;
    color: var(--muted);
}

/* Template Search & Filters */
.dfp-template-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.dfp-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.dfp-search-box svg {
    color: var(--muted);
    flex-shrink: 0;
}

.dfp-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.8rem;
    outline: none;
}

.dfp-search-box input::placeholder {
    color: var(--muted);
}

.dfp-filter-controls {
    display: flex;
    gap: 8px;
}

.dfp-filter-controls select {
    flex: 1;
    padding: 6px 8px;
    font-size: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
}

/* Search Results Dropdown */
.dfp-search-results {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    max-height: 250px;
    overflow: hidden;
}

.dfp-search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
}

.dfp-close-search {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.dfp-search-results-list {
    max-height: 200px;
    overflow-y: auto;
}

.dfp-search-result-item {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    text-align: left;
}

.dfp-search-result-item:last-child {
    border-bottom: none;
}

.dfp-search-result-item:hover {
    background: var(--accent-softer);
}

.dfp-result-name {
    font-size: 0.8rem;
    color: var(--text);
}

.dfp-result-category {
    font-size: 0.7rem;
    color: var(--muted);
    padding: 2px 6px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.dfp-no-results {
    padding: 16px;
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
}

/* Industry Templates Accordion */
.dfp-industry-section {
    margin-bottom: 8px;
}

.dfp-accordion-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    transition: all var(--transition);
}

.dfp-accordion-btn:hover {
    background: var(--accent-softer);
    border-color: var(--accent-2);
}

.dfp-accordion-icon {
    font-size: 0.8rem;
    color: var(--muted);
    transition: transform 0.2s ease;
}

.dfp-badge {
    margin-left: auto;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--accent);
    color: var(--bg);
    border-radius: 10px;
}

.dfp-accordion-content {
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 300px;
    overflow-y: auto;
}

.dfp-industry-list {
    padding: 8px;
}

.dfp-industry-category {
    margin-bottom: 12px;
}

.dfp-industry-category:last-child {
    margin-bottom: 0;
}

.dfp-industry-category-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 6px 4px;
}

.dfp-industry-template-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    cursor: pointer;
    text-align: left;
    font-size: 0.8rem;
    color: var(--text);
    transition: all var(--transition);
}

.dfp-industry-template-btn:hover {
    background: var(--accent-softer);
    border-color: var(--accent-2);
}

.dfp-industry-template-btn.active {
    background: var(--accent-subtle);
    border-color: var(--accent);
}

.dfp-industry-name {
    flex: 1;
}

.dfp-has-variables {
    font-size: 0.65rem;
    color: var(--accent-gold);
    padding: 2px 6px;
    background: rgba(154, 123, 79, 0.1);
    border-radius: var(--radius-sm);
}

/* Template Section Title */
.dfp-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 8px 0;
}

/* Enhanced Custom Template Items */
.dfp-custom-template-item {
    display: flex;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    overflow: hidden;
    transition: all var(--transition);
}

.dfp-custom-template-item:hover {
    border-color: var(--accent-2);
}

.dfp-custom-template-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
}

.dfp-template-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dfp-template-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

.dfp-template-category {
    font-size: 0.65rem;
    color: var(--muted);
    padding: 2px 6px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.dfp-use-count {
    font-size: 0.65rem;
    color: var(--accent);
}

.dfp-template-actions {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
}

.dfp-template-actions button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    color: var(--muted);
    transition: all var(--transition);
}

.dfp-template-actions button:last-child {
    border-bottom: none;
}

.dfp-template-actions button:hover {
    background: var(--accent-softer);
    color: var(--accent);
}

.dfp-edit-btn:hover, .dfp-share-btn:hover {
    color: var(--accent);
}

.dfp-delete-template-btn:hover {
    color: var(--error, #e74c3c) !important;
}

/* Modals */
.dfp-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.dfp-modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.dfp-modal-small {
    max-width: 400px;
}

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

.dfp-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--accent);
}

.dfp-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

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

.dfp-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.dfp-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* Form Groups in Modal */
.dfp-form-group {
    margin-bottom: 16px;
}

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

.dfp-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.dfp-form-group input,
.dfp-form-group select,
.dfp-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
}

.dfp-form-group input:focus,
.dfp-form-group select:focus,
.dfp-form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.dfp-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.dfp-hint {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 4px;
    display: block;
}

/* Share URL Box */
.dfp-share-url-box {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

.dfp-share-url-box input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.8rem;
    font-family: monospace;
}

.dfp-copy-btn {
    padding: 10px 14px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--bg);
    cursor: pointer;
    transition: all var(--transition);
}

.dfp-copy-btn:hover {
    background: var(--accent-2);
}

.dfp-copy-btn.copied {
    background: var(--success, #27ae60);
}

.dfp-share-note {
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
}

/* Textarea Animation */
.dfp-input-section textarea.dfp-textarea-filling {
    transform: scale(0.98);
    opacity: 0.7;
    transition: all 0.15s ease-out;
}

.dfp-input-section textarea.dfp-textarea-filled {
    animation: dfp-textarea-pop 0.4s ease-out;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

@keyframes dfp-textarea-pop {
    0% {
        transform: scale(0.98);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.01);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* DFP Panel Base */
.dfp-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 500px;
}

.dfp-panel-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--accent);
}

.dfp-panel-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.85rem;
}

/* Panel Header with History button */
.dfp-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.dfp-panel-header-text {
    flex: 1;
}

/* Unified Accordion Sections */
.dfp-accordion-section {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.dfp-accordion-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

/* Uploaded Documents Section Animation */
@keyframes dfp-docs-appear {
    0% {
        opacity: 0;
        transform: translateY(-10px);
        background-color: rgba(var(--accent-rgb), 0.15);
    }
    50% {
        background-color: rgba(var(--accent-rgb), 0.1);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        background-color: transparent;
    }
}

.dfp-docs-section-appear {
    animation: dfp-docs-appear 0.5s ease-out forwards;
    border-radius: var(--radius-md);
}

/* Content Row Layout (My Templates + Upload/Chat) */
.dfp-content-row {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

.dfp-my-templates-panel {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 16px;
    max-height: calc(100vh - 320px);
    overflow-y: auto;
}

.dfp-my-templates-panel .dfp-my-templates {
    gap: 12px;
}

.dfp-my-templates-panel .dfp-my-templates-header h4 {
    font-size: 1rem;
    color: var(--accent);
}

.dfp-upload-chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* Responsive: Stack on smaller screens */
@media (max-width: 1024px) {
    .dfp-content-row {
        flex-direction: column;
    }
    .dfp-my-templates-panel {
        width: 100%;
        max-height: 200px;
    }
}

/* Upload Zone */
.dfp-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
}

.dfp-upload-zone:hover {
    border-color: var(--accent-2);
    background: var(--accent-softer);
}

.dfp-upload-zone.has-file {
    border-color: var(--accent-gold);
    background: rgba(154, 123, 79, 0.05);
}

.dfp-upload-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.dfp-upload-text {
    font-size: 0.9rem;
    color: var(--muted);
}

.dfp-upload-text strong {
    color: var(--accent);
}

.dfp-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(154, 123, 79, 0.1);
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.dfp-file-info .file-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dfp-file-info .remove-file {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    font-size: 1rem;
}

.dfp-file-info .remove-file:hover {
    color: #dc2626;
}

/* Chat Log */
.dfp-chat-log {
    flex: 1;
    min-height: 200px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dfp-chat-message {
    display: flex;
    gap: 10px;
    max-width: 90%;
}

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

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

.dfp-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.dfp-chat-message.agent .dfp-chat-avatar {
    background: var(--accent-soft);
    color: var(--accent);
    border: 2px solid var(--accent-2);
}

.dfp-chat-message.user .dfp-chat-avatar {
    background: var(--button-primary);
    color: #fff;
}

.dfp-chat-bubble {
    padding: 12px 16px;
    border-radius: var(--radius);
    line-height: 1.5;
    font-size: 0.9rem;
}

.dfp-chat-message.agent .dfp-chat-bubble {
    background: var(--accent-softer);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) var(--radius) 4px;
}

.dfp-chat-message.user .dfp-chat-bubble {
    background: var(--button-primary);
    color: #fff;
    border-radius: var(--radius) var(--radius) 4px var(--radius);
}

/* Chat Input */
.dfp-input-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dfp-input-section textarea {
    resize: none;
    min-height: 100px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 14px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    background: var(--surface);
    color: var(--text);
    transition: all var(--transition);
}

.dfp-input-section textarea:focus {
    outline: none;
    border-color: var(--accent-2);
    box-shadow: var(--shadow-glow);
}

.dfp-input-section textarea::placeholder {
    color: var(--muted);
}

.dfp-actions {
    display: flex;
    gap: 12px;
}

.dfp-actions .pill-btn {
    flex: 1;
}

/* Processing Indicator */
.dfp-processing {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--accent-softer);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.dfp-spinner {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    animation: dfp-spin 0.8s linear infinite;
}

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

.dfp-processing-text {
    font-size: 0.9rem;
    color: var(--muted);
}

/* Keyboard Shortcut Hints */
.dfp-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 8px;
    font-size: 0.65rem;
    font-family: inherit;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.8;
}

.ghost-btn .dfp-kbd {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.15);
}

/* My Template Prompts - Inline Accordion Header */
.dfp-my-templates-header-inline {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

/* Full-width upload/chat panel when My Templates is in accordion */
.dfp-content-row-full {
    display: block;
}

.dfp-upload-chat-panel-full {
    width: 100%;
}

/* Document Badge on Recent Prompts */
.dfp-recent-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.dfp-doc-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: var(--radius-sm);
}

/* Prompt Documents Panel */
.dfp-prompt-docs-panel {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.dfp-prompt-docs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dfp-prompt-docs-header h5 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
}

.dfp-close-docs-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.dfp-close-docs-btn:hover {
    color: var(--error);
}

.dfp-prompt-docs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dfp-empty-docs,
.dfp-loading-docs,
.dfp-error-docs {
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
    padding: 16px 8px;
}

.dfp-error-docs {
    color: var(--error);
}

/* Document Item */
.dfp-doc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.dfp-doc-item:hover {
    border-color: var(--accent-2);
    background: var(--accent-softer);
}

.dfp-doc-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

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

.dfp-doc-filename {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dfp-doc-meta {
    font-size: 0.75rem;
    color: var(--muted);
}

.dfp-doc-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.dfp-doc-action-btn {
    background: none;
    border: none;
    padding: 4px 6px;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    opacity: 0.6;
}

.dfp-doc-item:hover .dfp-doc-action-btn {
    opacity: 1;
}

.dfp-doc-action-btn:hover {
    background: var(--accent-soft);
}

.dfp-doc-remove-btn:hover {
    background: var(--error-bg);
    color: var(--error);
}

/* Document Viewer Modal */
.dfp-doc-viewer-modal .dfp-modal-content {
    max-width: 900px;
    width: 95vw;
    max-height: 90vh;
}

.dfp-modal-large {
    height: 85vh;
    display: flex;
    flex-direction: column;
}

.dfp-doc-viewer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dfp-doc-viewer-body {
    flex: 1;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.dfp-doc-viewer-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dfp-doc-viewer-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--muted);
}

.dfp-doc-viewer-pdf {
    width: 100%;
    height: 100%;
}

.dfp-doc-viewer-pdf iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--radius-sm);
}

.dfp-doc-viewer-image {
    max-width: 100%;
    max-height: 100%;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dfp-doc-viewer-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.dfp-doc-viewer-text {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.dfp-doc-viewer-text pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    color: var(--text);
}

.dfp-doc-viewer-unsupported {
    text-align: center;
    padding: 40px;
}

.dfp-doc-unsupported-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.dfp-doc-viewer-unsupported p {
    margin: 0 0 8px;
    color: var(--text-secondary);
}

/* Danger button variant */
.dfp-btn-danger {
    background: var(--error);
    border-color: var(--error);
}

.dfp-btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

/* Redirect Skeleton Overlay */
.redirect-skeleton-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.redirect-skeleton-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px 60px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.redirect-skeleton-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: dfp-spin 1s linear infinite;
}

.redirect-skeleton-message {
    font-size: 1.1rem;
    color: var(--text);
    margin: 0 0 24px;
    font-weight: 500;
}

.redirect-preview {
    background: var(--accent-softer);
    border: 1px solid var(--accent-2);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.redirect-preview-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.redirect-preview-stats {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.preview-stat {
    font-size: 0.85rem;
    color: var(--text);
    background: var(--surface);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.preview-stat strong {
    color: var(--accent);
    font-weight: 700;
}

.redirect-skeleton-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 200px;
    margin: 0 auto;
}

.skeleton-bar {
    height: 12px;
    background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: shimmer 1.5s infinite;
}

.skeleton-bar:nth-child(2) {
    width: 80%;
}

.skeleton-bar:nth-child(3) {
    width: 60%;
}

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

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

[hidden] {
    display: none !important;
}

/* ===========================
   Footer Styles - Simplified
   =========================== */

.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1rem 0;
    margin-top: auto;
}

.footer-content {
    max-width: none;
    margin: 0;
    padding: 0 32px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

/* Hide footer logo - use page header instead */
.footer-brand {
    display: none;
}

.footer-logo {
    display: none;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition);
}

.footer-link:hover {
    color: var(--accent);
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: left;
    order: -1;
}

@media (max-width: 640px) {
    .footer-content {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .footer-copyright {
        order: 1;
        text-align: center;
    }

    .footer-links {
        order: 0;
    }
}

/* ===========================
   Bulk Upload File Status Badges
   =========================== */

.file-status {
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.file-status.pending {
    background: var(--accent-softer);
    color: var(--muted);
}

.file-status.uploading {
    background: var(--info-bg);
    color: var(--accent-3);
}

.file-status.success {
    background: var(--success-bg);
    color: var(--success);
}

.file-status.error {
    background: var(--error-bg);
    color: var(--error);
}

/* Modal overlay base */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(var(--shadow-color), 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    padding: 20px;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    width: 100%;
    max-width: 500px;
    animation: modalSlideIn 0.25s ease-out;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--accent);
}

.modal-close {
    border: none;
    background: var(--accent-softer);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
}

/* ===========================
   Responsive Layout - Header & Page Shell
   =========================== */

/* Tablet breakpoint */
@media (max-width: 768px) {
    .top-bar {
        padding: 12px 20px;
    }

    .page-shell {
        padding: 24px 20px 60px;
    }

    .footer-content {
        padding: 0 20px;
    }

    .header-center .brand-logo {
        max-height: var(--brand-logo-mobile-height);
    }

    .page-title h2 {
        font-size: 1rem;
    }
}

/* Mobile breakpoint */
@media (max-width: 480px) {
    .top-bar {
        padding: 10px 16px;
    }

    .page-shell {
        padding: 16px 16px 48px;
    }

    .footer-content {
        padding: 0 16px;
    }

    .header-center .brand-logo {
        max-height: var(--brand-logo-small-mobile-height);
    }

    .header-left .back-btn {
        font-size: 0.85rem;
        padding: 6px 10px;
    }

    .header-left .back-btn svg {
        width: 14px;
        height: 14px;
    }

    .tutorial-btn {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .page-title h2 {
        font-size: 0.9rem;
    }

    .pill-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
}

/* =============================================================================
   Filter Chips - Visual display of active filters with one-click removal
   ============================================================================= */

.active-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    margin: 8px 0;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 6px;
    align-items: center;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 4px 10px;
    background: var(--primary-color, #4a90d9);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.filter-chip:hover {
    background: var(--primary-hover, #3a7bc8);
    transform: scale(1.02);
}

.filter-chip:focus {
    outline: 2px solid var(--focus-color, #007bff);
    outline-offset: 2px;
}

.filter-chip:active {
    transform: scale(0.98);
}

.chip-label {
    opacity: 0.85;
    font-weight: 400;
}

.chip-value {
    font-weight: 600;
    text-transform: capitalize;
}

.chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 2px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    line-height: 1;
    transition: background-color 0.2s ease;
}

.filter-chip:hover .chip-remove {
    background: rgba(255, 255, 255, 0.35);
}

.filter-chip.clear-all {
    background: var(--danger-color, #dc3545);
    padding: 4px 12px;
}

.filter-chip.clear-all:hover {
    background: var(--danger-hover, #c82333);
}

/* =============================================================================
   Drag-and-Drop Reordering for Filter Chips
   ============================================================================= */

.filter-chip[draggable="true"] {
    cursor: grab;
}

.filter-chip.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#active-filter-chips {
    min-height: 32px;
}

/* =============================================================================
   Context Menu for Filter Chips
   ============================================================================= */

.chip-context-menu {
    background: white;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    padding: 4px 0;
    animation: contextMenuFadeIn 0.15s ease;
}

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

.context-menu-item {
    padding: 8px 16px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.context-menu-item:hover {
    background: var(--hover-bg, #f8f9fa);
}

.context-menu-item:active {
    background: var(--active-bg, #e9ecef);
}

body.dark-mode .chip-context-menu {
    background: var(--dark-surface, #2d2d2d);
    border-color: var(--dark-border, #444);
}

body.dark-mode .context-menu-item:hover {
    background: var(--dark-hover, #3d3d3d);
}

/* =============================================================================
   Filter History Panel
   ============================================================================= */

.history-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    min-width: 320px;
    max-width: 480px;
    max-height: 80vh;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    animation: panelSlideIn 0.2s ease;
}

@keyframes panelSlideIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color, #dee2e6);
}

.history-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.history-panel-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted, #6c757d);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.history-panel-close:hover {
    background: var(--hover-bg, #f8f9fa);
    color: var(--text-dark, #212529);
}

.history-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    max-height: 400px;
}

.history-empty {
    text-align: center;
    color: var(--text-muted, #6c757d);
    padding: 24px;
    font-style: italic;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    margin-bottom: 4px;
}

.history-item:hover {
    background: var(--hover-bg, #f8f9fa);
}

.history-item:focus {
    outline: 2px solid var(--focus-color, #007bff);
    outline-offset: -2px;
}

.history-timestamp {
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
    flex-shrink: 0;
    margin-right: 12px;
}

.history-filters {
    font-size: 0.85rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-panel-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color, #dee2e6);
    display: flex;
    justify-content: flex-end;
}

body.dark-mode .history-panel {
    background: var(--dark-surface, #2d2d2d);
    border-color: var(--dark-border, #444);
}

body.dark-mode .history-panel-header,
body.dark-mode .history-panel-footer {
    border-color: var(--dark-border, #444);
}

body.dark-mode .history-item:hover {
    background: var(--dark-hover, #3d3d3d);
}

/* =============================================================================
   Batch Preset Panel
   ============================================================================= */

.batch-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    min-width: 320px;
    max-width: 480px;
    max-height: 80vh;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    animation: panelSlideIn 0.2s ease;
}

.batch-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color, #dee2e6);
}

.batch-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.batch-panel-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted, #6c757d);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.batch-panel-close:hover {
    background: var(--hover-bg, #f8f9fa);
    color: var(--text-dark, #212529);
}

.batch-toolbar {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, #dee2e6);
}

.batch-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px;
    max-height: 300px;
}

.batch-empty {
    text-align: center;
    color: var(--text-muted, #6c757d);
    padding: 24px;
    font-style: italic;
}

.batch-preset-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light, #f0f0f0);
}

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

.batch-preset-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.batch-preset-item label {
    cursor: pointer;
    flex: 1;
}

.batch-panel-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color, #dee2e6);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

body.dark-mode .batch-panel {
    background: var(--dark-surface, #2d2d2d);
    border-color: var(--dark-border, #444);
}

body.dark-mode .batch-panel-header,
body.dark-mode .batch-toolbar,
body.dark-mode .batch-panel-footer {
    border-color: var(--dark-border, #444);
}

body.dark-mode .batch-preset-item {
    border-color: var(--dark-border, #444);
}

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

.shortcuts-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    min-width: 320px;
    max-width: 400px;
    z-index: 10002;
    animation: panelSlideIn 0.2s ease;
}

.shortcuts-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color, #dee2e6);
}

.shortcuts-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.shortcuts-panel-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted, #6c757d);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.shortcuts-panel-close:hover {
    background: var(--hover-bg, #f8f9fa);
    color: var(--text-dark, #212529);
}

.shortcuts-panel-content {
    padding: 16px;
}

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

.shortcuts-table tr {
    border-bottom: 1px solid var(--border-light, #f0f0f0);
}

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

.shortcuts-table td {
    padding: 8px 4px;
}

.shortcut-key {
    width: 100px;
}

.shortcut-key kbd {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-family: monospace;
    background: var(--kbd-bg, #f4f4f4);
    border: 1px solid var(--kbd-border, #ccc);
    border-radius: 3px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.shortcut-desc {
    font-size: 0.875rem;
    color: var(--text-dark, #212529);
}

body.dark-mode .shortcuts-panel {
    background: var(--dark-surface, #2d2d2d);
    border-color: var(--dark-border, #444);
}

body.dark-mode .shortcuts-panel-header {
    border-color: var(--dark-border, #444);
}

body.dark-mode .shortcuts-table tr {
    border-color: var(--dark-border, #444);
}

body.dark-mode .shortcut-key kbd {
    background: var(--dark-hover, #3d3d3d);
    border-color: var(--dark-border, #555);
}

/* =============================================================================
   Share URL Notification
   ============================================================================= */

.share-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success-bg, #28a745);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10003;
    animation: notificationSlideUp 0.3s ease, notificationFadeOut 0.3s ease 1.7s forwards;
}

@keyframes notificationSlideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

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

/* =============================================================================
   Button Utility Classes
   ============================================================================= */

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color, #dee2e6);
    color: var(--text-dark, #212529);
}

.btn-outline:hover {
    background: var(--hover-bg, #f8f9fa);
}

.btn-danger {
    background: var(--danger-color, #dc3545);
    border-color: var(--danger-color, #dc3545);
    color: var(--text-inverse, #fff);
}

.btn-danger:hover {
    background: var(--danger-hover, #c82333);
    border-color: var(--danger-hover, #c82333);
}

.btn-danger:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

body.dark-mode .btn-outline {
    border-color: var(--dark-border, #444);
    color: var(--dark-text, #e0e0e0);
}

body.dark-mode .btn-outline:hover {
    background: var(--dark-hover, #3d3d3d);
}

/* =============================================================================
   Filter Presets - Save and load common filter combinations
   ============================================================================= */

.preset-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 0;
}

#insights-preset-dropdown {
    flex: 1;
    min-width: 120px;
    max-width: 180px;
    padding: 6px 10px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

#insights-preset-dropdown:hover {
    border-color: var(--primary-color, #4a90d9);
}

#insights-preset-dropdown:focus {
    outline: none;
    border-color: var(--primary-color, #4a90d9);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

#save-preset-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary-color, #4a90d9);
    background: transparent;
    border: 1px solid var(--primary-color, #4a90d9);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#save-preset-btn:hover {
    background: var(--primary-color, #4a90d9);
    color: white;
}

#save-preset-btn:focus {
    outline: 2px solid var(--focus-color, #007bff);
    outline-offset: 2px;
}

/* =============================================================================
   Sort Direction Indicator
   ============================================================================= */

.sort-direction-indicator {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.85em;
    opacity: 0.9;
    transition: transform 0.2s ease;
}

[data-orientation="importance"]:hover .sort-direction-indicator {
    transform: scale(1.2);
}

/* =============================================================================
   Visual Feedback Animations
   ============================================================================= */

@keyframes presetFlash {
    0% {
        background-color: inherit;
        transform: scale(1);
    }
    25% {
        background-color: rgba(74, 144, 217, 0.15);
        transform: scale(1.02);
    }
    50% {
        background-color: rgba(74, 144, 217, 0.25);
        transform: scale(1.02);
    }
    100% {
        background-color: inherit;
        transform: scale(1);
    }
}

.preset-applied-flash {
    animation: presetFlash 0.6s ease-out;
}

/* =============================================================================
   Export/Import Button Styles
   ============================================================================= */

.preset-action-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-muted, #6c757d);
    background: transparent;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preset-action-btn:hover {
    color: var(--primary-color, #4a90d9);
    border-color: var(--primary-color, #4a90d9);
    background: rgba(74, 144, 217, 0.05);
}

.preset-action-btn:focus {
    outline: 2px solid var(--focus-color, #007bff);
    outline-offset: 2px;
}

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

#export-presets-btn {
    font-size: 1rem;
}

#import-presets-btn {
    font-size: 1rem;
}

/* =============================================================================
   Dark Mode Toggle Button
   ============================================================================= */

.dark-mode-toggle {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 1.2rem;
    background: var(--surface, #fff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle:hover {
    background: var(--accent-soft, rgba(74, 144, 217, 0.1));
    border-color: var(--primary-color, #4a90d9);
}

body.dark-mode .dark-mode-toggle {
    background: var(--surface-elevated, #1e3a5f);
    border-color: var(--border, #2a3f5f);
    color: #fbbf24;
}

/* =============================================================================
   Undo Button Styles
   ============================================================================= */

.undo-filter-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
    background: transparent;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.undo-filter-btn:hover:not(:disabled) {
    color: var(--primary-color, #4a90d9);
    border-color: var(--primary-color, #4a90d9);
}

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

.undo-filter-btn .undo-count {
    display: inline-block;
    margin-left: 4px;
    padding: 0 4px;
    font-size: 0.7rem;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 10px;
}

/* =============================================================================
   Dark Mode - Additional Styles for New Features
   ============================================================================= */

body.dark-mode .preset-action-btn {
    color: var(--text-secondary, #a0aec0);
    border-color: var(--border, #2a3f5f);
}

body.dark-mode .preset-action-btn:hover {
    color: var(--accent-gold, #8ba4c9);
    border-color: var(--accent-gold, #8ba4c9);
    background: rgba(139, 164, 201, 0.1);
}

body.dark-mode #insights-preset-dropdown {
    background: var(--surface, #16213e);
    color: var(--text, #eef1f5);
    border-color: var(--border, #2a3f5f);
}

body.dark-mode #save-preset-btn {
    color: var(--accent-gold, #8ba4c9);
    border-color: var(--accent-gold, #8ba4c9);
}

body.dark-mode #save-preset-btn:hover {
    background: var(--accent-gold, #8ba4c9);
    color: var(--surface, #16213e);
}

body.dark-mode .filter-chip {
    background: var(--surface-elevated, #1e3a5f);
    border-color: var(--border, #2a3f5f);
    color: var(--text, #eef1f5);
}

body.dark-mode .filter-chip:hover {
    background: rgba(139, 164, 201, 0.15);
}

body.dark-mode .undo-filter-btn {
    color: var(--text-secondary, #a0aec0);
    border-color: var(--border, #2a3f5f);
}

body.dark-mode .undo-filter-btn:hover:not(:disabled) {
    color: var(--accent-gold, #8ba4c9);
    border-color: var(--accent-gold, #8ba4c9);
}

body.dark-mode @keyframes presetFlash {
    0% {
        background-color: inherit;
        transform: scale(1);
    }
    25% {
        background-color: rgba(139, 164, 201, 0.15);
        transform: scale(1.02);
    }
    50% {
        background-color: rgba(139, 164, 201, 0.25);
        transform: scale(1.02);
    }
    100% {
        background-color: inherit;
        transform: scale(1);
    }
}

/* =============================================================================
   Keyboard Shortcut Hints
   ============================================================================= */

.shortcut-hint {
    display: none;
    font-size: 0.65rem;
    color: var(--text-muted, #6c757d);
    margin-left: 8px;
    padding: 2px 4px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 3px;
    font-family: monospace;
}

.filter-controls:hover .shortcut-hint,
.toggle-btn:hover .shortcut-hint {
    display: inline-block;
}

/* =============================================================================
   Filter Chips Responsive Styles
   ============================================================================= */

@media (max-width: 768px) {
    .active-filter-chips {
        padding: 6px 8px;
        gap: 6px;
    }

    .filter-chip {
        padding: 3px 6px 3px 8px;
        font-size: 0.7rem;
    }

    .chip-remove {
        width: 14px;
        height: 14px;
        font-size: 0.75rem;
    }

    .preset-controls {
        flex-wrap: wrap;
    }

    #insights-preset-dropdown {
        min-width: 100px;
        max-width: 150px;
        font-size: 0.75rem;
    }

    #save-preset-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .active-filter-chips {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-chip {
        width: 100%;
        justify-content: space-between;
    }

    .preset-controls {
        flex-direction: column;
        align-items: stretch;
    }

    #insights-preset-dropdown {
        max-width: 100%;
    }
}

/* =============================================================================
   RECENT DOCUMENTS SIDEBAR
   ============================================================================= */

/* Container that holds sidebar + main content */
.dfp-content-row-with-sidebar {
    display: flex;
    flex-direction: row;
    gap: 16px;
}

/* Sidebar container */
.dfp-recent-docs-sidebar {
    width: 240px;
    min-width: 200px;
    max-width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    overflow: hidden;
    transition: width 0.2s ease, min-width 0.2s ease, opacity 0.2s ease;
}

.dfp-recent-docs-sidebar.collapsed {
    width: 0;
    min-width: 0;
    opacity: 0;
    border: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

/* Header */
.dfp-recent-docs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: var(--bg-secondary, #f8fafc);
}

.dfp-recent-docs-header h4 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text, #1a202c);
}

/* Search filter */
.dfp-recent-docs-search {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    position: relative;
}
.dfp-docs-search-input {
    flex: 1;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    padding: 6px 28px 6px 10px;
    font-size: 0.8rem;
    background: var(--bg, #fff);
    color: var(--text, #1a202c);
    outline: none;
    transition: border-color 0.15s;
}
.dfp-docs-search-input:focus {
    border-color: var(--primary, #3182ce);
    box-shadow: 0 0 0 2px rgba(49,130,206,0.15);
}
.dfp-docs-search-input::placeholder {
    color: var(--text-secondary, #a0aec0);
}
.dfp-docs-search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary, #a0aec0);
    padding: 2px 4px;
    line-height: 1;
}
.dfp-docs-search-clear:hover {
    color: var(--text, #1a202c);
}
.dfp-docs-no-results {
    padding: 20px 14px;
    text-align: center;
    color: var(--text-secondary, #a0aec0);
    font-size: 0.8rem;
}

/* Sidebar header actions */
.dfp-sidebar-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.dfp-sidebar-icon-btn {
    background: none;
    border: none;
    color: var(--muted, #a0aec0);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm, 6px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}
.dfp-sidebar-icon-btn:hover {
    color: var(--accent, #4a90d9);
    background: var(--accent-soft, rgba(74, 144, 217, 0.08));
}
.dfp-sidebar-icon-btn:active svg {
    transform: rotate(180deg);
    transition: transform 0.4s ease;
}

/* Sort dropdown */
.dfp-recent-docs-sort {
    padding: 0 10px 8px;
}
.dfp-docs-sort-select {
    width: 100%;
    padding: 5px 8px;
    font-size: 0.75rem;
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: var(--radius-sm, 6px);
    background: var(--surface, #fff);
    color: var(--text-secondary, #718096);
    cursor: pointer;
    transition: var(--transition-fast);
    appearance: auto;
}
.dfp-docs-sort-select:focus {
    outline: none;
    border-color: var(--accent, #4a90d9);
    box-shadow: 0 0 0 2px var(--accent-soft, rgba(74, 144, 217, 0.15));
}

/* Modal navigation */
.dfp-doc-viewer-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.dfp-doc-viewer-nav h3 {
    margin: 0;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dfp-doc-nav-btn {
    background: none;
    border: 1px solid var(--border, #e2e8f0);
    color: var(--text-secondary, #718096);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm, 6px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    min-width: 32px;
    min-height: 32px;
}
.dfp-doc-nav-btn:hover:not(:disabled) {
    color: var(--accent, #4a90d9);
    border-color: var(--accent, #4a90d9);
    background: var(--accent-soft, rgba(74, 144, 217, 0.08));
}
.dfp-doc-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Document viewer modal */
.dfp-doc-viewer-modal .dfp-modal-content {
    max-width: 900px;
    max-height: 85vh;
}
.dfp-doc-viewer-body {
    overflow: hidden;
    padding: 0;
}
.dfp-doc-viewer-content {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dfp-doc-viewer-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary, #718096);
}
.dfp-doc-viewer-pdf {
    width: 100%;
    height: 70vh;
}
.dfp-doc-viewer-pdf iframe {
    width: 100%;
    height: 100%;
    border: none;
}
.dfp-doc-viewer-image {
    text-align: center;
    padding: 16px;
}
.dfp-doc-viewer-image img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
}
.dfp-doc-viewer-text {
    padding: 16px;
    overflow: auto;
    max-height: 65vh;
}
.dfp-doc-viewer-text pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.85rem;
    margin: 0;
}
.dfp-doc-viewer-unsupported {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary, #718096);
}
.dfp-doc-unsupported-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}
.dfp-doc-viewer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dfp-sidebar-collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: var(--text-secondary, #718096);
    transition: all 0.15s ease;
}

.dfp-sidebar-collapse-btn:hover {
    background: var(--bg-tertiary, #edf2f7);
    color: var(--text, #1a202c);
}

/* Action bar (shown when items selected) */
.dfp-recent-docs-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--accent-primary-light, #ebf8ff);
    border-bottom: 1px solid var(--accent-primary, #3182ce);
    gap: 8px;
}

.dfp-selected-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-primary, #3182ce);
}

.dfp-action-bar-buttons {
    display: flex;
    gap: 6px;
}

.dfp-action-btn {
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 4px;
    background: var(--surface, #ffffff);
    color: var(--text-secondary, #718096);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.dfp-action-btn:hover {
    background: var(--bg-tertiary, #edf2f7);
    border-color: var(--text-secondary, #718096);
}

.dfp-action-btn-primary {
    background: var(--accent-primary, #3182ce);
    color: #ffffff;
    border-color: var(--accent-primary, #3182ce);
}

.dfp-action-btn-primary:hover {
    background: var(--accent-primary-dark, #2c5282);
    border-color: var(--accent-primary-dark, #2c5282);
}

/* Document list */
.dfp-recent-docs-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    max-height: 400px;
}

/* Loading skeleton */
.dfp-docs-loading {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dfp-skeleton-item {
    height: 48px;
    background: linear-gradient(90deg, var(--bg-secondary, #f8fafc) 25%, var(--bg-tertiary, #edf2f7) 50%, var(--bg-secondary, #f8fafc) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 6px;
}

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

/* Empty state */
.dfp-docs-empty {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-secondary, #718096);
}

.dfp-docs-empty-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

.dfp-docs-empty p {
    margin: 0 0 12px 0;
    font-size: 0.8rem;
}

.dfp-docs-upload-cta {
    background: none;
    border: 1px dashed var(--accent-primary, #3182ce);
    color: var(--accent-primary, #3182ce);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dfp-docs-upload-cta:hover {
    background: var(--accent-primary-light, #ebf8ff);
}

/* Error state */
.dfp-docs-error {
    text-align: center;
    padding: 24px 16px;
    color: var(--danger, #e53e3e);
}

.dfp-docs-error p {
    margin: 0 0 12px 0;
    font-size: 0.8rem;
}

.dfp-docs-retry-btn {
    background: var(--danger, #e53e3e);
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dfp-docs-retry-btn:hover {
    background: var(--danger-dark, #c53030);
}

/* Document item */
.dfp-doc-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--surface, #ffffff);
}

.dfp-doc-item:hover {
    background: var(--bg-secondary, #f8fafc);
    border-color: var(--accent-primary, #3182ce);
}

.dfp-doc-item.selected {
    background: var(--accent-primary-light, #ebf8ff);
    border-color: var(--accent-primary, #3182ce);
}

.dfp-doc-item:focus {
    outline: 2px solid var(--accent-primary, #3182ce);
    outline-offset: 1px;
}

.dfp-doc-checkbox {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--accent-primary, #3182ce);
}

.dfp-doc-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary, #edf2f7);
    border-radius: 4px;
    font-size: 0.9rem;
}

.dfp-doc-icon.pdf { background: #fef3f2; color: #dc2626; }
.dfp-doc-icon.docx { background: #eff6ff; color: #2563eb; }
.dfp-doc-icon.doc { background: #eff6ff; color: #2563eb; }
.dfp-doc-icon.txt { background: #f5f5f5; color: #525252; }

.dfp-doc-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.dfp-doc-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text, #1a202c);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.dfp-doc-meta {
    display: flex;
    gap: 8px;
    font-size: 0.65rem;
    color: var(--text-secondary, #718096);
}

.dfp-doc-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.dfp-doc-item:hover .dfp-doc-actions {
    opacity: 1;
}

.dfp-doc-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: var(--text-secondary, #718096);
    transition: all 0.15s ease;
}

.dfp-doc-action-btn:hover {
    background: var(--bg-tertiary, #edf2f7);
    color: var(--accent-primary, #3182ce);
}

/* Session badge for documents added this session */
.dfp-doc-session-badge {
    font-size: 0.55rem;
    padding: 1px 4px;
    background: var(--accent-gold, #d69e2e);
    color: #ffffff;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Mobile toggle button */
.dfp-sidebar-toggle-mobile {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-primary, #3182ce);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    transition: all 0.2s ease;
}

.dfp-sidebar-toggle-mobile:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.dfp-toggle-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: var(--danger, #e53e3e);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Upload chat panel adjusts to take remaining space */
.dfp-upload-chat-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

/* =============================================================================
   RECENT DOCUMENTS SIDEBAR - Dark Mode
   ============================================================================= */

body.dark-mode .dfp-recent-docs-sidebar {
    background: var(--surface, #16213e);
    border-color: var(--border, #2a3f5f);
}

body.dark-mode .dfp-recent-docs-search {
    border-color: var(--border, #2a3f5f);
}
body.dark-mode .dfp-docs-search-input {
    background: var(--surface, #1a2d47);
    color: var(--text, #eef1f5);
    border-color: var(--border, #2a3f5f);
}
body.dark-mode .dfp-docs-search-input:focus {
    border-color: var(--primary, #63b3ed);
}
body.dark-mode .dfp-docs-search-clear {
    color: var(--text-secondary, #a0aec0);
}
body.dark-mode .dfp-docs-no-results {
    color: var(--text-secondary, #a0aec0);
}
body.dark-mode .dfp-docs-sort-select {
    background: var(--surface, #1a2d47);
    color: var(--text-secondary, #a0aec0);
    border-color: var(--border, #2a3f5f);
}
body.dark-mode .dfp-docs-sort-select:focus {
    border-color: var(--primary, #63b3ed);
}
body.dark-mode .dfp-sidebar-icon-btn {
    color: var(--text-secondary, #a0aec0);
}
body.dark-mode .dfp-sidebar-icon-btn:hover {
    color: var(--primary, #63b3ed);
    background: rgba(99, 179, 237, 0.1);
}
body.dark-mode .dfp-doc-nav-btn {
    color: var(--text-secondary, #a0aec0);
    border-color: var(--border, #2a3f5f);
}
body.dark-mode .dfp-doc-nav-btn:hover:not(:disabled) {
    color: var(--primary, #63b3ed);
    border-color: var(--primary, #63b3ed);
    background: rgba(99, 179, 237, 0.1);
}
body.dark-mode .dfp-doc-viewer-unsupported {
    color: var(--text-secondary, #a0aec0);
}

body.dark-mode .dfp-recent-docs-header {
    background: var(--surface-elevated, #1e3a5f);
    border-color: var(--border, #2a3f5f);
}

body.dark-mode .dfp-recent-docs-header h4 {
    color: var(--text, #eef1f5);
}

body.dark-mode .dfp-sidebar-collapse-btn {
    color: var(--text-secondary, #a0aec0);
}

body.dark-mode .dfp-sidebar-collapse-btn:hover {
    background: var(--surface-elevated, #1e3a5f);
    color: var(--text, #eef1f5);
}

body.dark-mode .dfp-recent-docs-action-bar {
    background: rgba(49, 130, 206, 0.15);
    border-color: var(--accent-primary, #3182ce);
}

body.dark-mode .dfp-action-btn {
    background: var(--surface-elevated, #1e3a5f);
    border-color: var(--border, #2a3f5f);
    color: var(--text-secondary, #a0aec0);
}

body.dark-mode .dfp-action-btn:hover {
    background: var(--surface, #16213e);
    border-color: var(--text-secondary, #a0aec0);
}

body.dark-mode .dfp-skeleton-item {
    background: linear-gradient(90deg, var(--surface-elevated, #1e3a5f) 25%, var(--surface, #16213e) 50%, var(--surface-elevated, #1e3a5f) 75%);
    background-size: 200% 100%;
}

body.dark-mode .dfp-docs-empty {
    color: var(--text-secondary, #a0aec0);
}

body.dark-mode .dfp-docs-upload-cta {
    border-color: var(--accent-primary, #3182ce);
    color: var(--accent-primary, #3182ce);
}

body.dark-mode .dfp-docs-upload-cta:hover {
    background: rgba(49, 130, 206, 0.15);
}

body.dark-mode .dfp-doc-item {
    background: var(--surface-elevated, #1e3a5f);
    border-color: var(--border, #2a3f5f);
}

body.dark-mode .dfp-doc-item:hover {
    background: var(--surface, #16213e);
    border-color: var(--accent-primary, #3182ce);
}

body.dark-mode .dfp-doc-item.selected {
    background: rgba(49, 130, 206, 0.2);
    border-color: var(--accent-primary, #3182ce);
}

body.dark-mode .dfp-doc-icon {
    background: var(--surface, #16213e);
}

body.dark-mode .dfp-doc-name {
    color: var(--text, #eef1f5);
}

body.dark-mode .dfp-doc-meta {
    color: var(--text-secondary, #a0aec0);
}

body.dark-mode .dfp-doc-action-btn {
    color: var(--text-secondary, #a0aec0);
}

body.dark-mode .dfp-doc-action-btn:hover {
    background: var(--surface, #16213e);
    color: var(--accent-primary, #3182ce);
}

body.dark-mode .dfp-sidebar-toggle-mobile {
    background: var(--accent-primary, #3182ce);
}

/* =============================================================================
   RECENT DOCUMENTS SIDEBAR - Responsive
   ============================================================================= */

@media (max-width: 720px) {
    .dfp-content-row-with-sidebar {
        flex-direction: column;
    }

    .dfp-recent-docs-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        z-index: 1000;
        border-radius: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .dfp-recent-docs-sidebar.mobile-open {
        transform: translateX(0);
    }

    .dfp-recent-docs-sidebar.collapsed {
        display: flex;
        width: 280px;
        max-width: 85vw;
        opacity: 1;
        border: 1px solid var(--border, #e2e8f0);
    }

    .dfp-sidebar-toggle-mobile[hidden] {
        display: none;
    }

    .dfp-sidebar-toggle-mobile:not([hidden]) {
        display: flex;
    }

    /* Overlay for mobile drawer */
    .dfp-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .dfp-sidebar-overlay.visible {
        opacity: 1;
        visibility: visible;
    }
}

@media (min-width: 721px) {
    .dfp-sidebar-toggle-mobile {
        display: none !important;
    }
}
