/*
|==========================================================================
| CITE MASTER — Premium Frontend Design System
|==========================================================================
| A state-of-the-art Glass + Clay hybrid dark-mode academic verification UI.
| Combines frosted glassmorphism transparency with claymorphism's puffy 3D depth.
| Built with CSS custom properties for easy theming and consistency.
*/

/* ── Google Fonts are loaded via wp_enqueue (Inter) ─────────────────── */

/* ══════════════════════════════════════════════════════════════════════
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ══════════════════════════════════════════════════════════════════════ */
:root {
    /* ── Brand Palette ───────────────────────────────────────────── */
    --cm-primary:        #6C5CE7;
    --cm-primary-light:  #A29BFE;
    --cm-primary-dark:   #4834D4;
    --cm-accent:         #00CEC9;
    --cm-accent-light:   #55EFC4;
    --cm-accent-dark:    #00B894;

    /* ── Semantic Colors ─────────────────────────────────────────── */
    --cm-success:        #00B894;
    --cm-success-bg:     rgba(0, 184, 148, 0.1);
    --cm-danger:         #FF6B6B;
    --cm-danger-bg:      rgba(255, 107, 107, 0.1);
    --cm-warning:        #FDCB6E;
    --cm-warning-bg:     rgba(253, 203, 110, 0.1);
    --cm-info:           #74B9FF;
    --cm-info-bg:        rgba(116, 185, 255, 0.1);

    /* ── Dark Theme Base ─────────────────────────────────────────── */
    --cm-bg-primary:     #0A0A1A;
    --cm-bg-secondary:   #12122A;
    --cm-bg-card:        rgba(18, 18, 42, 0.92);
    --cm-bg-glass:       rgba(255, 255, 255, 0.05);
    --cm-bg-glass-hover: rgba(255, 255, 255, 0.09);
    --cm-border:         rgba(255, 255, 255, 0.1);
    --cm-border-active:  rgba(108, 92, 231, 0.6);

    /* ── Text Colors ─────────────────────────────────────────────── */
    --cm-text-primary:   #F0F0F8;
    --cm-text-secondary: #8E8EA0;
    --cm-text-muted:     #7B7B94;
    --cm-text-inverse:   #0A0A1A;

    /* ── Typography ──────────────────────────────────────────────── */
    --cm-heading-font:   'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --cm-font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --cm-font-mono:      'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* ── Spacing Scale ───────────────────────────────────────────── */
    --cm-space-xs:       4px;
    --cm-space-sm:       8px;
    --cm-space-md:       16px;
    --cm-space-lg:       24px;
    --cm-space-xl:       32px;
    --cm-space-2xl:      48px;
    --cm-space-3xl:      64px;

    /* ── Border Radius (inflated for clay feel) ──────────────────── */
    --cm-radius-sm:      12px;
    --cm-radius-md:      16px;
    --cm-radius-lg:      22px;
    --cm-radius-xl:      30px;
    --cm-radius-full:    9999px;

    /* ── Shadows — Glass Layer ───────────────────────────────────── */
    --cm-shadow-sm:      0 2px 8px rgba(0, 0, 0, 0.2);
    --cm-shadow-md:      0 4px 16px rgba(0, 0, 0, 0.3);
    --cm-shadow-lg:      0 8px 32px rgba(0, 0, 0, 0.4);
    --cm-shadow-glow:    0 0 20px rgba(108, 92, 231, 0.3);
    --cm-shadow-accent:  0 0 20px rgba(0, 206, 201, 0.2);

    /* ── Shadows — Clay Layer (puffy 3D depth) ───────────────────── */
    --cm-clay-shadow:    8px 8px 20px rgba(0, 0, 0, 0.4),
                         -4px -4px 12px rgba(255, 255, 255, 0.03),
                         inset 0 1px 0 rgba(255, 255, 255, 0.07);
    --cm-clay-shadow-hover: 12px 12px 28px rgba(0, 0, 0, 0.5),
                         -6px -6px 16px rgba(255, 255, 255, 0.04),
                         inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --cm-clay-shadow-sm: 4px 4px 10px rgba(0, 0, 0, 0.3),
                         -2px -2px 6px rgba(255, 255, 255, 0.02),
                         inset 0 1px 0 rgba(255, 255, 255, 0.06);
    --cm-clay-inset:     inset 2px 2px 6px rgba(0, 0, 0, 0.25),
                         inset -2px -2px 6px rgba(255, 255, 255, 0.03);

    /* ── Transitions ─────────────────────────────────────────────── */
    --cm-ease:           cubic-bezier(0.34, 1.56, 0.64, 1);
    --cm-duration:       0.3s;
    --cm-duration-fast:  0.15s;
    --cm-duration-slow:  0.5s;
}

/* ══════════════════════════════════════════════════════════════════════
   1b. LIGHT THEME OVERRIDES
   ══════════════════════════════════════════════════════════════════════ */
.citemaster-root[data-theme="light"] {
    /* ── Light Theme Base ─────────────────────────────────────────── */
    --cm-bg-primary:     #F5F6FA;
    --cm-bg-secondary:   #ECEEF5;
    --cm-bg-card:        rgba(255, 255, 255, 0.95);
    --cm-bg-glass:       rgba(0, 0, 0, 0.03);
    --cm-bg-glass-hover: rgba(0, 0, 0, 0.06);
    --cm-border:         rgba(0, 0, 0, 0.10);
    --cm-border-active:  rgba(108, 92, 231, 0.5);

    /* ── Text Colors ─────────────────────────────────────────────── */
    --cm-text-primary:   #1A1A2E;
    --cm-text-secondary: #5A5A7A;
    --cm-text-muted:     #8888A0;
    --cm-text-inverse:   #F0F0F8;

    /* ── Shadows — soft light-mode drop shadows ──────────────────── */
    --cm-shadow-sm:      0 2px 8px rgba(0, 0, 0, 0.06);
    --cm-shadow-md:      0 4px 16px rgba(0, 0, 0, 0.08);
    --cm-shadow-lg:      0 8px 32px rgba(0, 0, 0, 0.10);
    --cm-shadow-glow:    0 0 20px rgba(108, 92, 231, 0.15);
    --cm-shadow-accent:  0 0 20px rgba(0, 206, 201, 0.10);

    /* ── Clay shadows — lighter for white surfaces ───────────────── */
    --cm-clay-shadow:    4px 4px 12px rgba(0, 0, 0, 0.08),
                         -2px -2px 8px rgba(255, 255, 255, 0.9),
                         inset 0 1px 0 rgba(255, 255, 255, 0.7);
    --cm-clay-shadow-hover: 6px 6px 16px rgba(0, 0, 0, 0.10),
                         -3px -3px 10px rgba(255, 255, 255, 0.95),
                         inset 0 1px 0 rgba(255, 255, 255, 0.8);
    --cm-clay-shadow-sm: 2px 2px 6px rgba(0, 0, 0, 0.06),
                         -1px -1px 4px rgba(255, 255, 255, 0.8),
                         inset 0 1px 0 rgba(255, 255, 255, 0.6);
    --cm-clay-inset:     inset 1px 1px 4px rgba(0, 0, 0, 0.06),
                         inset -1px -1px 4px rgba(255, 255, 255, 0.8);

    /* ── Semantic colors — slightly adjusted for light backgrounds ─ */
    --cm-success-bg:     rgba(0, 184, 148, 0.08);
    --cm-danger-bg:      rgba(255, 107, 107, 0.08);
    --cm-warning-bg:     rgba(253, 203, 110, 0.12);
    --cm-info-bg:        rgba(116, 185, 255, 0.08);
}

/* Light mode ambient gradient tones */
.citemaster-root[data-theme="light"] .cm-app {
    background-image:
        radial-gradient(ellipse at 15% 0%, rgba(108, 92, 231, 0.08) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 100%, rgba(0, 206, 201, 0.06) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, rgba(72, 52, 212, 0.03) 0%, transparent 70%);
}

/* Light mode header text needs solid colors */
.citemaster-root[data-theme="light"] .cm-header h1 {
    background: linear-gradient(135deg, #1A1A2E, var(--cm-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Light mode dot pattern */
.citemaster-root[data-theme="light"] .cm-app::after {
    background-image:
        radial-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px);
}

/* Light mode ambient rotation — softer */
.citemaster-root[data-theme="light"] .cm-app::before {
    background:
        radial-gradient(circle at 20% 30%, rgba(108, 92, 231, 0.04), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 206, 201, 0.03), transparent 50%);
}

/* Light mode kbd styling */
.citemaster-root[data-theme="light"] .cm-shortcut-badge kbd {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--cm-text-secondary);
}

/* Light mode global header/nav adjustment */
.citemaster-root[data-theme="light"] .cm-global-header {
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.citemaster-root[data-theme="light"] .cm-global-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* ══════════════════════════════════════════════════════════════════════
   2. RESET & BASE STYLES
   ══════════════════════════════════════════════════════════════════════ */
.citemaster-root,
.citemaster-root * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.citemaster-root h1, .citemaster-root h2, .citemaster-root h3, .citemaster-root h4, .citemaster-root h5, .citemaster-root h6 {
    font-family: var(--cm-heading-font);
}

html[data-cm-active="true"],
.citemaster-root {
    scroll-behavior: smooth;
}

.citemaster-root {
    font-family: var(--cm-font);
    color: var(--cm-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* App takeover mode: cover the entire theme/screen */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 99990;
    background: var(--cm-bg-primary);

    /* Flex column so header, main, footer stack properly */
    display: flex;
    flex-direction: column;
}

/* Adjust for WordPress admin bar if present */
body.admin-bar .citemaster-root {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar .citemaster-root {
        top: 46px;
    }
}

/* ══════════════════════════════════════════════════════════════════════
   3. MAIN LAYOUT — The Verification Page
   ══════════════════════════════════════════════════════════════════════ */
.cm-app {
    flex: 1;
    background: var(--cm-bg-primary);
    background-image:
        radial-gradient(ellipse at 15% 0%, rgba(108, 92, 231, 0.18) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 100%, rgba(0, 206, 201, 0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, rgba(72, 52, 212, 0.06) 0%, transparent 70%);
    padding: var(--cm-space-2xl) var(--cm-space-md);
    position: relative;
    overflow: hidden;
}

/* Animated gradient mesh — gives the background a living, breathing feel */
.cm-app::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 30%, rgba(108, 92, 231, 0.08), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 206, 201, 0.06), transparent 50%);
    animation: cm-ambient-breathe 25s ease-in-out infinite alternate;
    pointer-events: none;
}

/* Base64 SVG Noise overlay + Grid dots */
.cm-app::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
    background-size: 40px 40px, 150px 150px;
    background-repeat: repeat, repeat;
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: overlay;
}

@keyframes cm-ambient-breathe {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(10deg) scale(1.05); }
    100% { transform: rotate(-5deg) scale(0.95); }
}

.cm-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ══════════════════════════════════════════════════════════════════════
   4. HEADER — Branding & Status Bar
   ══════════════════════════════════════════════════════════════════════ */
.cm-header {
    text-align: center;
    margin-bottom: var(--cm-space-2xl);
}

.cm-logo-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--cm-space-md);
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-accent));
    border-radius: var(--cm-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: var(--cm-clay-shadow), var(--cm-shadow-glow);
    animation: cm-logo-pulse 3s ease-in-out infinite;
}

.cm-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--cm-radius-md);
}

@keyframes cm-logo-pulse {
    0%, 100% { box-shadow: var(--cm-shadow-glow); }
    50%      { box-shadow: 0 0 30px rgba(108, 92, 231, 0.5); }
}

.cm-header h1 {
    font-family: var(--cm-heading-font);
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--cm-text-primary), var(--cm-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--cm-space-xs);
    letter-spacing: -0.02em;
}

.cm-header p {
    color: var(--cm-text-secondary);
    font-size: 0.95rem;
}

