:root {
    --primary: #D4AF37;
    /* Bronze Gold */
    --primary-hover: #b8962e;
    --bg-dark: #050505;
    /* Deeper Black */
    --surface-dark: #121212;
    --text-light: #f1f1f1;
    --text-dim: #888888;
    --glass-bg: rgba(20, 20, 20, 0.8);
    --glass-border: rgba(212, 175, 55, 0.15);
    --bronze-gold: #D4AF37;
}

/* Logo & Slogan */
.logo-container {
    position: absolute;
    top: 2rem;
    left: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    z-index: 100;
}

.logo-text {
    display: flex;
    align-items: center;
    line-height: 1;
    position: relative;
}

.logo-glow-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 7rem;
    height: 7rem;
    background: radial-gradient(circle,
            rgba(255, 255, 255, 0.9) 0%,
            rgba(255, 255, 255, 0.4) 40%,
            transparent 75%);
    filter: blur(20px);
    z-index: -1;
    pointer-events: none;
    mix-blend-mode: screen;
}

.hero-logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    background: radial-gradient(circle,
            rgba(255, 255, 255, 0.8) 0%,
            rgba(255, 255, 255, 0.2) 50%,
            transparent 80%);
    filter: blur(40px);
    z-index: -1;
    mix-blend-mode: screen;
}

.logo-slogan {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.slogan-en {
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    font-family: 'Outfit', sans-serif;
}

.slogan-zh {
    font-size: 1rem;
    color: #888;
    letter-spacing: 0.3rem;
    font-family: "Noto Serif SC", serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
        linear-gradient(to bottom, #050505, #0a0a0a);
    overflow-x: hidden;
    letter-spacing: 0.02em;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 4rem;
    margin-bottom: 3rem;
    text-align: center;
}

h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--bronze-gold);
    font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
    letter-spacing: 0.8rem;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.2);
    text-transform: uppercase;
}

.search-box-container {
    width: 100%;
    max-width: 700px;
    position: relative;
    margin-top: 2rem;
}

.search-input {
    width: 100%;
    padding: 1.25rem 2rem;
    padding-right: 4.5rem;
    font-size: 1.2rem;
    background: rgba(10, 10, 10, 0.6);
    border: none;
    border-bottom: 2px solid #2C2C2C;
    border-radius: 0;
    color: white;
    backdrop-filter: blur(20px);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.search-input:focus {
    outline: none;
    border-color: var(--bronze-gold);
    background: rgba(212, 175, 55, 0.05);
    box-shadow: 0 10px 30px -10px rgba(212, 175, 55, 0.15);
}

.search-input::placeholder {
    color: #444;
    font-style: italic;
}

.scanning-line {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--bronze-gold), transparent);
    width: 0%;
    transition: width 0.3s ease;
    z-index: 10;
}

.searching .scanning-line {
    animation: scan 1.5s linear infinite;
    width: 100%;
}

@keyframes scan {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.search-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    border: none;
    color: white;
    padding: 0.75rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}


