/* Sidebar */
.sidebar {
    background: var(--bg-surface);
    padding: 20px;
    border-radius: 6px;
    border: 1px solid var(--border-default);
    font-size: 14px;
    line-height: 1.6;
}

.sidebar h3 {
    color: var(--accent-primary);
    font-size: 16px;
    margin: 0 0 16px 0;
    font-weight: 600;
}

.sidebar .tip {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-muted);
}

.sidebar .tip:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar .tip-title {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.sidebar .tip-content {
    color: var(--text-muted);
    font-size: 14px;
}

.sidebar code {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--accent-primary);
    font-size: 13px;
}

.sidebar kbd {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    font-size: 12px;
}

.system-overview-link {
    display: block;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.system-overview-link:hover {
    background: var(--bg-surface);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
}
/* Search Box */
.search-box {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    margin-bottom: 20px;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    font-family: 'IBM Plex Sans', sans-serif;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.search-box:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
}

.search-box::placeholder {
    color: var(--text-subtle);
}

/* Filters */
.filters {
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.filters label {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filters input[type="checkbox"] {
    accent-color: var(--accent-primary);
}

.filters select,
.filters input[type="date"] {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 6px 10px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.filters select:focus,
.filters input[type="date"]:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.filters button {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filters button:first-of-type {
    background: var(--accent-secondary);
    color: white;
}

.filters button:first-of-type:hover {
    background: var(--accent-primary);
}

.filters button:nth-of-type(2) {
    background: var(--accent-secondary);
    color: white;
}

.filters button:nth-of-type(2):hover {
    background: var(--accent-primary);
}

.filters button:nth-of-type(3) {
    background: var(--success);
    color: white;
}

.filters button:nth-of-type(3):hover {
    background: #2ea043;
}

.filters button:nth-of-type(4) {
    background: var(--danger);
    color: white;
}

.filters button:nth-of-type(4):hover {
    background: #da3633;
}

/* Results Header */
.results-header {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 500;
}

/* Dataset banner (snapshot mode) */
.dataset-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: color-mix(in srgb, var(--warning) 18%, var(--bg-surface));
    border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border-default));
    border-radius: 10px;
}

.dataset-banner-title {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
}

/* Result Cards */
.result {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-left: 3px solid transparent;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.result.windows {
    border-left-color: var(--accent-primary);
}

.result.wsl {
    border-left-color: var(--warning);
}

.result:hover {
    background: var(--bg-elevated);
    border-color: var(--border-muted);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.result-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.result-meta {
    color: var(--text-muted);
    font-size: 14px;
    margin: 8px 0;
}

.result-meta .conv-id {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 13px;
}

.result-snippet {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
    margin-top: 12px;
}

.result-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.resume-btn {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    background: var(--accent-primary);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.resume-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.resume-btn:active {
    transform: translateY(0);
}

.resume-btn.success {
    background: var(--success);
}

.resume-btn.error {
    background: var(--danger);
}

.tool-badge {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 3px;
    background: var(--code-bg);
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tool-badge.claude {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent-primary);
}

.tool-badge.vibe {
    background: rgba(255, 149, 0, 0.15);
    color: var(--warning);
}

.tool-badge.opencode {
    background: rgba(46, 204, 113, 0.15);
    color: var(--success);
}

.header {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message {
    background: var(--bg-elevated);
    border-left: 3px solid var(--accent-primary);
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 8px;
}

.message.user {
    border-left-color: var(--accent-primary);
}

.message.assistant {
    border-left-color: var(--success);
}

.message .role {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.message .content {
    white-space: pre-wrap;
    color: var(--text-primary);
}

.back-button {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: var(--accent-primary);
    text-decoration: none;
    margin-bottom: 8px;
}

.back-button:hover {
    text-decoration: underline;
}

/* Loading State */
.loading {
    text-align: center;
    color: var(--text-muted);
    font-size: 16px;
    padding: 40px 20px;
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 4px;
    z-index: 100;
}

.theme-toggle button {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle button:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.theme-toggle button.active {
    background: var(--accent-primary);
    color: white;
}

/* Highlights */
.mark-exact {
    background: rgba(255, 215, 0, 0.35);
    color: var(--text-primary);
    padding: 0 2px;
    border-radius: 3px;
}

.mark-semantic {
    background: rgba(56, 139, 253, 0.25);
    color: var(--text-primary);
    padding: 0 2px;
    border-radius: 3px;
}

/* Snippet formatting */
.snippet-text {
    margin-bottom: 8px;
}

.snippet-code-block {
    border: 1px solid var(--border-default);
    border-radius: 8px;
    margin-top: 10px;
    overflow: hidden;
    background: var(--bg-elevated);
}

.snippet-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
    font-size: 12px;
    color: var(--text-muted);
}

.snippet-code-actions {
    display: flex;
    gap: 8px;
}

.snippet-code-actions button {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.snippet-code-actions button:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.snippet-code {
    margin: 0;
    padding: 12px 14px;
    background: var(--bg-primary);
    overflow-x: auto;
    max-height: none;
}

.snippet-code.collapsed {
    max-height: 240px;
    overflow: hidden;
}

.snippet-code code {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-primary);
}

/* Diff preview */
.diff-btn {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.diff-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.result-diff {
    display: none;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: var(--bg-elevated);
}

.result-diff.open {
    display: block;
}

.diff-summary {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 12px;
}

.diff-count {
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-surface);
}

.diff-count.added {
    color: var(--success);
}

.diff-count.removed {
    color: var(--danger);
}

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

.diff-section {
    margin-bottom: 12px;
}

.diff-title {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.diff-block {
    margin: 0;
    padding: 10px;
    border-radius: 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.diff-added {
    border-left: 3px solid var(--success);
}

.diff-removed {
    border-left: 3px solid var(--danger);
}

.diff-unchanged {
    border-left: 3px solid var(--border-muted);
}

.diff-error {
    color: var(--danger);
    font-size: 13px;
}

/* Project summary */
.project-summary {
    margin: 12px 0 16px 0;
    padding: 12px 14px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: var(--bg-surface);
}

.project-summary-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.project-summary-details {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
}

.project-suggestion {
    margin: 10px 0 16px 0;
    padding: 10px 12px;
    border: 1px dashed var(--border-default);
    border-radius: 8px;
    background: var(--bg-surface);
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-suggestion strong {
    color: var(--text-primary);
}

.project-suggestion button {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.project-suggestion button:hover {
    background: var(--accent-primary);
    color: white;
}

/* Saved queries */
.saved-queries-panel {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-muted);
}

.saved-queries-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.saved-queries-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--accent-primary);
}

.saved-queries-header button {
    background: var(--accent-secondary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    cursor: pointer;
}

.saved-queries-form {
    display: none;
    margin-bottom: 12px;
    gap: 8px;
}

.saved-queries-form input {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 12px;
    font-family: 'IBM Plex Sans', sans-serif;
}

.saved-queries-actions {
    display: flex;
    gap: 6px;
}

.saved-queries-actions button {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.saved-queries-actions button.secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.saved-query-item {
    padding: 10px 12px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-elevated);
}

.saved-query-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.saved-query-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.saved-query-actions {
    display: flex;
    gap: 6px;
}

.saved-query-actions button {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.saved-query-actions button:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.saved-queries-status {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* Dashboards */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.dashboard-header h2 {
    margin: 0;
    font-size: 26px;
    color: var(--text-primary);
}

.dashboard-header p {
    margin: 4px 0 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

button.link {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.dashboard-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

.dashboard-panel h3 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-size: 18px;
}

.dashboard-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.dashboard-form input {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text-primary);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13px;
}

.dashboard-queries {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.dashboard-query-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text-primary);
}

.dashboard-query-option small {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.dashboard-form-actions {
    display: flex;
    gap: 10px;
}

.dashboard-form-actions button {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    cursor: pointer;
}

.dashboard-status {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.dashboard-list {
    display: grid;
    gap: 12px;
}

.dashboard-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background: var(--bg-elevated);
}

.dashboard-card-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.dashboard-card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.dashboard-card-actions {
    display: flex;
    gap: 8px;
}

.dashboard-card-actions button {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.dashboard-card-actions button.danger {
    border-color: var(--danger);
    color: var(--danger);
}

.dashboard-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.dashboard-view-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.dashboard-view-header p {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.dashboard-view-actions {
    display: flex;
    gap: 8px;
}

.dashboard-builder {
    display: grid;
    gap: 14px;
}

.dashboard-builder-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.dashboard-builder-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.dashboard-builder-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.dashboard-builder-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.dashboard-builder-form input {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text-primary);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13px;
}

.dashboard-builder-widgets {
    display: grid;
    gap: 10px;
}

.dashboard-builder-widget {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 12px;
    display: grid;
    gap: 10px;
}

.dashboard-builder-widget-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr 0.6fr 0.9fr;
    gap: 10px;
}

.dashboard-builder-widget-grid input,
.dashboard-builder-widget-grid select {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text-primary);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13px;
}

.dashboard-builder-widget-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.dashboard-builder-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.dashboard-view-actions .secondary {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.dashboard-widget {
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 14px;
    background: var(--bg-elevated);
}

.dashboard-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.dashboard-widget-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.dashboard-widget-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.dashboard-widget-tag {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-widget-body {
    display: grid;
    gap: 10px;
}

.dashboard-result-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: var(--bg-surface);
}

.dashboard-result-main {
    flex: 1;
    min-width: 0;
}

.dashboard-result-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.dashboard-result-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.dashboard-result-snippet {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.dashboard-result-open {
    align-self: center;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--accent-primary);
    text-decoration: none;
    white-space: nowrap;
}

.dashboard-empty,
.dashboard-loading {
    font-size: 13px;
    color: var(--text-muted);
}

/* Chat Panel */
.chat-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 18px 20px;
    margin: 20px 0 24px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.chat-header {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.chat-header h2 {
    margin: 0 0 4px 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    color: var(--text-primary);
}

.chat-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.chat-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    font-size: 13px;
}

.chat-advanced {
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 6px 10px;
    color: var(--text-muted);
}

.chat-advanced summary {
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.chat-advanced[open] {
    background: var(--bg-elevated);
}

.chat-advanced-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 10px 12px;
}

.chat-advanced-wide {
    grid-column: 1 / -1;
}

.chat-system-prompt {
    width: 100%;
    min-height: 80px;
    resize: vertical;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 8px 10px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13px;
}

.chat-controls label {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chat-controls select,
.chat-controls input {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 6px 10px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13px;
}

.chat-textarea {
    width: 100%;
    min-height: 90px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.chat-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.chat-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.chat-actions button {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-actions button:first-of-type {
    background: var(--accent-primary);
    color: white;
}

.chat-actions button:first-of-type:hover {
    background: var(--accent-secondary);
}

.chat-actions button.secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.chat-actions button.secondary:hover {
    border-color: var(--accent-primary);
}

.chat-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-status {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.chat-status-row {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 20px;
}

.chat-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-default);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: chat-spin 0.8s linear infinite;
    display: none;
}

.chat-spinner.active {
    display: inline-block;
}

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

.chat-answer {
    margin-top: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 12px 14px;
    white-space: pre-wrap;
    font-size: 14px;
    color: var(--text-primary);
    min-height: 60px;
}

.chat-sources {
    margin-top: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-primary);
}

.chat-sources-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-source-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 0;
    border-top: 1px solid var(--border-muted);
}

.chat-source-item:first-of-type {
    border-top: none;
    padding-top: 0;
}

.chat-source-main {
    flex: 1;
    min-width: 0;
}

.chat-source-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-source-meta {
    color: var(--text-muted);
    font-size: 12px;
}

.chat-source-open {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 500;
    flex: 0 0 auto;
}

.chat-source-open:hover {
    border-color: var(--accent-primary);
    background: var(--bg-surface);
}

/* Splash Screen */
.splash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.splash-overlay.splash-visible {
    opacity: 1;
}

.splash-content {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    padding: 32px 40px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.splash-header {
    text-align: center;
    margin-bottom: 24px;
}

.splash-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.splash-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.splash-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.splash-highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.splash-highlight-item:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.splash-highlight-icon {
    font-size: 24px;
    line-height: 1;
    flex: 0 0 auto;
}

.splash-highlight-text {
    flex: 1;
    min-width: 0;
}

.splash-highlight-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.splash-highlight-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.splash-progress-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.splash-progress-item {
    display: grid;
    grid-template-columns: 24px 120px 20px 1fr 80px;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-muted);
}

.splash-progress-item:last-child {
    border-bottom: none;
}

.splash-progress-icon {
    font-size: 16px;
    text-align: center;
}

.splash-progress-ready .splash-progress-icon {
    color: var(--success);
}

.splash-progress-error .splash-progress-icon {
    color: var(--danger);
}

.splash-progress-loading .splash-progress-icon,
.splash-progress-idle .splash-progress-icon {
    color: var(--text-muted);
}

.splash-progress-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.splash-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-default);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: splash-spin 0.8s linear infinite;
}

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

.splash-progress-bar {
    height: 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: 3px;
    overflow: hidden;
}

.splash-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.splash-progress-ready .splash-progress-fill {
    background: linear-gradient(90deg, var(--success) 0%, #2ea043 100%);
}

.splash-progress-error .splash-progress-fill {
    background: linear-gradient(90deg, var(--danger) 0%, #da3633 100%);
}

.splash-progress-status {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

.splash-progress-ready .splash-progress-status {
    color: var(--success);
    font-weight: 600;
}

.splash-progress-error .splash-progress-status {
    color: var(--danger);
    font-weight: 600;
}

.splash-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.splash-btn {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.splash-btn-primary {
    background: var(--accent-primary);
    color: white;
}

.splash-btn-primary:hover:not(:disabled) {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
}

.splash-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.splash-btn-secondary {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.splash-btn-secondary:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
}

/* Responsive design */
@media (max-width: 768px) {
    .splash-content {
        padding: 24px;
    }

    .splash-header h1 {
        font-size: 32px;
    }

    .splash-highlights {
        grid-template-columns: 1fr;
    }

    .splash-progress-item {
        grid-template-columns: 24px 1fr 20px;
        gap: 8px;
    }

    .splash-progress-bar,
    .splash-progress-status {
        grid-column: 1 / -1;
    }

    .splash-actions {
        flex-direction: column;
    }
}
