:root {
    color-scheme: light;
    --bg: #f6f7f4;
    --panel: #ffffff;
    --ink: #1f2a24;
    --muted: #66726b;
    --line: #dbe2dd;
    --brand: #2f7d68;
    --accent: #d58b3a;
    --danger: #b83b3b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

body.modal-open {
    overflow: hidden;
}

.page,
.admin-page {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 18px 16px 40px;
}

.hero {
    min-height: 210px;
    display: flex;
    align-items: flex-end;
    padding: 28px 22px;
    color: #fff;
    background: linear-gradient(rgba(22, 48, 40, .18), rgba(22, 48, 40, .72)), url("/assets/wellness-bg.svg") center/cover;
    border-radius: 8px;
}

.hero.compact {
    min-height: 150px;
}

.hero h1,
.admin-page h1,
.admin-login h1 {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: 0;
}

.hero p {
    margin: 0;
}

.eyebrow {
    font-size: 13px;
    opacity: .9;
}

.notice,
.alert,
.result,
.form,
.detail {
    margin-top: 16px;
    padding: 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.notice {
    border-left: 4px solid var(--accent);
}

.notice p {
    margin: 6px 0 0;
    color: var(--muted);
}

.alert {
    color: var(--danger);
    border-color: #f0cccc;
    background: #fff7f7;
}

.form {
    display: grid;
    gap: 14px;
}

.form.narrow {
    width: min(100%, 380px);
    margin: 12vh auto 0;
}

label,
legend {
    display: grid;
    gap: 7px;
    font-weight: 650;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}

textarea {
    resize: vertical;
}

fieldset {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr;
}

.check,
.agree {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 500;
    min-height: 34px;
}

.check input,
.agree input {
    width: 18px;
    min-height: 18px;
}

.hint {
    color: var(--muted);
    font-size: 13px;
}

.subhead {
    margin: 12px 0 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.notice.inline {
    margin: 0 0 12px;
    padding: 12px;
}

.camera-gate {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(18, 32, 27, .72);
}

.camera-gate.is-hidden {
    display: none;
}

.camera-gate-panel {
    width: min(100%, 420px);
    padding: 24px 18px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}

.camera-gate-panel h2 {
    margin: 4px 0 8px;
    font-size: 24px;
    line-height: 1.25;
}

.camera-gate-panel p {
    margin: 0 0 14px;
    color: var(--muted);
}

.photo-step {
    border-color: rgba(47, 125, 104, .45);
}

.photo-picker {
    display: grid;
    gap: 6px;
    min-height: 124px;
    place-items: center;
    padding: 18px;
    border: 2px dashed rgba(47, 125, 104, .45);
    border-radius: 8px;
    background: #f3faf6;
    text-align: center;
}

.photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.photo-picker-main {
    font-size: 18px;
    font-weight: 800;
    color: var(--brand);
}

.photo-picker-sub {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.photo-picker input {
    position: absolute;
    width: 1px;
    min-height: 1px;
    opacity: 0;
    pointer-events: none;
}

.optional-form {
    display: grid;
    gap: 14px;
}

.optional-form summary {
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfcfa;
    color: var(--brand);
    font-weight: 800;
    cursor: pointer;
}

button,
.link,
.admin-bar a,
.pager a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
}

button {
    width: 100%;
}

.ghost-btn {
    margin-top: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

button:disabled {
    opacity: .72;
}

pre {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    font-family: inherit;
}

.constitution-report {
    display: grid;
    gap: 12px;
}

.constitution-report h2 {
    margin: 0;
    font-size: 24px;
}

.report-subtitle {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.constitution-report dl {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 10px 12px;
    margin: 0;
}

.constitution-report dt {
    color: var(--muted);
    font-weight: 700;
}

.constitution-report .wide-label,
.detail .wide-label {
    grid-column: 1 / -1;
}

.constitution-report dd {
    margin: 0;
    font-weight: 700;
}

.constitution-report .report-remark {
    grid-column: 1 / -1;
    white-space: normal;
    font-weight: 500;
}

.pending-report {
    text-align: center;
}

.pending-title {
    margin: 18px 0 8px;
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
}

.pending-text {
    margin: 0 auto;
    max-width: 420px;
    color: var(--muted);
    line-height: 1.8;
}

.loading-dot {
    width: 44px;
    height: 44px;
    margin: 22px auto 0;
    border-radius: 50%;
    border: 4px solid #dbe6df;
    border-top-color: var(--accent);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.preview {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    margin-top: 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
}

.upload-preview {
    max-height: 360px;
    margin-top: 10px;
}

.admin-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.admin-bar nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-bar form,
.row-actions form {
    margin: 0;
}

.admin-bar button,
.row-actions button {
    width: auto;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.row-actions a,
.row-actions button {
    display: inline-flex;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--brand);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.text-danger {
    color: var(--danger) !important;
}

.table-wrap {
    overflow-x: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

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

th {
    background: #eef3ef;
}

.detail dl {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px 14px;
    margin: 0;
}

.detail dt {
    color: var(--muted);
}

.detail dd {
    margin: 0;
}

.detail .report-remark {
    grid-column: 1 / -1;
    white-space: normal;
}

.pager {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

@media (max-width: 560px) {
    .page,
    .admin-page {
        padding: 12px 10px 32px;
    }

    .hero {
        min-height: 190px;
        padding: 22px 18px;
    }

    .grid,
    .photo-grid,
    .detail dl,
    .constitution-report dl {
        grid-template-columns: 1fr;
    }

    .admin-bar {
        align-items: flex-start;
        flex-direction: column;
    }
}