.recommendations {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.lang-row {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.lang-label {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.lang-select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    padding: 0.35rem 0.6rem;
    border-radius: 0.6rem;
    color: white;
    font-size: 0.85rem;
}

.recommendations-title {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.recommendations-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.recommendation-chip {
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-light);
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.recommendation-chip:hover {
    border-color: rgba(212, 175, 55, 0.6);
    background: rgba(212, 175, 55, 0.15);
    transform: translateY(-1px);
}

.search-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* Filters */
.filters-panel {
    width: 100%;
    max-width: 700px;
    margin-top: 1rem;
}

.filters-toggle {
    color: var(--text-dim);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    user-select: none;
}

.filters-toggle::-webkit-details-marker {
    display: none;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    background: rgba(30, 41, 59, 0.5);
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.filter-group input,
.filter-group select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: white;
}

.ai-status {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: rgba(212, 175, 55, 0.12);
    color: var(--text-dim);
    font-size: 0.9rem;
}

.ai-status .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(212, 175, 55, 0.35);
    border-top-color: var(--bronze-gold);
    border-radius: 50%;
    animation: rotation 1s linear infinite;
}

.disclaimer {
    margin: 2rem auto 0;
    padding: 0.75rem 1rem;
    max-width: 900px;
    border-radius: 0.75rem;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.45);
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Results */
.results-section {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
    padding-bottom: 4rem;
}

.section-header {
    font-family: inherit;
    font-size: 1.4rem;
    color: var(--bronze-gold);
    border-left: 3px solid var(--bronze-gold);
    padding-left: 1rem;
    margin-bottom: 1rem;
    letter-spacing: 0.2rem;
}

.result-card {
    background: var(--surface-dark);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(360px, 42%) 1fr;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.result-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    border-color: rgba(212, 175, 55, 0.5);
}

.thumbnail-container {
    position: relative;
    width: 100%;
    min-height: 260px;
    height: 100%;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center;
    transition: transform 0.5s ease;
    display: block;
}

.result-card:hover .thumbnail-img {
    transform: scale(1.05);
}

.low-confidence-details {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px dashed var(--glass-border);
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.35);
}

.low-confidence-summary {
    cursor: pointer;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 600;
    list-style: none;
}

.low-confidence-summary::-webkit-details-marker {
    display: none;
}

.low-confidence-list {
    margin-top: 1rem;
    display: grid;
    gap: 0.75rem;
}

.low-confidence-item {
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.4);
}

.low-confidence-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.low-confidence-title {
    color: var(--bronze-gold);
    text-decoration: none;
    font-size: 0.95rem;
}

.low-confidence-title:hover {
    text-decoration: underline;
}

.low-confidence-time {
    color: var(--text-dim);
    font-size: 0.8rem;
}

.low-confidence-snippet {
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.5;
}

.timestamp-badge {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    /* Crucial for child ellipsis to work in grid/flex */
}

.title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-light);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.score-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.75rem;
}

.score-high {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.score-medium {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.score-low {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.ai-reason {
    font-size: 0.8rem;
    color: #cbd5e1;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    line-height: 1.4;
}

.ai-inline-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(212, 175, 55, 0.35);
    border-top-color: var(--bronze-gold);
    border-radius: 50%;
    animation: rotation 1s linear infinite;
    display: inline-block;
    margin-right: 6px;
    vertical-align: -2px;
}

/* Best Match Box */

.best-match-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.best-match-link:hover .snippet-content {
    background: rgba(212, 175, 55, 0.12);
    border-radius: 6px;
}

.best-match-box {
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-top: 0.5rem;
}

.snippet-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.75rem;
    opacity: 0.8;
}

.snippet-content {
    font-size: 0.95rem;
    color: #d1d5db;
    line-height: 1.7;
}

.snippet-content strong {
    color: #fff;
    background: rgba(212, 175, 55, 0.3);
    padding: 0 4px;
    border-radius: 2px;
}

/* Outline details */
.outline-details {
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    background: rgba(30, 41, 59, 0.3);
    overflow: hidden;
}

.outline-summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dim);
    transition: all 0.2s;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.outline-summary::after {
    content: '\25BC';
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.outline-details[open] .outline-summary::after {
    transform: rotate(180deg);
}

.outline-summary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
}

.outline-content {
    padding: 1rem;
    border-top: 1px solid var(--glass-border);
    max-height: 400px;
    overflow-y: auto;
}

.full-summary-snippet {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
    line-height: 1.5;
    border-bottom: 1px dashed var(--glass-border);
    padding-bottom: 1rem;
}

.full-summary-snippet h1,
.full-summary-snippet h2,
.full-summary-snippet h3,
.full-summary-snippet h4,
.full-summary-snippet h5,
.full-summary-snippet h6 {
    font-size: 1rem;
    line-height: 1.35;
    margin: 0.6rem 0 0.4rem;
    color: #e2e8f0;
}

