/* Litmus Public App Styles */

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --border: #e2e8f0;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --score-high: #10b981;
    --score-good: #3b82f6;
    --score-mid: #ea580c;
    --score-low: #dc2626;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ===== Navbar ===== */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    height: 60px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.nav-brand {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.nav-brand:hover {
    text-decoration: none;
}

.nav-tagline {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    border-left: 1px solid var(--border);
    padding-left: 1rem;
    text-decoration: none;
}
.nav-tagline:hover {
    color: var(--primary);
    text-decoration: none;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    transition: color 0.15s;
}
.nav-link:first-of-type {
    margin-left: auto;
}
.nav-link + .nav-link {
    margin-left: 1.25rem;
}
.nav-link:hover {
    color: var(--primary);
    text-decoration: none;
}
.nav-logout {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
}

/* ===== Container ===== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 120px);
}
.container.container-wide {
    max-width: 1200px;
}

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 2.5rem 0 1.5rem;
}
.hero h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 0.75rem;
}
.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ===== Page Header ===== */
.page-header {
    margin-bottom: 2rem;
}
.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.subtitle {
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

/* ===== Prompt Card ===== */
.prompt-card {
    max-width: 700px;
    margin: 0 auto 2rem;
}

.prompt-card textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.15s;
    min-height: 100px;
}
.prompt-card textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.prompt-card textarea::placeholder {
    color: #9ca3af;
}

.char-count {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ===== Forms ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== Model Grid ===== */
.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.5rem;
}
.model-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
}
.model-option:hover {
    border-color: var(--primary);
    background: #f5f3ff;
}
.model-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}
.model-option input[type="checkbox"]:disabled + .model-label {
    opacity: 0.4;
}
.model-label {
    font-weight: 500;
}
.model-option-random {
    margin-bottom: 0.5rem;
    border-style: dashed;
    background: #fefce8;
}

/* ===== Grouped Model Grid (provider × tier) ===== */
.model-grouped-grid {
    margin-top: 0.25rem;
}

.model-tier-header-row {
    display: grid;
    grid-template-columns: 90px 1fr 1fr;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
    padding: 0 0.1rem;
}

.model-provider-col {
    /* empty spacer above provider name column */
}

.model-tier-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    text-align: center;
}

#model-grid {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.model-provider-row {
    display: grid;
    grid-template-columns: 90px 1fr 1fr;
    gap: 0.4rem;
    align-items: stretch;
}

.model-provider-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding-right: 0.5rem;
}

.model-option-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.78rem;
    min-width: 0;
}

.model-option-cell:hover {
    border-color: var(--primary);
    background: #f5f3ff;
}

.model-option-cell input[type="checkbox"] {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    accent-color: var(--primary);
}

.model-option-cell input[type="checkbox"]:disabled + .model-label {
    opacity: 0.4;
}

.model-option-cell .model-label {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.model-option-empty {
    border: 1px dashed transparent;
    cursor: default;
    background: none;
}

@media (max-width: 600px) {
    .model-tier-header-row,
    .model-provider-row {
        grid-template-columns: 55px 1fr 1fr;
    }
    .model-provider-name {
        font-size: 0.65rem;
    }
    .model-option-cell {
        font-size: 0.68rem;
        padding: 0.4rem 0.35rem;
        gap: 0.3rem;
    }
    .model-tier-label {
        font-size: 0.6rem;
    }
}

/* ===== Buttons ===== */
.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}
.btn:hover {
    text-decoration: none;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-large {
    padding: 0.85rem 2.5rem;
    font-size: 1rem;
    width: 100%;
}

/* ===== Tags ===== */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #eef2ff;
    color: var(--primary);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
}
.tag-model {
    background: #eef2ff;
    color: var(--primary);
}

/* ===== Progress Bar ===== */
.progress-bar-container {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
    transition: width 0.3s ease;
}
.progress-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.error-text {
    color: var(--danger);
    margin-bottom: 1rem;
}

