:root {
    --ink: #1c2b28;
    --muted: #5c6b66;
    --teal: #0b6e5e;
    --teal-deep: #084f44;
    --teal-soft: #e7f4f0;
    --paper: #f4f6f5;
    --card: #ffffff;
    --line: #e2e6e4;
    --gold: #8a5a1e;
    --danger: #9f2d2d;
    --danger-soft: #fdecec;
    --shadow: none;
    --serif: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    --sans: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    --radius: 12px;
    --dock: calc(88px + env(safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
/* Hide reCAPTCHA v3 badge; branding noted in the page footer (Google requirement). */
.grecaptcha-badge {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; }
button, input, select, textarea {
    font: inherit;
    color: inherit;
    /* Keep 16px+ so iOS Safari does not zoom on focus. */
    font-size: 16px;
}
h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 8px; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 12px; }
a { color: var(--teal-deep); }
.skip {
    position: absolute;
    left: 12px;
    top: -40px;
    background: #fff;
    padding: 8px 12px;
    z-index: 5;
}
.skip:focus { top: 8px; }

.preview-bar {
    margin: 0;
    background: #24312e;
    color: #f4f6f5;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 16px;
}
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    width: min(1040px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 64px;
    display: flex;
    align-items: center;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ink);
}
.brand img { width: 44px; height: 44px; display: block; }
.brand-text { display: flex; flex-direction: column; gap: 1px; line-height: 1.15; }
.brand-text strong { font-size: 0.98rem; letter-spacing: -0.02em; }
.brand-text span { font-size: 0.75rem; font-weight: 600; color: var(--muted); }

.wrap {
    width: min(1040px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 48px;
}
.confirm {
    width: min(640px, 100%);
    margin-left: auto;
    margin-right: auto;
}
.visit {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 8px;
}
.visit h1 { margin-bottom: 8px; font-size: 1.55rem; }
.visit-lead { margin: 0 0 16px; max-width: 42rem; color: var(--muted); }
.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.pills li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
}
.meet-icon { display: block; flex: none; width: 20px; height: auto; }
.visit-fee {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    white-space: nowrap;
}
.emergency {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 16px;
    padding: 12px 14px;
    background: #fdecec;
    border: 1px solid #f3b4b4;
    border-left: 4px solid #c62828;
    border-radius: 10px;
    color: #8f1d1d;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.45;
}
.emergency-mark {
    flex: none;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border-radius: 50%;
    background: #c62828;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
}
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
}
.side {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 16px 8px;
    position: sticky;
    top: 12px;
}
.side h2 { font-size: 0.95rem; margin-bottom: 12px; }
.fee-card { margin-top: 8px; }
.fee-paid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: var(--teal-soft);
    border-radius: 12px;
    padding: 12px 14px;
}
.fee-paid-label {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--teal-deep);
}
.fee-paid-meta {
    margin: 4px 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
}
.fee-paid-meta .meet-icon { width: 16px; height: auto; }
.fee-paid-amount {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 750;
    color: var(--teal-deep);
    white-space: nowrap;
}
.fee-follow {
    margin-top: 12px;
    padding: 0 2px;
}
.fee-follow.is-solo { margin-top: 0; }
.fee-follow-title {
    margin: 0 0 8px;
    font-size: 0.88rem;
    font-weight: 700;
}
.fee-follow-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}
.fee-follow-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 10px 12px;
    font-size: 0.9rem;
}
.fee-follow-list li + li { border-top: 1px solid var(--line); }
.fee-follow-list span { color: var(--muted); font-weight: 500; }
.fee-follow-list strong { font-weight: 700; white-space: nowrap; }
.fee-note { color: var(--muted); font-size: 0.8rem; margin: 8px 0 0; line-height: 1.4; }
.flow {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.flow li { position: relative; min-width: 0; }
.flow li:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 28px;
    bottom: 2px;
    width: 2px;
    background: #d5e6e1;
}
.flow-node {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 0 0 14px;
    background: transparent;
    border: 0;
}
.flow-ico {
    width: 28px;
    height: 28px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--teal-soft);
    color: var(--teal-deep);
    position: relative;
    z-index: 1;
}
.flow-ico svg { width: 18px; height: 18px; }
.flow-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding-top: 3px; }
.flow-copy strong { font-size: 0.9rem; }
.flow-copy span { color: var(--muted); font-size: 0.8rem; }
.flow-arrow { display: none; }
.flow li.is-done .flow-copy { color: var(--muted); }
.flow li.is-current .flow-ico { background: var(--teal); color: #fff; }
.flow li.is-current .flow-copy strong { color: var(--teal-deep); }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    position: relative;
}
.progress {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0 0 22px;
}
.progress li {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #8b9692;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--line);
}
.step-mark {
    width: 20px;
    height: 20px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1.5px solid #c9d1cd;
    background: #fff;
    color: #8b9692;
    font-size: 0.72rem;
    line-height: 1;
}
.progress li.is-current { color: var(--teal-deep); border-color: var(--teal); }
.progress li.is-current .step-mark {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}
.progress li.is-done { color: var(--teal-deep); border-color: var(--teal); cursor: pointer; }
.progress li.is-done .step-mark {
    background: var(--teal);
    border-color: var(--teal);
    color: transparent;
    font-size: 0;
}
.progress li.is-done .step-mark::after {
    content: "";
    width: 8px;
    height: 4px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translate(0, -1px);
}
.step { display: none; }
.step.is-active { display: block; }
.step-lead { color: var(--muted); }
.confirm-note {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #99d5c8;
    background: #eefaf6;
    color: #0b4f44;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.45;
}