/* Quota Badge */
.cm-quota-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--cm-space-sm);
    margin-top: var(--cm-space-md);
    padding: var(--cm-space-xs) var(--cm-space-md);
    background: var(--cm-bg-glass);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-full);
    font-size: 0.8rem;
    color: var(--cm-text-secondary);
    box-shadow: var(--cm-clay-shadow-sm);
}

.cm-quota-badge .cm-quota-count {
    color: var(--cm-accent);
    font-weight: 700;
}

.cm-quota-badge.cm-quota-low .cm-quota-count {
    color: var(--cm-warning);
}

.cm-quota-badge.cm-quota-empty .cm-quota-count {
    color: var(--cm-danger);
}

/* ══════════════════════════════════════════════════════════════════════
   5. INPUT CARD — The Search Interface
   ══════════════════════════════════════════════════════════════════════ */
.cm-input-card {
    background: var(--cm-bg-card);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    backdrop-filter: blur(20px) saturate(1.6);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-lg);
    padding: var(--cm-space-xl);
    box-shadow: var(--cm-clay-shadow);
    transition: border-color var(--cm-duration) var(--cm-ease),
                box-shadow var(--cm-duration) var(--cm-ease),
                transform var(--cm-duration) var(--cm-ease);
    position: relative;
}

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

.cm-textarea.cm-error-placeholder::placeholder {
    color: var(--cm-danger);
    font-weight: 600;
}

.cm-input-card:focus-within {
    border-color: var(--cm-border-active);
    box-shadow: var(--cm-clay-shadow-hover), var(--cm-shadow-glow);
    transform: translateY(-3px);
}

.cm-input-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cm-text-secondary);
    margin-bottom: var(--cm-space-sm);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.cm-textarea-wrapper {
    position: relative;
}

.cm-textarea {
    width: 100%;
    min-height: 120px;
    max-height: 300px;
    padding: var(--cm-space-md);
    padding-bottom: var(--cm-space-xl);
    background: var(--cm-bg-glass);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-md);
    color: var(--cm-text-primary);
    font-family: var(--cm-font-mono);
    font-size: 0.92rem;
    line-height: 1.7;
    resize: vertical;
    box-shadow: var(--cm-clay-inset);
    transition: border-color var(--cm-duration) var(--cm-ease),
                background var(--cm-duration) var(--cm-ease),
                box-shadow var(--cm-duration) var(--cm-ease);
    outline: none;
}

.cm-textarea::placeholder {
    color: var(--cm-text-muted);
    font-family: var(--cm-font);
    font-style: italic;
}

.cm-textarea:focus {
    border-color: var(--cm-primary);
    background: rgba(108, 92, 231, 0.05);
    box-shadow: var(--cm-clay-inset), 0 0 0 3px rgba(108, 92, 231, 0.1);
}

/* Keyboard shortcut badge */
.cm-shortcut-badge {
    position: absolute;
    bottom: var(--cm-space-sm);
    right: var(--cm-space-sm);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--cm-bg-glass);
    border: 1px solid var(--cm-border);
    border-radius: 6px;
    font-size: 0.7rem;
    color: var(--cm-text-muted);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--cm-duration) var(--cm-ease);
}

.cm-textarea:focus ~ .cm-shortcut-badge {
    opacity: 1;
}

.cm-shortcut-badge kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 1px 5px;
    font-family: var(--cm-font);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--cm-text-secondary);
    box-shadow: var(--cm-clay-shadow-sm);
}

/* Character counter */
.cm-char-counter {
    position: absolute;
    bottom: var(--cm-space-sm);
    left: var(--cm-space-sm);
    font-size: 0.7rem;
    color: var(--cm-text-muted);
    pointer-events: none;
    transition: color var(--cm-duration-fast) var(--cm-ease);
}

.cm-char-counter.cm-has-text {
    color: var(--cm-text-secondary);
}

/* Example citations */
.cm-examples {
    margin-top: var(--cm-space-md);
    padding-top: var(--cm-space-md);
    border-top: 1px solid var(--cm-border);
}

.cm-examples-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--cm-space-sm);
}

.cm-example-chip {
    display: inline-block;
    padding: 6px 14px;
    margin: 4px 4px 4px 0;
    background: var(--cm-bg-glass);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-full);
    font-size: 0.78rem;
    color: var(--cm-text-secondary);
    cursor: pointer;
    box-shadow: var(--cm-clay-shadow-sm);
    transition: all var(--cm-duration-fast) var(--cm-ease);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.cm-example-chip:hover {
    border-color: var(--cm-primary-light);
    background: rgba(108, 92, 231, 0.08);
    color: var(--cm-text-primary);
    transform: translateY(-2px);
    box-shadow: var(--cm-clay-shadow);
}

/* Actions Row */
.cm-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--cm-space-md);
    gap: var(--cm-space-md);
    flex-wrap: wrap;
}

.cm-actions-left {
    display: flex;
    gap: var(--cm-space-sm);
    flex-wrap: wrap;
}

.cm-actions-right {
    display: flex;
    gap: var(--cm-space-sm);
    flex-wrap: wrap;
}

.cm-export-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 10;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: var(--cm-bg-secondary);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-md);
    box-shadow: var(--cm-clay-shadow), 0 8px 32px rgba(0,0,0,0.3);
    min-width: 220px;
    max-height: 70vh;
    overflow-y: auto;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.cm-export-section {
    padding: 8px 10px;
    border-bottom: 1px solid var(--cm-border);
}
.cm-export-section:last-child { border-bottom: none; }

.cm-export-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cm-text-muted);
    padding: 4px 6px 6px;
}

.cm-export-section button {
    width: 100%;
    text-align: left;
    justify-content: flex-start;
    font-size: 0.78rem;
    padding: 5px 8px;
    border-radius: var(--cm-radius-sm);
    margin-bottom: 1px;
}

.cm-export-section-batch {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
}

.cm-export-section-batch select {
    background: var(--cm-bg-glass);
    border: 1px solid var(--cm-border);
    color: var(--cm-text-primary);
    border-radius: var(--cm-radius-sm);
}

/* ── Side-by-Side Style Preview Modal ──────────────────────────── */
.cm-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: cm-fade-in 0.2s ease;
}

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

.cm-preview-modal {
    width: 90vw;
    max-width: 860px;
    max-height: 80vh;
    overflow-y: auto;
    padding: var(--cm-space-lg) !important;
    animation: cm-slide-up 0.3s var(--cm-ease);
}

.cm-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--cm-space-md);
}

.cm-preview-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cm-text-primary);
}

.cm-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--cm-space-md);
}

.cm-preview-cell {
    background: var(--cm-bg-glass);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius-md);
    padding: var(--cm-space-md);
    display: flex;
    flex-direction: column;
    gap: var(--cm-space-sm);
}

.cm-preview-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cm-primary-light);
}

.cm-preview-content {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--cm-text-primary);
    word-break: break-word;
}

.cm-preview-content em { font-style: italic; }
.cm-preview-content strong { font-weight: 700; }

.cm-preview-loading {
    color: var(--cm-text-muted);
    font-style: italic;
}

.cm-preview-copy {
    align-self: flex-end;
    font-size: 0.72rem !important;
    padding: 3px 10px !important;
}

/* ══════════════════════════════════════════════════════════════════════
   6. BUTTONS
   ══════════════════════════════════════════════════════════════════════ */
.cm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--cm-space-sm);
    padding: var(--cm-space-sm) var(--cm-space-lg);
    border: none;
    border-radius: var(--cm-radius-sm);
    font-family: var(--cm-font);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--cm-duration) var(--cm-ease);
    outline: none;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.cm-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s var(--cm-ease);
}

.cm-btn:hover::after {
    transform: translateX(100%);
}

.cm-btn:focus-visible {
    outline: 2px solid var(--cm-primary-light);
    outline-offset: 3px;
}

/* Primary */
.cm-btn-primary {
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-dark));
    color: white;
    box-shadow: var(--cm-clay-shadow-sm), 0 4px 12px rgba(108, 92, 231, 0.3);
}

.cm-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--cm-clay-shadow), 0 6px 20px rgba(108, 92, 231, 0.4);
}

.cm-btn-primary:active {
    transform: translateY(0px);
    box-shadow: var(--cm-clay-shadow-sm);
}

/* Accent */
.cm-btn-accent {
    background: linear-gradient(135deg, var(--cm-accent), var(--cm-accent-dark));
    color: var(--cm-text-inverse);
    box-shadow: var(--cm-clay-shadow-sm), 0 4px 12px rgba(0, 206, 201, 0.2);
}

.cm-btn-accent:hover {
    transform: translateY(-3px);
    box-shadow: var(--cm-clay-shadow), 0 6px 20px rgba(0, 206, 201, 0.3);
}

/* Ghost — recessed clay inset feel */
.cm-btn-ghost {
    background: var(--cm-bg-glass);
    color: var(--cm-text-secondary);
    border: 1.5px solid var(--cm-border);
    box-shadow: var(--cm-clay-inset);
}

.cm-btn-ghost:hover {
    background: var(--cm-bg-glass-hover);
    color: var(--cm-text-primary);
    border-color: var(--cm-primary-light);
    box-shadow: var(--cm-clay-shadow-sm);
    transform: translateY(-2px);
}

/* Danger */
.cm-btn-danger {
    background: linear-gradient(135deg, var(--cm-danger), #E74C3C);
    color: white;
}

/* Small */
.cm-btn-sm {
    padding: var(--cm-space-xs) var(--cm-space-md);
    font-size: 0.8rem;
}

/* Large */
.cm-btn-lg {
    padding: var(--cm-space-md) var(--cm-space-xl);
    font-size: 1rem;
    border-radius: var(--cm-radius-md);
}

/* Loading state */
.cm-btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.cm-btn-loading .cm-btn-text {
    visibility: hidden;
}

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

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

/* Premium gated button */
.cm-btn-gated {
    position: relative;
}

.cm-btn-gated .cm-lock-icon {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ══════════════════════════════════════════════════════════════════════
   7. LOADING ANIMATION
   ══════════════════════════════════════════════════════════════════════ */
.cm-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: var(--cm-space-2xl);
    gap: var(--cm-space-lg);
}

.cm-loading.active {
    display: flex;
}

.cm-loading-bar {
    width: 100%;
    max-width: 400px;
    height: 4px;
    background: var(--cm-bg-glass);
    border-radius: var(--cm-radius-full);
    overflow: hidden;
}

.cm-loading-bar-inner {
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, var(--cm-primary), var(--cm-accent), var(--cm-primary));
    background-size: 200% 100%;
    border-radius: var(--cm-radius-full);
    animation: cm-loading-slide 1.5s ease-in-out infinite;
}

@keyframes cm-loading-slide {
    0%   { transform: translateX(-100%); background-position: 0% 0%; }
    50%  { background-position: 100% 0%; }
    100% { transform: translateX(400%); background-position: 0% 0%; }
}

.cm-loading-text {
    color: var(--cm-text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    animation: cm-fade-pulse 2s ease-in-out infinite;
}

@keyframes cm-fade-pulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1; }
}

/* Loading steps — visual timeline */
.cm-loading-steps {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: var(--cm-space-sm);
}

.cm-loading-step {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid var(--cm-text-muted);
    transition: all var(--cm-duration) var(--cm-ease);
    position: relative;
}

.cm-loading-step + .cm-loading-step::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    width: 2px;
    height: 2px;
    background: var(--cm-text-muted);
}

.cm-loading-step.active {
    background: var(--cm-primary);
    border-color: var(--cm-primary);
    box-shadow: 0 0 8px var(--cm-primary);
    transform: scale(1.3);
}

.cm-loading-step.done {
    background: var(--cm-success);
    border-color: var(--cm-success);
}

/* ══════════════════════════════════════════════════════════════════════
   8. RESULTS CARD
   ══════════════════════════════════════════════════════════════════════ */