/* ===== Score Badges ===== */
.score-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.85rem;
}
.score-badge-lg {
    padding: 0.4rem 0.85rem;
    font-size: 1.25rem;
}
.score-badge-lg .score-max {
    font-size: 0.7em;
    opacity: 0.6;
    font-weight: 500;
}
.score-high {
    background: #d1fae5;
    color: #065f46;
}
.score-good {
    background: #dbeafe;
    color: #1e40af;
}
.score-mid {
    background: #fed7aa;
    color: #9a3412;
}
.score-low {
    background: #fee2e2;
    color: #991b1b;
}
.score-na {
    background: #f1f5f9;
    color: #64748b;
}
.score-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
    background: none !important;
}
.score-label.score-high { color: #065f46; }
.score-label.score-good { color: #1e40af; }
.score-label.score-mid  { color: #9a3412; }
.score-label.score-low  { color: #991b1b; }
.score-label.score-na   { color: #64748b; }
.criteria-col-score.score-na { color: #64748b; }

/* ===== Criteria Grid ===== */
.criteria-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0.75rem 0;
}
.criteria-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
}
.criteria-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.criteria-name {
    text-transform: capitalize;
    font-size: 0.82rem;
    font-weight: 500;
}

/* ===== Flags ===== */
.flags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
    margin: 0.5rem 0;
}
.flag-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.flag-none { background: #e2e8f0; color: #64748b; }
.flag-refusal_to_engage { background: #fde8e8; color: #991b1b; }
.flag-factual_error { background: #fde8e8; color: #991b1b; }
.flag-asymmetric_hedging { background: #fef3c7; color: #92400e; }
.flag-sycophantic_agreement { background: #fef3c7; color: #92400e; }
.flag-selective_evidence { background: #ffe4e6; color: #9f1239; }
.flag-false_equivalence { background: #e0e7ff; color: #3730a3; }

/* ===== Prompt Display ===== */
.prompt-display {
    background: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 1rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

/* ===== Response Cards Grid ===== */
.responses-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.responses-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 700px;
    margin: 0 auto;
}
.responses-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.response-card {
    margin-bottom: 0;
}
.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.response-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.response-body {
    font-size: 0.88rem;
    line-height: 1.7;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 1rem;
    background: #fafbfc;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.response-error {
    color: var(--danger);
    font-style: italic;
}

/* ===== Grade Section ===== */
.grade-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.grade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.grade-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.rationale-details {
    margin-top: 0.75rem;
}
.rationale-details summary {
    font-size: 0.82rem;
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
}
.rationale-details summary:hover {
    text-decoration: underline;
}
.rationale-text {
    margin-top: 0.5rem;
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: var(--radius);
    font-size: 0.82rem;
    border: 1px solid var(--border);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
    font-family: inherit;
}

/* ===== Criteria Feedback Buttons ===== */
.criteria-feedback-group {
    display: inline-flex;
    gap: 0.2rem;
}
.cfb-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    line-height: 1.3;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition: opacity 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}
.cfb-btn:hover {
    border-color: var(--text-muted);
    color: var(--text);
}
.cfb-btn.cfb-selected {
    color: var(--surface);
    border-color: transparent;
}
.cfb-btn.cfb-selected[data-value="agree"] {
    background: var(--score-high);
}
.cfb-btn.cfb-selected[data-value="too_high"] {
    background: var(--score-mid);
}
.cfb-btn.cfb-selected[data-value="too_low"] {
    background: var(--score-low);
}

/* ===== Two-Column Criteria Layout ===== */
.criteria-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 0.75rem 0;
}
@media (max-width: 600px) {
    .criteria-columns { grid-template-columns: 1fr; }
}
.criteria-col-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.35rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--border);
}
.criteria-col-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.criteria-col-score {
    font-weight: 700;
    font-size: 0.85rem;
    background: none !important;
}
.criteria-col-score.score-high { color: #065f46; }
.criteria-col-score.score-good { color: #1e40af; }
.criteria-col-score.score-mid  { color: #9a3412; }
.criteria-col-score.score-low  { color: #991b1b; }

/* Compact criteria rows */
.criteria-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0.5rem;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
}
.criteria-row .criteria-name {
    font-size: 0.78rem;
}
.criteria-row-right {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

/* Chevron button */
.criteria-expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.1rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s, transform 0.15s;
    opacity: 0.4;
}
.criteria-expand-btn:hover {
    opacity: 1;
    color: var(--primary);
}
.criteria-expand-btn[aria-expanded="true"] {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--primary);
}
.criteria-expand-btn.has-feedback {
    opacity: 1;
    color: var(--score-high);
}

/* Feedback drawer (hidden by default) */
.criteria-feedback-drawer {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem 0.25rem 0.8rem;
    margin-bottom: 0.2rem;
    background: #f0f2f5;
    border-radius: 0 0 var(--radius) var(--radius);
    margin-top: -0.2rem;
}
.criteria-feedback-drawer.hidden { display: none; }
.drawer-prompt {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.drawer-btns {
    display: flex;
    gap: 0.2rem;
}

/* ===== Feedback Section ===== */
.feedback-inline {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.feedback-model-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: #fafbfc;
}
.feedback-model-card h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.feedback-row {
    margin-bottom: 1rem;
}
.feedback-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

/* Star Rating */
.star-rating {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 0.15rem;
}
.star-rating input {
    display: none;
}
.star-rating label {
    cursor: pointer;
    font-size: 1.75rem;
    color: #d1d5db;
    transition: color 0.1s;
    line-height: 1;
}
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: #f59e0b;
}

/* Agreement Radio Group */
.agreement-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.agreement-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
}
.agreement-option:hover {
    border-color: var(--primary);
    background: #f5f3ff;
}
.agreement-option input[type="radio"] {
    accent-color: var(--primary);
}

/* Feedback Comment */
.feedback-comment {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.15s;
}
.feedback-comment:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ===== Info Section ===== */
.info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 700px;
    margin: 0 auto 2rem;
}
.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.info-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}
.info-card ol, .info-card ul {
    padding-left: 1.25rem;
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--text-muted);
}
.info-card strong {
    color: var(--text);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 1.5rem 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

/* ===== Utility ===== */
.hidden {
    display: none !important;
}
.muted {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Criteria Page ===== */
.criteria-page {
    max-width: 780px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.criteria-header {
    margin-bottom: 2rem;
}
.criteria-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.criteria-header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}
.criteria-lead {
    font-size: 1.02rem;
    color: var(--text-muted);
    line-height: 1.75;
}

.criteria-intro {
    margin-bottom: 2rem;
}
.criteria-intro p {
    font-size: 0.92rem;
    color: #444;
    line-height: 1.75;
    margin-bottom: 1rem;
}
.criteria-intro .principles-list {
    font-size: 0.92rem;
    color: #444;
    line-height: 1.75;
    margin: 0 0 1rem 1.5rem;
    list-style-type: disc;
}
.criteria-intro .principles-list li {
    margin-bottom: 0.4rem;
}

/* Scoring Process & Grader Bias Lists */
.scoring-process-list,
.grader-bias-list {
    font-size: 0.92rem;
    color: #444;
    line-height: 1.75;
    margin: 0 0 1.25rem 1.5rem;
}
.scoring-process-list {
    list-style-type: decimal;
}
.grader-bias-list {
    list-style-type: disc;
}
.scoring-process-list li,
.grader-bias-list li {
    margin-bottom: 0.4rem;
}

/* Criterion Cards */
.criterion-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.criterion-num {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.2rem;
}
.criterion-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}
.criterion-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Score Anchors */
.anchor-row {
    display: flex;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.82rem;
    line-height: 1.55;
}
.anchor {
    flex: 1;
    padding: 0.65rem 0.9rem;
}
.anchor-low {
    background: #fee2e2;
    color: #991b1b;
}
.anchor-high {
    background: #d1fae5;
    color: #065f46;
    text-align: right;
}
.anchor-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}

/* Section Headings */
.section-heading {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 2.5rem 0 0.75rem;
    letter-spacing: -0.02em;
}
.section-text {
    font-size: 0.92rem;
    color: #444;
    line-height: 1.75;
    margin-bottom: 1.25rem;
}

/* Scoring Band */
.scoring-band {
    display: flex;
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.82rem;
    text-align: center;
    margin: 1.25rem 0;
}
.band-segment {
    padding: 0.75rem 0.5rem;
    color: white;
    font-weight: 500;
}
.band-range {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.1rem;
}
.band-label {
    font-size: 0.7rem;
    opacity: 0.88;
}
.band-high     { background: #10b981; flex: 5; }
.band-good     { background: #3b82f6; flex: 5; }
.band-moderate { background: #ea580c; flex: 6; }
.band-strong   { background: #dc2626; flex: 5; }

/* Divider */
.criteria-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

/* Flags Grid (criteria page variant) */
.flag-grid-criteria {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin: 1rem 0;
}
.flag-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.82rem;
}
.flag-code-label {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    padding-top: 0.1rem;
    flex-shrink: 0;
}
.flag-desc {
    color: var(--text-muted);
    line-height: 1.5;
}

/* Callout */
.criteria-callout {
    background: #fef3c7;
    border-left: 3px solid #ea580c;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    font-size: 0.88rem;
    line-height: 1.7;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: #444;
}
.criteria-callout strong {
    color: var(--text);
}

/* ===== Access Code Page ===== */
.access-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    padding: 2rem;
}

.access-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.access-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.access-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.access-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.access-error {
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.access-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    text-align: center;
    margin-bottom: 1rem;
    transition: border-color 0.15s;
}
.access-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ===== Data Page ===== */
.data-filter {
    margin-bottom: 1rem;
}
.data-filter-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.data-filter-form label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}
.data-filter-form input[type="date"] {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-family: inherit;
}
.data-filter-form input[type="date"]:focus {
    outline: none;
    border-color: var(--primary);
}
.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
}
.btn-clear {
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-clear:hover {
    background: #e2e8f0;
    text-decoration: none;
}
.data-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}
.data-count {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 500;
}
.data-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--surface);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.data-table th {
    background: #f1f5f9;
    font-weight: 600;
    text-align: left;
    padding: 0.65rem 0.75rem;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    color: var(--text);
}
.data-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: top;
}
.data-table tbody tr:hover {
    background: #f8fafc;
}
.data-table tbody tr:last-child td {
    border-bottom: none;
}
.data-date {
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.78rem;
}
.data-prompt {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.data-model {
    white-space: nowrap;
    font-weight: 500;
}
.data-flags {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 150px;
}
.data-comment {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    .navbar {
        padding: 0 1rem;
    }
    .hero h1 {
        font-size: 1.5rem;
    }
    .hero-subtitle {
        font-size: 0.9rem;
    }
    .responses-grid-2,
    .responses-grid-4 {
        grid-template-columns: 1fr;
    }
    .info-section {
        grid-template-columns: 1fr;
    }
    .agreement-group {
        flex-direction: column;
    }
    .model-grid {
        grid-template-columns: 1fr;
    }
    .model-tier-header-row,
    .model-provider-row {
        grid-template-columns: 55px 1fr 1fr;
    }
    .model-provider-name {
        font-size: 0.65rem;
    }
    .model-option-cell {
        font-size: 0.68rem;
        padding: 0.4rem 0.35rem;
        gap: 0.3rem;
    }
    .model-tier-label {
        font-size: 0.6rem;
    }
    .flag-grid-criteria {
        grid-template-columns: 1fr;
    }
    .anchor-row {
        flex-direction: column;
    }
    .anchor-high {
        text-align: left;
    }
    .criteria-header h1 {
        font-size: 1.5rem;
    }
}

/* ===== Trust Score Sub-scores ===== */
.sub-scores-row {
    display: flex;
    gap: 1.5rem;
    margin: 0.75rem 0 1rem;
}
.sub-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sub-score-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}
.sub-score-value {
    font-weight: 700;
    font-size: 1rem;
}
.sub-score-value.score-high { color: var(--score-high); }
.sub-score-value.score-good { color: var(--score-good); }
.sub-score-value.score-mid { color: var(--score-mid); }
.sub-score-value.score-low { color: var(--score-low); }

/* ===== Criteria Group Labels ===== */
.criteria-group-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 1rem 0 0.25rem;
    grid-column: 1 / -1;
}
.criteria-group-header {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin: 2rem 0 0.5rem;
}
.measure-group-label {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--primary);
    margin: 1rem 0 0.25rem 0;
}

