:root {
    --bg: #f6f8fb;
    --panel: #ffffff;
    --text: #162033;
    --muted: #5f6b7a;
    --line: #dfe5ee;
    --primary: #0b6bcb;
    --primary-dark: #084f98;
    --accent: #16a085;
}

* {
    box-sizing: border-box;
}

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

a {
    color: inherit;
}

.container {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

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

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

.brand {
    font-weight: 700;
    text-decoration: none;
}

.site-nav a {
    color: var(--muted);
    font-size: 14px;
    text-decoration: none;
}

.hero {
    padding: 72px 0 48px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
    gap: 40px;
    align-items: center;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

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

h1 {
    max-width: 720px;
    margin-bottom: 20px;
    font-size: 46px;
    line-height: 1.15;
}

h2 {
    margin-bottom: 20px;
    font-size: 26px;
}

h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.lead {
    max-width: 720px;
    color: var(--muted);
    font-size: 19px;
}

.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
}

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

.button-primary:hover {
    background: var(--primary-dark);
}

.button-secondary {
    background: #eef3f8;
    color: var(--text);
}

.button-secondary:hover {
    background: #dde7f2;
}

.phase-note {
    color: var(--muted);
    font-size: 14px;
}

.summary-panel,
.checkpoint {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(21, 35, 58, 0.06);
}

.summary-panel {
    padding: 10px;
}

.summary-row {
    display: grid;
    gap: 4px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.summary-row:last-child {
    border-bottom: 0;
}

.summary-row span {
    color: var(--muted);
    font-size: 13px;
}

.summary-row strong {
    font-size: 17px;
}

.checkpoints {
    padding: 28px 0 72px;
}

.checkpoint-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.checkpoint {
    padding: 22px;
}

.checkpoint p {
    margin-bottom: 0;
    color: var(--muted);
}

.error-page {
    padding: 92px 0;
}

.page-section {
    padding: 56px 0 72px;
}

.narrow {
    max-width: 780px;
}

.form-shell {
    max-width: 980px;
}

.form-heading {
    margin-bottom: 26px;
}

.form-heading h1,
.page-section h1 {
    margin-bottom: 14px;
    font-size: 38px;
}

.alert {
    margin: 18px 0;
    padding: 14px 16px;
    border-radius: 8px;
    font-weight: 600;
}

.alert-error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

.info-list {
    display: grid;
    gap: 12px;
    margin: 28px 0;
}

.info-list > div {
    display: grid;
    gap: 4px;
    padding: 16px 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.info-list strong {
    font-size: 15px;
}

.info-list span {
    color: var(--muted);
}

.action-row,
.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.form-panel {
    padding: 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

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

.field {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.field span,
.consent-field span {
    font-size: 14px;
}

.field em,
.question-card legend em {
    color: #be123c;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.field input,
.field select,
.text-control {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

.text-control {
    resize: vertical;
}

.field-error {
    margin: 0;
    color: #be123c;
    font-size: 13px;
    font-weight: 700;
}

.consent-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 22px;
    color: var(--text);
    font-weight: 700;
}

.consent-field input {
    margin-top: 4px;
}

.progress-wrap {
    position: sticky;
    top: 0;
    z-index: 5;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(21, 35, 58, 0.08);
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 14px;
}

.progress-meta strong {
    color: var(--text);
}

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

.progress-track span {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
    transition: width 160ms ease;
}

.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 22px;
}

.category-nav a {
    padding: 8px 10px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.category-section {
    margin-bottom: 28px;
}

.category-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.category-heading h2 {
    margin-bottom: 0;
}

.category-heading > span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.question-card {
    margin: 0 0 12px;
    padding: 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.question-card.is-invalid {
    border-color: #fb7185;
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.14);
}

.question-card[hidden] {
    display: none;
}

.question-card legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.45;
}

.question-card legend span {
    color: var(--primary);
    font-size: 13px;
}

.question-help {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 14px;
}

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

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 48px;
    padding: 12px;
    border: 1px solid #d7dee8;
    border-radius: 8px;
    background: #fbfcfe;
    cursor: pointer;
}

.option-item:has(input:checked) {
    border-color: var(--primary);
    background: #eff6ff;
}

.option-item input {
    flex: 0 0 auto;
    margin-top: 4px;
}

.option-item span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.sticky-submit {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding: 14px 0;
    background: linear-gradient(to top, var(--bg) 75%, rgba(246, 248, 251, 0));
}

.site-footer {
    background: #ffffff;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    padding: 24px 0;
}

.site-footer p {
    margin-bottom: 0;
}

.report-shell {
    padding-top: 44px;
}

.report-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 24px;
}

.report-header h1 {
    margin-bottom: 12px;
}

.report-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
}

.report-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.report-meta > div,
.score-overview,
.recommendation-card,
.score-table,
.gap-item,
.action-checklist article,
.source-grid a,
.gate-alert {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.report-meta > div {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
}

.report-meta strong,
.report-meta span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.report-meta span {
    color: var(--muted);
}

.report-section {
    margin-top: 28px;
}

.section-heading {
    margin-bottom: 14px;
}

.section-heading h2 {
    margin-bottom: 0;
}

.score-overview {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr) minmax(180px, 0.6fr);
    gap: 18px;
    padding: 22px;
}

.score-main {
    display: grid;
    gap: 8px;
}

.score-main span,
.gate-summary span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.score-main strong {
    font-size: 54px;
    line-height: 1;
}

.score-meter,
.score-bar {
    height: 10px;
    overflow: hidden;
    background: #e7edf5;
    border-radius: 999px;
}

.score-meter span,
.score-bar span {
    display: block;
    height: 100%;
    background: var(--primary);
    border-radius: inherit;
}

.score-meter.compact {
    height: 8px;
    margin: 8px 0 16px;
}

.grade-panel h2 {
    margin: 12px 0 8px;
}

.grade-panel p {
    margin-bottom: 0;
    color: var(--muted);
}

.grade-badge,
.rank-badge,
.gap-item > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.grade-badge {
    background: #e8f7f2;
    color: #08745d;
}

.rank-badge {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    background: var(--primary);
    color: #ffffff;
}

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

.gate-summary > div {
    display: grid;
    place-items: center;
    padding: 16px 10px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.gate-summary strong {
    font-size: 30px;
    line-height: 1;
}

.gate-alert {
    padding: 18px 20px;
}

.gate-alert h2 {
    margin-bottom: 8px;
    font-size: 20px;
}

.gate-alert p {
    margin-bottom: 0;
    color: var(--muted);
}

.gate-alert.is-critical {
    border-color: #fecdd3;
    background: #fff1f2;
}

.gate-alert.is-warning {
    border-color: #fde68a;
    background: #fffbeb;
}

.recommendation-list {
    display: grid;
    gap: 14px;
}

.recommendation-card {
    padding: 20px;
}

.recommendation-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: flex-start;
}

.recommendation-head h3 {
    margin-bottom: 4px;
}

.recommendation-head p,
.recommendation-detail p {
    margin-bottom: 0;
    color: var(--muted);
}

.recommendation-head > strong {
    white-space: nowrap;
}

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

.recommendation-detail h4 {
    margin: 0 0 8px;
    font-size: 15px;
}

.recommendation-detail ul {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

.recommendation-detail li + li {
    margin-top: 6px;
}

.score-table {
    overflow: hidden;
}

.score-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.2fr) minmax(160px, 0.8fr);
    gap: 18px;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.score-row:last-child {
    border-bottom: 0;
}

.score-row > div {
    display: grid;
    gap: 4px;
}

.score-row span {
    color: var(--muted);
    font-size: 14px;
}

.score-row-meter {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.score-bar.is-good span {
    background: #16a085;
}

.score-bar.is-ok span {
    background: var(--primary);
}

.score-bar.is-warning span {
    background: #d97706;
}

.score-bar.is-danger span {
    background: #dc2626;
}

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

.gap-list,
.action-checklist {
    display: grid;
    gap: 10px;
}

.gap-item {
    padding: 16px;
}

.gap-item > span {
    margin-bottom: 10px;
    background: #eef3f8;
    color: var(--muted);
}

.gap-item.is-high {
    border-color: #fecdd3;
}

.gap-item.is-high > span {
    background: #fff1f2;
    color: #be123c;
}

.gap-item.is-medium > span {
    background: #fffbeb;
    color: #92400e;
}

.gap-item h3 {
    margin-bottom: 6px;
}

.gap-item p {
    margin-bottom: 0;
    color: var(--muted);
}

.action-checklist article {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
}

.action-checklist article > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #eef3f8;
    color: var(--primary);
    font-weight: 800;
}

.action-checklist strong,
.action-checklist em,
.action-checklist p {
    display: block;
}

.action-checklist em {
    color: var(--accent);
    font-size: 13px;
    font-style: normal;
    font-weight: 800;
}

.action-checklist p {
    margin: 4px 0 0;
    color: var(--muted);
}

.source-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.source-grid a {
    display: grid;
    gap: 6px;
    min-height: 118px;
    padding: 16px;
    text-decoration: none;
}

.source-grid span,
.source-grid em {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.source-grid strong {
    overflow-wrap: anywhere;
}

.empty-state {
    margin: 0;
    padding: 18px;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: var(--muted);
}

@media (max-width: 760px) {
    .container {
        width: min(100% - 28px, 1120px);
    }

    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding: 14px 0;
    }

    .hero {
        padding: 44px 0 28px;
    }

    .hero-grid,
    .checkpoint-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 34px;
    }

    .lead {
        font-size: 17px;
    }

    .form-heading h1,
    .page-section h1 {
        font-size: 30px;
    }

    .form-grid,
    .option-grid {
        grid-template-columns: 1fr;
    }

    .form-panel,
    .question-card {
        padding: 18px;
    }

    .category-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .sticky-submit {
        align-items: stretch;
        flex-direction: column;
    }

    .report-header,
    .report-actions {
        flex-direction: column;
    }

    .report-actions,
    .report-actions .button {
        width: 100%;
    }

    .report-meta,
    .score-overview,
    .recommendation-detail,
    .score-row,
    .report-grid,
    .source-grid {
        grid-template-columns: 1fr;
    }

    .score-main strong {
        font-size: 42px;
    }

    .recommendation-head {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .recommendation-head > strong {
        grid-column: 2;
    }
}
