/* Device Doctor Dashboard - Production Dark Theme */

:root {
    /* Colors - Locked in for production */
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a1a;
    --bg-card: #1f1f1f;
    --text-primary: #e8e8e8;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent: #14b8a6; /* Teal - single accent color */
    --border: #2a2a2a;
    --success: #10b981;
    --warning: #f59e0b; /* Amber for medium */
    --critical: #dc2626; /* Muted red, use sparingly */
    
    /* Spacing system */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Typography */
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */
.header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-lg) 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.settings-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-btn:hover {
    background-color: var(--bg-secondary);
    border-color: var(--accent);
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    letter-spacing: -0.01em;
}

.subtitle {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.01em;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--bg-card);
    border-radius: 0.375rem;
    border: 1px solid var(--border);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--text-muted);
    flex-shrink: 0;
}

.status-dot.healthy {
    background-color: var(--success);
}

.status-dot.attention {
    background-color: var(--warning);
}

.status-dot.critical {
    background-color: var(--critical);
}

.status-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: var(--spacing-xl);
}

.card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.01em;
}

/* Health Score */
.health-score-card {
    text-align: center;
}

.health-score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2xl);
    padding: var(--spacing-xl) 0;
}

.score-circle {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--border);
    background-color: var(--bg-secondary);
    flex-shrink: 0;
}

.score-circle.healthy {
    border-color: var(--success);
}

.score-circle.warning {
    border-color: var(--warning);
}

.score-circle.critical {
    border-color: var(--critical);
}

.score-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
}

.score-label {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
    font-weight: 400;
}

.score-details {
    text-align: left;
    max-width: 420px;
}

.score-grade {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.02em;
}

.score-status {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    text-transform: capitalize;
    font-weight: 500;
}

.score-explanation {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.score-breakdown-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    padding: var(--spacing-xs) var(--spacing-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
    transition: all 0.15s ease;
    font-family: inherit;
}

.score-breakdown-toggle:hover {
    border-color: var(--accent);
    color: var(--text-secondary);
}

.score-breakdown-toggle.expanded .breakdown-toggle-icon {
    transform: rotate(180deg);
}

.breakdown-toggle-icon {
    font-size: 0.625rem;
    transition: transform 0.15s ease;
}

.score-breakdown {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--bg-secondary);
    border-radius: 0.375rem;
    border: 1px solid var(--border);
    font-size: 0.8125rem;
    font-family: var(--font-mono);
}

.score-breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-xs) 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.score-breakdown-item:last-child {
    border-bottom: none;
}

.score-breakdown-label {
    color: var(--text-muted);
}

.score-breakdown-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* Telemetry Section */
.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.telemetry-card {
    padding: var(--spacing-lg);
    background-color: var(--bg-secondary);
    border-radius: 0.375rem;
    border: 1px solid var(--border);
}

.telemetry-card h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.metric-value {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.01em;
}

.metric-value .unit {
    font-size: 1rem;
    color: var(--text-muted);
    margin-left: 0.25rem;
    font-weight: 400;
}

.telemetry-card canvas {
    max-height: 100px;
    width: 100% !important;
    height: 100px !important;
}

/* Symptoms Section */
.symptoms-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.symptom-item {
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: var(--bg-secondary);
    border-radius: 0.375rem;
    border-left: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: var(--spacing-lg);
    transition: border-color 0.15s ease;
}

.symptom-item.low {
    border-left-color: rgba(16, 185, 129, 0.4);
}

.symptom-item.medium {
    border-left-color: rgba(245, 158, 11, 0.4);
}

.symptom-item.high,
.symptom-item.critical {
    border-left-color: rgba(220, 38, 38, 0.4);
}

.symptom-info {
    flex: 1;
    min-width: 0;
}

.symptom-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    text-transform: capitalize;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
}

