:root {
    color-scheme: light;
    --ink: #17211d;
    --muted: #68736d;
    --paper: #f5f6f2;
    --surface: #ffffff;
    --line: #dfe4df;
    --green: #165c45;
    --green-light: #e5f1eb;
    --red: #a6382d;
    --red-light: #f8e9e6;
    --amber: #94600a;
    --amber-light: #fff2d8;
    --shadow: 0 18px 46px rgba(22, 43, 34, 0.08);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(90deg, transparent calc(100% - 1px), rgba(23, 33, 29, 0.035) 1px),
        radial-gradient(circle at 88% 2%, rgba(49, 121, 92, 0.1), transparent 25rem),
        var(--paper);
    background-size: 72px 72px, auto, auto;
    min-width: 320px;
}

button, input { font: inherit; }
button { color: inherit; }

a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
    outline: 3px solid rgba(22, 92, 69, 0.28);
    outline-offset: 3px;
}

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

.site-header {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(23, 33, 29, 0.11);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 0.035em;
}

.brand b { font-weight: 650; }

.brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    color: white;
    background: var(--green);
    font-weight: 750;
}

.source-health {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 13px;
}

.main-navigation {
    display: flex;
    align-items: center;
    gap: 6px;
}

.main-navigation a {
    padding: 8px 11px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 650;
}

.main-navigation a:hover, .main-navigation a.is-active {
    color: var(--green);
    background: rgba(22, 92, 69, 0.08);
}

.health-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a0a9a4;
    box-shadow: 0 0 0 4px rgba(160, 169, 164, 0.14);
}

.source-health.is-ready .health-dot {
    background: #2c8a63;
    box-shadow: 0 0 0 4px rgba(44, 138, 99, 0.14);
}

.source-health.is-unavailable .health-dot {
    background: var(--red);
    box-shadow: 0 0 0 4px rgba(166, 56, 45, 0.12);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.72fr);
    column-gap: 7vw;
    align-items: end;
    padding: 58px 0 42px;
}

.eyebrow, .step-label {
    margin: 0 0 18px;
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(43px, 5vw, 64px);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.045em;
}

.hero h1 span { color: var(--green); }

.hero-copy {
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.62;
}

.hero-copy > p { margin: 0; }

.hero-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 22px 0 0;
    padding: 17px 0 0;
    border-top: 1px solid rgba(23, 33, 29, 0.12);
    list-style: none;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.025em;
}

.hero-facts li::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 8px 1px 0;
    border-radius: 50%;
    background: var(--green);
}

.screening-card {
    padding: 36px 40px;
    border: 1px solid rgba(23, 33, 29, 0.08);
    border-radius: 6px 24px 24px 24px;
    background: rgba(255, 255, 255, 0.93);
    box-shadow: var(--shadow);
}

.card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.card-heading h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 570;
    letter-spacing: -0.025em;
}

.secure-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 7px;
    color: var(--muted);
    font-size: 12px;
}

.secure-note span { color: var(--green); font-size: 9px; }

.subject-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 30px 0 28px;
    padding: 6px;
    border-radius: 15px;
    background: #eef0ed;
}

.subject-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    transition: background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.subject-option.is-active {
    color: var(--green);
    background: white;
    box-shadow: 0 3px 14px rgba(26, 48, 39, 0.08);
}

.option-icon {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border: 1px solid currentColor;
    border-radius: 8px;
    font-size: 11px;
}

.fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 0.8fr;
    gap: 18px;
}

.organization-fields { grid-template-columns: 1fr; }
.field-wide { max-width: 720px; }

.field { display: grid; gap: 10px; }

.field > span {
    font-size: 13px;
    font-weight: 650;
}

