/* ═══════════════════════════════════════════════════════════
   Label Change Module — Complete Stylesheet
   Matches Leaf Intelligence design system (Inter, emerald/purple)
   ═══════════════════════════════════════════════════════════ */

/* ── SEVERITY CSS CUSTOM PROPERTIES ──────────────────────── */
:root {
    --lc-critical-bg: #fef2f2;
    --lc-critical-border: #dc2626;
    --lc-critical-badge: #dc2626;
    --lc-moderate-bg: #fffbeb;
    --lc-moderate-border: #f59e0b;
    --lc-moderate-badge: #d97706;
    --lc-minor-bg: #f0f9ff;
    --lc-minor-border: #3b82f6;
    --lc-minor-badge: #2563eb;
    --lc-formatting-bg: #f9fafb;
    --lc-formatting-border: #9ca3af;
    --lc-formatting-badge: #9ca3af;
}

/* ── 1. SEARCH DROPDOWN ─────────────────────────────────── */

.lc-inline-dropdown {
    position: relative;
    z-index: 100;
    max-width: 56rem;
    margin: 0 auto;
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.06);
    max-height: 360px;
    overflow-y: auto;
    padding: 4px;
    animation: lc-fadeIn 0.15s ease;
}

.lc-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    color: #6b7280;
    font-size: 13px;
}

.lc-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: lc-spin 0.6s linear infinite;
}

.lc-no-results {
    padding: 16px;
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
}

.lc-drug-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    border-radius: 8px;
    transition: background 0.12s;
    gap: 2px;
}

.lc-drug-card:hover {
    background: #f0fdf4;
}

.lc-drug-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
}

.lc-drug-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
}

.lc-version-count {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    white-space: nowrap;
}


/* ── 2. PILL BAR & VERSION SELECTORS ─────────────────────── */

.lc-pill-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 6px 0;
}

.lc-drug-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 8px;
    background: #f0fdf4;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    font-size: 12px;
    animation: lc-fadeIn 0.2s ease;
}

.lc-pill-icon {
    font-size: 14px;
    line-height: 1;
}

.lc-pill-name {
    font-weight: 600;
    color: #065f46;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lc-pill-mfr {
    color: #6b7280;
    font-size: 11px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lc-pill-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    transition: all 0.12s;
}

.lc-pill-remove:hover {
    background: #fee2e2;
    color: #dc2626;
}

.lc-version-select {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    color: #374151;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}

.lc-version-select:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.lc-pill-warning {
    color: #b45309;
    background: #fef3c7;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
}

.lc-version-pair {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.lc-version-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lc-version-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.05em;
}

.lc-version-dropdown {
    padding: 5px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    color: #374151;
    background: #fff;
}

.lc-compare-btn {
    padding: 6px 16px;
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.lc-compare-btn:hover {
    background: #059669;
}

.lc-version-info {
    font-size: 11px;
    color: #6b7280;
}


/* ── 3. DRUG INFO CARD ───────────────────────────────────── */

.lc-drug-card-info {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.lc-drug-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.lc-drug-card-main {
    flex: 1;
    min-width: 0;
}

.lc-drug-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    margin: 0;
}

.lc-generic-sub {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

.lc-drug-header {
    margin-bottom: 12px;
}

.lc-drug-meta-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.lc-drug-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6b7280;
}

.lc-drug-meta-item svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.lc-mfr {
    font-size: 12px;
    color: #6b7280;
}

.lc-drug-links {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.lc-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.12s;
    white-space: nowrap;
}

.lc-link-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
}

.lc-link-btn svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.lc-version-badges {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.lc-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'SF Mono', 'Fira Code', monospace;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.lc-badge.previous {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.lc-badge.current {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}


/* ── 4. CONTEXT BAR ──────────────────────────────────────── */

.lc-context-bar {
    padding: 10px 24px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 12.5px;
    color: #4b5563;
    line-height: 1.5;
}


/* ── 5. COMPARISON HEADER ────────────────────────────────── */

.lc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    gap: 8px;
    flex-wrap: wrap;
}

.lc-stats-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
}

.lc-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    color: #374151;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.lc-filter-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.lc-filter-btn.active,
.lc-filter-btn[style*="background:#10b981"],
.lc-filter-btn[style*="background:#059669"] {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}

.lc-filter-btn svg {
    width: 12px;
    height: 12px;
}

.lc-status-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}