.cm-results {
    display: none;
    margin-top: var(--cm-space-xl);
    scroll-margin-top: 100px;
}

.cm-results.active {
    display: block;
    animation: cm-slide-up 0.5s var(--cm-ease);
}

@keyframes cm-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Stagger child sections */
.cm-results .cm-result-header {
    animation: cm-stagger-in 0.3s var(--cm-ease) 0.05s both;
}
.cm-results .cm-diff-section {
    animation: cm-stagger-in 0.3s var(--cm-ease) 0.1s both;
}
.cm-results .cm-metadata-grid {
    animation: cm-stagger-in 0.3s var(--cm-ease) 0.15s both;
}
.cm-results .cm-metrics-row {
    animation: cm-stagger-in 0.3s var(--cm-ease) 0.2s both;
}
.cm-results .cm-format-section {
    animation: cm-stagger-in 0.3s var(--cm-ease) 0.25s both;
}
.cm-results .cm-action-row {
    animation: cm-stagger-in 0.3s var(--cm-ease) 0.3s both;
}

@keyframes cm-stagger-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cm-result-card {
    background: var(--cm-bg-card);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius-lg);
    overflow: hidden;
    box-shadow: var(--cm-shadow-lg);
}

/* Status Header */
.cm-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--cm-space-md) var(--cm-space-xl);
    border-bottom: 1px solid var(--cm-border);
    flex-wrap: wrap;
    gap: var(--cm-space-sm);
}

.cm-result-status {
    display: flex;
    align-items: center;
    gap: var(--cm-space-sm);
    font-weight: 700;
    font-size: 0.95rem;
}

.cm-result-status.verified {
    color: var(--cm-success);
}

.cm-result-status.partial {
    color: var(--cm-warning);
}

.cm-result-status.failed {
    color: var(--cm-danger);
}

.cm-result-status .cm-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
    animation: cm-status-pulse 2s ease-in-out infinite;
}

@keyframes cm-status-pulse {
    0%, 100% { box-shadow: 0 0 0 0 currentColor; }
    50%      { box-shadow: 0 0 0 6px transparent; }
}

.cm-result-meta {
    display: flex;
    align-items: center;
    gap: var(--cm-space-md);
    flex-wrap: wrap;
}

.cm-result-meta-item {
    display: flex;
    align-items: center;
    gap: var(--cm-space-xs);
    font-size: 0.8rem;
    color: var(--cm-text-muted);
}

.cm-result-meta-item span {
    font-weight: 600;
    color: var(--cm-text-secondary);
}

/* ── Confidence Ring ──────────────────────────────────────────────── */
.cm-confidence-ring {
    width: 52px;
    height: 52px;
    position: relative;
}

.cm-confidence-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.cm-confidence-ring .cm-ring-bg {
    fill: none;
    stroke: var(--cm-bg-glass);
    stroke-width: 4;
}

.cm-confidence-ring .cm-ring-value {
    fill: none;
    stroke: var(--cm-success);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 138.23;
    stroke-dashoffset: 138.23;
    transition: stroke-dashoffset 1.5s var(--cm-ease);
}

.cm-confidence-ring .cm-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--cm-text-primary);
}

/* ── Result Body ──────────────────────────────────────────────────── */
.cm-result-body {
    padding: var(--cm-space-xl);
}

/* ── Visual Diff Section ────────────────────────────────────────── */
.cm-diff-section {
    margin-bottom: var(--cm-space-xl);
}

.cm-diff-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cm-text-muted);
    margin-bottom: var(--cm-space-sm);
}

.cm-diff-section-block {
    margin-bottom: var(--cm-space-md);
}

.cm-diff-block {
    padding: var(--cm-space-md);
    background: var(--cm-bg-glass);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius-sm);
    font-family: var(--cm-font-mono);
    font-size: 0.88rem;
    line-height: 1.8;
}

.cm-diff-removed {
    color: var(--cm-danger);
    text-decoration: line-through;
    text-decoration-color: rgba(255, 107, 107, 0.5);
    background: var(--cm-danger-bg);
    padding: 1px 4px;
    border-radius: 3px;
}

.cm-diff-added {
    color: var(--cm-success);
    font-weight: 600;
    background: var(--cm-success-bg);
    padding: 1px 4px;
    border-radius: 3px;
}

/* ── Metadata Grid ───────────────────────────────────────────────── */
.cm-metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--cm-space-md);
    margin-bottom: var(--cm-space-xl);
}

.cm-meta-field {
    padding: var(--cm-space-md);
    background: var(--cm-bg-glass);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius-sm);
    transition: border-color var(--cm-duration) var(--cm-ease);
}

.cm-meta-field:hover {
    border-color: var(--cm-primary-light);
}

.cm-meta-field-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cm-text-muted);
    margin-bottom: var(--cm-space-xs);
}

.cm-meta-field-value {
    color: var(--cm-text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    word-break: break-word;
}

.cm-meta-field-value a {
    color: var(--cm-primary-light);
    text-decoration: none;
    transition: color var(--cm-duration-fast) var(--cm-ease);
}

.cm-meta-field-value a:hover {
    color: var(--cm-accent);
    text-decoration: underline;
}

/* ── Citation Metrics Row ────────────────────────────────────────── */
.cm-metrics-row {
    display: flex;
    gap: var(--cm-space-md);
    margin-bottom: var(--cm-space-xl);
    flex-wrap: wrap;
}

.cm-metric {
    flex: 1;
    min-width: 120px;
    display: flex;
    align-items: center;
    gap: var(--cm-space-sm);
    padding: var(--cm-space-md);
    background: var(--cm-bg-glass);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius-sm);
}

.cm-metric-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--cm-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.cm-metric-icon.citations {
    background: var(--cm-info-bg);
}

.cm-metric-icon.oa {
    background: var(--cm-success-bg);
}

.cm-metric-info .cm-metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cm-text-primary);
}

.cm-metric-info .cm-metric-label {
    font-size: 0.72rem;
    color: var(--cm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ══════════════════════════════════════════════════════════════════════
   9. FORMAT TOGGLE (APA/MLA/Vancouver/Chicago/Harvard)
   ══════════════════════════════════════════════════════════════════════ */
.cm-format-section {
    margin-bottom: var(--cm-space-xl);
}

.cm-format-tabs {
    display: flex;
    gap: 2px;
    background: var(--cm-bg-glass);
    border-radius: var(--cm-radius-sm);
    padding: 3px;
    margin-bottom: var(--cm-space-md);
    overflow-x: auto;
}

.cm-format-tab {
    flex: 1;
    min-width: 80px;
    padding: var(--cm-space-sm) var(--cm-space-md);
    background: var(--cm-bg-glass);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-sm);
    color: var(--cm-text-secondary);
    font-family: var(--cm-font);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--cm-clay-inset);
    transition: all var(--cm-duration-fast) var(--cm-ease);
    text-align: center;
}

.cm-format-tab:hover {
    color: var(--cm-text-primary);
    background: var(--cm-bg-glass-hover);
    box-shadow: var(--cm-clay-shadow-sm);
    transform: translateY(-1px);
}

.cm-format-tab.active {
    background: var(--cm-primary);
    border-color: var(--cm-primary);
    color: white;
    box-shadow: var(--cm-clay-shadow-sm), 0 2px 8px rgba(108, 92, 231, 0.3);
    transform: translateY(-1px);
}

.cm-format-output-wrap {
    position: relative;
}

.cm-format-output {
    padding: var(--cm-space-md);
    padding-right: var(--cm-space-3xl);
    background: var(--cm-bg-glass);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-sm);
    font-family: var(--cm-font-mono);
    font-size: 0.88rem;
    line-height: 1.8;
    color: var(--cm-text-primary);
    cursor: text;
    -webkit-user-select: all;
    user-select: all;
    min-height: 48px;
    box-shadow: var(--cm-clay-inset);
}

.cm-copy-btn {
    position: absolute;
    top: var(--cm-space-sm);
    right: var(--cm-space-sm);
    z-index: 2;
    padding: var(--cm-space-xs) var(--cm-space-sm);
    background: var(--cm-bg-glass-hover);
    border: 1.5px solid var(--cm-border);
    border-radius: 8px;
    color: var(--cm-text-secondary);
    font-family: var(--cm-font);
    font-size: 0.75rem;
    cursor: pointer;
    box-shadow: var(--cm-clay-shadow-sm);
    transition: all var(--cm-duration-fast) var(--cm-ease);
}

.cm-copy-btn:hover {
    background: var(--cm-primary);
    color: white;
    border-color: var(--cm-primary);
}

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

/* ══════════════════════════════════════════════════════════════════════
   10. RETRACTED PAPER ALARM 🚨
   ══════════════════════════════════════════════════════════════════════ */
.cm-retracted-alarm {
    display: none;
    margin-top: var(--cm-space-xl);
    padding: var(--cm-space-xl);
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(231, 76, 60, 0.15));
    border: 1.5px solid var(--cm-danger);
    border-radius: var(--cm-radius-lg);
    text-align: center;
    animation: cm-alarm-flash 2s ease-in-out infinite;
    box-shadow: var(--cm-clay-shadow);
}

.cm-retracted-alarm.active {
    display: block;
}

@keyframes cm-alarm-flash {
    0%, 100% { border-color: var(--cm-danger); box-shadow: 0 0 20px rgba(255, 107, 107, 0.2); }
    50%      { border-color: #E74C3C; box-shadow: 0 0 40px rgba(255, 107, 107, 0.4); }
}

.cm-retracted-icon {
    font-size: 3rem;
    margin-bottom: var(--cm-space-md);
    animation: cm-shake 0.5s ease-in-out infinite alternate;
}

@keyframes cm-shake {
    from { transform: rotate(-3deg); }
    to   { transform: rotate(3deg); }
}

.cm-retracted-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--cm-danger);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--cm-space-sm);
}

.cm-retracted-text {
    color: var(--cm-text-secondary);
    font-size: 0.95rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ══════════════════════════════════════════════════════════════════════
   11. ACTION ROW (Export, Certificate, Library, Graph)
   ══════════════════════════════════════════════════════════════════════ */
.cm-action-row {
    display: flex;
    gap: var(--cm-space-sm);
    flex-wrap: wrap;
    padding-top: var(--cm-space-md);
    border-top: 1px solid var(--cm-border);
}

/* ══════════════════════════════════════════════════════════════════════
   12. AMBIGUOUS RESULTS (Missing Data Interpolation)
   ══════════════════════════════════════════════════════════════════════ */
.cm-ambiguous {
    display: none;
    margin-top: var(--cm-space-xl);
    animation: cm-slide-up 0.5s var(--cm-ease);
}

.cm-ambiguous.active {
    display: block;
}

.cm-ambiguous-header {
    display: flex;
    align-items: center;
    gap: var(--cm-space-sm);
    margin-bottom: var(--cm-space-md);
    color: var(--cm-warning);
    font-weight: 600;
}

.cm-candidate-card {
    background: var(--cm-bg-card);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-md);
    padding: var(--cm-space-lg);
    margin-bottom: var(--cm-space-md);
    cursor: pointer;
    box-shadow: var(--cm-clay-shadow-sm);
    transition: all var(--cm-duration) var(--cm-ease);
}

.cm-candidate-card:hover {
    border-color: var(--cm-primary);
    box-shadow: var(--cm-clay-shadow);
    transform: translateY(-2px);
}

.cm-candidate-card .cm-candidate-title {
    font-weight: 600;
    color: var(--cm-text-primary);
    margin-bottom: var(--cm-space-xs);
}

.cm-candidate-card .cm-candidate-meta {
    font-size: 0.85rem;
    color: var(--cm-text-secondary);
}

/* ══════════════════════════════════════════════════════════════════════
   13. MODAL (Login Wall / Paywall / General)
   ══════════════════════════════════════════════════════════════════════ */
