/* ==================== CITATION PILLS ==================== */
.citations-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 12px 8px 12px;
}

.citation-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 9999px;
    background: #f0f4ff;
    border: 1px solid #dbeafe;
    color: #3b82f6;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    max-width: 260px;
    outline: none;
    font-family: inherit;
    line-height: 1.3;
    text-decoration: none;
}

.citation-pill:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #2563eb;
}

.citation-pill:active {
    background: #bfdbfe;
}

/* Link variant (has external link icon) */
a.citation-pill-link {
    text-decoration: none;
}
a.citation-pill-link:visited {
    color: #3b82f6;
}

.citation-pill-num {
    flex-shrink: 0;
    font-weight: 700;
}

.citation-pill-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.citation-pill-ext {
    flex-shrink: 0;
    opacity: 0.6;
}

/* Inline citation pill (inside message text) */
.citation-inline-pill {
    display: inline;
    padding: 1px 5px;
    border-radius: 4px;
    background: #eff6ff;
    color: #3b82f6;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    font-family: inherit;
    transition: all 0.12s ease;
    vertical-align: baseline;
}
.citation-inline-pill:hover {
    background: #dbeafe;
    color: #1d4ed8;
}
.citation-inline-pill-doc {
    outline: none;
}

/* "Open source" link in citation panel */
.citation-open-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease;
}
.citation-open-link:hover {
    background: #334155;
}

/* ==================== CITATION DETAIL PANEL ==================== */
.citation-panel-header {
    padding: 14px 16px 12px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}
.citation-panel-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #f0f4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #6366f1;
}
.citation-panel-body {
    padding: 16px 18px 24px;
}
.citation-body-text {
    font-size: 12.5px;
    line-height: 1.7;
    color: #334155;
    letter-spacing: 0.005em;
}
.citation-body-text p {
    margin: 0 0 10px;
}
.citation-body-text p:last-child {
    margin-bottom: 0;
}
.citation-body-text .citation-heading {
    font-weight: 600;
    font-size: 11.5px;
    color: #1e293b;
    margin: 14px 0 4px;
    letter-spacing: 0.02em;
}
.citation-body-text .citation-heading:first-child {
    margin-top: 0;
}

/* ==================== SOURCES PANEL ==================== */

/* "View all sources" button in chat */
.sources-btn-wrapper {
    display: flex;
    justify-content: start;
    padding: 0 8px;
    margin: 4px 0 2px;
}
.sources-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px 6px 11px;
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: 0.01em;
}
.sources-view-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}
.sources-view-btn:active {
    background: #e2e8f0;
}
.sources-view-chevron {
    opacity: 0.5;
    transition: transform 0.15s ease;
}
.sources-view-btn:hover .sources-view-chevron {
    transform: translateY(1px);
    opacity: 0.8;
}

/* Panel header */
.sources-panel-header {
    padding: 14px 16px 12px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sources-panel-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #92400e;
}

/* Source card */
.src-card {
    background: #ffffff;
    border: 1px solid #e8ecf1;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    transition: border-color 0.15s ease;
}
.src-card:hover {
    border-color: #cbd5e1;
}
.src-card:last-child {
    margin-bottom: 0;
}

/* Card header — number + title */
.src-card-header {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 8px;
}
.src-card-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    font-size: 10.5px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}
.src-card-title-wrap {
    min-width: 0;
    flex: 1;
}
.src-card-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    margin: 0 0 3px;
}
.src-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.src-card-court {
    font-size: 10.5px;
    color: #64748b;
    line-height: 1.3;
}

/* Badges row */
.src-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}
.src-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    line-height: 1.4;
}
.src-badge-judgment {
    background: #dbeafe;
    color: #1e40af;
}
.src-badge-article {
    background: #e0e7ff;
    color: #3730a3;
}
.src-badge-blog {
    background: #f3e8ff;
    color: #6b21a8;
}
.src-badge-doctrine {
    background: #ecfdf5;
    color: #065f46;
}
.src-align {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.src-align-strong {
    background: #f0fdf4;
    color: #166534;
}
.src-align-moderate {
    background: #fefce8;
    color: #854d0e;
}
.src-align-weak {
    background: #fef2f2;
    color: #991b1b;
}

/* Summary */
.src-card-summary {
    font-size: 11.5px;
    line-height: 1.6;
    color: #475569;
    margin: 0 0 10px;
}

/* Labeled sections (Relevance, etc.) */
.src-card-section {
    margin-bottom: 8px;
}
.src-card-label {
    display: block;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 3px;
}
.src-card-text {
    font-size: 11px;
    line-height: 1.55;
    color: #64748b;
    margin: 0;
}

/* Principles list */
.src-card-principles {
    list-style: none;
    padding: 0;
    margin: 0;
}
.src-card-principles li {
    font-size: 11px;
    line-height: 1.5;
    color: #64748b;
    padding: 2px 0 2px 12px;
    position: relative;
}
.src-card-principles li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #cbd5e1;
}

/* Flags */
.src-card-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}
.src-flag-chip {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    line-height: 1.45;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
}

/* Source link */
.src-card-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    padding: 4px 0;
    transition: color 0.1s ease;
}
.src-card-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}