.symptom-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.symptom-severity {
    padding: 0.1875rem var(--spacing-sm);
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.symptom-severity.low {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.symptom-severity.medium {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.symptom-severity.high,
.symptom-severity.critical {
    background-color: rgba(220, 38, 38, 0.15);
    color: var(--critical);
}

/* Issues Section */
.issues-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.issue-item {
    padding: var(--spacing-xl);
    background-color: var(--bg-secondary);
    border-radius: 0.375rem;
    border: 1px solid var(--border);
}

.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--spacing-md);
    gap: var(--spacing-lg);
}

.issue-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.01em;
}

.issue-urgency {
    padding: 0.25rem var(--spacing-sm);
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    flex-shrink: 0;
}

.issue-urgency.high {
    background-color: rgba(220, 38, 38, 0.15);
    color: var(--critical);
}

.issue-urgency.medium {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.issue-urgency.low {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.issue-explanation {
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.7;
    font-size: 0.9375rem;
}

.issue-section {
    margin-top: var(--spacing-lg);
}

.issue-section:first-of-type {
    margin-top: 0;
}

.issue-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--spacing-sm);
}

.issue-list {
    list-style: none;
    padding-left: 0;
}

.issue-list li {
    padding: var(--spacing-xs) 0;
    padding-left: var(--spacing-lg);
    color: var(--text-secondary);
    position: relative;
    line-height: 1.7;
    font-size: 0.9375rem;
}

.issue-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 600;
    font-size: 1.125rem;
    line-height: 1.4;
}

.issue-confidence {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
}

.issue-evidence {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.issue-evidence-label {
    color: var(--text-muted);
    font-weight: 500;
    margin-right: 0.5rem;
}

.issue-evidence-text {
    color: var(--text-secondary);
}

/* Top Contributors Section */
.contributors-group {
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.contributors-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--spacing-xs);
}

.contributors-list {
    list-style: none;
    padding-left: 0;
    margin-top: var(--spacing-xs);
}

.contributors-list li {
    padding: var(--spacing-xs) 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
    font-family: var(--font-mono);
}

.contributor-name {
    color: var(--text-primary);
    font-weight: 500;
}

.contributor-value {
    color: var(--accent);
    font-weight: 600;
}

/* Footer */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-2xl);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.footer-content p {
    margin: var(--spacing-xs) 0;
}

.timestamp {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.snapshot-note {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.6875rem;
}

/* System Configuration Section */
.system-config-section {
    margin-bottom: var(--spacing-xl);
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.config-item {
    padding: var(--spacing-sm);
    background-color: var(--bg-secondary);
    border-radius: 0.375rem;
    border: 1px solid var(--border);
}

.config-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--spacing-xs);
}

.config-value {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-word;
}

.config-value code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    background-color: var(--bg-primary);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    color: var(--accent);
}

/* Scanning Section */
.scanning-section {
    margin-bottom: var(--spacing-xl);
}

.scanning-timeline {
    margin-top: var(--spacing-lg);
}

.scan-step {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    background-color: var(--bg-secondary);
    border-radius: 0.375rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.scan-step.completed {
    border-color: var(--success);
    background-color: rgba(16, 185, 129, 0.05);
}

.scan-step.active {
    border-color: var(--accent);
    background-color: rgba(20, 184, 166, 0.05);
}

.step-status {
    font-size: 1.125rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.step-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    flex: 1;
}

.scan-step.completed .step-text {
    color: var(--text-primary);
}

.scan-step.active .step-text {
    color: var(--accent);
    font-weight: 500;
}

.scan-complete {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    border-radius: 0.375rem;
    text-align: center;
    color: var(--success);
    font-weight: 500;
}

/* Suggested Fixes Section */
.fixes-section {
    margin-top: var(--spacing-xl);
}

.fixes-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.fix-item {
    padding: var(--spacing-lg);
    background-color: var(--bg-secondary);
    border-radius: 0.375rem;
    border-left: 3px solid var(--accent);
}

.fix-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.fix-steps {
    list-style: none;
    padding-left: 0;
    margin-top: var(--spacing-sm);
}

.fix-steps li {
    padding: var(--spacing-xs) 0;
    padding-left: var(--spacing-lg);
    color: var(--text-secondary);
    position: relative;
    line-height: 1.7;
    font-size: 0.9375rem;
}

.fix-steps li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 600;
}