.cm-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: var(--cm-space-md);
    animation: cm-fade-in 0.3s var(--cm-ease);
}

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

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

.cm-modal {
    background: var(--cm-bg-secondary);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius-xl);
    padding: var(--cm-space-2xl);
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: var(--cm-clay-shadow);
    animation: cm-modal-pop 0.4s var(--cm-ease);
    position: relative;
}

@keyframes cm-modal-pop {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Staggered children inside modal */
.cm-modal .cm-modal-icon {
    animation: cm-stagger-in 0.3s var(--cm-ease) 0.1s both;
}
.cm-modal h2 {
    animation: cm-stagger-in 0.3s var(--cm-ease) 0.2s both;
}
.cm-modal p {
    animation: cm-stagger-in 0.3s var(--cm-ease) 0.3s both;
}
.cm-modal .cm-modal-actions {
    animation: cm-stagger-in 0.3s var(--cm-ease) 0.4s both;
}

.cm-modal > .cm-modal-close {
    position: absolute;
    top: var(--cm-space-md);
    right: var(--cm-space-md);
    width: 32px;
    height: 32px;
    background: var(--cm-bg-glass);
    border: 1px solid var(--cm-border);
    border-radius: 50%;
    color: var(--cm-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--cm-duration-fast) var(--cm-ease);
}

.cm-modal > .cm-modal-close:hover {
    background: var(--cm-danger);
    color: white;
    border-color: var(--cm-danger);
}

.cm-modal-icon {
    font-size: 3rem;
    margin-bottom: var(--cm-space-md);
    position: relative;
}

/* Radial glow behind modal icon */
.cm-modal-icon::after {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.15), transparent 70%);
    border-radius: 50%;
    z-index: -1;
}

.cm-modal h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--cm-text-primary);
    margin-bottom: var(--cm-space-sm);
}

.cm-modal p {
    color: var(--cm-text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--cm-space-xl);
    line-height: 1.6;
}

.cm-modal-actions {
    display: flex;
    flex-direction: column;
    gap: var(--cm-space-sm);
    align-items: stretch;
}

/* Ensure modal action buttons never overlap — each takes full row */
.cm-modal-actions > a,
.cm-modal-actions > button {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

/* ══════════════════════════════════════════════════════════════════════
   14. BULK UPLOAD ZONE
   ══════════════════════════════════════════════════════════════════════ */
.cm-bulk-zone {
    margin-top: var(--cm-space-xl);
    padding: var(--cm-space-2xl);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-lg);
    text-align: center;
    color: var(--cm-text-muted);
    cursor: pointer;
    transition: all var(--cm-duration) var(--cm-ease);
    background-image: none;
    box-shadow: var(--cm-clay-shadow-sm);
}

.cm-bulk-zone:hover {
    border-color: var(--cm-primary);
    background: rgba(108, 92, 231, 0.05);
    color: var(--cm-text-secondary);
    border-style: solid;
    box-shadow: var(--cm-clay-shadow);
}

.cm-bulk-zone.dragover {
    border-color: var(--cm-accent);
    background: rgba(0, 206, 201, 0.08);
    border-style: solid;
    transform: scale(1.01);
    box-shadow: var(--cm-clay-shadow);
}

.cm-bulk-zone-icon {
    font-size: 2.5rem;
    margin-bottom: var(--cm-space-md);
    opacity: 0.5;
}

.cm-bulk-zone-text {
    font-size: 0.95rem;
    margin-bottom: var(--cm-space-xs);
}

.cm-bulk-zone-hint {
    font-size: 0.8rem;
    color: var(--cm-text-muted);
}

/* ══════════════════════════════════════════════════════════════════════
   15. FEATURE TEASER BADGES
   ══════════════════════════════════════════════════════════════════════ */
.cm-plus-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-accent));
    border-radius: var(--cm-radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    vertical-align: middle;
}

/* ══════════════════════════════════════════════════════════════════════
   16. RESPONSIVE DESIGN
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .cm-app {
        padding: var(--cm-space-md) var(--cm-space-sm);
    }

    .cm-input-card {
        padding: var(--cm-space-md);
    }

    .cm-result-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .cm-metrics-row {
        flex-direction: column;
    }

    .cm-format-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cm-action-row {
        flex-direction: column;
    }

    .cm-action-row .cm-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cm-header h1 {
        font-size: 1.5rem;
    }

    .cm-modal {
        padding: var(--cm-space-lg);
    }
}

/* ══════════════════════════════════════════════════════════════════════
   17. OPEN ACCESS PDF BUTTON
   ══════════════════════════════════════════════════════════════════════ */
.cm-oa-download {
    display: none;
    align-items: center;
    gap: var(--cm-space-sm);
    padding: var(--cm-space-sm) var(--cm-space-lg);
    background: linear-gradient(135deg, var(--cm-success), var(--cm-accent-dark));
    border: none;
    border-radius: var(--cm-radius-sm);
    color: white;
    font-family: var(--cm-font);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--cm-duration) var(--cm-ease);
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.3);
}

.cm-oa-download.active {
    display: inline-flex;
}

.cm-oa-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.4);
}

/* ══════════════════════════════════════════════════════════════════════
   18. CITATION GRAPH CONTAINER
   ══════════════════════════════════════════════════════════════════════ */
.cm-graph-container {
    display: none;
    margin-top: var(--cm-space-xl);
    padding: var(--cm-space-xl);
    background: var(--cm-bg-card);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius-lg);
    min-height: 400px;
    position: relative;
}

.cm-graph-container.active {
    display: block;
    animation: cm-slide-up 0.5s var(--cm-ease);
}

.cm-graph-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--cm-space-md);
}

.cm-graph-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--cm-text-primary);
}

.cm-graph-canvas {
    width: 100%;
    height: 350px;
    background: var(--cm-bg-glass);
    border-radius: var(--cm-radius-md);
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════════════
   19. UTILITY CLASSES
   ══════════════════════════════════════════════════════════════════════ */
.cm-hidden { display: none !important; }

.cm-diff-muted {
    color: var(--cm-text-muted);
    font-style: italic;
}
.cm-flex   { display: flex; }
.cm-gap-sm { gap: var(--cm-space-sm); }
.cm-gap-md { gap: var(--cm-space-md); }
.cm-mt-md  { margin-top: var(--cm-space-md); }
.cm-mt-xl  { margin-top: var(--cm-space-xl); }
.cm-text-center { text-align: center; }
.cm-text-muted  { color: var(--cm-text-muted); }
.cm-font-mono   { font-family: var(--cm-font-mono); }

/* ══════════════════════════════════════════════════════════════════════
   20. PRICING PAGE
   ══════════════════════════════════════════════════════════════════════ */

/* Billing toggle */
.cm-billing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--cm-space-md);
    margin-bottom: var(--cm-space-2xl);
}

.cm-toggle-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cm-text-secondary);
}

.cm-save-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, var(--cm-accent), var(--cm-accent-dark));
    color: var(--cm-text-inverse);
    border-radius: var(--cm-radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 4px;
}

.cm-toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.cm-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cm-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--cm-bg-glass);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius-full);
    transition: all var(--cm-duration) var(--cm-ease);
}

.cm-toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    bottom: 2px;
    background: var(--cm-text-secondary);
    border-radius: 50%;
    transition: all var(--cm-duration) var(--cm-ease);
}

.cm-toggle-switch input:checked + .cm-toggle-slider {
    background: rgba(108, 92, 231, 0.2);
    border-color: var(--cm-primary);
}

.cm-toggle-switch input:checked + .cm-toggle-slider::before {
    transform: translateX(22px);
    background: var(--cm-primary);
}

/* Pricing grid */
.cm-pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--cm-space-lg);
    margin-bottom: var(--cm-space-2xl);
    align-items: start;
}

/* Plan card */
.cm-plan-card {
    background: var(--cm-bg-card);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    backdrop-filter: blur(20px) saturate(1.6);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-lg);
    padding: var(--cm-space-xl);
    box-shadow: var(--cm-clay-shadow);
    transition: all var(--cm-duration) var(--cm-ease);
    position: relative;
}

.cm-plan-card:hover {
    border-color: var(--cm-border-active);
    transform: translateY(-6px);
    box-shadow: var(--cm-clay-shadow-hover), 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* Featured (Plus) card */
.cm-plan-featured {
    border-color: var(--cm-primary);
    box-shadow: var(--cm-clay-shadow), var(--cm-shadow-glow), 0 0 0 1px rgba(108, 92, 231, 0.2);
    transform: scale(1.04);
}

.cm-plan-featured:hover {
    transform: scale(1.04) translateY(-6px);
    box-shadow: var(--cm-clay-shadow-hover), var(--cm-shadow-glow), 0 12px 40px rgba(108, 92, 231, 0.15);
}

.cm-plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 16px;
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-accent));
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    border-radius: var(--cm-radius-full);
    letter-spacing: 0.1em;
    white-space: nowrap;
    box-shadow: var(--cm-clay-shadow-sm);
}

.cm-plan-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cm-text-primary);
    margin-bottom: var(--cm-space-sm);
}

.cm-plan-price {
    margin-bottom: var(--cm-space-sm);
}

.cm-plan-currency {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--cm-text-secondary);
    vertical-align: top;
}

.cm-plan-amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--cm-text-primary);
    line-height: 1;
}

.cm-plan-period {
    font-size: 0.85rem;
    color: var(--cm-text-muted);
}

.cm-plan-desc {
    font-size: 0.85rem;
    color: var(--cm-text-secondary);
    margin-bottom: var(--cm-space-lg);
}

/* Feature list */
.cm-plan-features {
    list-style: none;
    margin-bottom: var(--cm-space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--cm-space-sm);
}

.cm-plan-features li {
    font-size: 0.85rem;
    line-height: 1.6;
    padding-left: 4px;
}

.cm-plan-features li.included {
    color: var(--cm-text-primary);
}

.cm-plan-features li.excluded {
    color: var(--cm-text-muted);
    text-decoration: line-through;
    text-decoration-color: rgba(92, 92, 114, 0.4);
}

.cm-plan-features li strong {
    color: var(--cm-accent);
}

/* Full width button */
.cm-btn-full {
    width: 100%;
}

/* Trust section */
.cm-trust-section {
    display: flex;
    gap: var(--cm-space-lg);
    justify-content: center;
    flex-wrap: wrap;
}

.cm-trust-badge {
    font-size: 0.8rem;
    color: var(--cm-text-muted);
    display: flex;
    align-items: center;
    gap: var(--cm-space-xs);
}


/* ── Pricing responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
    .cm-pricing-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }

    .cm-plan-featured {
        transform: none;
        order: -1;
    }

    .cm-plan-featured:hover {
        transform: translateY(-4px);
    }
}

/* ═══════════════════════════════════════════════════════════════════
   CITATION GRAPH CONTAINER
   ═══════════════════════════════════════════════════════════════════ */
.cm-graph-container,
.cm-citing-panel {
    display: none;
    background: var(--cm-bg-card);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-xl);
    padding: var(--cm-space-lg);
    margin-top: var(--cm-space-lg);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    backdrop-filter: blur(20px) saturate(1.6);
    box-shadow: var(--cm-clay-shadow);
}

.cm-graph-container.active,
.cm-citing-panel.active {
    display: block;
    animation: cm-slideIn 0.3s ease;
}

.cm-graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--cm-space-md);
    padding-bottom: var(--cm-space-sm);
    border-bottom: 1px solid var(--cm-glass-border);
}

.cm-graph-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cm-text-primary);
}

.cm-graph-loading {
    text-align: center;
    padding: var(--cm-space-xl);
    color: var(--cm-text-muted);
    font-size: 0.9rem;
}

.cm-graph-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: var(--cm-space-sm);
    font-size: 0.78rem;
    color: var(--cm-text-muted);
}

