/* ============================================================
   search-results.css — ChatGPT-style search result UI
   ============================================================ */

/* -----------------------------------------------------------
   Search Banner — shimmer text indicator
   ----------------------------------------------------------- */
.search-banner {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    margin-bottom: 14px;
    background: var(--overlay-hover, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.07));
    border-radius: 12px;
    animation: bannerFadeIn 0.3s ease;
}

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

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

.search-banner__label {
    font-size: 0.92rem;
    font-weight: 600;
    /* Stronger shimmer — higher contrast, wider bright band, faster. */
    background: linear-gradient(
        90deg,
        rgba(148, 163, 184, 0.55) 0%,
        rgba(148, 163, 184, 0.55) 35%,
        #ffffff 50%,
        rgba(148, 163, 184, 0.55) 65%,
        rgba(148, 163, 184, 0.55) 100%
    );
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: search-shimmer 1.6s linear infinite;
    flex: 1 1 auto;
    min-width: 0;
}

.search-banner__dots {
    display: inline-flex;
    gap: 3px;
    align-items: center;
    flex-shrink: 0;
}
.search-banner__dots > span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-secondary, rgba(255, 255, 255, 0.55));
    animation: search-dot-pulse 1.1s ease-in-out infinite;
}
.search-banner__dots > span:nth-child(2) { animation-delay: 0.18s; }
.search-banner__dots > span:nth-child(3) { animation-delay: 0.36s; }
@keyframes search-dot-pulse {
    0%, 80%, 100% { opacity: 0.25; transform: scale(0.7); }
    40%           { opacity: 1;    transform: scale(1);   }
}

.search-banner__query {
    font-size: 0.8rem;
    color: var(--text-tertiary, #8b95a4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-banner__progress {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
    min-height: 16px;
}

.search-banner__favicons {
    display: inline-flex;
    align-items: center;
}
.search-banner__favicon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--overlay-pressed, rgba(255, 255, 255, 0.08));
    margin-left: -4px;
    border: 1.5px solid var(--bg-primary, rgba(20, 20, 22, 0.95));
    object-fit: cover;
    animation: search-favicon-in 0.25s ease-out;
}
.search-banner__favicon:first-child { margin-left: 0; }
@keyframes search-favicon-in {
    from { opacity: 0; transform: scale(0.6); }
    to   { opacity: 1; transform: scale(1);   }
}

@keyframes search-shimmer {
    0%   { background-position: 150% 0; }
    100% { background-position: -50% 0; }
}

/* -----------------------------------------------------------
   Collapsed banner — ChatGPT-style persistent "Searched the web"
   pill shown once the answer starts streaming. Stays above the
   text, clickable to open the sources sidebar.
   ----------------------------------------------------------- */
.search-banner.search-banner--collapsed {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 3px 10px;
    background: var(--overlay-hover, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-radius: 999px;
    width: fit-content;
    max-width: 100%;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    animation: none;
}
.search-banner.search-banner--collapsed:hover {
    background: var(--overlay-pressed, rgba(255, 255, 255, 0.07));
    border-color: var(--border-secondary, rgba(255, 255, 255, 0.14));
}
.search-banner.search-banner--collapsed .search-banner__label {
    font-size: 11.5px;
    letter-spacing: 0.02em;
    color: var(--text-secondary, rgba(255, 255, 255, 0.68));
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: initial;
    animation: none;
}
.search-banner.search-banner--collapsed .search-banner__query {
    display: none;
}
/* Tiny globe glyph before the label. */
.search-banner.search-banner--collapsed .search-banner__label::before {
    content: '\2B19';              /* small diamond globe — subtle */
    margin-right: 6px;
    opacity: 0.7;
}

/* -----------------------------------------------------------
   News Cards Carousel — renders above AI text
   ----------------------------------------------------------- */
.search-news-carousel {
    position: relative;
    margin: 0 0 16px 0;
    overflow: hidden;
}

.search-news-cards {
    display: flex;
    gap: 12px;
}

.search-news-card {
    flex: 0 0 calc(33.333% - 8px);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    background: var(--overlay-hover, rgba(255, 255, 255, 0.03));
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
    text-decoration: none;
    color: inherit;
}

.search-news-card:hover {
    border-color: var(--border-secondary, rgba(255, 255, 255, 0.2));
    transform: translateY(-2px);
}

.search-news-card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    background: var(--overlay-pressed, rgba(255, 255, 255, 0.05));
}