.fix-best-practices {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
}

.fix-best-practices-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--spacing-sm);
}

.fix-best-practices-list {
    list-style: none;
    padding-left: 0;
}

.fix-best-practices-list li {
    padding: var(--spacing-xs) 0;
    padding-left: var(--spacing-lg);
    color: var(--text-secondary);
    position: relative;
    line-height: 1.7;
    font-size: 0.9375rem;
    font-style: italic;
}

.fix-best-practices-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-muted);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.4;
}

/* Best Practices Section */
.best-practices-section {
    margin-top: var(--spacing-xl);
}

.best-practices-content {
    margin-top: var(--spacing-md);
}

.best-practices-list {
    list-style: none;
    padding-left: 0;
    display: grid;
    gap: var(--spacing-md);
}

.best-practices-list li {
    padding: var(--spacing-md);
    padding-left: var(--spacing-xl);
    background-color: var(--bg-secondary);
    border-radius: 0.375rem;
    border-left: 2px solid var(--border);
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9375rem;
    position: relative;
    transition: border-color 0.15s ease;
}

.best-practices-list li:hover {
    border-left-color: var(--accent);
}

.best-practices-list li::before {
    content: "✓";
    position: absolute;
    left: var(--spacing-md);
    color: var(--accent);
    font-weight: 600;
    font-size: 1rem;
}

/* Diagnostic Scope Section */
.diagnostic-scope-section {
    margin-top: var(--spacing-xl);
}

.scope-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-md);
}

.scope-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border);
}

.scope-list {
    list-style: none;
    padding-left: 0;
}

.scope-list.evaluated li {
    padding: var(--spacing-xs) 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.scope-list.not-evaluated li {
    padding: var(--spacing-xs) 0;
    padding-left: var(--spacing-lg);
    color: var(--text-muted);
    position: relative;
    line-height: 1.7;
    font-size: 0.9375rem;
}

.scope-list.not-evaluated li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-muted);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.4;
}

/* Empty State */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: var(--spacing-2xl);
    font-style: italic;
    font-size: 0.9375rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .health-score-display {
        flex-direction: column;
        gap: var(--spacing-xl);
    }

    .telemetry-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: var(--spacing-lg) var(--spacing-md);
        gap: var(--spacing-lg);
    }

    .card {
        padding: var(--spacing-lg);
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .scope-content {
        grid-template-columns: 1fr;
    }
}

/* Diagnostic Panel - Bottom-up expandable */
.diagnostic-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.diagnostic-panel.collapsed {
    transform: translateY(calc(100% - 56px));
}

.diagnostic-panel.expanded {
    transform: translateY(0);
}

.diagnostic-panel.full-height {
    transform: translateY(0);
}

.diagnostic-panel.full-height .panel-content {
    height: 90vh;
}

/* Panel Bar (Collapsed State) */
.panel-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    min-height: 56px;
}

.panel-bar-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
}

.panel-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-context {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-style: italic;
}

.panel-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-xs);
    font-size: 1rem;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}

.panel-toggle:hover {
    color: var(--text-primary);
}

.panel-toggle-icon {
    display: block;
    transition: transform 0.25s;
}

.diagnostic-panel.expanded .panel-toggle-icon,
.diagnostic-panel.full-height .panel-toggle-icon {
    transform: rotate(180deg);
}

/* Panel Content (Expanded State) */
.panel-content {
    display: none;
    flex-direction: column;
    height: 50vh;
    max-height: 600px;
    overflow: hidden;
}

.diagnostic-panel.expanded .panel-content,
.diagnostic-panel.full-height .panel-content {
    display: flex;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.panel-header-left {
    flex: 1;
}

.panel-header-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-xs) 0;
}

.panel-context-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.8125rem;
}

.context-label {
    color: var(--text-muted);
}

.context-value {
    color: var(--accent);
    font-weight: 500;
}

.panel-header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.panel-expand-btn,
.panel-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 1rem;
    line-height: 1;
    transition: color 0.2s;
    border-radius: 0.25rem;
}

.panel-expand-btn:hover,
.panel-close-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