.cm-graph-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.cm-graph-center-dot { background: #6C5CE7; }
.cm-graph-citing-dot { background: #00CEC9; }

#cm-graph-svg {
    width: 100%;
    height: 500px;
    border-radius: var(--cm-radius-lg);
    background: rgba(0, 0, 0, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════
   CITING PAPERS LIST
   ═══════════════════════════════════════════════════════════════════ */
.cm-citing-list {
    max-height: 400px;
    overflow-y: auto;
}

.cm-citing-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}

.cm-citing-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.cm-citing-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--cm-text-primary);
    margin-bottom: 4px;
}

.cm-citing-meta {
    font-size: 0.78rem;
    color: var(--cm-text-muted);
}

.cm-citing-meta a {
    color: var(--cm-primary);
    text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════════
   BULK PROCESSING RESULTS
   ═══════════════════════════════════════════════════════════════════ */
.cm-bulk-results {
    display: none;
    background: var(--cm-bg-card);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-xl);
    padding: var(--cm-space-lg);
    margin-top: var(--cm-space-lg);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    backdrop-filter: blur(20px) saturate(1.6);
    box-shadow: var(--cm-clay-shadow);
}

.cm-bulk-results.active {
    display: block;
    animation: cm-slideIn 0.3s ease;
}

.cm-bulk-status {
    font-size: 0.88rem;
    color: var(--cm-text-muted);
    margin-bottom: var(--cm-space-md);
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--cm-radius-md);
}

.cm-bulk-list {
    max-height: 500px;
    overflow-y: auto;
}

.cm-bulk-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.88rem;
}

.cm-bulk-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.cm-bulk-title {
    flex: 1;
    color: var(--cm-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cm-bulk-conf {
    font-weight: 600;
    font-size: 0.78rem;
    flex-shrink: 0;
    min-width: 40px;
    text-align: right;
}

.cm-bulk-verified .cm-bulk-icon { color: var(--cm-success); }
.cm-bulk-partial .cm-bulk-icon { color: var(--cm-warning); }
.cm-bulk-failed .cm-bulk-icon { color: var(--cm-danger); }
.cm-bulk-verified .cm-bulk-conf { color: var(--cm-success); }
.cm-bulk-partial .cm-bulk-conf { color: var(--cm-warning); }
.cm-bulk-failed .cm-bulk-conf { color: var(--cm-danger); }

/* ═══════════════════════════════════════════════════════════════════
   SAVE TO LIBRARY BUTTON STATE
   ═══════════════════════════════════════════════════════════════════ */
.cm-btn-saved {
    color: var(--cm-success) !important;
    border-color: var(--cm-success) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   FREE TIER UPSELL MESSAGE
   ═══════════════════════════════════════════════════════════════════ */
.cm-graph-upsell {
    text-align: center;
    padding: 10px 16px;
    margin-top: var(--cm-space-sm);
    background: linear-gradient(135deg, rgba(108,92,231,0.15), rgba(0,206,201,0.08));
    border: 1px solid rgba(108,92,231,0.3);
    border-radius: var(--cm-radius-md);
    font-size: 0.82rem;
    color: var(--cm-text-muted);
}

/* ═══════════════════════════════════════════════════════════════════
   GLOBAL UI WRAPPER (Header, Footer, Hero, Auth forms)
   ═══════════════════════════════════════════════════════════════════ */


/* Force the body background dark so no white flashes around the plugin */
body:has(.citemaster-root) {
    background: var(--cm-bg-primary) !important;
}

/* Hide the WordPress theme's header, page title, logos, sidebars, and footer
   so they don't bleed through above/below the plugin UI.
   Note: .citemaster-root is deeply nested (body > main > article > .entry-content > .citemaster-root),
   so we target only known theme elements by their semantic tags/classes. */
body:has(.citemaster-root) > header,
body:has(.citemaster-root) > footer,
body:has(.citemaster-root) > .site-header,
body:has(.citemaster-root) > .site-footer,
body:has(.citemaster-root) > nav.main-navigation,
body:has(.citemaster-root) > .skip-link,
body:has(.citemaster-root) .site-header,
body:has(.citemaster-root) .site-footer:not(.cm-global-footer),
body:has(.citemaster-root) #masthead,
body:has(.citemaster-root) #colophon,
body:has(.citemaster-root) .page-header,
body:has(.citemaster-root) .entry-header,
body:has(.citemaster-root) .entry-title,
body:has(.citemaster-root) .custom-logo-link,
body:has(.citemaster-root) .wp-block-post-title,
body:has(.citemaster-root) .site-branding,
body:has(.citemaster-root) .wp-site-blocks > header {
    display: none !important;
}

/* Override WordPress page wrapper to remove padding/margins so the plugin fills the viewport */
body:has(.citemaster-root) .site-main,
body:has(.citemaster-root) .entry-content,
body:has(.citemaster-root) .page .entry-content,
body:has(.citemaster-root) article.page,
body:has(.citemaster-root) .wp-site-blocks,
body:has(.citemaster-root) .site-content,
body:has(.citemaster-root) #content,
body:has(.citemaster-root) #primary {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}
.cm-global-header {
    display: flex;
    justify-content: center;
    padding: var(--cm-space-md) var(--cm-space-2xl);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    background: rgba(10, 10, 26, 0.88);
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3),
               inset 0 -1px 0 rgba(255, 255, 255, 0.04);
    transition: background var(--cm-duration) var(--cm-ease),
                box-shadow var(--cm-duration) var(--cm-ease);
}

.cm-global-header.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4),
               inset 0 -1px 0 rgba(255, 255, 255, 0.06);
    background: rgba(10, 10, 26, 0.95);
}

/* Hide the JS-generated internal app header when inside the global wrapper */
.citemaster-root > .cm-main-content .cm-header {
    display: none;
}

.cm-nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
}

.cm-brand {
    display: flex;
    align-items: center;
    gap: var(--cm-space-sm);
    text-decoration: none;
    transition: opacity var(--cm-duration-fast) var(--cm-ease);
}

.cm-brand:hover {
    opacity: 0.85;
}

.cm-brand-logo {
    height: 32px;
    width: auto;
}

.cm-brand-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--cm-text-primary);
    letter-spacing: -0.02em;
}

.cm-nav-links {
    display: flex;
    align-items: center;
    gap: var(--cm-space-xl);
}

.cm-nav-links a:not(.cm-btn) {
    color: var(--cm-text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    padding-bottom: 4px;
    transition: color var(--cm-duration) var(--cm-ease);
}

.cm-nav-links a:not(.cm-btn)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--cm-primary), var(--cm-accent));
    border-radius: 2px;
    transition: width var(--cm-duration) var(--cm-ease);
}

.cm-nav-links a:not(.cm-btn):hover {
    color: var(--cm-text-primary);
}

.cm-nav-links a:not(.cm-btn):hover::after {
    width: 100%;
}

.cm-nav-links a:not(.cm-btn).cm-nav-active {
    color: var(--cm-text-primary);
}

.cm-nav-links a:not(.cm-btn).cm-nav-active::after {
    width: 100%;
}

.cm-hero-section {
    text-align: center;
    padding: var(--cm-space-3xl) var(--cm-space-md) var(--cm-space-xl);
    max-width: 800px;
    margin: 0 auto;
}

.cm-hero-headline {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: var(--cm-space-lg);
    background: linear-gradient(135deg, #ffffff 0%, var(--cm-primary-light) 50%, var(--cm-accent) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    animation: cm-shimmer-text 6s ease-in-out infinite;
}

@keyframes cm-shimmer-text {
    0%, 100% { background-position: 0% center; }
    50%      { background-position: 200% center; }
}

.cm-hero-subtitle {
    font-size: 1.1rem;
    color: var(--cm-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--cm-space-xl);
    animation: cm-fade-in-up 0.6s var(--cm-ease) 0.15s both;
}

@keyframes cm-fade-in-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cm-hero-trust {
    font-size: 0.85rem;
    color: var(--cm-text-muted);
    animation: cm-fade-in-up 0.6s var(--cm-ease) 0.3s both;
}

.cm-hero-trust strong {
    color: var(--cm-text-secondary);
}

.cm-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.cm-app-mount-point {
    width: 100%;
}

.cm-global-footer {
    border-top: 1.5px solid var(--cm-border);
    padding: var(--cm-space-xl) var(--cm-space-2xl);
    background: var(--cm-bg-secondary);
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cm-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: var(--cm-space-md);
}

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

.cm-footer-links {
    display: flex;
    gap: var(--cm-space-lg);
}

.cm-footer-links a {
    color: var(--cm-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color var(--cm-duration) var(--cm-ease);
}

.cm-footer-links a:hover {
    color: var(--cm-text-primary);
}

/* Auth Wrappers */
.cm-auth-wrapper {
    max-width: 400px;
    margin: var(--cm-space-3xl) auto;
    background: var(--cm-bg-card);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    backdrop-filter: blur(20px) saturate(1.6);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-lg);
    padding: var(--cm-space-2xl);
    box-shadow: var(--cm-clay-shadow);
}

.cm-auth-wrapper #loginform label {
    display: block;
    font-weight: 600;
    color: var(--cm-text-secondary);
    margin-bottom: var(--cm-space-xs);
    font-size: 0.9rem;
}

.cm-auth-wrapper #loginform input[type="text"],
.cm-auth-wrapper #loginform input[type="password"] {
    width: 100%;
    padding: var(--cm-space-md);
    background: var(--cm-bg-glass);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-md);
    color: var(--cm-text-primary);
    margin-bottom: var(--cm-space-lg);
    font-family: var(--cm-font);
    box-shadow: var(--cm-clay-inset);
}

.cm-auth-wrapper #loginform input[type="submit"] {
    width: 100%;
    padding: var(--cm-space-md);
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-dark));
    color: white;
    border: none;
    border-radius: var(--cm-radius-md);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.cm-auth-wrapper p.forgetmenot {
    display: flex;
    align-items: center;
    gap: var(--cm-space-xs);
    color: var(--cm-text-secondary);
    margin-bottom: var(--cm-space-lg);
}

/* ═══════════════════════════════════════════════════════════════════
   TOAST NOTIFICATION SYSTEM
   ═══════════════════════════════════════════════════════════════════ */
.cm-toast-container {
    position: fixed;
    bottom: var(--cm-space-xl);
    right: var(--cm-space-xl);
    z-index: 100001;
    display: flex;
    flex-direction: column-reverse;
    gap: var(--cm-space-sm);
    pointer-events: none;
}

.cm-toast {
    display: flex;
    align-items: center;
    gap: var(--cm-space-sm);
    padding: var(--cm-space-md) var(--cm-space-lg);
    background: var(--cm-bg-secondary);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-md);
    box-shadow: var(--cm-clay-shadow);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--cm-text-primary);
    pointer-events: auto;
    animation: cm-toast-in 0.4s var(--cm-ease);
    max-width: 360px;
}

.cm-toast.cm-toast-out {
    animation: cm-toast-out 0.3s var(--cm-ease) forwards;
}

@keyframes cm-toast-in {
    from { opacity: 0; transform: translateX(40px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes cm-toast-out {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to   { opacity: 0; transform: translateX(40px) scale(0.95); }
}

.cm-toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.cm-toast-success { border-left: 3px solid var(--cm-success); }
.cm-toast-error   { border-left: 3px solid var(--cm-danger); }
.cm-toast-warning { border-left: 3px solid var(--cm-warning); }
.cm-toast-info    { border-left: 3px solid var(--cm-info); }

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT CLASSES (replacing inline styles)
   ═══════════════════════════════════════════════════════════════════ */
.cm-dashboard-header {
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--cm-space-2xl);
    flex-wrap: wrap;
    gap: var(--cm-space-md);
}

.cm-dashboard-header-right {
    text-align: right;
}

.cm-dashboard-tier {
    font-size: 0.8rem;
    padding: 4px 12px;
    margin-bottom: var(--cm-space-sm);
    display: inline-block;
}

.cm-dashboard-quota {
    font-size: 0.85rem;
    color: var(--cm-text-secondary);
}

.cm-dashboard-quota strong {
    color: var(--cm-text-primary);
}

.cm-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--cm-space-lg);
    margin-bottom: var(--cm-space-2xl);
}