.search-news-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, rgba(255, 255, 255, 0.2));
    font-size: 2rem;
}

.search-news-card__body {
    padding: 10px 12px 12px;
}

.search-news-card__publisher {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.search-news-card__favicon {
    width: 14px;
    height: 14px;
    border-radius: 2px;
}

.search-news-card__publisher-name {
    font-size: 0.72rem;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
    font-weight: 500;
}

.search-news-card__title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, rgba(255, 255, 255, 0.9));
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.search-news-card__date {
    font-size: 0.72rem;
    color: var(--text-muted, rgba(255, 255, 255, 0.35));
}

/* Carousel arrows */
.search-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.15));
    color: var(--text-primary, rgba(255, 255, 255, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.15s, transform 0.15s, opacity 0.15s;
    font-size: 16px;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
}

.search-news-carousel:hover .search-carousel-arrow:not(.search-carousel-arrow--hidden) {
    opacity: 1;
    pointer-events: auto;
}

.search-carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.search-carousel-arrow--left  { left: 8px; }
.search-carousel-arrow--right { right: 8px; }
.search-carousel-arrow--hidden { display: none !important; }

/* -----------------------------------------------------------
   Image Carousel (image_grid render_hint)
   ----------------------------------------------------------- */
.search-images {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
    padding: 4px 0 8px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

.search-images::-webkit-scrollbar { height: 4px; }
.search-images::-webkit-scrollbar-track { background: transparent; }
.search-images::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 2px;
}

.search-images__item {
    flex-shrink: 0;
    scroll-snap-align: start;
    width: 140px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    transition: transform 0.15s ease, border-color 0.15s ease;
    position: relative;
    background: var(--overlay-hover, rgba(255, 255, 255, 0.03));
}

.search-images__item:hover {
    transform: scale(1.04);
    border-color: rgba(56, 189, 248, 0.4);
}

.search-images__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* -----------------------------------------------------------
   YouTube Video Embed (video_primary render_hint)
   ----------------------------------------------------------- */
.search-video-embed {
    width: 100%;
    margin-bottom: 14px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
}

.search-video-embed__ratio {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
}

.search-video-embed__ratio iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.search-video-embed__caption {
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
    background: var(--overlay-hover, rgba(255, 255, 255, 0.03));
    border-top: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.06));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -----------------------------------------------------------
   Video Cards (remaining videos below embed)
   ----------------------------------------------------------- */
.search-video-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 8px;
}

.search-video-cards__label {
    width: 100%;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 4px;
}

.search-video-card {
    display: flex;
    gap: 10px;
    width: calc(50% - 4px);
    min-width: 200px;
    background: var(--overlay-hover, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.search-video-card:hover {
    background: var(--overlay-pressed, rgba(255, 255, 255, 0.07));
    border-color: rgba(56, 189, 248, 0.3);
}

.search-video-card__thumb {
    position: relative;
    width: 100px;
    height: 64px;
    flex-shrink: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.search-video-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.search-video-card__duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.68rem;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
    line-height: 1.4;
}

.search-video-card__body {
    flex: 1;
    padding: 8px 8px 8px 0;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.search-video-card__title {
    font-size: 0.78rem;
    color: var(--text-primary, #e2e8f0);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-video-card__meta {
    font-size: 0.7rem;
    color: var(--text-secondary, #94a3b8);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -----------------------------------------------------------
   Inline Citation Pills — replaces [1][2][3] numbers
   ----------------------------------------------------------- */
.citation-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0px 5px;
    margin: 0 0 0 2px;
    border-radius: 4px;
    background: var(--overlay-hover, rgba(255, 255, 255, 0.06));
    border: none;
    cursor: pointer;
    text-decoration: none;
    vertical-align: middle;
    transition: background 0.15s, color 0.15s;
    font-size: 0.65rem;
    line-height: 1.5;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
    font-weight: 500;
    white-space: nowrap;
    user-select: none;
}

.citation-pill:hover {
    background: var(--overlay-pressed, rgba(255, 255, 255, 0.12));
    color: var(--text-primary, rgba(255, 255, 255, 0.95));
    text-decoration: none;
}

/* Citation Tooltip Card — hover preview */
.citation-tooltip {
    position: absolute;
    z-index: 1000;
    width: 280px;
    background: var(--bg-elevated, #1a1a22);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    font-size: 0.8rem;
    pointer-events: auto;
}
.citation-tooltip__nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
    font-size: 0.75rem;
}
.citation-tooltip__nav button {
    background: var(--overlay-pressed, rgba(255, 255, 255, 0.08));
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
    border-radius: 4px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    cursor: pointer;
    padding: 2px 7px;
    font-size: 0.85rem;
}
.citation-tooltip__nav button:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.15));
}
.citation-tooltip__nav span {
    margin-left: auto;
}
.citation-tooltip__publisher {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted, rgba(255, 255, 255, 0.45));
    font-size: 0.72rem;
    margin-bottom: 6px;
}
.citation-tooltip__publisher img {
    border-radius: 2px;
}
.citation-tooltip__title {
    font-weight: 600;
    color: var(--text-primary, rgba(255, 255, 255, 0.9));
    line-height: 1.35;
    margin-bottom: 6px;
}
.citation-tooltip__snippet {
    color: var(--text-muted, rgba(255, 255, 255, 0.45));
    font-size: 0.75rem;
    line-height: 1.4;
}

/* Highlight style for cited sources in sidebar */
.source-item--highlight {
    background: var(--overlay-hover, rgba(255, 255, 255, 0.06));
    border-left: 2px solid var(--border-secondary, rgba(255, 255, 255, 0.3));
}

/* -----------------------------------------------------------
   Sources Button — in message action bar
   ----------------------------------------------------------- */
.sources-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 8px 0 3px;
    border-radius: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.18s ease;
    font-size: 0.76rem;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
    font-weight: 500;
    line-height: 1;
}