.date-field { position: relative; }
.date-field input[type="date"] {
    cursor: pointer;
    position: relative;
    padding-right: 42px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%230b6e5e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='2.5' y='3.5' width='13' height='12' rx='2'/><path d='M2.5 7.5h13M6 2.2v2.6M12 2.2v2.6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;
}
.date-field input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
    opacity: 0;
}
.field { margin: 0 0 16px; }
.field label, .field legend {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}
.optional { color: var(--muted); font-weight: 500; font-size: 0.82rem; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 6px 0 0; }
.field.is-low textarea {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.14);
}
.field.is-low .hint {
    color: #b45309;
    font-weight: 600;
}
.error { color: var(--danger); font-size: 0.85rem; font-weight: 600; min-height: 0; margin: 6px 0 0; }
.error:empty { display: none; }
input[type="text"], input[type="tel"], input[type="email"], input[type="date"], select, textarea {
    width: 100%;
    border: 1px solid #d5dbd8;
    background: #fff;
    border-radius: 8px;
    padding: 12px 14px;
    min-height: 48px;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: 3px solid rgba(11, 110, 94, 0.25);
    border-color: var(--teal);
}
.is-invalid input, .is-invalid select, .is-invalid textarea, .is-invalid .choices {
    border-color: var(--danger);
}
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
    position: relative;
    display: block;
    border: 1px solid #d5dbd8;
    border-radius: 14px;
    background: #fff;
    min-height: 64px;
    cursor: pointer;
}
.choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}
.choice span {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 64px;
    padding: 10px 12px;
    font-weight: 700;
}
.choice small { font-weight: 500; color: var(--muted); font-size: 0.78rem; }
/* Class toggled in JS — works without :has() (older Safari / some WebViews). */
.choice.is-on {
    border-color: var(--teal);
    background: var(--teal-soft);
    box-shadow: inset 0 0 0 1px var(--teal);
}
.choice.is-on small { color: var(--teal-deep); }
.choice:focus-within { outline: 3px solid rgba(11, 110, 94, 0.25); }
@supports selector(:has(*)) {
    .choice:has(input:checked) {
        border-color: var(--teal);
        background: var(--teal-soft);
        box-shadow: inset 0 0 0 1px var(--teal);
    }
    .choice:has(input:checked) small { color: var(--teal-deep); }
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.split-3 { grid-template-columns: 1fr 1fr 1fr; }
.group { margin: 18px 0 10px; font-size: 0.95rem; }

.review-title, .next-title { margin: 8px 0 10px; }
.summary { margin: 0 0 18px; }
.summary div {
    display: grid;
    grid-template-columns: 9.5rem 1fr;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}
.summary dt { color: var(--muted); font-size: 0.85rem; }
.summary dd { margin: 0; font-weight: 600; }
.summary .is-total dd { color: var(--teal-deep); font-size: 1.15rem; }
.summary .is-block { grid-template-columns: 1fr; }
.summary .is-block dd { font-weight: 500; white-space: pre-wrap; }

.terms { margin: 4px 0 14px; }
.terms .fee-card { margin-top: 12px; }
.terms .fee-note { margin-bottom: 0; }
.lead { color: var(--ink); }
.terms ul { margin: 0 0 12px; padding-left: 18px; }
.terms li { margin: 0 0 8px; }
.terms-callout {
    background: var(--teal-soft);
    border-radius: 12px;
    padding: 12px 14px;
}
.terms-callout p { margin: 0; }
.check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-weight: 600;
}
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--teal); flex: none; }