.cm-dashboard-card {
    text-decoration: none;
    display: block;
    box-shadow: var(--cm-clay-shadow-sm);
}

.cm-dashboard-card:hover {
    transform: translateY(-3px);
    border-color: var(--cm-primary-light);
    box-shadow: var(--cm-clay-shadow);
}

.cm-dashboard-card h3 {
    font-size: 1.2rem;
    margin-bottom: var(--cm-space-sm);
    color: var(--cm-text-primary);
}

.cm-dashboard-card p {
    font-size: 0.9rem;
    color: var(--cm-text-secondary);
}

/* Library section */
.cm-library-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--cm-space-lg);
    flex-wrap: wrap;
    gap: var(--cm-space-md);
}

.cm-library-title {
    font-size: 1.5rem;
    color: var(--cm-text-primary);
    margin: 0;
}

.cm-library-toolbar {
    display: flex;
    gap: var(--cm-space-sm);
    align-items: center;
}

.cm-search-input {
    padding: var(--cm-space-sm) 14px;
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-sm);
    background: var(--cm-bg-glass);
    color: var(--cm-text-primary);
    font-size: 0.9rem;
    font-family: var(--cm-font);
    width: 240px;
    outline: none;
    box-shadow: var(--cm-clay-inset);
    transition: border-color var(--cm-duration) var(--cm-ease),
               box-shadow var(--cm-duration) var(--cm-ease);
}

.cm-search-input:focus {
    border-color: var(--cm-primary);
    box-shadow: var(--cm-clay-inset), 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.cm-library-count {
    font-size: 0.85rem;
    color: var(--cm-text-secondary);
    margin-bottom: var(--cm-space-md);
}

.cm-library-items {
    display: grid;
    gap: var(--cm-space-md);
}

.cm-lib-card {
    padding: 20px;
    box-shadow: var(--cm-clay-shadow-sm);
    transition: transform var(--cm-duration-fast) var(--cm-ease),
                border-color var(--cm-duration-fast) var(--cm-ease),
                box-shadow var(--cm-duration-fast) var(--cm-ease);
}

.cm-lib-card:hover {
    transform: translateY(-2px);
    border-color: var(--cm-primary-light);
    box-shadow: var(--cm-clay-shadow);
}

.cm-lib-card-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--cm-space-md);
}

.cm-lib-card-content {
    flex: 1;
    min-width: 0;
}

.cm-lib-card-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--cm-text-primary);
    margin-bottom: 4px;
}

.cm-lib-card-meta {
    font-size: 0.85rem;
    color: var(--cm-text-secondary);
    margin-bottom: 6px;
}

.cm-lib-card-doi {
    font-size: 0.8rem;
    color: var(--cm-accent);
}

.cm-lib-card-tags {
    font-size: 0.8rem;
    margin-top: 4px;
    color: var(--cm-text-secondary);
}

.cm-lib-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.cm-lib-card-date {
    font-size: 0.75rem;
    color: var(--cm-text-muted);
    margin-top: var(--cm-space-sm);
}

/* Empty state */
.cm-empty-state {
    display: none;
    text-align: center;
    padding: var(--cm-space-2xl) 0;
    color: var(--cm-text-secondary);
}

.cm-empty-state.active {
    display: block;
}

.cm-empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--cm-space-md);
    opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════
   SKELETON LOADING PLACEHOLDERS
   ═══════════════════════════════════════════════════════════════════ */
.cm-skeleton {
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.04) 25%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.04) 75%);
    background-size: 200% 100%;
    animation: cm-skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: var(--cm-radius-sm);
}

@keyframes cm-skeleton-pulse {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

.cm-skeleton-line {
    height: 14px;
    margin-bottom: 10px;
    width: 100%;
}

.cm-skeleton-line.short {
    width: 60%;
}

.cm-skeleton-card {
    height: 100px;
    margin-bottom: var(--cm-space-md);
}

/* ═══════════════════════════════════════════════════════════════════
   FOCUS-VISIBLE ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════════ */
.citemaster-root :focus-visible {
    outline: 2px solid var(--cm-primary-light);
    outline-offset: 2px;
}

.citemaster-root button:focus-visible,
.citemaster-root a:focus-visible {
    outline: 2px solid var(--cm-primary-light);
    outline-offset: 2px;
}

.citemaster-root textarea:focus-visible,
.citemaster-root input:focus-visible {
    outline: none;
    border-color: var(--cm-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════
   PREFERS REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .cm-app::before { animation: none; }
    .cm-hero-headline { animation: none; }
    .cm-logo-icon { animation: none; }
    .cm-loading-bar-inner { animation: none; width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════════
   COUPON SECTION (replacing inline styles in pricing.js)
   ═══════════════════════════════════════════════════════════════════ */
.cm-coupon-section {
    margin-top: var(--cm-space-md);
    text-align: center;
}

.cm-coupon-toggle {
    font-size: 0.82rem;
    color: var(--cm-text-muted);
    text-decoration: underline;
    cursor: pointer;
}

.cm-coupon-toggle:hover {
    color: var(--cm-text-secondary);
}

.cm-coupon-wrap {
    display: none;
    margin-top: var(--cm-space-sm);
}

.cm-coupon-row {
    display: flex;
    gap: 6px;
}

.cm-coupon-input {
    flex: 1;
    padding: var(--cm-space-sm) var(--cm-space-md);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-sm);
    background: var(--cm-bg-glass);
    color: var(--cm-text-primary);
    font-size: 0.82rem;
    font-family: var(--cm-font);
    outline: none;
    box-shadow: var(--cm-clay-inset);
    transition: border-color var(--cm-duration) var(--cm-ease);
}

.cm-coupon-input:focus {
    border-color: var(--cm-primary);
}

.cm-coupon-msg {
    display: none;
    font-size: 0.78rem;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════ */
.opacity-50 {
    opacity: 0.5;
}

.cursor-not-allowed {
    cursor: not-allowed;
}

.cm-results {
    scroll-margin-top: var(--cm-space-lg);
}

/* ═══════════════════════════════════════════════════════════════════
   AUTH-REQUIRED & REGISTER PAGE STATES
   ═══════════════════════════════════════════════════════════════════ */
.cm-auth-required {
    text-align: center;
    margin-top: 10vh;
}

.cm-auth-required h2 {
    font-size: 2rem;
    margin-bottom: var(--cm-space-md);
}

.cm-auth-required p {
    color: var(--cm-text-secondary);
    margin-bottom: var(--cm-space-lg);
}

.cm-register-card {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.cm-register-card p {
    margin-bottom: var(--cm-space-lg);
    color: var(--cm-text-secondary);
}

.cm-register-btn {
    width: 100%;
    display: block;
    text-decoration: none;
    text-align: center;
    margin-bottom: var(--cm-space-sm);
}

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

.cm-plan-amount-custom {
    font-size: var(--cm-text-2xl);
}

.cm-diff-section-block {
    margin-bottom: var(--cm-space-sm);
}

.cm-diff-muted {
    color: var(--cm-text-muted);
}

.cm-coupon-success {
    color: var(--cm-success);
    display: block;
}

/* ══════════════════════════════════════════════════════════════════════
   AUTH FORMS & STATIC PAGES
   ══════════════════════════════════════════════════════════════════════ */
.cm-auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
}

.cm-auth-card {
    background: var(--cm-bg-card);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    backdrop-filter: blur(20px) saturate(1.6);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-lg);
    padding: var(--cm-space-2xl);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--cm-clay-shadow);
}

.cm-auth-header {
    text-align: center;
    margin-bottom: var(--cm-space-xl);
}

.cm-auth-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: var(--cm-space-xs);
    background: linear-gradient(135deg, var(--cm-text-primary), var(--cm-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cm-auth-header p {
    color: var(--cm-text-secondary);
    font-size: 0.95rem;
}

.cm-form-group {
    margin-bottom: var(--cm-space-md);
}

.cm-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--cm-bg-glass);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-md);
    color: var(--cm-text-primary);
    font-family: var(--cm-font);
    font-size: 0.95rem;
    box-shadow: var(--cm-clay-inset);
    transition: all var(--cm-duration) var(--cm-ease);
    outline: none;
}

.cm-input::placeholder {
    color: var(--cm-text-muted);
}

.cm-input:focus {
    border-color: var(--cm-primary);
    background: rgba(108, 92, 231, 0.05);
    box-shadow: var(--cm-clay-inset), 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.cm-checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--cm-space-xs);
    font-size: 0.85rem;
    color: var(--cm-text-secondary);
    cursor: pointer;
}

.cm-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--cm-space-lg);
}

.cm-auth-footer {
    text-align: center;
    margin-top: var(--cm-space-xl);
    padding-top: var(--cm-space-md);
    border-top: 1px solid var(--cm-border);
}

.cm-auth-footer a {
    color: var(--cm-primary-light);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--cm-duration) var(--cm-ease);
}

.cm-auth-footer a:hover {
    color: var(--cm-text-primary);
    text-decoration: underline;
}

.cm-btn-block {
    width: 100%;
}

/* Static Pages styling */
.cm-page-container {
    max-width: 800px;
    margin: 0 auto;
}

.cm-page-card {
    background: var(--cm-bg-card);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    backdrop-filter: blur(20px) saturate(1.6);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-lg);
    padding: var(--cm-space-3xl) var(--cm-space-2xl);
    box-shadow: var(--cm-clay-shadow);
}

