:root {
    --bg: #fafaf9;
    --surface: #ffffff;
    --text: #1a1a1a;
    --muted: #666666;
    --border: rgba(0,0,0,0.08);
    --accent: #2563eb;
    --badge-bg: #f0f0ee;
    --error: #dc2626;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    margin: 0;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

nav {
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
}

nav .site-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

nav .nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
}

nav a:hover {
    text-decoration: underline;
}

.article {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.article-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.article-title:hover {
    text-decoration: underline;
}

.article-title:visited {
    color: var(--muted);
}

.article-meta {
    margin-top: 0.3rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--muted);
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* ── Status pills (replaces .score-badge) ─────────────────── */
.status-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    border-radius: 3px;
    padding: 2px 6px;
    white-space: nowrap;
    text-transform: uppercase;
}
.pill-bridged {
    background: #dbeafe;       /* blue-100 */
    color: #1d4ed8;            /* blue-700 */
}
.pill-needs-ratings {
    background: var(--badge-bg);
    color: var(--muted);
}
.pill-needs-help {
    background: #fef3c7;       /* amber-100 */
    color: #92400e;            /* amber-800 */
}
.pill-disputed {
    background: #fee2e2;       /* red-100 */
    color: #991b1b;            /* red-800 */
}

/* legacy alias kept for any unmigrated callers — same shape as needs-ratings */
.score-badge {
    background: var(--badge-bg);
    border-radius: 4px;
    padding: 2px 6px;
    font-weight: 500;
    color: var(--text);
}

.vote-form {
    display: inline;
    margin: 0;
}

.vote-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.vote-btn {
    border: 1px solid rgba(0,0,0,0.18);
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 0.8rem;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.vote-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.vote-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.section-separator {
    margin: 2rem 0;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.section-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0;
}

h1, h2 {
    font-family: 'Playfair Display', serif;
}

h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 1.5rem 0 0.5rem;
}

.form-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    max-width: 560px;
    margin: 2rem auto;
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    box-sizing: border-box;
    background: var(--surface);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
}

.btn-primary:hover {
    opacity: 0.9;
}

.error {
    color: var(--error);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 3rem;
}

footer a {
    color: var(--muted);
}

main {
    padding: 1.5rem 0;
}

@media (max-width: 768px) {
    nav {
        padding: 0.75rem 1rem;
    }

    nav .site-title {
        font-size: 1.2rem;
    }

    .form-card {
        margin: 1rem;
        padding: 1.5rem;
    }

    .article-title {
        font-size: 1.05rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    nav .site-title {
        font-size: 1.1rem;
    }

    nav .nav-links {
        gap: 0.75rem;
        font-size: 0.9rem;
    }

    .vote-buttons {
        flex-wrap: wrap;
    }

    .vote-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
        min-height: 36px;
        border-color: rgba(0,0,0,0.28);
        color: var(--text);
    }

    .article-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .form-card {
        margin: 0.75rem;
        padding: 1.25rem;
    }
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

.logout-btn:hover {
    text-decoration: underline;
}

.empty-state {
    color: var(--muted);
    font-size: 0.95rem;
    padding: 1.5rem 0;
}

/* ── Rating queue (/rate) ───────────────────────────────────── */
.rate-shell {
    padding: 1rem 0 3rem;
}
.rate-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    color: var(--muted);
    margin: 0 0 0.4rem;
    text-transform: uppercase;
}
.rate-headline {
    font-family: 'Playfair Display', serif;
    font-size: 1.7rem;
    font-weight: 600;
    margin: 0 0 1.5rem;
}
.rate-progress {
    margin-bottom: 1.5rem;
}
.rate-progress-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--muted);
    margin: 0 0 0.4rem;
}
.rate-progress-text.rate-progress-ready {
    color: #1d4ed8;
}
.rate-progress-count {
    color: var(--muted);
    margin-left: 0.4rem;
}
.rate-progress-bar {
    background: var(--badge-bg);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    max-width: 280px;
}
.rate-progress-fill {
    background: #1d4ed8;
    height: 100%;
    transition: width 0.3s ease;
}
.rate-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.5rem;
    background: #fff;
}
.rate-card-empty {
    text-align: center;
}
.rate-card-title {
    font-size: 1.25rem;
    display: block;
    margin-bottom: 0.6rem;
}
.rate-instruction {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 1rem 0 1.25rem;
    line-height: 1.5;
}
.rate-buttons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.rate-btn {
    flex: 1;
    min-width: 110px;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
}
.rate-footnote {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--muted);
    text-align: center;
    margin-top: 1rem;
}
.rate-footnote a {
    color: var(--muted);
}

