/* Global Box Sizing */
* {
    box-sizing: border-box;
}

/* Chart Card Container */
.chart-card {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    position: relative;
    text-align: left;
    /* Ensure chart content aligns left */
}

/* Chart Header */
.chart-header {
    margin-bottom: 20px;
    text-align: left;
}

.chart-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #E9A23B;
    background: rgba(233, 162, 59, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.chart-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1F2937;
    margin: 0;
    letter-spacing: -0.02em;
}

.chart-header .subtitle {
    font-size: 13px;
    color: #6B7280;
    margin: 6px 0 0;
}

/* Legends */
.legend {
    display: flex;
    gap: 20px;
    margin: 16px 0 20px;
    flex-wrap: wrap;
    justify-content: flex-start;
    /* Align legend items to start */
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #4B5563;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Annotations */
.floating-annotation {
    position: absolute;
    top: 12px;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

.annotation-badge {
    font-size: 11px;
    font-weight: 700;
    color: #E9A23B;
    background: rgba(233, 162, 59, 0.12);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(233, 162, 59, 0.25);
}

/* Footer */
.chart-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #E5E7EB;
    text-align: left;
}

.chart-footer .insight {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
    margin: 0 0 4px;
    line-height: 1.4;
}

.chart-footer .source {
    font-size: 11px;
    color: #9CA3AF;
    margin: 0;
}

/* System Leaderboard & Latency Style Rows */
.leaderboard-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    height: 32px;
}

.leaderboard-row.highlight {
    background: rgba(233, 162, 59, 0.05);
    padding: 4px;
    border-radius: 6px;
    margin-left: -4px;
    margin-right: -4px;
    width: calc(100% + 8px);
}

.system-name {
    width: 100px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.bar-container {
    flex: 1;
    margin: 0 12px;
}

.bar-track {
    background: #f0f0f0;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease-out;
}

.score-value {
    width: 50px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
}

.baseline-note {
    margin-top: 20px;
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
}

.note-indicator {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    opacity: 0.5;
    border-radius: 50%;
}

/* Metrics Row (Ablation) */
.metrics-row {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    gap: 12px;
}

.metric-box {
    background: #f9fafb;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    flex: 1;
}

.metric-value {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.metric-label {
    font-size: 11px;
    color: #6b7280;
}

/* LLM Provider Highlight */
.highlight-box {
    background: rgba(233, 162, 59, 0.06);
    border: 1px solid rgba(233, 162, 59, 0.2);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.highlight-icon {
    font-size: 20px;
    color: #e9a23b;
    font-weight: bold;
}

.highlight-title {
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
    margin-bottom: 2px;
}

.highlight-subtitle {
    font-size: 12px;
    color: #6b7280;
}

/* Figure and Caption Styles - Updated for Scientific Left Alignment */
.chart-figure {
    margin: 40px auto;
    width: 100%;
    max-width: 800px;
    /* Constrain figure to chart width */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Left align items */
}

.chart-caption {
    font-family: Georgia, Cambria, "Times New Roman", Times, serif;
    font-size: 15px;
    color: #444;
    /* Darker grey to match reference */
    margin-top: 12px;
    line-height: 1.5;
    text-align: left;
    /* Explicit left align */
    width: 100%;
    padding: 0;
    /* Align with chart edge */
}

.chart-caption strong {
    color: #000;
    font-weight: 700;
    margin-right: 6px;
}