/* ===== Detail Modal (Data Page) ===== */
.detail-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.detail-modal-overlay.hidden {
    display: none;
}
.detail-modal {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}
.detail-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.15s;
}
.detail-modal-close:hover {
    color: var(--text);
}
.detail-section {
    margin-bottom: 1.25rem;
}
.detail-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.detail-prompt {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    white-space: pre-wrap;
}
.detail-loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Clickable data rows */
.data-row-clickable {
    cursor: pointer;
}
.data-row-clickable:hover {
    background: #eef2ff !important;
}

/* ===== Leaderboard Report Cards ===== */
.report-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.report-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
    transition: box-shadow 0.15s, transform 0.15s;
}
.report-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.report-card-rank {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.report-card-header {
    margin-bottom: 1rem;
    padding-right: 3rem;
}
.report-card-model {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-bottom: 0.15rem;
}
.report-card-queries {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.report-card-overall {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.report-card-score-block {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-card-subscores {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.report-card-subscore {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-card-criteria {
    margin-bottom: 0.75rem;
}
.report-card-criteria .criteria-group {
    margin-bottom: 0.5rem;
}
.report-card-criteria .criteria-group-label {
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}
.report-card-criteria .criteria-row {
    font-size: 0.78rem;
}
.report-card-criteria .score-badge {
    font-size: 0.75rem;
    padding: 0.1rem 0.45rem;
}

.report-card-flags {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}
.report-card-flags .criteria-group-label {
    margin-top: 0;
    margin-bottom: 0.35rem;
}
.report-card-flags .flags-row {
    margin: 0;
}

@media (max-width: 768px) {
    .detail-modal-overlay { padding: 1rem; }
    .detail-modal { max-height: 90vh; padding: 1.25rem; }
    .report-cards-grid { grid-template-columns: 1fr; }
    .report-card-subscores { gap: 1rem; }
}