.cm-page-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: var(--cm-space-2xl);
    padding-bottom: var(--cm-space-md);
    border-bottom: 2px solid var(--cm-border);
    background: linear-gradient(135deg, var(--cm-text-primary), var(--cm-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cm-page-content p {
    color: var(--cm-text-secondary);
    margin-bottom: var(--cm-space-md);
    line-height: 1.8;
}

.cm-page-content h3 {
    font-size: 1.3rem;
    color: var(--cm-text-primary);
    margin: var(--cm-space-xl) 0 var(--cm-space-sm);
}

.cm-contact-container {
    max-width: 600px;
}

.cm-contact-card {
    text-align: center;
}

.cm-contact-email {
    font-size: 1.2rem;
    color: var(--cm-primary-light);
    margin-bottom: var(--cm-space-2xl);
    background: var(--cm-bg-glass);
    padding: var(--cm-space-md);
    border-radius: var(--cm-radius-md);
    border: 1px solid var(--cm-border);
}

.cm-contact-form {
    text-align: left;
}

.cm-input-textarea {
    resize: vertical;
    min-height: 120px;
}

/* ═══════════════════════════════════════════════════════════════════
   LIGHT MODE THEME
   ═══════════════════════════════════════════════════════════════════ */
[data-theme="light"] .citemaster-root,
.citemaster-root[data-theme="light"] {
    --cm-bg-primary:     #F5F5FA;
    --cm-bg-secondary:   #EEEEF5;
    --cm-bg-card:        rgba(255, 255, 255, 0.88);
    --cm-bg-glass:       rgba(255, 255, 255, 0.65);
    --cm-bg-glass-hover: rgba(255, 255, 255, 0.85);
    --cm-border:         rgba(0, 0, 0, 0.08);
    --cm-border-active:  rgba(108, 92, 231, 0.35);
    --cm-glass-border:   rgba(0, 0, 0, 0.06);
    --cm-text-primary:   #1A1A2E;
    --cm-text-secondary: #4A4A6A;
    --cm-text-muted:     #7B7B94;
    --cm-text-inverse:   #F0F0F8;
    --cm-clay-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --cm-clay-shadow:    0 6px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    --cm-clay-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.1), 0 3px 8px rgba(0, 0, 0, 0.05);
    --cm-clay-inset:     inset 0 2px 4px rgba(0, 0, 0, 0.04);
    --cm-shadow-glow:    0 0 20px rgba(108, 92, 231, 0.12);
}

[data-theme="light"] body:has(.citemaster-root) {
    background: #F5F5FA !important;
}

[data-theme="light"] .cm-global-header {
    background: rgba(245, 245, 250, 0.92);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .cm-global-header.scrolled {
    background: rgba(245, 245, 250, 0.97);
}

[data-theme="light"] .cm-hero-headline {
    background: linear-gradient(135deg, #1A1A2E 0%, var(--cm-primary) 50%, var(--cm-accent-dark) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .cm-global-footer {
    background: #EEEEF5;
    border-top-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .cm-modal-overlay {
    background: rgba(0, 0, 0, 0.35);
}

/* Theme Toggle */
.cm-theme-toggle {
    background: var(--cm-bg-glass);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-full);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--cm-duration) var(--cm-ease);
}

.cm-theme-toggle:hover {
    background: var(--cm-bg-glass-hover);
    border-color: var(--cm-primary);
    transform: rotate(15deg);
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE HAMBURGER NAVIGATION
   ═══════════════════════════════════════════════════════════════════ */
.cm-mobile-toggle {
    display: none;
    background: var(--cm-bg-glass);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-sm);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--cm-text-primary);
    transition: all var(--cm-duration-fast) var(--cm-ease);
}

.cm-mobile-toggle:hover {
    background: var(--cm-bg-glass-hover);
    border-color: var(--cm-primary);
}

@media (max-width: 768px) {
    .cm-mobile-toggle {
        display: flex;
    }

    .cm-nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--cm-bg-secondary);
        border-bottom: 1.5px solid var(--cm-border);
        padding: var(--cm-space-md);
        gap: var(--cm-space-sm);
        box-shadow: var(--cm-clay-shadow);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 100;
    }

    .cm-nav-links.cm-nav-open {
        display: flex;
        animation: cm-slide-down 0.3s var(--cm-ease);
    }

    @keyframes cm-slide-down {
        from { opacity: 0; transform: translateY(-8px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .cm-nav-links a:not(.cm-btn) {
        padding: var(--cm-space-sm) var(--cm-space-md);
        border-radius: var(--cm-radius-sm);
    }

    .cm-nav-links a:not(.cm-btn):hover {
        background: var(--cm-bg-glass);
    }

    .cm-nav-container {
        position: relative;
    }

    .cm-hero-headline {
        font-size: 2rem;
    }

    .cm-hero-subtitle {
        font-size: 0.95rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   HOW IT WORKS — VERIFY PAGE EMPTY STATE
   ═══════════════════════════════════════════════════════════════════ */
.cm-how-it-works {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--cm-space-2xl) var(--cm-space-md);
    text-align: center;
    animation: cm-fade-in-up 0.5s var(--cm-ease);
}

.cm-how-it-works-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cm-text-primary);
    margin-bottom: var(--cm-space-xl);
}

.cm-steps {
    display: flex;
    gap: var(--cm-space-xl);
    flex-wrap: wrap;
    justify-content: center;
    max-width: 700px;
}

.cm-step {
    flex: 1;
    min-width: 160px;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--cm-space-sm);
}

.cm-step-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--cm-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--cm-bg-glass);
    border: 1.5px solid var(--cm-border);
    box-shadow: var(--cm-clay-shadow-sm);
    margin-bottom: var(--cm-space-xs);
}

.cm-step-number {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--cm-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.cm-step-text {
    font-size: 0.85rem;
    color: var(--cm-text-secondary);
    line-height: 1.5;
}

.cm-step-arrow {
    display: flex;
    align-items: center;
    color: var(--cm-text-muted);
    font-size: 1.2rem;
    padding-top: var(--cm-space-md);
}

@media (max-width: 600px) {
    .cm-steps {
        flex-direction: column;
        align-items: center;
    }
    .cm-step-arrow {
        transform: rotate(90deg);
    }
}

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD QUOTA PROGRESS BAR
   ═══════════════════════════════════════════════════════════════════ */
.cm-quota-bar-container {
    margin-top: var(--cm-space-sm);
}

.cm-quota-bar {
    height: 8px;
    border-radius: var(--cm-radius-full);
    background: var(--cm-bg-glass);
    border: 1px solid var(--cm-border);
    overflow: hidden;
    position: relative;
}

.cm-quota-bar-fill {
    height: 100%;
    border-radius: var(--cm-radius-full);
    background: linear-gradient(90deg, var(--cm-success), var(--cm-accent-dark));
    transition: width 0.6s var(--cm-ease), background 0.6s var(--cm-ease);
}

.cm-quota-bar-fill.cm-quota-bar-warning {
    background: linear-gradient(90deg, var(--cm-warning), #E17055);
}

.cm-quota-bar-fill.cm-quota-bar-danger {
    background: linear-gradient(90deg, var(--cm-danger), #E74C3C);
}

/* ═══════════════════════════════════════════════════════════════════
   PASSWORD STRENGTH METER
   ═══════════════════════════════════════════════════════════════════ */
.cm-password-strength {
    margin-top: var(--cm-space-xs);
}

.cm-strength-bar {
    height: 4px;
    border-radius: var(--cm-radius-full);
    background: var(--cm-bg-glass);
    overflow: hidden;
    margin-bottom: 4px;
}

.cm-strength-bar-fill {
    height: 100%;
    width: 0;
    border-radius: var(--cm-radius-full);
    transition: width 0.3s var(--cm-ease), background 0.3s var(--cm-ease);
}

.cm-strength-bar-fill.weak {
    width: 33%;
    background: var(--cm-danger);
}

.cm-strength-bar-fill.medium {
    width: 66%;
    background: var(--cm-warning);
}

.cm-strength-bar-fill.strong {
    width: 100%;
    background: var(--cm-success);
}

.cm-strength-text {
    font-size: 0.72rem;
    font-weight: 600;
}

.cm-strength-text.weak { color: var(--cm-danger); }
.cm-strength-text.medium { color: var(--cm-warning); }
.cm-strength-text.strong { color: var(--cm-success); }

/* ═══════════════════════════════════════════════════════════════════
   FEATURE COMPARISON TABLE (Pricing)
   ═══════════════════════════════════════════════════════════════════ */
.cm-comparison-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: var(--cm-space-2xl);
    background: var(--cm-bg-card);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-lg);
    overflow: hidden;
    box-shadow: var(--cm-clay-shadow-sm);
}

.cm-comparison-table th,
.cm-comparison-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--cm-border);
    font-size: 0.88rem;
}

.cm-comparison-table thead th {
    background: var(--cm-bg-glass);
    font-weight: 700;
    color: var(--cm-text-primary);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

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

.cm-comparison-table tbody tr:hover {
    background: rgba(108, 92, 231, 0.03);
}

.cm-comparison-table td:first-child {
    color: var(--cm-text-secondary);
    font-weight: 500;
}

.cm-comparison-check {
    color: var(--cm-success);
    font-weight: 700;
}

.cm-comparison-cross {
    color: var(--cm-text-muted);
}

.cm-comparison-value {
    color: var(--cm-text-primary);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════
   ADMIN STYLED CONFIRM MODAL
   ═══════════════════════════════════════════════════════════════════ */
.cm-confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.cm-confirm-overlay.active {
    display: flex;
}

.cm-confirm-dialog {
    background: var(--cm-bg-secondary);
    border: 1px solid var(--cm-border);
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.cm-confirm-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.cm-confirm-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cm-text-primary);
    margin-bottom: 8px;
}

.cm-confirm-text {
    font-size: 0.9rem;
    color: var(--cm-text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.cm-confirm-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════
   LIBRARY BULK ACTIONS
   ═══════════════════════════════════════════════════════════════════ */
.cm-lib-bulk-bar {
    display: none;
    align-items: center;
    gap: var(--cm-space-sm);
    padding: var(--cm-space-sm) var(--cm-space-md);
    background: var(--cm-bg-glass);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-md);
    margin-bottom: var(--cm-space-md);
    animation: cm-slide-down 0.2s var(--cm-ease);
}

.cm-lib-bulk-bar.active {
    display: flex;
}

.cm-lib-bulk-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cm-text-primary);
    margin-right: auto;
}

.cm-lib-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--cm-primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   PRE-VERIFICATION FORMAT SELECTOR TABS
   ═══════════════════════════════════════════════════════════════════ */
.cm-input-format-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: var(--cm-space-sm);
    padding: 3px;
    background: var(--cm-bg-glass);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius-md);
    overflow-x: auto;
}

.cm-input-format-tab {
    flex: 1;
    min-width: max-content;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--cm-font);
    color: var(--cm-text-muted);
    background: transparent;
    border: none;
    border-radius: var(--cm-radius-sm);
    cursor: pointer;
    transition: all var(--cm-duration-fast) var(--cm-ease);
    white-space: nowrap;
}

.cm-input-format-tab:hover {
    color: var(--cm-text-secondary);
    background: rgba(108, 92, 231, 0.06);
}

.cm-input-format-tab.active {
    color: var(--cm-primary-light);
    background: rgba(108, 92, 231, 0.12);
    box-shadow: var(--cm-clay-shadow-sm);
}

/* ═══════════════════════════════════════════════════════════════════
   CITATION COUNT INDICATOR
   ═══════════════════════════════════════════════════════════════════ */
.cm-citation-count {
    display: none;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--cm-accent-light);
    padding: 4px 10px;
    margin-top: 4px;
    background: rgba(0, 206, 201, 0.08);
    border: 1px solid rgba(0, 206, 201, 0.2);
    border-radius: var(--cm-radius-sm);
    animation: cm-fade-in 0.2s var(--cm-ease);
}

.cm-citation-count.active {
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════════
   VERIFY ALL BUTTON
   ═══════════════════════════════════════════════════════════════════ */
.cm-verify-all-btn {
    display: none;
}

.cm-verify-all-btn.active {
    display: inline-flex;
    animation: cm-fade-in 0.25s var(--cm-ease);
}

/* ═══════════════════════════════════════════════════════════════════
   MULTI-CITATION RESULTS PANEL
   ═══════════════════════════════════════════════════════════════════ */
.cm-multi-results {
    display: none;
    margin-top: var(--cm-space-lg);
    animation: cm-fade-in-up 0.4s var(--cm-ease);
    scroll-margin-top: var(--cm-space-lg);
}

.cm-multi-results.active {
    display: block;
}

.cm-multi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--cm-space-md);
    flex-wrap: wrap;
    gap: var(--cm-space-sm);
}

.cm-multi-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cm-text-primary);
}

.cm-multi-summary {
    display: flex;
    gap: var(--cm-space-md);
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.cm-multi-stat.verified { color: var(--cm-success); }
.cm-multi-stat.partial  { color: var(--cm-warning); }
.cm-multi-stat.failed   { color: var(--cm-danger); }
.cm-multi-total {
    color: var(--cm-text-muted);
    font-weight: 400;
}

.cm-multi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--cm-space-md);
}

.cm-multi-card {
    background: var(--cm-bg-card);
    border: 1.5px solid var(--cm-border);
    border-radius: var(--cm-radius-md);
    padding: var(--cm-space-md);
    transition: all var(--cm-duration) var(--cm-ease);
    animation: cm-fade-in 0.3s var(--cm-ease);
}

.cm-multi-card:hover {
    border-color: var(--cm-border-active);
    box-shadow: var(--cm-clay-shadow);
    transform: translateY(-2px);
}

.cm-multi-verified { border-left: 3px solid var(--cm-success); }
.cm-multi-partial  { border-left: 3px solid var(--cm-warning); }
.cm-multi-failed   { border-left: 3px solid var(--cm-danger); }

.cm-multi-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--cm-space-sm);
}

.cm-multi-status-icon {
    font-size: 1.1rem;
    font-weight: 700;
}

