:root {
    --page-bg: #eef5ef;
    --card-bg: rgba(251, 255, 251, 0.92);
    --text-main: #1e1a18;
    --text-soft: #5d554e;
    --border-soft: rgba(62, 45, 35, 0.12);
    --accent: #1c6944;
    --accent-strong: #165338;
    --accent-soft: #d9eee2;
    --danger: #8a1c1c;
    --shadow: 0 20px 50px rgba(48, 35, 24, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Cambria, Georgia, serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(28, 105, 68, 0.14), transparent 28%),
        radial-gradient(circle at top right, rgba(22, 83, 56, 0.16), transparent 24%),
        linear-gradient(180deg, #f9fdf9 0%, var(--page-bg) 58%, #e0ece2 100%);
    min-height: 100vh;
}

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

a {
    color: inherit;
}

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

.page-shell {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.page-shell-home {
    min-height: 100vh;
    padding: 14px 0 16px;
    display: grid;
    grid-template-rows: auto 1fr;
}

.site-header {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px 20px 18px;
    border: 1px solid rgba(28, 105, 68, 0.14);
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(251, 255, 251, 0.94), rgba(240, 248, 242, 0.88));
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.site-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-grid;
    grid-template-columns: auto minmax(180px, 1fr);
    align-items: center;
    gap: 16px;
    text-decoration: none;
}

.brand-logo {
    width: clamp(210px, 20vw, 330px);
    height: auto;
    display: block;
}

.brand-lockup {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: nowrap;
    max-width: none;
    white-space: nowrap;
}

.brand strong,
h1,
h2,
h3 {
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
    letter-spacing: -0.03em;
}

.brand strong {
    font-size: clamp(1.25rem, 1.85vw, 1.85rem);
    line-height: 1;
}

.brand small {
    display: inline;
    color: var(--text-soft);
    font-size: clamp(0.9rem, 1.05vw, 1.08rem);
    line-height: 1.2;
}

.site-header-utility {
    display: grid;
    justify-items: end;
    gap: 10px;
    min-width: min(100%, 560px);
}

.header-utility-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.header-context-label {
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-soft);
}

.locale-switcher {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(28, 105, 68, 0.12);
}

.header-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 0;
    border-top: 1px solid rgba(28, 105, 68, 0.1);
}

.header-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(28, 105, 68, 0.12);
    background: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    color: var(--accent-strong);
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.header-nav-link.is-active {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff9f2;
    border-color: transparent;
}

.locale-switcher-label {
    font-size: 0.82rem;
    color: var(--text-soft);
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.locale-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(28, 105, 68, 0.08);
    text-decoration: none;
    font-size: 0.88rem;
}

.locale-pill.is-active {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff9f2;
}

.page-content {
    display: grid;
    gap: 24px;
}

.page-shell-home .page-content {
    align-content: stretch;
    gap: 0;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.hero-grid,
.report-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 24px;
}

.hero-copy,
.form-card,
.report-summary,
.report-chart,
.question-card,
.table-card,
.auth-card,
.note-card,
.interest-card {
    padding: 28px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.8rem;
    color: var(--text-soft);
    margin: 0 0 10px;
}

.participant-hero-eyebrow {
    font-size: 1.05rem;
    letter-spacing: 0.14em;
    margin-bottom: 14px;
}

.lead,
.support-copy {
    color: var(--text-soft);
    line-height: 1.6;
}

.flash {
    padding: 14px 18px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.flash-success {
    background: rgba(76, 149, 108, 0.12);
    color: #234731;
}

.flash-error {
    background: rgba(181, 101, 118, 0.12);
    color: #6e2030;
}

.stack-form {
    display: grid;
    gap: 16px;
}

.stack-form label {
    display: grid;
    gap: 8px;
}

.stack-form span {
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
    font-size: 0.95rem;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(62, 45, 35, 0.15);
    border-radius: 14px;
    padding: 13px 14px;
    background: rgba(255, 255, 255, 0.72);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.primary-button,
.ghost-button,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    padding: 12px 18px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease;
}

.primary-button {
    border: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff9f2;
}

.ghost-button {
    border: 1px solid rgba(28, 105, 68, 0.18);
    background: rgba(255, 255, 255, 0.55);
    color: var(--text-main);
}

.text-link {
    border: 0;
    padding: 0;
    background: none;
    color: var(--accent);
}

.destructive-link {
    color: var(--danger);
}

.primary-button:hover,
.ghost-button:hover,
.text-link:hover {
    transform: translateY(-1px);
}

.feature-list {
    margin: 0;
    padding-left: 18px;
    line-height: 1.7;
}

.compact-list {
    margin-top: 8px;
}

.info-panel {
    margin-top: 28px;
    padding: 22px;
    border-radius: 20px;
    background: rgba(28, 105, 68, 0.06);
    border: 1px solid rgba(28, 105, 68, 0.08);
}

.participant-start-grid {
    align-items: start;
}

.page-shell-home .site-header {
    margin-bottom: 14px;
    padding: 14px 18px 16px;
}

.page-shell-home .participant-start-grid {
    min-height: calc(100vh - 178px);
    align-items: center;
    gap: 18px;
}

.page-shell-home .hero-copy,
.page-shell-home .form-card {
    padding: 22px 24px;
}

.page-shell-home .hero-copy {
    display: grid;
    align-content: center;
}

.page-shell-home .hero-copy h1 {
    margin-bottom: 12px;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.02;
}

.page-shell-home .lead {
    margin-bottom: 0;
    font-size: 1.02rem;
    line-height: 1.5;
    max-width: 58ch;
}

.page-shell-home .form-card h2 {
    margin-bottom: 8px;
}

.page-shell-home .form-card .support-copy {
    margin-bottom: 14px;
}

.page-shell-home .stack-form {
    gap: 14px;
}

.page-shell-home input,
.page-shell-home select {
    padding: 11px 13px;
}

.page-shell-home .primary-button {
    padding: 11px 18px;
}

.start-highlight-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.start-highlight-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(28, 105, 68, 0.12);
}