.full-summary-snippet p {
    margin: 0.4rem 0;
}

.full-summary-snippet ul,
.full-summary-snippet ol {
    margin: 0.4rem 0 0.6rem;
    padding-left: 1.1rem;
}

.full-summary-snippet li {
    margin: 0.2rem 0;
}

.segments-list-mini {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.segment-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.2s;
    font-size: 0.85rem;
}

.segment-item:hover {
    background: rgba(212, 175, 55, 0.1);
    transform: translateX(4px);
}

.segment-item-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.2s;
    font-size: 0.85rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.segment-item-link:hover {
    background: rgba(212, 175, 55, 0.15);
    transform: translateX(4px);
}

.segment-icon {
    color: var(--primary);
    font-size: 0.8rem;
}

.segment-title {
    flex: 1;
    color: #e2e8f0;
    font-weight: 500;
}

.segment-summary {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 2px;
    line-height: 1.35;
}

.outline-empty {
    font-size: 0.85rem;
    color: var(--text-dim);
    padding: 0.5rem 0;
}

.segment-time {
    color: var(--bronze-gold);
    background: rgba(212, 175, 55, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.75rem;
}

.segment-time-badge {
    color: var(--bronze-gold);
    background: rgba(212, 175, 55, 0.15);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.segment-time-link {
    color: var(--bronze-gold);
    background: rgba(212, 175, 55, 0.15);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.segment-time-link:hover {
    background: rgba(212, 175, 55, 0.3);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

/* Other Matches - Expandable Details */
.other-matches-title {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.other-match-details {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.other-match-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
    list-style: none;
}

.other-match-summary::-webkit-details-marker {
    display: none;
}

.other-match-summary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.hit-type {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

.badge-segment {
    background: rgba(168, 85, 247, 0.2);
    color: #c4b5fd;
}

.badge-chunk {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.hit-time-link {
    color: var(--bronze-gold);
    background: rgba(212, 175, 55, 0.15);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.75rem;
    text-decoration: none;
    font-weight: 600;
    flex-shrink: 0;
    transition: all 0.2s;
}

.hit-time-link:hover {
    background: rgba(212, 175, 55, 0.3);
    color: #fff;
}

.hit-preview {
    flex: 1;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.other-match-content {
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    line-height: 1.6;
    color: #d1d5db;
}

.other-match-content p {
    margin: 0.5rem 0;
}

.jump-to-video {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.3), rgba(184, 134, 11, 0.3));
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 6px;
    color: var(--bronze-gold);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.jump-to-video:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(168, 85, 247, 0.5));
    color: #fff;
    transform: translateY(-1px);
}

/* Progress Log Styling */
#progressLog {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #d1d5db;
    margin: 1.5rem auto;
    max-width: 900px;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.6;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

#debugStatus {
    background: rgba(17, 24, 39, 0.6);
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    padding: 10px 14px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    color: #cbd5f5;
    margin: -0.5rem auto 1.25rem;
    max-width: 900px;
    display: none;
    backdrop-filter: blur(8px);
}

body:not(.debug-enabled) .score-badge {
    display: none !important;
}

/* Layout guard: ensure result cards render correctly even if prior styles are missing */
.result-card.video-group-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    margin: 16px auto;
    max-width: 900px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.result-card.video-group-card .thumbnail-container {
    width: 280px;
    flex-shrink: 0;
}

.result-card.video-group-card .thumbnail-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
}

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

.result-card .title {
    margin: 0 0 6px 0;
    font-size: 1.1rem;
    color: #e5e7eb;
}

.result-card .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 8px;
}

.best-match-link {
    display: block;
    padding: 12px 14px;
    background: rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    text-decoration: none;
    color: #e2e8f0;
    margin: 10px 0;
}

.snippet-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #a5b4fc;
    margin-bottom: 6px;
}

.snippet-content {
    font-size: 0.92rem;
    line-height: 1.6;
    color: #e5e7eb;
}

.debug-status-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #a5b4fc;
    margin-bottom: 4px;
}