/* ── Vote fingerprint visualization ─────────────────────────── */
.vote-fingerprint {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    margin-left: 0.25rem;
    width: 36px;
    height: 36px;
}

/* ── NYH badge ───────────────────────────────────────────────── */
.nyh-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #1d4ed8;
    background: #dbeafe;
    border-radius: 3px;
    padding: 1px 5px;
    white-space: nowrap;
}

/* ── Sign-in-to-vote link button ─────────────────────────────── */
.vote-btn-signin {
    color: var(--muted);
    border-color: var(--border);
    font-size: 0.8rem;
}
.vote-btn-signin:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ── Submit unlock progress ──────────────────────────────────── */
.submit-lock-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    background: var(--badge-bg);
    border-radius: 3px;
    padding: 1px 4px;
    margin-left: 4px;
    vertical-align: middle;
    color: var(--muted);
}

.submit-locked {
    text-align: center;
    padding: 2rem;
}

.submit-locked-heading {
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.submit-progress-track {
    height: 6px;
    background: var(--badge-bg);
    border-radius: 3px;
    overflow: hidden;
    margin: 0.75rem auto;
    max-width: 240px;
}

.submit-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    min-width: 4px;
    transition: width 0.3s ease;
}

.submit-progress-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0.25rem 0 1rem;
}

.submit-locked-why {
    font-size: 0.88rem;
    color: var(--muted);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ── Admin Dashboard ─────────────────────────────────────────── */
.admin-header {
    margin-bottom: 1.5rem;
}
.admin-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin: 0 0 0.25rem 0;
}
.admin-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.admin-stat-card {
    flex: 1;
    min-width: 120px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    background: var(--surface);
}
.admin-stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1;
    margin-bottom: 0.4rem;
}
.admin-stat-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.admin-section {
    margin-bottom: 2.5rem;
}
.admin-section-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.admin-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.admin-bar-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--muted);
    width: 2.5rem;
    text-align: right;
    flex-shrink: 0;
}
.admin-bar-fill {
    height: 12px;
    background: var(--accent);
    border-radius: 2px;
    min-width: 2px;
    opacity: 0.7;
}
.admin-bar-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--muted);
}
.admin-top-list {
    padding-left: 1.25rem;
    margin: 0;
}
.admin-top-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}
.admin-article-link {
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem;
    color: var(--text);
    text-decoration: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-article-link:hover {
    text-decoration: underline;
}
.admin-article-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--muted);
    flex-shrink: 0;
}
.admin-table-wrap {
    overflow-x: auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}
.admin-table th,
.admin-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.admin-table th {
    color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.72rem;
}

/* ── Onboarding Hero ─────────────────────────────────────────── */
.onboarding-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}
.hero-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin: 0 0 0.5rem 0;
}
.hero-headline {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.75rem 0;
}
.hero-body {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.6;
    margin: 0 0 1rem 0;
    max-width: 600px;
}
.hero-dismiss {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    color: var(--muted);
    display: block;
    margin-left: auto;
    min-height: 36px;
}
.hero-dismiss:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Mobile optimizations ────────────────────────────────────── */
/* Touch targets: all interactive elements min 44px */
.vote-btn,
.btn-primary,
.hero-dismiss,
.logout-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Pagination */
.pagination-row {
    margin: 1rem 0;
    text-align: center;
}
.pagination-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    color: var(--accent);
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    display: inline-block;
    min-height: 44px;
    line-height: 32px;
}
.pagination-link:hover {
    border-color: var(--accent);
    background: var(--badge-bg);
}

@media (max-width: 375px) {
    .onboarding-hero {
        padding: 1.25rem 1rem;
    }
    .hero-headline {
        font-size: 1.1rem;
    }
    .pagination-link {
        display: block;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .admin-stats {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .onboarding-hero {
        padding: 1.25rem 1rem;
    }
    .admin-top-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    .admin-article-link {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
}