/* ── 6. COMPARISON LAYOUT ────────────────────────────────── */

.lc-comparison-wrapper {
    display: flex;
    position: relative;
    min-height: 400px;
    overflow: hidden;
}

.lc-pdf-layout {
    display: flex;
    flex: 1;
    min-width: 0;
}

.lc-pdf-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.lc-col-header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.lc-col-header.previous {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
    border-bottom: 2px solid #34d399;
}

.lc-col-header.current {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1e40af;
    border-bottom: 2px solid #60a5fa;
}

.lc-pdf-container {
    flex: 1;
    padding: 16px;
    background: #fff;
    min-height: 300px;
    font-size: 12px;
    line-height: 1.5;
}

.lc-pdf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: #6b7280;
    gap: 10px;
    font-size: 13px;
}

.lc-pdf-error {
    padding: 24px 16px;
    text-align: center;
    color: #dc2626;
    font-size: 12px;
    background: #fef2f2;
    border-radius: 8px;
    margin: 16px;
}

.lc-divider {
    width: 1px;
    background: #e5e7eb;
    flex-shrink: 0;
}

.lc-pdf-page {
    background: #fff;
    margin-bottom: 8px;
}

.lc-text-layer {
    padding: 12px 16px;
    font-size: 12px;
    line-height: 1.6;
    color: #1f2937;
}

.lc-single-version {
    flex: 1;
    max-height: 80vh;
    overflow-y: auto;
}


/* ── 7. SIDEBAR ──────────────────────────────────────────── */

.lc-sidebar {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 340px;
    flex-shrink: 0;
    border-left: 1px solid #e5e7eb;
    background: #fafafa;
    overflow-y: auto;
    max-height: 80vh;
    z-index: 20;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
}

.lc-sidebar.open {
    transform: translateX(0);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
}

.lc-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 5;
}

.lc-sidebar-header span {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.lc-sidebar-header button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.12s;
}

.lc-sidebar-header button:hover {
    background: #f3f4f6;
    color: #111827;
}

.lc-unified-entry {
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    border-radius: 0;
}

.lc-unified-entry:hover {
    background: #f0fdf4;
}

.lc-unified-entry[data-severity="critical"] {
    border-left-color: #dc2626;
}
.lc-unified-entry[data-severity="critical"]:hover {
    background: #fef2f2;
}
.lc-unified-entry[data-severity="moderate"] {
    border-left-color: #d97706;
}
.lc-unified-entry[data-severity="moderate"]:hover {
    background: #fffbeb;
}
.lc-unified-entry[data-severity="minor"] {
    border-left-color: #2563eb;
}
.lc-unified-entry[data-severity="minor"]:hover {
    background: #eff6ff;
}
.lc-unified-entry[data-severity="formatting"] {
    border-left-color: #9ca3af;
}
.lc-unified-entry[data-severity="formatting"]:hover {
    background: #f9fafb;
}

