/* Muted text helper */
.muted { color: var(--pico-muted-color); }

/* Centered page layout for non-review pages */
.page-centered {
    text-align: center;
    max-width: 32rem;
    margin: 0 auto;
    padding: 2rem 0;
    min-height: calc(100vh - 13rem);
    display: grid;
    align-content: center;
}

.login-page {
    max-width: 24rem;
}

.page-centered table,
.page-centered dl,
.page-centered details {
    text-align: left;
}

.page-centered a[role="button"],
.page-centered button[type="submit"] {
    width: fit-content;
    display: inline-block;
    margin: 0.25rem;
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: calc(100vh - 210px);
    color: var(--pico-muted-color);
    font-size: 1.25rem;
}

/* Review page: fit everything in one viewport */
.review-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 210px); /* nav + container padding + footer */
    overflow: hidden;
}

.review-header {
    flex-shrink: 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.review-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    padding: 0.5rem 0 0;
}

.review-progress progress {
    flex: 1;
    margin: 0;
}

.review-columns {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.review-image {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.review-image img {
    flex: 1;
    min-height: 0;
    width: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.review-info {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
}

.review-prediction {
    font-size: 1.25rem;
}

.review-meta {
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: nowrap;
}

.review-history {
    line-height: 1.3;
}

.history-list {
    list-style: disc;
    padding-left: 1.25rem;
    margin: 0.25rem 0;
}

.history-list li {
    margin-bottom: 0.15rem;
}

.history-source {
    cursor: help;
}

.history-info-icon {
    width: 0.85rem;
    height: 0.85rem;
    vertical-align: -0.1rem;
    color: var(--pico-muted-color);
}

.history-modal {
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.history-modal header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-modal-body {
    overflow-y: auto;
    max-height: 60vh;
    line-height: 1.4;
}

.review-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    margin-top: auto;
}

.review-buttons-label {
    grid-column: 1 / -1;
}

.review-buttons button {
    margin: 0;
    padding: 0.4rem 0.25rem;
    font-size: 0.85rem;
}

.review-buttons button.btn-positive.outline { --pico-color: var(--pico-ins-color); border-color: var(--pico-ins-color); color: var(--pico-ins-color); }
.review-buttons button.btn-negative.outline { --pico-color: var(--pico-del-color); border-color: var(--pico-del-color); color: var(--pico-del-color); }
.review-buttons button.btn-invalid.outline { border-color: var(--pico-secondary-border); color: var(--pico-secondary); }
.review-buttons button.btn-inconclusive.outline { border-color: var(--pico-secondary-border); color: var(--pico-secondary); }

.review-buttons button u,
.review-nav button u {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2rem;
    text-decoration-color: color-mix(in srgb, currentColor 80%, transparent);
}

.verdict-check {
    width: 1rem;
    height: 1rem;
    vertical-align: -0.15rem;
}

.review-nav {
    display: flex;
    gap: 0.25rem;
}

.review-nav button {
    margin: 0;
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
    flex: 1;
}

.nav-chevron {
    width: 1.25rem;
    height: 1.25rem;
    vertical-align: middle;
}

.label-positive { color: var(--pico-ins-color); }
.label-negative { color: var(--pico-del-color); }

/* Nav: compact */
nav {
    padding: 0.25rem 0;
}

.nav-title {
    white-space: nowrap;
}

.nav-active {
    color: var(--pico-secondary);
    cursor: default;
}

@media (max-width: 768px) {
    .nav-title { display: none; }
}

.error-banner {
    background: var(--pico-del-color);
    color: var(--pico-background-color);
    padding: 0.75rem 1rem;
    border-radius: var(--pico-border-radius);
    font-weight: bold;
}

/* Dashboard */
.dashboard-welcome {
    margin: 0 0 1.5rem;
    text-align: center;
    font-weight: normal;
}

.dashboard-section {
    margin-bottom: 1.25rem;
}

.dashboard-label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.65rem;
    margin-bottom: 0.4rem;
}

.dashboard-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: -0.5rem;
}

.dashboard-progress progress {
    flex: 1;
    margin: 0;
}

.session-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 1rem;
    align-items: center;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    margin-bottom: 0.5rem;
    text-decoration: none;
    transition: border-color 0.15s;
}

.session-card:hover {
    border-color: var(--pico-primary);
}

.session-card progress {
    grid-column: 1 / -1;
    margin: 0;
    height: 0.3rem;
}

/* Completion page */
.completion-page {
    max-width: 32rem;
    margin: 0 auto;
    padding: 2rem 0;
    text-align: center;
}

.completion-header {
    margin-bottom: 1.5rem;
    color: var(--pico-ins-color);
}

.completion-header h2 {
    margin: 1rem 0 0.25rem;
}