.start-highlight-card strong {
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.start-highlight-card span {
    color: var(--text-soft);
    line-height: 1.5;
}

.start-policy-card {
    margin-top: 24px;
    padding: 24px;
}

.step-list {
    margin: 0;
    padding-left: 22px;
    line-height: 1.7;
}

.start-policy-note {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(28, 105, 68, 0.12);
}

.start-policy-note h3 {
    margin: 0 0 8px;
}

.test-header,
.report-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.progress-pill,
.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(28, 105, 68, 0.08);
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.question-meta {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
}

.tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tag-accent) 12%, white);
    color: var(--text-main);
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(28, 105, 68, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    border-radius: inherit;
}

.answer-option:has(input:checked) {
    border-color: rgba(28, 105, 68, 0.45);
    background: rgba(28, 105, 68, 0.06);
}

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

.answer-option {
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.answer-option input {
    width: auto;
}

.form-actions,
.toolbar-actions,
.search-form,
.actions-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-actions {
    justify-content: space-between;
    margin-top: 6px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 0 0 22px;
}

.details-grid dt {
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
    color: var(--text-soft);
    margin-bottom: 6px;
}

.details-grid dd {
    margin: 0;
}

.primary-area {
    display: grid;
    gap: 6px;
    padding: 20px;
    border-radius: 20px;
    background: color-mix(in srgb, var(--accent) 7%, white);
    border-left: 5px solid var(--accent);
}

.primary-area h3,
.primary-area p {
    margin: 0;
}

.line-score-list,
.report-sections {
    display: grid;
    gap: 16px;
}

.line-score-item {
    display: grid;
    grid-template-columns: 120px 1fr 70px;
    gap: 14px;
    align-items: center;
}

.line-score-label {
    display: grid;
    gap: 2px;
}

.line-score-track {
    position: relative;
    height: 12px;
    border-radius: 999px;
    background: rgba(62, 45, 35, 0.08);
}

.line-score-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--line-color);
}

.line-score-point {
    position: absolute;
    top: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--line-color);
    border: 3px solid #fffaf4;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.interest-card header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.interest-card {
    border-left: 6px solid var(--interest-accent);
}

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

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

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(28, 105, 68, 0.12);
    background: rgba(255, 255, 255, 0.56);
    text-decoration: none;
    color: var(--text-main);
}

.admin-nav-link.is-active {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff9f2;
    border-color: transparent;
}

.admin-section-stack {
    display: grid;
    gap: 18px;
}

.inline-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.filter-grid {
    align-items: end;
}

.wide-field {
    grid-column: span 2;
}

.two-wide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filter-actions {
    display: flex;
    align-items: end;
}

.checkbox-field {
    display: flex !important;
    align-items: center;
    gap: 10px;
    align-self: end;
    padding-bottom: 10px;
}

.checkbox-field input {
    width: auto;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.86rem;
}

.status-badge.is-active {
    background: rgba(28, 105, 68, 0.12);
    color: var(--accent-strong);
}

.status-badge.is-inactive {
    background: rgba(138, 28, 28, 0.1);
    color: var(--danger);
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

.actions-cell form {
    margin: 0;
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: 65vh;
}

.auth-card {
    width: min(480px, 100%);
}

.auth-card-wide {
    width: min(560px, 100%);
}

.auth-action-button {
    width: 100%;
}

@media (max-width: 780px) {
    .site-header {
        padding: 18px;
    }

    .site-header-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .brand {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .brand-logo {
        width: min(300px, 72vw);
    }

    .brand-lockup {
        display: grid;
        gap: 4px;
        white-space: normal;
    }

    .site-header-utility {
        max-width: none;
        width: 100%;
        justify-items: start;
    }

    .header-utility-actions {
        justify-content: flex-start;
    }
}

@media print {
    body {
        background: #ffffff;
    }

    .site-header,
    .toolbar-actions,
    .note-card,
    .flash {
        display: none !important;
    }

    .page-shell {
        width: 100%;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #d0d0d0;
    }
}

@media (max-width: 960px) {
    .hero-grid,
    .report-grid,
    .recommendation-grid,
    .details-grid,
    .start-highlight-grid {
        grid-template-columns: 1fr;
    }

    .test-header,
    .report-toolbar,
    .site-header-main,
    .form-actions,
    .toolbar-actions,
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .site-header-utility {
        justify-items: stretch;
        min-width: 0;
    }

    .header-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }

    .line-score-item {
        grid-template-columns: 1fr;
    }

    .inline-form-grid,
    .two-wide-grid {
        grid-template-columns: 1fr;
    }

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

    .page-shell-home {
        min-height: auto;
        padding-bottom: 24px;
    }

    .page-shell-home .participant-start-grid {
        min-height: auto;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 20px, 1200px);
    }

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