/* Severity badge in entries */
.lc-severity-badge {
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #fff;
    flex-shrink: 0;
}
.lc-severity-badge.critical { background: #dc2626; }
.lc-severity-badge.moderate { background: #d97706; }
.lc-severity-badge.minor { background: #2563eb; }
.lc-severity-badge.formatting { background: #9ca3af; }

.lc-unified-entry h4 {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 3px;
    line-height: 1.3;
}

.lc-unified-entry p {
    font-size: 11px;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

.lc-entry-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.lc-entry-name {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lc-entry-count {
    font-size: 10px;
    color: #94a3b8;
    white-space: nowrap;
}

.lc-entry-summary {
    font-size: 11px;
    color: #374151;
    line-height: 1.5;
    margin: 0 0 4px;
}

.lc-entry-impact {
    font-size: 11px;
    color: #0d9488;
    font-style: italic;
    margin-bottom: 6px;
    padding: 4px 8px;
    background: rgba(13, 148, 136, 0.06);
    border-radius: 4px;
}

.lc-change-item {
    display: flex;
    gap: 6px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.lc-change-icon {
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.lc-change-item.added .lc-change-icon { color: #16a34a; }
.lc-change-item.removed .lc-change-icon { color: #dc2626; }

.lc-change-detail {
    min-width: 0;
    flex: 1;
}

.lc-change-text {
    font-size: 11px;
    color: #1e293b;
}

.lc-change-text.added {
    font-weight: 600;
}

.lc-change-text.removed {
    text-decoration: line-through;
    color: #6b7280;
}

.lc-change-reason {
    font-size: 10px;
    color: #64748b;
    margin-top: 1px;
}

.lc-entry-loading {
    padding: 12px 14px;
    border-bottom: 1px solid #f3f4f6;
}

.lc-entry-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1.5px solid #e5e7eb;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: lc-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

.lc-entry-changes {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}


/* ── 8. ANALYSIS BANNER & LOADER ─────────────────────────── */

.lc-analysis-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    background: linear-gradient(135deg, #ecfdf5, #f0f9ff);
    border-bottom: 1px solid #d1fae5;
    font-size: 12px;
    color: #374151;
    animation: lc-fadeIn 0.2s ease;
    z-index: 15;
    position: relative;
}

.lc-analysis-banner .lc-progress-bar {
    flex: 1;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    max-width: 200px;
}

.lc-analysis-banner .lc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #14b8a6);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.lc-analysis-banner.complete {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border-bottom-color: #a7f3d0;
    animation: lc-fadeIn 0.2s ease;
}

.lc-analysis-banner.complete .lc-banner-pulse {
    background: #10b981;
    animation: none;
}

.lc-banner-count {
    font-weight: 700;
    color: #059669;
}

.lc-banner-pulse {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    animation: lc-pulse 1.5s ease-in-out infinite;
}

.lc-analysis-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    gap: 12px;
    animation: lc-fadeIn 0.2s ease;
}

.lc-loader-icon {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: lc-spin 0.7s linear infinite;
}

.lc-loader-text {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.lc-loader-sub {
    font-size: 12px;
    color: #9ca3af;
}

.lc-shimmer {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: lc-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.lc-placeholder {
    padding: 24px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}


/* ── 9. INLINE HIGHLIGHTS & TOOLTIPS ─────────────────────── */

.lc-inline-highlight {
    cursor: pointer;
    border-radius: 2px;
    padding: 1px 3px;
    transition: all 0.15s ease;
    position: relative;
    border-bottom: 2px solid var(--lc-sev-border, #9ca3af);
    background: var(--lc-sev-bg, #f3f4f6);
}

/* ── OVERLAY HIGHLIGHTS (positioned over label, no DOM injection) ── */

.lc-overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.lc-overlay-highlight {
    position: absolute;
    pointer-events: auto;
    border-radius: 2px;
    transition: opacity 0.2s;
    cursor: pointer;
}

.lc-overlay-highlight.removed {
    background: rgba(220, 38, 38, 0.12);
    border-bottom: 2px solid rgba(220, 38, 38, 0.4);
}

.lc-overlay-highlight.added {
    background: rgba(22, 163, 74, 0.12);
    border-bottom: 2px solid rgba(22, 163, 74, 0.4);
}

.lc-overlay-highlight.change {
    background: rgba(234, 179, 8, 0.12);
    border-bottom: 2px solid rgba(234, 179, 8, 0.4);
}

.lc-overlay-highlight.critical {
    border-bottom-color: rgba(220, 38, 38, 0.6);
}

.lc-overlay-highlight.flash {
    animation: lc-overlay-flash 0.6s ease 3;
}

@keyframes lc-overlay-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Overlay tooltip on hover */
.lc-overlay-tooltip {
    position: fixed;
    z-index: 10000;
    background: #1e293b;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    max-width: 340px;
    font-size: 11px;
    line-height: 1.5;
    pointer-events: none;
    animation: lc-fadeIn 0.1s ease;
}

.lc-overlay-tooltip .lc-severity-badge {
    margin-right: 6px;
    vertical-align: middle;
}

/* Formatting divider in sidebar */
.lc-formatting-divider {
    padding: 8px 14px;
    border-top: 1px solid #e5e7eb;
    margin-top: 4px;
}

.lc-formatting-divider button {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 11px;
    color: #6b7280;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: all 0.15s;
}

.lc-formatting-divider button:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.hidden {
    display: none !important;
}

/* Stats bar progress inline */
.lc-stats-progress {
    font-size: 11px;
    color: #6b7280;
}

.lc-stats-bar .lc-banner-pulse {
    width: 6px;
    height: 6px;
}

.lc-stats-bar .lc-banner-count {
    font-size: 10px;
    font-weight: 600;
    color: #059669;
}

.lc-stats-bar .lc-progress-bar {
    max-width: 100px;
}

.lc-inline-highlight:hover {
    filter: brightness(0.9);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.lc-highlight-removed {
    text-decoration: line-through;
    text-decoration-color: var(--lc-sev-border, #dc2626);
}

.lc-highlight-added {
    font-weight: 600;
}

.lc-rich-tooltip {
    position: absolute;
    z-index: 1000;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    padding: 0;
    width: 300px;
    max-width: 90vw;
    animation: lc-fadeIn 0.15s ease;
    overflow: hidden;
}

.lc-popover {
    position: fixed;
    z-index: 10000;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    width: 320px;
    max-width: 90vw;
    animation: lc-fadeIn 0.12s ease;
    overflow: hidden;
}

.lc-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    background: #fafafa;
}

.lc-popover-type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lc-popover-type-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lc-popover-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.1s;
}

.lc-popover-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

.lc-popover-body {
    padding: 12px 14px;
}

.lc-popover-diff {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 8px;
    word-break: break-word;
}

.lc-popover-reason {
    font-size: 11.5px;
    color: #4b5563;
    line-height: 1.5;
}

.lc-active-popover {
    outline: 2px solid #7c3aed;
    outline-offset: 1px;
    border-radius: 3px;
}


/* ── 10. DIFF CONTENT & MARKS ────────────────────────────── */

.lc-diff-content {
    padding: 12px 16px;
    font-size: 12px;
    line-height: 1.7;
    color: #1f2937;
    white-space: pre-wrap;
    word-break: break-word;
}

.lc-mark-delete {
    background: #fecaca;
    color: #991b1b;
    text-decoration: line-through;
    padding: 0 2px;
    border-radius: 2px;
}

.lc-mark-insert {
    background: #bbf7d0;
    color: #166534;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 500;
}

.lc-added-bg {
    background: #f0fdf4;
}

.lc-removed-bg {
    background: #fef2f2;
}


/* ── 11. RENDERED SECTION WRAPPERS ───────────────────────── */

.lc-rendered-section {
    border-bottom: 1px solid #f3f4f6;
}

.lc-rendered-section-head {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 3;
}

.lc-rendered-section-body {
    padding: 12px 16px;
}

.lc-section {
    margin-bottom: 8px;
}

.lc-section-head {
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    padding: 6px 0;
}

.lc-section-body {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.6;
}

.lc-section-change-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bar-bg, #f9fafb);
    border: 1px solid var(--bar-border, #e5e7eb);
    border-left: 4px solid var(--bar-badge, #9ca3af);
    border-radius: 4px;
    padding: 4px 10px;
    margin: 4px 0 8px;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 10px;
}

.lc-bar-summary {
    color: #475569;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ── 12. PRECEDENT & REGULATORY PANELS ───────────────────── */

.lc-precedent {
    padding: 20px;
}

.lc-prec-drug-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.lc-prec-drug-info {
    margin-bottom: 12px;
}

.lc-prec-drug-info h3 {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px;
}

.lc-prec-drug-info p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.lc-prec-stat-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.lc-stat-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
}

.lc-stat-num {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.lc-stat-label {
    font-size: 10px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.lc-prec-products {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 14px;
}

.lc-product-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: #f3f4f6;
    border-radius: 999px;
    font-size: 11px;
    color: #374151;
    font-weight: 500;
}

.lc-precedent-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.lc-precedent-links a {
    font-size: 11px;
    color: #2563eb;
    text-decoration: none;
}

.lc-precedent-links a:hover {
    text-decoration: underline;
}


/* ── 13. SUBMISSIONS LIST ────────────────────────────────── */

.lc-submissions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.lc-sub-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.lc-sub-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.lc-sub-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    flex-wrap: wrap;
}

.lc-sub-card-docs {
    padding: 8px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.lc-sub-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
}

.lc-sub-date {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.lc-sub-type {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #ede9fe;
    color: #6d28d9;
}

.lc-sub-desc {
    font-size: 11px;
    color: #4b5563;
    flex: 1;
    min-width: 0;
}

.lc-sub-status {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.lc-sub-crl {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.lc-sub-approved {
    background: #f0fdf4;
    color: #059669;
    border: 1px solid #bbf7d0;
}

.lc-sub-priority {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.lc-doc-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 10px;
    color: #4b5563;
    cursor: default;
}

.lc-doc-pill a {
    color: #2563eb;
    text-decoration: none;
}

.lc-doc-pill a:hover {
    text-decoration: underline;
}

.lc-crl-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 11px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.12s;
}

.lc-crl-toggle:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.lc-crl-text {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.6;
    padding: 10px 14px;
    background: #fafafa;
    border-top: 1px solid #f3f4f6;
}

.lc-crl-expand {
    margin-top: 6px;
    font-size: 11px;
    color: #2563eb;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.lc-crl-expand:hover {
    text-decoration: underline;
}

.lc-source-note {
    font-size: 10px;
    color: #9ca3af;
    text-align: center;
    padding: 8px;
    margin-top: 8px;
}


/* ── 14. ANIMATIONS ──────────────────────────────────────── */

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

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

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

@keyframes lc-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}


/* ── 15. RESPONSIVE ──────────────────────────────────────── */

@media (max-width: 900px) {
    .lc-pdf-layout {
        flex-direction: column;
    }
    .lc-pdf-col {
        max-height: 50vh;
    }
    .lc-divider {
        width: 100%;
        height: 1px;
    }
    .lc-sidebar {
        width: 100%;
        max-height: 50vh;
        border-left: none;
        border-top: 1px solid #e5e7eb;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        transform: translateY(100%);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.1);
    }
    .lc-sidebar.open {
        transform: translateY(0);
    }
    .lc-drug-card-top {
        flex-direction: column;
    }
    .lc-version-badges {
        flex-direction: row;
    }
    .lc-popover {
        width: calc(100vw - 32px);
        left: 16px !important;
    }
}

@media (max-width: 640px) {
    .lc-drug-card-info {
        padding: 14px 16px 12px;
    }
    .lc-drug-title {
        font-size: 16px;
    }
    .lc-drug-links {
        gap: 4px;
    }
    .lc-link-btn {
        padding: 4px 8px;
        font-size: 10px;
    }
    .lc-header {
        padding: 6px 10px;
    }
    .lc-sidebar {
        width: 100%;
    }
}