.progress-step {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    border-left: 2px solid transparent;
    padding-left: 12px;
    transition: border-color 0.3s;
}

.progress-step:hover {
    border-left-color: rgba(212, 175, 55, 0.5);
}

.progress-step-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.progress-indicator {
    color: var(--bronze-gold);
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 1rem;
}

.progress-message {
    flex: 1;
}

.progress-details {
    margin-top: 4px;
}

.progress-details-toggle {
    cursor: pointer;
    color: #818cf8;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    display: list-item;
    /* Restore default summary behavior */
    list-style-position: inside;
    user-select: none;
    transition: all 0.2s;
    margin-left: 10px;
    background: rgba(99, 102, 241, 0.05);
    width: fit-content;
}

.progress-details-toggle:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    padding-left: 12px;
}

.progress-details-content {
    margin-left: 18px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #9ca3af;
}

.progress-details-content ul {
    margin: 0;
    padding-left: 1.25rem;
    list-style-type: '→ ';
}

.progress-details-content li {
    margin-bottom: 4px;
}

.progress-details-content li {
    margin-bottom: 2px;
}

.segment-time {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
}

/* Other Matches */
.other-matches-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.other-match-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.6rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    transition: all 0.2s;
    cursor: pointer;
    margin-bottom: 0.35rem;
    background: rgba(15, 23, 42, 0.2);
    border: 1px solid transparent;
    min-width: 0;
    /* Ensure this container stays within parent */
    overflow: hidden;
}

.other-match-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
    color: var(--text-light);
}

.hit-type {
    padding: 0.15rem 0.45rem;
    border-radius: 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-segment {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-chunk {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.hit-time {
    font-family: monospace;
    font-weight: 600;
    color: var(--text-dim);
}

.hit-snippet {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.7;
}

.snippet strong {
    color: var(--bronze-gold);
    font-weight: 600;
}

/* AI Answer Container */
.ai-answer-container {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 1.25rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(212, 175, 55, 0.05);
    backdrop-filter: blur(10px);
}

.ai-answer-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-family: "Noto Serif SC", serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--bronze-gold);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 0.5rem;
}

.ai-answer-text {
    color: #e2e8f0;
    line-height: 1.8;
    font-size: 1.05rem;
}

.ai-answer-text h1,
.ai-answer-text h2,
.ai-answer-text h3 {
    color: var(--bronze-gold);
    margin: 1.5rem 0 0.75rem;
}

.ai-answer-text ul,
.ai-answer-text ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.ai-answer-text li {
    margin-bottom: 0.5rem;
}

.ai-answer-text a,
.ai-sources a {
    color: var(--bronze-gold);
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    transition: all 0.2s;
}

.ai-answer-text a:hover,
.ai-sources a:hover {
    background: rgba(212, 175, 55, 0.15);
    border-bottom-color: var(--bronze-gold);
}

.ai-sources {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* Loading State */
.loader {
    display: none;
    width: 48px;
    height: 48px;
    border: 5px solid #fff;
    border-bottom-color: var(--primary);
    border-radius: 50%;
    animation: rotation 1s linear infinite;
    margin: 2rem auto;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4a4a5a;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--bronze-gold);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .logo-container {
        position: static;
        margin: 2rem auto 1rem;
        align-items: center;
        text-align: center;
    }

    .result-card {
        grid-template-columns: 1fr;
    }

    .thumbnail-container {
        height: 200px;
    }
}

/* Disclaimer Styling */
.card-disclaimer,
.ai-disclaimer {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-style: italic;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    line-height: 1.4;
    opacity: 0.7;
}

.ai-disclaimer {
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}