.completion-header p {
    margin: 0;
}

.completion-grid {
    margin-bottom: 1rem;
}

.completion-grid article {
    padding: 0.5rem;
    container-type: inline-size;
}

.completion-agreement {
    margin-bottom: 1.5rem;
}

.completion-agreement .stat-number {
    font-size: 2.5rem;
}

.completion-actions a {
    width: auto;
    display: inline-block;
    margin: 0 0.25rem;
}

/* Form card grid */
.form-card-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.form-card-grid article {
    margin: 0;
    padding: 0.75rem;
    min-width: 10rem;
    flex: 0 1 auto;
}

.form-card-grid fieldset {
    margin: 0 auto;
    padding: 0;
    border: none;
    width: fit-content;
}

.form-card-grid legend {
    text-align: center;
}

.form-card-grid label {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.85rem;
}

.review-depth-card {
    text-align: center;
}

.review-depth-fields {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.form-section-label {
    display: block;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.65rem;
    margin-bottom: 0.4rem;
}

.help-trigger {
    cursor: help;
}

.help-icon {
    width: 0.85rem;
    height: 0.85rem;
    vertical-align: -0.1rem;
    color: var(--pico-muted-color);
}

/* Count estimate */
.count-estimate {
    text-align: center;
    margin: 0.75rem 0;
    font-size: 0.85rem;
}

/* Dashboard: compact grid */
.grid article {
    padding: 0.5rem;
    text-align: center;
    container-type: inline-size;
}

.grid article small {
    font-size: 0.75rem;
}

.page-centered small {
    font-size: 0.75rem;
}

.stat-number {
    font-size: min(2.25rem, 18cqi);
    font-weight: bold;
    margin: 0;
}

/* Admin page */
.admin-page {
    max-width: 48rem;
    margin: 0 auto;
    padding: 1rem 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.admin-header h1 {
    margin: 0;
}

.admin-header button {
    width: auto;
    margin: 0;
}

/* User cards grid */
.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
    gap: 1rem;
}

.user-card {
    margin: 0;
    padding: 1rem;
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--pico-primary);
    color: var(--pico-primary-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.user-identity {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.role-badge {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.4rem;
    border-radius: 1rem;
    white-space: nowrap;
    line-height: 1.4;
}

.role-admin {
    background: var(--pico-del-color);
    color: var(--pico-background-color);
}

.role-reviewer {
    background: var(--pico-ins-color);
    color: var(--pico-background-color);
}

.user-card-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
}

.user-card-actions summary {
    font-size: 0.85rem;
}

.user-card-actions fieldset {
    margin-bottom: 0.5rem;
}

.user-card-actions button {
    white-space: nowrap;
}

/* Admin dialog */
#create-user-dialog header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* About page */
.about-page {
    max-width: 42rem;
    margin: 0 auto;
    padding: 2rem 0;
    scroll-behavior: smooth;
}

.about-hero {
    text-align: center;
    margin: -2rem 0 0;
    padding: 2rem 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-actions {
    margin-top: 1.5rem;
}

.hero-actions a {
    width: auto;
    display: inline-block;
    margin: 0 0.25rem;
    padding: 0.4rem 1.5rem;
}

.scroll-hint {
    margin-top: 9.6rem;
    color: var(--pico-muted-color);
    opacity: 0.4;
    text-decoration: none;
    animation: scroll-hint-bob 3s ease-in-out infinite;
    transition: opacity 0.2s;
}

.scroll-hint:hover {
    opacity: 0.7;
}

@keyframes scroll-hint-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

.about-logo {
    height: 8rem;
    margin-bottom: 2rem;
}

.about-hero h1 {
    margin-bottom: 0.5rem;
}

.about-tagline {
    color: var(--pico-muted-color);
    font-size: 1.05rem;
    max-width: 36rem;
    margin: 0 auto;
    line-height: 1.5;
}

.about-section {
    margin-bottom: 2rem;
}

.about-section h2 {
    margin-bottom: 0.75rem;
}

.about-section p {
    line-height: 1.6;
    text-align: justify;
    hyphens: auto;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.about-feature {
    text-align: center;
    padding: 1rem 0.75rem;
    margin: 0;
}

.about-feature p {
    margin: 0;
    text-align: center;
}

.about-feature-icon {
    margin-bottom: 0.5rem;
}

.about-feature-icon svg {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--pico-primary);
}

.about-partners {
    text-align: center;
    padding: 1rem 0;
    border-top: 1px solid var(--pico-muted-border-color);
}

.about-partners small {
    display: block;
    margin-bottom: 0.25rem;
}

@media (max-width: 600px) {
    .about-features {
        grid-template-columns: 1fr;
    }
    .about-section p {
        text-align: left;
    }
}