.sources-btn:hover {
    background: var(--overlay-pressed, rgba(255, 255, 255, 0.08));
    color: var(--text-primary, rgba(255, 255, 255, 0.9));
}

.sources-btn__favicons {
    display: flex;
    align-items: center;
    height: 18px;
}

.sources-btn__favicon {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 2px solid var(--bg-secondary, #1a1a22);
    margin-left: -7px;
    position: relative;
    object-fit: cover;
    flex-shrink: 0;
}

.sources-btn__favicon:first-child { margin-left: 0; z-index: 3; }
.sources-btn__favicon:nth-child(2) { z-index: 2; }
.sources-btn__favicon:nth-child(3) { z-index: 1; }

.sources-btn__label {
    color: inherit;
}

/* -----------------------------------------------------------
   Sources Sidebar — slides in from right
   ----------------------------------------------------------- */
.sources-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    height: 100vh;
    background: var(--bg-secondary, #1a1a22);
    border-left: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    z-index: 500;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

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

.sources-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    flex-shrink: 0;
}

.sources-sidebar__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #e8e8f0);
}

.sources-sidebar__close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.12s;
}

.sources-sidebar__close:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.05));
    color: var(--text-primary, #e8e8f0);
}

.sources-sidebar__body {
    overflow-y: auto;
    flex: 1;
    padding: 12px 0;
}

.source-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.04));
}

.source-item:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.05));
}

.source-item__publisher {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.source-item__favicon {
    width: 14px;
    height: 14px;
    border-radius: 2px;
}

.source-item__name {
    font-size: 0.75rem;
    color: var(--text-tertiary, #5a5a70);
    font-weight: 500;
}

.source-item__title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary, #e8e8f0);
    line-height: 1.35;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.source-item__snippet {
    font-size: 0.78rem;
    color: var(--text-secondary, #9898b0);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.source-item__date {
    font-size: 0.7rem;
    color: var(--text-muted, rgba(255, 255, 255, 0.25));
}

.sources-sidebar__more {
    padding: 10px 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.35));
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* -----------------------------------------------------------
   Lightbox
   ----------------------------------------------------------- */
.search-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    animation: lightbox-in 0.15s ease;
    cursor: zoom-out;
}

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

.search-lightbox__img {
    max-width: 92vw;
    max-height: 88vh;
    border-radius: 10px;
    object-fit: contain;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

.search-lightbox__title {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.65);
    color: #e2e8f0;
    font-size: 0.82rem;
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
    max-width: 80vw;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.search-lightbox__close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0; /* lightbox is always dark-overlay — intentional */
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.15s ease;
}

.search-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* -----------------------------------------------------------
   Premium Reader — Pocket/Instapaper-style article overlay
   ----------------------------------------------------------- */

.reader-body {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary, rgba(255, 255, 255, 0.88));
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px 80px;
}

.reader-body h1,
.reader-body h2,
.reader-body h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    margin: 24px 0 8px;
    line-height: 1.3;
}

.reader-body h1 { font-size: 1.5rem; }
.reader-body h2 { font-size: 1.25rem; }
.reader-body h3 { font-size: 1.1rem; }