.cm-multi-verified .cm-multi-status-icon { color: var(--cm-success); }
.cm-multi-partial  .cm-multi-status-icon { color: var(--cm-warning); }
.cm-multi-failed   .cm-multi-status-icon { color: var(--cm-danger); }

.cm-multi-conf {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--cm-text-primary);
    background: var(--cm-bg-glass);
    padding: 2px 8px;
    border-radius: var(--cm-radius-sm);
}

.cm-multi-card-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--cm-text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.cm-multi-card-meta {
    font-size: 0.8rem;
    color: var(--cm-text-secondary);
    margin-bottom: 4px;
}

.cm-multi-card-doi {
    font-size: 0.78rem;
}

.cm-multi-card-doi a {
    color: var(--cm-primary-light);
    text-decoration: none;
}

.cm-multi-card-doi a:hover {
    text-decoration: underline;
}

.cm-multi-card-source {
    font-size: 0.72rem;
    color: var(--cm-text-muted);
    margin-top: var(--cm-space-xs);
}

/* ═══════════════════════════════════════════════════════════════════
   PREPRINT LINK
   ═══════════════════════════════════════════════════════════════════ */
.cm-preprint-link {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(0, 206, 201, 0.08);
    border: 1.5px solid rgba(0, 206, 201, 0.25);
    border-radius: var(--cm-radius-md);
    color: var(--cm-accent-light);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--cm-duration) var(--cm-ease);
}

.cm-preprint-link.active {
    display: inline-flex;
}

.cm-preprint-link:hover {
    background: rgba(0, 206, 201, 0.15);
    border-color: rgba(0, 206, 201, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 206, 201, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════
   GLOBAL NAV QUOTA BADGE
   ═══════════════════════════════════════════════════════════════════ */
#cm-nav-quota {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--cm-text-secondary);
    padding: 4px 10px;
    background: var(--cm-bg-glass);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius-full);
    white-space: nowrap;
}

.cm-nav-quota-count {
    color: var(--cm-accent-light);
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════
   DISCOUNT BADGE & PRICE STRIKETHROUGH
   ═══════════════════════════════════════════════════════════════════ */
.cm-discount-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--cm-danger), #E17055);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--cm-radius-full);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: var(--cm-space-xs);
    animation: cm-pulse-subtle 2s ease-in-out infinite;
}

@keyframes cm-pulse-subtle {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.85; }
}

.cm-price-original {
    text-decoration: line-through;
    color: var(--cm-text-muted);
    font-size: 0.82rem;
    font-weight: 400;
    margin-right: 6px;
}

/* ═══════════════════════════════════════════════════════════════════
   CURRENCY TOGGLE
   ═══════════════════════════════════════════════════════════════════ */
.cm-currency-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: var(--cm-space-lg);
    padding-left: var(--cm-space-lg);
    border-left: 1px solid var(--cm-border);
}

.cm-currency-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cm-text-secondary);
}

.cm-toggle-sm {
    transform: scale(0.8);
}

/* ═══════════════════════════════════════════════════════════════════
   4-COLUMN PRICING GRID
   ═══════════════════════════════════════════════════════════════════ */
.cm-pricing-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.cm-plan-starter {
    border-color: var(--cm-accent-dark);
    position: relative;
}

.cm-plan-starter::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    height: 3px;
    background: linear-gradient(90deg, var(--cm-accent-dark), var(--cm-accent-light));
    border-radius: var(--cm-radius-lg) var(--cm-radius-lg) 0 0;
}

@media (max-width: 1100px) {
    .cm-pricing-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .cm-pricing-grid-4 {
        grid-template-columns: 1fr;
    }

    .cm-multi-grid {
        grid-template-columns: 1fr;
    }

    .cm-input-format-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cm-currency-toggle {
        margin-left: 0;
        margin-top: var(--cm-space-sm);
        padding-left: 0;
        border-left: none;
    }

    .cm-billing-toggle {
        flex-wrap: wrap;
        justify-content: center;
    }

    .cm-comparison-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cm-toast-container {
        right: var(--cm-space-md);
        left: var(--cm-space-md);
        bottom: var(--cm-space-md);
    }

    .cm-toast {
        max-width: none;
        width: 100%;
    }

    .cm-modal {
        padding: var(--cm-space-lg);
        max-height: 90vh;
        overflow-y: auto;
        border-radius: var(--cm-radius-lg);
    }
}

/* ═══════════════════════════════════════════════════════════════════
   LANGUAGE SWITCHER (Footer)
   ═══════════════════════════════════════════════════════════════════ */
.cm-lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--cm-text-muted);
}

.cm-lang-switcher select {
    background: var(--cm-bg-glass);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius-sm);
    color: var(--cm-text-secondary);
    padding: 4px 8px;
    font-size: 0.8rem;
    font-family: var(--cm-font);
    cursor: pointer;
    outline: none;
    transition: border-color var(--cm-duration) var(--cm-ease);
}

.cm-lang-switcher select:hover,
.cm-lang-switcher select:focus {
    border-color: var(--cm-primary);
}

/* ═══════════════════════════════════════════════════════════════════
   PHASE 2: CONFIDENCE BADGES & BATCH PROGRESS
   ═══════════════════════════════════════════════════════════════════ */
.cm-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--cm-radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--cm-space-sm);
}

.cm-badge-verified {
    background: rgba(0, 206, 201, 0.15);
    color: var(--cm-success);
    border: 1px solid rgba(0, 206, 201, 0.3);
}

.cm-badge-partial {
    background: rgba(253, 203, 110, 0.15);
    color: var(--cm-warning);
    border: 1px solid rgba(253, 203, 110, 0.3);
}

.cm-badge-failed {
    background: rgba(255, 107, 107, 0.15);
    color: var(--cm-danger);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.cm-batch-progress-container {
    animation: cm-fade-in 0.3s var(--cm-ease);
}

/* ═══════════════════════════════════════════════════════════════════
   PHASE 3: MICRO-INTERACTIONS (Spotlight & Stagger)
   ═══════════════════════════════════════════════════════════════════ */
.cm-spotlight-active {
    position: relative;
    overflow: hidden;
}

.cm-spotlight-active::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: radial-gradient(400px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(255, 255, 255, 0.08), transparent 40%);
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--cm-duration) var(--cm-ease);
}

.cm-spotlight-active:hover::before {
    opacity: 1;
}

.cm-spotlight-active > * {
    position: relative;
    z-index: 1;
}

/* Staggered Reveals */
.cm-stagger-item {
    animation: cm-slide-up 0.5s var(--cm-ease) both;
    animation-delay: calc(var(--index, 0) * 0.05s);
}

@keyframes cm-slide-up {
    0% { opacity: 0; transform: translateY(20px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════════════════════════════════
   PHASE 4: FORM VALIDATION & EMPTY STATES
   ═══════════════════════════════════════════════════════════════════ */
.cm-error-placeholder {
    animation: cm-error-pulse 1s ease-in-out 3;
    border-color: var(--cm-danger) !important;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.4) !important;
}

@keyframes cm-error-pulse {
    0%, 100% { border-color: var(--cm-danger); box-shadow: 0 0 15px rgba(255, 107, 107, 0.4); }
    50% { border-color: rgba(255, 107, 107, 0.2); box-shadow: none; }
}

@keyframes cm-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.cm-fade-enter {
    animation: cm-fade-in var(--cm-duration) var(--cm-ease) forwards;
}

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

/* ═══════════════════════════════════════════════════════════════════
   PHASE 5: LOGIN & AUTH UX ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════════ */

/* Auth Card Animations */
.cm-auth-card {
    animation: cm-fade-in-up 0.6s var(--cm-ease) forwards;
}

@keyframes cm-fade-in-up {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Password Toggle Icon */
.cm-password-toggle {
    transition: color 0.2s ease;
}
.cm-password-toggle:hover {
    color: var(--cm-primary) !important;
}
.cm-password-toggle.visible {
    color: var(--cm-primary) !important;
}

/* Spinner for Loading Buttons */
.cm-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: cm-spin 0.8s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Forgot Password Modal */
.cm-modal-overlay {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: cm-fade-in 0.3s ease forwards;
}

.cm-forgot-pass-link {
    font-size: 0.85rem;
    color: var(--cm-primary);
    text-decoration: none;
    font-weight: 500;
    float: right;
}
.cm-forgot-pass-link:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════
   AUTH & CONTACT EXTRACTED CLASSES
   ═══════════════════════════════════════════════════════════════════ */
.cm-input-icon-wrap {
    position: relative;
}
.cm-password-toggle {
    position: absolute;
    right: 12px;
    top: 14px;
    cursor: pointer;
    color: var(--cm-text-muted);
}
.cm-password-toggle:hover, .cm-password-toggle.visible {
    color: var(--cm-primary);
}
.cm-auth-logo-img {
    max-height: 40px;
    margin-bottom: 20px;
}
.cm-contact-container {
    max-width: 800px;
    margin: 0 auto;
}
.cm-contact-header {
    text-align: center;
    margin-bottom: 10px;
}
.cm-contact-subheader {
    text-align: center;
    color: var(--cm-text-dim);
    margin-bottom: 40px;
}
.cm-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.cm-contact-box {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--cm-border);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}
.cm-contact-box-sales h3 { margin-top: 0; color: var(--cm-primary); }
.cm-contact-box-sales p { font-size: 0.9rem; color: var(--cm-text-dim); }
.cm-contact-box-sales a { color: var(--cm-primary); font-weight: 600; text-decoration: none; }
.cm-contact-box-tech h3 { margin-top: 0; color: var(--cm-accent); }
.cm-contact-box-tech p { font-size: 0.9rem; color: var(--cm-text-dim); }
.cm-contact-box-tech a { color: var(--cm-accent); font-weight: 600; text-decoration: none; }
.cm-contact-box-billing h3 { margin-top: 0; color: var(--cm-success); }
.cm-contact-box-billing p { font-size: 0.9rem; color: var(--cm-text-dim); }
.cm-contact-box-billing a { color: var(--cm-success); font-weight: 600; text-decoration: none; }
.cm-contact-form-wrap {
    background: rgba(0,0,0,0.2);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--cm-border);
}
.cm-contact-form-title {
    margin-top: 0;
    margin-bottom: 20px;
}
.cm-contact-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.cm-contact-select {
    width: 100%;
    background: var(--cm-bg-dark);
    color: #fff;
    border: 1px solid var(--cm-border);
}
.cm-contact-textarea {
    min-height: 120px;
}
.cm-contact-disclaimer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--cm-text-dim);
    margin-top: 15px;
    margin-bottom: 0;
}


/* ═══════════════════════════════════════════════════════════════════
   PHASE 6: MOBILE RESPONSIVENESS (8.9)
   ═══════════════════════════════════════════════════════════════════ */
@media screen and (max-width: 768px) {
    .citemaster-root { font-size: 14px; }
    .cm-contact-grid { grid-template-columns: 1fr; }
    .cm-contact-form-grid { grid-template-columns: 1fr; }
    .cm-preview-grid { grid-template-columns: 1fr; }
    .cm-nav-links { gap: var(--cm-space-sm); flex-wrap: wrap; justify-content: center; margin-top: 10px; }
    .cm-nav-container { flex-direction: column; text-align: center; }
    .cm-app { padding: var(--cm-space-md) var(--cm-space-sm); }
    .cm-input-card { padding: var(--cm-space-md); }
    .cm-actions { flex-direction: column; align-items: stretch; }
    .cm-actions-left, .cm-actions-right { justify-content: center; width: 100%; }
}
@media screen and (max-width: 480px) {
    .cm-header h1 { font-size: 1.8rem; }
    .cm-btn { width: 100%; margin-bottom: 5px; justify-content: center; }
    .cm-auth-card { padding: 15px; width: 95%; max-width: 100%; }
    .cm-quota-badge { width: 100%; justify-content: center; margin-top: 5px; }
}

