:root {
    color-scheme: light dark;
    --page: #f5f5f2;
    --paper: #ffffff;
    --paper-alt: #f0f0ec;
    --ink: #1f2421;
    --muted: #626963;
    --line: #cfd2cc;
    --line-strong: #aeb3ac;
    --accent: #286442;
    --accent-hover: #1f5035;
    --accent-soft: #e4eee8;
    --danger: #9d2f2f;
    --danger-soft: #f8e7e5;
    --warning: #996414;
    --success: #286442;
    --focus: #87a996;
    --radius: 4px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --page: #171a18;
        --paper: #202421;
        --paper-alt: #292e2a;
        --ink: #edf0ed;
        --muted: #aeb5af;
        --line: #3c433d;
        --line-strong: #596159;
        --accent: #7ab693;
        --accent-hover: #9bc7ac;
        --accent-soft: #26392e;
        --danger: #ee8d87;
        --danger-soft: #412927;
        --warning: #ddb66f;
        --success: #7ab693;
        --focus: #5d8c70;
    }
}

* {
    box-sizing: border-box;
}

html {
    background: var(--page);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

body {
    min-height: 100vh;
    margin: 0;
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

a:hover {
    color: var(--accent-hover);
}

button,
input,
select,
textarea {
    font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

code {
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--paper-alt);
    padding: 0.08rem 0.3rem;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.9em;
}

.shell {
    width: min(1040px, calc(100% - 32px));
    margin-inline: auto;
}

.site-header {
    border-bottom: 1px solid var(--line-strong);
    background: var(--paper);
}

.header-inner {
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.82rem;
    font-weight: 800;
}

.brand-product {
    color: var(--muted);
    font-weight: 500;
}

nav {
    display: flex;
    gap: 1.1rem;
    font-size: 0.9rem;
}

nav a {
    color: var(--muted);
    text-decoration: none;
}

nav a:hover {
    color: var(--ink);
}

main {
    padding-block: 2.1rem 4rem;
}

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    padding-block: 1.15rem 2rem;
    font-size: 0.82rem;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0.45rem;
    font-size: clamp(1.8rem, 3.5vw, 2.45rem);
    font-weight: 680;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

h2 {
    margin-bottom: 0.4rem;
    font-size: 1.18rem;
    font-weight: 680;
    line-height: 1.3;
}

p {
    margin-bottom: 0.8rem;
    color: var(--muted);
}

.page-header,
.hero {
    max-width: 760px;
    margin-bottom: 1.6rem;
}

.page-meta,
.eyebrow {
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.76rem;
    letter-spacing: 0.02em;
    text-transform: none;
}

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    padding: 1.25rem;
}

.button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
    font-weight: 650;
    padding: 0.52rem 0.9rem;
    text-decoration: none;
}

@media (prefers-color-scheme: dark) {
    .button {
        color: #132018;
    }
}

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

@media (prefers-color-scheme: dark) {
    .button:hover {
        color: #132018;
    }
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.button-secondary {
    border-color: var(--line-strong);
    background: transparent;
    color: var(--ink);
}

.button-secondary:hover {
    border-color: var(--ink);
    background: var(--paper-alt);
    color: var(--ink);
}

.guide-list {
    border-top: 1px solid var(--line-strong);
}

.guide-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding: 1.25rem 0;
}

.guide-row h2 {
    margin-bottom: 0.3rem;
    font-size: 1.15rem;
}

.guide-row h2 a {
    color: var(--ink);
    text-decoration: none;
}

.guide-row h2 a:hover {
    color: var(--accent);
}

.guide-row p:last-child {
    margin-bottom: 0;
}

.guide-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.9rem;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.76rem;
}

.guide-open {
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 650;
    text-decoration: none;
}

.guide-heading,
.admin-heading,
.section-heading,
.completion {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
}

.guide-heading,
.admin-heading {
    margin-bottom: 1.3rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--line-strong);
}

.guide-heading > div:first-child,
.admin-heading > div:first-child {
    max-width: 760px;
}

.save-panel {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.save-dot {
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    background: var(--muted);
}

[data-save-state="pending"] .save-dot,
[data-save-state="saving"] .save-dot {
    background: var(--warning);
}

[data-save-state="saved"] .save-dot {
    background: var(--success);
}

[data-save-state="error"] .save-dot {
    background: var(--danger);
}

.notice,
.test-notice {
    border-left: 3px solid var(--line-strong);
    background: var(--paper-alt);
    padding: 0.85rem 1rem;
}

.notice {
    margin-bottom: 1rem;
}

.notice p:last-child,
.test-notice p:last-child {
    margin-bottom: 0;
}

.environment-card,
.progress-card,
.test-section,
.completion {
    margin-top: 1rem;
}

.environment-card {
    border-top: 3px solid var(--ink);
}

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

.field {
    display: grid;
    gap: 0.32rem;
}

.field-wide {
    grid-column: 1 / -1;
}

label {
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 650;
}

.required {
    margin-left: 0.35rem;
    color: var(--danger);
    font-size: 0.72rem;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    padding: 0.58rem 0.65rem;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--ink);
}

textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.1rem;
}

.form-error {
    min-height: 1.2rem;
    margin: 0.7rem 0 0;
    color: var(--danger);
    font-size: 0.88rem;
    font-weight: 600;
}

.text-link {
    font-size: 0.88rem;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

.status-badge {
    display: inline-block;
    border: 1px solid var(--line-strong);
    border-radius: 2px;
    background: var(--paper-alt);
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.72rem;
    padding: 0.18rem 0.45rem;
    text-transform: lowercase;
}

.status-completed {
    border-color: var(--success);
    background: var(--accent-soft);
    color: var(--success);
}

.progress-card {
    position: sticky;
    z-index: 10;
    top: 0;
    display: grid;
    gap: 0.5rem;
    border-color: var(--line-strong);
    background: var(--paper);
    padding-block: 0.8rem;
}

.progress-card > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.8rem;
}

progress {
    width: 100%;
    height: 0.42rem;
    border: 0;
    background: var(--paper-alt);
    accent-color: var(--success);
}

progress::-webkit-progress-bar {
    background: var(--paper-alt);
}

progress::-webkit-progress-value {
    background: var(--success);
}

progress::-moz-progress-bar {
    background: var(--success);
}

.test-section {
    padding: 0;
    overflow: hidden;
}

.test-section > .section-heading,
.test-section > h2 {
    margin: 0;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--line);
    background: var(--paper-alt);
}

.test-section > .section-heading p {
    margin-bottom: 0;
}

.section-number {
    display: inline-block;
    min-width: 2rem;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.75rem;
}

.test-items {
    display: grid;
}

.test-item,
.test-notice {
    border-top: 1px solid var(--line);
    padding: 0.95rem 1.15rem;
}

.test-items > :first-child {
    border-top: 0;
}

.test-notice {
    border-left: 3px solid var(--line-strong);
    background: var(--paper-alt);
}

.check-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.check-row input {
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.18rem;
    accent-color: var(--success);
}

.check-copy {
    display: grid;
    gap: 0.12rem;
}

.check-copy strong {
    font-size: 0.94rem;
    font-weight: 620;
}

.check-copy span,
.response-item label span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 400;
}

.issue-details {
    margin: 0.55rem 0 0 1.8rem;
}

.issue-details summary {
    width: fit-content;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.8rem;
}

.issue-details summary:hover {
    color: var(--danger);
}

.issue-details label {
    display: block;
    margin: 0.65rem 0 0.3rem;
    color: var(--danger);
    font-size: 0.8rem;
}

.issue-details[open] {
    border-left: 2px solid var(--danger);
    padding-left: 0.75rem;
}

.response-item {
    display: grid;
    gap: 0.55rem;
}

.checklist-locked {
    opacity: 0.48;
}

.completion {
    align-items: center;
    border-top: 3px solid var(--ink);
}

.completion p:last-child {
    margin-bottom: 0;
}

.narrow-page {
    width: min(480px, 100%);
    margin-inline: auto;
}

.narrow-page .card {
    border-top: 3px solid var(--ink);
}

#admin-login-form .button {
    margin-top: 1rem;
}

.table-wrap {
    overflow-x: auto;
    padding: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--paper);
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 0.72rem 0.8rem;
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--paper-alt);
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

tbody tr:hover {
    background: var(--paper-alt);
}

td {
    font-size: 0.88rem;
}

td small {
    display: block;
    color: var(--muted);
}

.issue-count {
    color: var(--danger);
    font-weight: 700;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.detail-grid div {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 0.7rem;
}

dt {
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.68rem;
    text-transform: uppercase;
}

dd {
    margin: 0.2rem 0 0;
    font-size: 0.9rem;
}

.result-list {
    display: grid;
}

.result-row {
    display: grid;
    grid-template-columns: 1.5rem 1fr;
    gap: 0.65rem;
    border-top: 1px solid var(--line);
    padding: 0.78rem 1.15rem;
}

.result-list > :first-child {
    border-top: 0;
}

.result-row p {
    margin: 0.3rem 0 0;
}

.result-mark {
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-weight: 700;
}

.result-issue {
    border-left: 3px solid var(--danger);
    background: var(--danger-soft);
}

@media (max-width: 720px) {
    .shell {
        width: min(100% - 22px, 1040px);
    }

    main {
        padding-top: 1.4rem;
    }

    .header-inner {
        min-height: 50px;
    }

    .brand-product {
        display: none;
    }

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

    .field-wide {
        grid-column: auto;
    }

    .guide-row {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .guide-heading,
    .admin-heading,
    .section-heading,
    .completion {
        flex-direction: column;
    }

    .save-panel {
        margin-top: 0;
    }

    .progress-card > div {
        flex-direction: column;
        gap: 0.1rem;
    }

    .test-item,
    .test-notice,
    .test-section > .section-heading,
    .result-row {
        padding-inline: 0.9rem;
    }
}
