:root {
    color-scheme: light;
    --ink: #1f2933;
    --muted: #4b5563;
    --line: #d9e2ec;
    --paper: #f5f7fb;
    --panel: #ffffff;
    --accent: #2563eb;
    --accent-soft: #e0ebff;
    --danger: #ed4545;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--paper);
    color: var(--ink);
}

.page {
    max-width: 1080px;
    margin: 2rem auto;
    padding: 0 1.5rem 2rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    margin: 0 0 0.5rem;
    font-size: 1.85rem;
}

.subtitle,
.helper-text {
    color: var(--muted);
}

.card {
    background: var(--panel);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.4rem;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
}

/* Plan §User-Facing View: keep instruction examples readable without changing the task cards. */
.example-copy-card {
    padding: 1rem 1.5rem;
    font-size: 1.08rem;
    line-height: 1.45;
}

.example-copy-card p {
    margin: 0.45rem 0;
}

.section-title {
    margin: 0 0 0.85rem;
    font-size: 1.2rem;
}

.patch-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 0.65rem;
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
}

.patch-img,
.reference-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #eef2f7;
}

.outlier-patch {
    border: 3px solid var(--danger);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.option-card {
    display: block;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    background: #fbfdff;
}

.option-card h3 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}

.selectable-option {
    cursor: pointer;
}

.selectable-option input {
    margin-bottom: 0.6rem;
}

.selectable-option.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.not-sure-choice {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    margin-top: 1rem;
    font-weight: 600;
}

.form-actions {
    margin-top: 1rem;
}

.primary-button,
.secondary-button {
    display: inline-block;
    border-radius: 999px;
    padding: 0.55rem 1.25rem;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.primary-button {
    border: none;
    background: var(--accent);
    color: #ffffff;
}

.secondary-button {
    border: 1px solid #c7d2fe;
    background: #ffffff;
    color: var(--accent);
}

.primary-button:disabled {
    background: #9ca3af;
    cursor: default;
}

.progress-wrap {
    margin-top: 1rem;
}

.progress-track {
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
}

.progress-text {
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.stack {
    display: grid;
    gap: 0.75rem;
}

.field-label {
    font-weight: 700;
}

.text-input {
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
}

.message-error,
.error-text {
    color: var(--danger);
}

.debug-json,
.error-text {
    white-space: pre-wrap;
    overflow-x: auto;
}

.compact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.compact-table th,
.compact-table td {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

@media (max-width: 900px) {
    .patch-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

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