.reader-body p {
    margin: 0 0 1.2em;
}

.reader-body strong {
    color: var(--text-primary, #ffffff);
    font-weight: 600;
}

.reader-body a {
    color: var(--accent, #7eb8ff);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-translucent, rgba(126, 184, 255, 0.3));
}

.reader-body blockquote {
    border-left: 3px solid var(--border-secondary, rgba(255, 255, 255, 0.2));
    margin: 20px 0;
    padding: 4px 16px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
    font-style: italic;
}

.reader-body ul,
.reader-body ol {
    padding-left: 24px;
    margin: 0 0 1.2em;
}

.reader-body li {
    margin-bottom: 6px;
    line-height: 1.7;
}

.reader-body code {
    background: var(--bg-code, rgba(255, 255, 255, 0.08));
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
}

.reader-body pre {
    background: var(--bg-code, rgba(255, 255, 255, 0.06));
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.reader-body pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.6;
}

.reader-body hr {
    border: none;
    border-top: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
    margin: 24px 0;
}

.reader-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 12px 0;
}

/* Spinner keyframe (injected once via CSS, not inline) */
@keyframes reader-spin {
    to { transform: rotate(360deg); }
}

/* ===============================================
   LIGHT THEME OVERRIDES — search results UI
   =============================================== */
[data-theme="light"] .search-banner {
    background: var(--bg-elevated, #ffffff);
    border-color: var(--border-primary, rgba(0, 0, 0, 0.08));
}

[data-theme="light"] .search-banner__dots > span {
    background: var(--text-tertiary, #8890a8);
}

[data-theme="light"] .search-banner__progress {
    color: var(--text-secondary, #4a5068);
}

[data-theme="light"] .search-banner__favicon {
    background: var(--bg-tertiary, #e4eaf1);
    border-color: var(--bg-primary, #f7f9fc);
}

[data-theme="light"] .search-banner.search-banner--collapsed {
    background: var(--bg-tertiary, #e4eaf1);
    border-color: var(--border-primary, rgba(0, 0, 0, 0.08));
}

[data-theme="light"] .search-banner.search-banner--collapsed:hover {
    background: var(--bg-secondary, #eef2f6);
    border-color: var(--border-primary, rgba(0, 0, 0, 0.12));
}

[data-theme="light"] .search-banner.search-banner--collapsed .search-banner__label {
    color: var(--text-secondary, #4a5068);
}

[data-theme="light"] .search-news-card {
    background: var(--bg-elevated, #ffffff);
    border-color: var(--border-primary, rgba(0, 0, 0, 0.08));
}

[data-theme="light"] .search-news-card:hover {
    border-color: var(--border-focus, #5b46d6);
}

[data-theme="light"] .search-news-card__image {
    background: var(--bg-tertiary, #e4eaf1);
}

[data-theme="light"] .search-news-card__image--placeholder {
    color: var(--text-tertiary, #8890a8);
}

[data-theme="light"] .search-news-card__publisher-name {
    color: var(--text-tertiary, #8890a8);
}

[data-theme="light"] .search-news-card__title {
    color: var(--text-primary, #1a1d2e);
}

[data-theme="light"] .search-news-card__date {
    color: var(--text-tertiary, #8890a8);
}

[data-theme="light"] .search-carousel-arrow {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--border-primary, rgba(0, 0, 0, 0.08));
    color: var(--text-primary, #1a1d2e);
}

[data-theme="light"] .search-carousel-arrow:hover {
    background: var(--bg-elevated, #ffffff);
}

[data-theme="light"] .search-images__item {
    background: var(--bg-tertiary, #e4eaf1);
    border-color: var(--border-primary, rgba(0, 0, 0, 0.08));
}

[data-theme="light"] .search-video-embed {
    border-color: var(--border-primary, rgba(0, 0, 0, 0.08));
}

[data-theme="light"] .reader-body hr {
    border-top-color: var(--border-primary, rgba(0, 0, 0, 0.08));
}

/* ---------------------------------------------------------------
   LIGHT THEME — citation pills, sources btn, tooltip, source items
   --------------------------------------------------------------- */

[data-theme="light"] .citation-pill {
    background: var(--bg-tertiary, #e4eaf1);
    color: var(--text-secondary, #4a5068);
}

[data-theme="light"] .citation-pill:hover {
    background: var(--bg-secondary, #eef2f6);
    color: var(--text-primary, #1a1d2e);
}

[data-theme="light"] .citation-tooltip {
    background: var(--bg-elevated, #ffffff);
    border-color: var(--border-primary, rgba(0, 0, 0, 0.08));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .citation-tooltip__nav {
    color: var(--text-tertiary, #8890a8);
}

[data-theme="light"] .citation-tooltip__nav button {
    background: var(--bg-tertiary, #e4eaf1);
    border-color: var(--border-primary, rgba(0, 0, 0, 0.08));
    color: var(--text-secondary, #4a5068);
}

[data-theme="light"] .citation-tooltip__nav button:hover {
    background: var(--bg-secondary, #eef2f6);
}

[data-theme="light"] .citation-tooltip__publisher {
    color: var(--text-tertiary, #8890a8);
}

[data-theme="light"] .citation-tooltip__title {
    color: var(--text-primary, #1a1d2e);
}

[data-theme="light"] .citation-tooltip__snippet {
    color: var(--text-secondary, #4a5068);
}

[data-theme="light"] .source-item--highlight {
    background: var(--accent-muted, rgba(91, 70, 214, 0.08));
    border-left-color: var(--accent, #5b46d6);
}

[data-theme="light"] .sources-btn {
    color: var(--text-secondary, #4a5068);
}

[data-theme="light"] .sources-btn:hover {
    background: var(--bg-tertiary, #e4eaf1);
    color: var(--text-primary, #1a1d2e);
}

[data-theme="light"] .sources-sidebar__close {
    color: var(--text-secondary, #4a5068);
}

[data-theme="light"] .source-item__date {
    color: var(--text-muted, #8890a8);
}

[data-theme="light"] .sources-sidebar__more {
    color: var(--text-tertiary, #8890a8);
}

/* ---------------------------------------------------------------
   LIGHT THEME — search banner, news cards, video cards, images
   --------------------------------------------------------------- */

[data-theme="light"] .search-banner__progress {
    color: var(--text-secondary, #4a5068);
}

[data-theme="light"] .search-banner__dots > span {
    background: var(--text-tertiary, #8890a8);
}

[data-theme="light"] .search-news-card__publisher-name {
    color: var(--text-tertiary, #8890a8);
}

[data-theme="light"] .search-news-card__image--placeholder {
    color: var(--text-tertiary, #8890a8);
}

[data-theme="light"] .search-news-card__title {
    color: var(--text-primary, #1a1d2e);
}

[data-theme="light"] .search-news-card__date {
    color: var(--text-tertiary, #8890a8);
}

[data-theme="light"] .search-video-card {
    background: var(--bg-elevated, #ffffff);
    border-color: var(--border-primary, rgba(0, 0, 0, 0.08));
}

[data-theme="light"] .search-video-card:hover {
    background: var(--bg-secondary, #eef2f6);
    border-color: var(--border-focus, #5b46d6);
}

[data-theme="light"] .search-video-embed {
    border-color: var(--border-primary, rgba(0, 0, 0, 0.08));
}

[data-theme="light"] .search-video-embed__caption {
    background: var(--bg-secondary, #eef2f6);
    border-top-color: var(--border-primary, rgba(0, 0, 0, 0.06));
}

[data-theme="light"] .search-images__item {
    background: var(--bg-tertiary, #e4eaf1);
    border-color: var(--border-primary, rgba(0, 0, 0, 0.08));
}

/* ---------------------------------------------------------------
   LIGHT THEME — reader body
   --------------------------------------------------------------- */

[data-theme="light"] .reader-body {
    color: var(--text-primary, #1a1d2e);
}

[data-theme="light"] .reader-body h1,
[data-theme="light"] .reader-body h2,
[data-theme="light"] .reader-body h3 {
    color: var(--text-primary, #1a1d2e);
}

[data-theme="light"] .reader-body strong {
    color: var(--text-primary, #1a1d2e);
}

[data-theme="light"] .reader-body a {
    color: var(--accent, #5b46d6);
    border-bottom-color: var(--accent-translucent, rgba(91, 70, 214, 0.3));
}

[data-theme="light"] .reader-body blockquote {
    border-left-color: var(--border-primary, rgba(0, 0, 0, 0.15));
    color: var(--text-secondary, #4a5068);
}

[data-theme="light"] .reader-body code {
    background: var(--bg-code, #eef2f6);
}

[data-theme="light"] .reader-body pre {
    background: var(--bg-code, #e4eaf1);
}

/* Mobile overrides are in mobile.css */