/* Panel Body - Explanation Area */
.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    background-color: var(--bg-card);
}

.panel-body::-webkit-scrollbar {
    width: 8px;
}

.panel-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.panel-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.panel-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.panel-explanation {
    max-width: 900px;
    margin: 0 auto;
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 0.9375rem;
}

.explanation-placeholder {
    color: var(--text-secondary);
    text-align: center;
    padding: var(--spacing-2xl) 0;
}

.explanation-placeholder p {
    margin: 0 0 var(--spacing-md) 0;
}

.explanation-content {
    animation: fadeIn 0.3s ease;
}

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

.explanation-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: var(--spacing-xl) 0 var(--spacing-md) 0;
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border);
}

.explanation-content h2:first-child {
    margin-top: 0;
}

.explanation-content h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: var(--spacing-lg) 0 var(--spacing-sm) 0;
}

.explanation-content p {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--text-primary);
}

.explanation-content ul,
.explanation-content ol {
    margin: var(--spacing-md) 0;
    padding-left: var(--spacing-xl);
    color: var(--text-primary);
}

.explanation-content li {
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

.explanation-content strong {
    color: var(--accent);
    font-weight: 600;
}

.explanation-content code {
    background-color: var(--bg-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--accent);
    border: 1px solid var(--border);
}

/* Conversation History */
.conversation-history {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.conversation-entry {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.conversation-question,
.conversation-answer {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.conversation-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
}

.conversation-text {
    color: var(--text-primary);
    line-height: 1.7;
}

.conversation-question .conversation-text {
    font-weight: 500;
    color: var(--accent);
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--bg-secondary);
    border-left: 3px solid var(--accent);
    border-radius: 0.25rem;
}

.conversation-answer .conversation-text {
    padding: var(--spacing-sm) 0;
}

.conversation-separator {
    height: 1px;
    background-color: var(--border);
    margin: var(--spacing-md) 0;
    opacity: 0.5;
}

/* Panel Footer */
.panel-footer {
    flex-shrink: 0;
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.panel-quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.quick-question-btn {
    padding: var(--spacing-xs) var(--spacing-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.quick-question-btn:hover {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--accent);
}

.quick-question-btn:active {
    transform: scale(0.98);
}

.panel-input-container {
    display: flex;
    gap: var(--spacing-xs);
}

.panel-input {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.panel-input:focus {
    border-color: var(--accent);
}

.panel-input::placeholder {
    color: var(--text-muted);
}

/* Adjust main content when panel is expanded */
body.panel-expanded .main-content {
    padding-bottom: 50vh;
    transition: padding-bottom 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.panel-full-height .main-content {
    padding-bottom: 90vh;
}

/* Responsive */
@media (max-width: 768px) {
    .diagnostic-panel.expanded .panel-content,
    .diagnostic-panel.full-height .panel-content {
        height: 70vh;
    }
    
    .panel-explanation {
        font-size: 0.875rem;
    }
    
    .panel-quick-questions {
        flex-direction: column;
    }
    
    .quick-question-btn {
        width: 100%;
    }
}

/* Old chat widget styles removed - using diagnostic panel now */

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .header,
    .footer {
        border-color: #ccc;
    }
    
    .diagnostic-panel {
        display: none;
    }
}

/* Settings Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-lg);
}

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
}

.settings-section {
    margin-bottom: var(--spacing-lg);
}

.settings-section label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

.settings-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: var(--font-mono);
}

.settings-input:focus {
    outline: none;
    border-color: var(--accent);
}

.settings-hint {
    margin-top: var(--spacing-xs);
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.info-box {
    padding: var(--spacing-md);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.info-box strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: var(--spacing-xs);
}

.info-box p {
    color: var(--text-secondary);
    margin: var(--spacing-xs) 0;
}

.info-box code {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--accent);
    margin: var(--spacing-xs) 0;
}

.settings-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border);
}

.btn-primary, .btn-secondary {
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--accent);
    color: #0d0d0d;
    flex: 1;
}

.btn-primary:hover {
    background-color: #0d9488;
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background-color: var(--bg-primary);
}