.dock {
    display: flex;
    gap: 10px;
    margin: 18px -22px -22px;
    padding: 12px 22px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 252, 248, 0.96);
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--radius) var(--radius);
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}
.btn-primary { background: var(--teal); color: #fff; flex: 1; }
.btn-primary:hover { background: var(--teal-deep); }
.btn-ghost { background: #fff; border-color: #d9d0c4; color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible, .text-btn:focus-visible, a:focus-visible { outline: 3px solid rgba(11, 110, 94, 0.35); outline-offset: 2px; }

.faq { margin-top: 36px; }
.faq dt { font-weight: 700; margin-top: 14px; }
.faq dd { margin: 4px 0 0; color: var(--muted); }

.confirm { padding-bottom: 22px; }
.success-hero { margin-bottom: 8px; }
.success-kicker {
    margin: 0 0 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--teal-deep);
}
.success-hero h1 { margin: 0 0 8px; }
.success-ref {
    margin: 10px 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}
.success-ref strong { color: var(--ink); }
.records-cta {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 14px;
    align-items: center;
    background: var(--teal-soft);
    border-radius: 14px;
    padding: 16px;
    margin: 14px 0 18px;
}
.records-cta img { width: 72px; height: 72px; border-radius: 14px; }
.records-cta h2 { margin: 0 0 6px; font-size: 1.05rem; }
.records-cta p { margin: 0 0 10px; color: var(--ink); font-size: 0.92rem; }
.records-cta .btn { width: 100%; max-width: 280px; }
.records-missing { margin: 0; color: var(--muted); font-size: 0.88rem; }
.success-next, .success-follow { margin-top: 8px; }
.next-steps {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}
.next-steps li {
    display: grid;
    gap: 2px;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
}
.next-steps li:first-child { border-top: 0; }
.next-steps li strong { font-size: 0.95rem; }
.next-steps li span { color: var(--muted); font-size: 0.82rem; }
.next-steps li.is-done { background: #f6faf8; }
.next-steps li.is-done strong { color: var(--teal-deep); }
.next-steps li.is-current {
    background: var(--teal-soft);
    box-shadow: inset 3px 0 0 var(--teal);
}
.success-follow .fee-follow-list { margin-top: 0; }
.success-foot {
    margin: 20px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.success-foot .btn { width: 100%; }
.link-line {
    font-size: 0.85rem;
    word-break: break-all;
    color: var(--teal-deep);
    background: #fff;
    border-radius: 8px;
    padding: 8px 10px;
}
.records-cta .btn { margin-top: 8px; }
.next-list { margin: 0 0 12px; padding-left: 18px; }
.next-list li { margin: 0 0 6px; }
.followup-note { color: var(--muted); font-size: 0.92rem; }
.actions { display: flex; gap: 16px; align-items: center; }
.text-btn { background: none; border: 0; padding: 0; color: var(--teal-deep); font-weight: 700; cursor: pointer; }

.upload-block {
    border-top: 1px solid var(--line);
    padding: 14px 0;
}
.upload-block h2 { font-size: 1.2rem; }
.upload-block p { color: var(--muted); }
.file-list { list-style: none; padding: 0; margin: 10px 0 0; }
.file-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    margin-top: 8px;
}
.file-list button { border: 0; background: none; color: var(--danger); font-weight: 700; cursor: pointer; }

.site-foot {
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    padding: 8px 16px 28px;
}
.site-foot .recaptcha-note {
    margin: 8px auto 0;
    max-width: 36rem;
    font-size: 0.72rem;
    line-height: 1.4;
    font-weight: 500;
}
.site-foot .recaptcha-note a { color: inherit; text-decoration: underline; }
input[type="date"] {
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
}
input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
}
/* Larger tap targets on touch devices */
@media (pointer: coarse) {
    .choice { min-height: 72px; }
    .btn { min-height: 48px; }
}

@media (max-width: 860px) {
    .layout { grid-template-columns: 1fr; }
    .side { position: static; }
}
@media (max-width: 640px) {
    .split, .split-3 { grid-template-columns: 1fr; }
    .summary div { grid-template-columns: 1fr; gap: 2px; }
    .card { padding: 16px; }
    .dock { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
    .progress li {
        flex-direction: column;
        gap: 4px;
        font-size: 0.7rem;
        line-height: 1.15;
    }
    .visit { align-items: flex-start; }
    .records-cta { grid-template-columns: 1fr; }
    .records-cta img { width: 72px; height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