.field em {
    margin-left: 6px;
    color: #8b948f;
    font-size: 10px;
    font-style: normal;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.field input {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    border: 1px solid #ccd3ce;
    border-radius: 11px;
    outline: none;
    color: var(--ink);
    background: #fbfcfa;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field input::placeholder { color: #a3aba7; }

.field input:focus {
    border-color: var(--green);
    background: white;
    box-shadow: 0 0 0 4px rgba(22, 92, 69, 0.1);
}

.field input.is-invalid { border-color: var(--red); }

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-top: 28px;
    padding-top: 23px;
    border-top: 1px solid var(--line);
}

.form-footer p {
    max-width: 540px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.primary-button, .secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    min-height: 54px;
    padding: 0 19px 0 24px;
    border: 1px solid var(--green);
    border-radius: 11px;
    cursor: pointer;
    font-weight: 650;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-button {
    color: white;
    background: var(--green);
    box-shadow: 0 10px 20px rgba(22, 92, 69, 0.16);
}

.primary-button:hover, .secondary-button:hover { transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: 0.7; transform: none; }

.button-arrow {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: var(--green);
    background: white;
}

.form-message {
    margin-top: 22px;
    padding: 14px 16px;
    border: 1px solid #efc9c3;
    border-radius: 10px;
    color: #822d25;
    background: #fff4f2;
    font-size: 13px;
}

.upload-zone {
    display: grid;
    place-items: center;
    min-height: 190px;
    margin-top: 28px;
    padding: 28px;
    border: 2px dashed #bdc9c2;
    border-radius: 16px;
    color: var(--muted);
    background: #fafbf9;
    text-align: center;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
}

.upload-zone:hover, .upload-zone.is-dragging {
    border-color: var(--green);
    background: var(--green-light);
}

.upload-zone.is-disabled {
    cursor: wait;
    opacity: 0.65;
}

.upload-zone.is-disabled:hover {
    border-color: #b9c4bd;
    background: #fafbf9;
}

.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-zone strong { display: block; margin-bottom: 7px; color: var(--ink); font-size: 17px; }
.upload-zone small { display: block; margin-top: 8px; font-size: 11px; }

.format-help {
    margin-top: 22px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafbf9;
}

.format-help summary { padding: 14px 16px; color: var(--green); cursor: pointer; font-size: 13px; font-weight: 650; }
.format-help-content { padding: 0 16px 16px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.format-help-content code { display: block; overflow-x: auto; margin: 10px 0; padding: 12px; border-radius: 8px; color: var(--ink); background: #eef0ed; white-space: pre; }
.text-link { color: var(--green); font-weight: 650; text-underline-offset: 3px; }

.file-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fafbf9;
}

.file-summary strong, .file-summary span { display: block; }
.file-summary span { margin-top: 3px; color: var(--muted); font-size: 12px; }

.progress-panel {
    margin-top: 20px;
    padding: 17px;
    border: 1px solid #bad3c7;
    border-radius: 12px;
    color: var(--green);
    background: #f3f8f5;
}

.progress-panel.is-complete { border-color: #9bc5af; }
.progress-panel.is-error { border-color: #e3b6b0; color: var(--red); background: #fff6f4; }
.progress-heading { display: flex; justify-content: space-between; gap: 18px; font-size: 13px; }
.progress-heading span { font-variant-numeric: tabular-nums; }
.progress-track { height: 4px; margin: 13px 0; overflow: hidden; border-radius: 2px; background: rgba(22, 92, 69, 0.12); }
.progress-track span { display: block; width: 35%; height: 100%; border-radius: inherit; background: currentColor; animation: progress-indeterminate 1.3s ease-in-out infinite; }
.progress-panel.is-complete .progress-track span, .progress-panel.is-error .progress-track span { width: 100%; animation: none; }
.progress-panel ol { display: grid; gap: 5px; margin: 0; padding-left: 20px; color: var(--muted); font-size: 11px; line-height: 1.45; }

@keyframes progress-indeterminate {
    from { transform: translateX(-110%); }
    to { transform: translateX(300%); }
}

.result-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.overview-item { padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.overview-item span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.overview-item strong { font-size: 24px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: white; }
.bulk-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bulk-table th { padding: 13px 15px; color: var(--muted); background: #f4f6f3; text-align: left; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.bulk-table td { padding: 14px 15px; border-top: 1px solid var(--line); vertical-align: top; }
.bulk-result-table { margin-top: 14px; }
.result-group-row td { padding: 10px 15px; color: var(--muted); background: #eef1ee; font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.result-group-LikelyMatch td { color: var(--red); background: var(--red-light); }
.result-group-PotentialMatch td { color: var(--amber); background: var(--amber-light); }
.decision-badge { display: inline-flex; padding: 5px 8px; border-radius: 7px; color: var(--green); background: var(--green-light); font-size: 11px; font-weight: 700; white-space: nowrap; }
.decision-badge.is-warning { color: var(--amber); background: var(--amber-light); }
.decision-badge.is-danger { color: var(--red); background: var(--red-light); }
.match-list-compact { margin: 7px 0 0; padding-left: 17px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.result-section { padding-top: 68px; }

.section-divider {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 26px;
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.section-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.result-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px 24px 24px 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.result-summary {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 32px 36px;
    border-bottom: 1px solid var(--line);
    box-shadow: inset 5px 0 0 var(--green);
}

.result-card.is-warning .result-summary { box-shadow: inset 5px 0 0 var(--amber); }
.result-card.is-danger .result-summary { box-shadow: inset 5px 0 0 var(--red); }

.decision-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 4px solid white;
    border-radius: 50%;
    color: var(--green);
    background: var(--green-light);
    font-size: 24px;
    font-weight: 750;
    box-shadow: 0 0 0 1px rgba(22, 92, 69, 0.12);
}

.result-card.is-warning .decision-icon { color: var(--amber); background: var(--amber-light); }
.result-card.is-danger .decision-icon { color: var(--red); background: var(--red-light); }

.decision-copy h2 { margin: 0 0 5px; font-size: 23px; letter-spacing: -0.02em; }
.decision-copy p { margin: 0; color: var(--muted); font-size: 14px; }

.result-actions { display: flex; gap: 9px; }

.secondary-button {
    min-height: 44px;
    padding: 0 16px;
    gap: 9px;
    color: var(--green);
    background: white;
    font-size: 13px;
}

.result-body { padding: 34px 36px 38px; }

.result-metadata {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin-bottom: 32px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--line);
}

.metadata-item { padding: 17px 18px; background: #fafbf9; }
.metadata-item span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; }
.metadata-item strong { font-size: 14px; font-weight: 650; }

.match-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 14px; }
.match-heading h3 { margin: 0; font-size: 16px; }
.match-heading span { color: var(--muted); font-size: 12px; }

.match-list { display: grid; gap: 12px; }

.match-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fcfdfb;
}

.match-card summary {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 18px;
    align-items: center;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
}

.match-card summary::-webkit-details-marker { display: none; }
.match-name strong { display: block; margin-bottom: 4px; font-size: 15px; }
.match-name span { color: var(--muted); font-size: 12px; }
.match-score { color: var(--red); font-size: 14px; font-weight: 700; }
.match-toggle { color: var(--green); font-size: 19px; transition: transform 150ms ease; }
.match-card[open] .match-toggle { transform: rotate(45deg); }

.match-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
    padding: 0 20px 22px;
    border-top: 1px solid var(--line);
}

.detail-group { padding-top: 18px; }
.detail-group h4 { margin: 0 0 8px; color: var(--muted); font-size: 10px; letter-spacing: 0.09em; text-transform: uppercase; }
.detail-group p, .detail-group ul { margin: 0; font-size: 13px; line-height: 1.55; }
.detail-group ul { padding-left: 18px; }
.detail-group a { color: var(--green); overflow-wrap: anywhere; }

.notice {
    margin: 28px 0 0;
    padding: 16px 18px;
    border-left: 3px solid #9fa9a4;
    color: var(--muted);
    background: #f6f7f5;
    font-size: 12px;
    line-height: 1.55;
}

.source-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.source-chip { padding: 7px 10px; border-radius: 8px; color: #526059; background: #edf0ed; font-size: 11px; }

.empty-matches {
    padding: 24px;
    border: 1px dashed #cbd3ce;
    border-radius: 13px;
    color: var(--muted);
    background: #fafbf9;
    font-size: 14px;
}

.use-notes {
    display: grid;
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.8fr);
    gap: 42px 64px;
    margin-top: 76px;
    padding: 40px 0 34px;
    border-top: 1px solid rgba(23, 33, 29, 0.18);
    border-bottom: 1px solid rgba(23, 33, 29, 0.18);
}

.notes-intro h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(25px, 3vw, 35px);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.025em;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}

.notes-grid section {
    padding-left: 17px;
    border-left: 1px solid #c9d0cb;
}

.note-number {
    display: block;
    margin-bottom: 18px;
    color: var(--green);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
    font-style: italic;
}

.notes-grid h3 {
    margin: 0 0 9px;
    font-size: 13px;
    letter-spacing: -0.01em;
}

.notes-grid p, .source-credit {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.62;
}

.source-credit {
    grid-column: 2;
    padding: 18px 20px;
    border: 1px solid rgba(23, 33, 29, 0.09);
    background: rgba(255, 255, 255, 0.55);
}

.source-credit a { color: var(--green); text-underline-offset: 2px; }

footer {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: end;
    gap: 20px;
    padding: 30px 0 36px;
    color: #818b86;
    font-size: 11px;
}

footer > div { display: grid; gap: 4px; }
footer strong { color: #59645e; font-size: 12px; }
footer div span { max-width: 350px; line-height: 1.45; }
.copyright { white-space: nowrap; }

.legal-links {
    display: flex;
    gap: 20px;
}

.legal-links a {
    color: inherit;
    text-underline-offset: 3px;
    transition: color 150ms ease;
}

.legal-links a:hover { color: var(--green); }

.no-script-message {
    margin-top: 24px;
    padding: 14px 17px;
    border: 1px solid #e7c577;
    border-radius: 11px;
    color: #704a08;
    background: var(--amber-light);
    font-size: 13px;
    line-height: 1.55;
}

.no-script-message strong { margin-right: 4px; }

[hidden] { display: none !important; }

@media (max-width: 820px) {
    .hero { grid-template-columns: 1fr; gap: 22px; padding-top: 44px; }
    .hero-copy { grid-column: 1; grid-row: auto; max-width: 650px; }
    .fields-grid { grid-template-columns: 1fr 1fr; }
    .field:last-child { grid-column: 1 / -1; }
    .result-summary { grid-template-columns: auto 1fr; }
    .result-actions { grid-column: 1 / -1; padding-left: 72px; }
    .use-notes { grid-template-columns: 1fr; gap: 30px; }
    .source-credit { grid-column: 1; }
    footer { grid-template-columns: 1fr auto; }
    .copyright { grid-column: 1 / -1; }
}

@media (max-width: 590px) {
    .page-shell { width: min(100% - 28px, 1160px); }
    .site-header { min-height: 66px; }
    .source-health span:last-child { display: none; }
    .brand > span:last-child { display: none; }
    .main-navigation a { padding: 7px 8px; font-size: 11px; }
    .hero { padding: 38px 0 32px; }
    .hero h1 { font-size: clamp(43px, 14vw, 64px); }
    .hero-copy { font-size: 15px; }
    .screening-card { padding: 24px 20px; border-radius: 18px; }
    .secure-note { display: none; }
    .subject-switch { grid-template-columns: 1fr; }
    .fields-grid { grid-template-columns: 1fr; }
    .field:last-child { grid-column: auto; }
    .form-footer { align-items: stretch; flex-direction: column; }
    .primary-button { width: 100%; justify-content: space-between; }
    .result-section { padding-top: 48px; }
    .result-card { border-radius: 18px; }
    .result-summary { grid-template-columns: auto 1fr; padding: 24px 20px; }
    .decision-icon { width: 45px; height: 45px; border-radius: 13px; }
    .result-actions { padding-left: 0; }
    .secondary-button { flex: 1; }
    .result-body { padding: 25px 20px 28px; }
    .result-metadata { grid-template-columns: 1fr; }
    .match-card summary { grid-template-columns: 1fr auto; }
    .match-score { grid-row: 2; }
    .match-toggle { grid-column: 2; grid-row: 1 / span 2; }
    .match-details { grid-template-columns: 1fr; gap: 0; }
    .use-notes { margin-top: 54px; padding-top: 32px; }
    .notes-grid { grid-template-columns: 1fr; }
    .notes-grid section { padding: 0 0 18px 17px; }
    footer { grid-template-columns: 1fr; align-items: start; }
    .legal-links { margin-top: 4px; }
    .copyright { grid-column: 1; }
    .result-overview { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; }
}
