:root {
  color-scheme: light;
  --navy: #073894;
  --blue: #0b55e7;
  --bright: #7464e9;
  --mint: #24d2a4;
  --aqua: #55d9d2;
  --orange: #ff7a24;
  --orange-bright: #ff9a43;
  --green: #19c995;
  --red: #e54a24;
  --ink: #0b245b;
  --muted: #5f6f87;
  --line: #dbe9f1;
  --paper: #ffffff;
  --wash: #f4fbfb;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 6% 7%, rgba(11,85,231,.1) 0 1.5px, transparent 1.8px) 0 0 / 18px 18px,
    radial-gradient(circle at 96% 16%, rgba(36,210,164,.16), transparent 25rem),
    radial-gradient(circle at 3% 46%, rgba(116,100,233,.09), transparent 23rem),
    linear-gradient(135deg, #f8fcff 0%, #f4fbfb 48%, #f8fdff 100%);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.hero {
  position: relative;
  padding-top: env(safe-area-inset-top);
  color: #fff;
  background: #fff;
  box-shadow: 0 18px 46px rgba(7,56,148,.14);
}
.hero__art {
  width: min(1200px, 100%);
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
}
.hero__art img { display: block; width: 100%; height: auto; }
.hero__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  width: min(980px, calc(100% - 28px));
  margin: -1px auto 0;
  padding: 19px 24px 21px;
  border-radius: 0 0 24px 24px;
  background:
    radial-gradient(circle at 84% 20%, rgba(255,255,255,.22) 0 2px, transparent 2.5px) 0 0 / 17px 17px,
    linear-gradient(118deg, rgba(255,255,255,.08) 0 31%, transparent 31% 100%),
    linear-gradient(112deg, var(--navy), var(--blue) 52%, #12bfc2 115%);
}
.hero h1 { margin: 3px 0 0; font-size: clamp(23px, 5vw, 38px); line-height: 1.22; letter-spacing: -.02em; text-wrap: balance; }
.hero__chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.hero__chips span { padding: 8px 12px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; color: #fff; background: rgba(255,255,255,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); font-size: 13px; white-space: nowrap; }
.eyebrow { margin: 0; opacity: .82; font-size: 12px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }

.shell { width: min(980px, 100%); margin: 0 auto; padding: 24px 14px calc(44px + env(safe-area-inset-bottom)); }
.card, .records, dialog {
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid rgba(11,85,231,.12);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 14px 38px rgba(7,56,148,.08);
}
.card::before, .records::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--blue), var(--bright) 35%, var(--mint) 72%, var(--orange)); }
.centered { text-align: center; padding: 40px 22px; }
.centered p { color: var(--muted); line-height: 1.7; }
.notice { margin-bottom: 14px; padding: 14px 16px; border: 1px solid #ffd8bb; border-radius: 14px; color: #8a3900; background: #fff7ef; line-height: 1.5; }

.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.section-heading h2 { margin: 3px 0 0; color: var(--navy); font-size: 24px; letter-spacing: -.02em; }
.step { display: inline-block; margin: 0; color: var(--blue); font-size: 12px; font-weight: 850; letter-spacing: .14em; }
.step::after { content: ""; display: inline-block; width: 28px; height: 3px; margin: 0 0 3px 8px; border-radius: 99px; background: linear-gradient(90deg, var(--blue), var(--mint), var(--orange)); }
.section-help, .fine-print { color: var(--muted); font-size: 13px; line-height: 1.65; }
.draft-status, .pill { padding: 7px 11px; border: 1px solid #bdeee5; border-radius: 999px; color: #087f73; background: #edfffb; font-size: 12px; white-space: nowrap; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.field { display: grid; gap: 8px; margin-bottom: 18px; font-weight: 680; }
.field small { color: var(--muted); font-weight: 400; line-height: 1.5; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #f9fcff;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--mint); background: #fff; box-shadow: 0 0 0 4px rgba(36,210,164,.13); }
.required { color: var(--orange); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; padding: 13px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: #f9fcff; text-align: center; }
.segmented input:checked + span { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--blue), var(--bright)); box-shadow: 0 8px 18px rgba(11,85,231,.2); }

.member-card { padding: 18px; margin-bottom: 13px; border: 1px solid #d8e9ef; border-radius: 17px; background: linear-gradient(150deg, #fff 0 70%, #effcf9); }
.member-card__title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.member-card__title h3 { margin: 0; color: var(--navy); font-size: 17px; }
.member-card .field-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.member-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.button { min-height: 50px; padding: 11px 17px; border: 0; border-radius: 14px; font-weight: 800; letter-spacing: .01em; transition: transform .16s ease, box-shadow .16s ease; }
.button:not(:disabled):active { transform: translateY(1px) scale(.99); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button--primary { color: #fff; background: linear-gradient(135deg, var(--blue), #2773ee 48%, var(--bright)); box-shadow: 0 10px 22px rgba(11,85,231,.24); }
.button--secondary { color: var(--blue); background: linear-gradient(135deg, #eef4ff, #edfffb); }
.button--ghost { color: var(--muted); background: #eef1f5; }
.text-button, .icon-button { border: 0; color: var(--blue); background: transparent; }
.icon-button { font-size: 30px; color: var(--muted); }

.upload-guide ol { margin: 0; padding-left: 22px; color: var(--muted); line-height: 1.85; }
.upload-guide li::marker { color: var(--blue); font-weight: 800; }
.total-card { background: linear-gradient(145deg, #fff 0 67%, #effdf9); }
.total-card::before { background: linear-gradient(90deg, var(--blue), var(--mint), var(--orange)); }
.total-card strong { display: block; margin: 5px 0; color: var(--orange); font-size: 40px; letter-spacing: -.04em; }
.total-card small { color: var(--muted); }
.agreement { display: flex; gap: 11px; align-items: flex-start; margin: 22px 0; line-height: 1.55; }
.agreement input { width: 22px; height: 22px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--blue); }
.agreement label { font-weight: 700; }
.agreement small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.agreement__links { display: inline; }
.terms-link {
  display: inline;
  margin: 0;
  padding: 0 1px;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 800;
  line-height: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(11,85,231,.34);
  text-underline-offset: 3px;
}
.terms-link:focus-visible { outline: 3px solid rgba(36,210,164,.25); outline-offset: 3px; border-radius: 4px; }
.sticky-actions { display: grid; grid-template-columns: .75fr 1.25fr; gap: 10px; }
.fine-print { padding-top: 14px; border-top: 1px dashed var(--line); }

.organization-card { overflow: hidden; }
.organization-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.organization-group { padding: 16px; border: 1px solid #d9e9f0; border-radius: 15px; background: linear-gradient(145deg, #fff, #f0fcfa); }
.organization-group--wide { grid-column: 1 / -1; }
.organization-group h3 { margin: 0 0 10px; color: var(--blue); font-size: 15px; }
.organization-group ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.organization-group li { color: #44516a; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.organization-group strong { color: var(--ink); }

.risk-card { margin-top: 22px; border-color: rgba(229,74,36,.2); background: linear-gradient(145deg, #fff 0 78%, #fff7ef); }
.risk-card::before { background: linear-gradient(90deg, var(--orange), var(--red), var(--blue)); }
.risk-badge { flex: 0 0 auto; padding: 7px 11px; border: 1px solid #ffd1ba; border-radius: 999px; color: #a53e00; background: #fff3e9; font-size: 12px; font-weight: 800; }
.risk-lead { margin: 0 0 15px; padding: 14px 15px; border: 1px solid #ffd8c2; border-radius: 13px; color: #74320f; background: #fff7f0; line-height: 1.7; }
.risk-list { margin: 0; padding-left: 24px; }
.risk-list li { margin-bottom: 12px; color: #44516a; line-height: 1.75; }
.risk-list li::marker { color: var(--orange); font-weight: 850; }
.risk-list strong { color: var(--ink); }
.risk-footer { margin: 15px 0 0; padding-top: 14px; border-top: 1px dashed #e4cbbb; color: var(--muted); font-size: 13px; line-height: 1.7; }

.records__heading { margin: 0 0 16px; }
.records-list { display: grid; gap: 12px; }
.empty { padding: 30px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; }
.record { position: relative; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(150deg, #fff, #f2fcfa); }
.record__top { display: flex; justify-content: space-between; gap: 12px; }
.record h3 { margin: 0 0 5px; color: var(--navy); }
.record p { margin: 5px 0; color: var(--muted); font-size: 14px; }
.status { align-self: flex-start; padding: 6px 10px; border-radius: 999px; color: #9a4300; background: #fff0dd; font-size: 12px; white-space: nowrap; }
.status--paid, .status--approved { color: #007c5b; background: #dcf8ef; }
.record__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.record__actions .button { min-height: 40px; padding: 8px 12px; font-size: 13px; }

dialog { width: min(760px, calc(100% - 24px)); max-height: calc(100dvh - 24px); margin: auto; overflow: auto; border: 0; }
dialog::backdrop { background: rgba(7,21,49,.68); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; position: sticky; top: -22px; z-index: 2; padding: 18px 0 12px; background: #fff; }
.dialog-head h2 { margin: 4px 0 0; }
.detail-summary { padding: 14px; border-radius: 13px; color: var(--muted); background: #f0fbfa; line-height: 1.6; }
.proof-group-note { padding: 12px 14px; border: 1px solid #bdeee5; border-radius: 12px; color: #087f73; background: #edfffb; font-weight: 800; line-height: 1.6; }
.team-proof-field { padding: 14px; border: 1px solid #bdeee5; border-radius: 14px; background: #f1fffb; }
.team-proof-field input[type="file"] { width: 100%; padding: 10px; border: 1px dashed #76cbbb; border-radius: 11px; background: #fff; }
.selected-file { color: #087f73; font-size: 13px; font-weight: 750; overflow-wrap: anywhere; }
.team-proof-box { margin: 16px 0; padding: 14px; border: 1px solid #bdeee5; border-radius: 13px; background: #f1fffb; }
.team-proof-box h3 { margin-top: 0; }
.team-proof-current { margin: 8px 0 12px; color: #087f73; font-weight: 750; overflow-wrap: anywhere; }
.proof-row { padding: 13px 0; border-bottom: 1px solid var(--line); }
.proof-row:last-child { border-bottom: 0; }
.proof-row h4 { margin: 0 0 7px; }
.proof-row p { margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
.file-control { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.file-control input { max-width: 100%; }
.refund-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

.terms-dialog { width: min(820px, calc(100% - 20px)); padding-bottom: max(22px, env(safe-area-inset-bottom)); }
.terms-summary { margin-bottom: 15px; padding: 15px 16px; border: 1px solid #ffd5b8; border-radius: 14px; color: #713100; background: #fff7ef; line-height: 1.65; }
.terms-summary strong { color: #a53e00; }
.terms-summary p { margin: 5px 0 0; }
.terms-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; position: sticky; top: 72px; z-index: 1; padding: 8px 0 12px; background: #fff; }
.terms-nav button { min-height: 42px; padding: 8px; border: 1px solid #cfe8ed; border-radius: 12px; color: var(--blue); background: linear-gradient(135deg, #eff5ff, #effcf9); font-weight: 800; }
.terms-section { scroll-margin-top: 138px; padding: 8px 0 14px; border-bottom: 1px solid var(--line); }
.terms-section h3 { margin: 12px 0 10px; color: var(--navy); font-size: 20px; }
.terms-section ol { margin: 0; padding-left: 24px; }
.terms-section li { margin-bottom: 11px; color: #44516a; line-height: 1.72; }
.terms-section li::marker { color: var(--blue); font-weight: 850; }
.terms-section strong { color: var(--ink); }
.terms-footer { padding-top: 18px; }
.terms-footer p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.terms-footer .button { width: 100%; margin-top: 6px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 20; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 17px; border-radius: 999px; color: #fff; background: rgba(7,56,148,.96); box-shadow: 0 8px 28px rgba(7,56,148,.28); text-align: center; }
.spinner { width: 34px; height: 34px; margin: 0 auto 12px; border: 4px solid #dff8f2; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 680px) {
  .hero__content { display: block; width: 100%; padding: 15px 17px 17px; border-radius: 0; }
  .hero h1 { font-size: 22px; }
  .hero__chips { justify-content: flex-start; margin-top: 13px; gap: 6px; }
  .hero__chips span { padding: 6px 9px; font-size: 11px; }
  .shell { padding-top: 16px; }
  .card, .records { padding: 17px; border-radius: 18px; }
  .organization-grid { grid-template-columns: 1fr; }
  .organization-group--wide { grid-column: auto; }
  .risk-card .section-heading { display: block; }
  .risk-badge { display: inline-block; margin-top: 10px; }
  .risk-list li { font-size: 14px; }
  .field-grid, .member-card .field-grid { grid-template-columns: 1fr; gap: 0; }
  .sticky-actions { position: static; bottom: auto; z-index: auto; padding: 8px; margin: 14px -8px 0; border: 1px solid rgba(11,85,231,.1); border-radius: 16px; background: rgba(255,255,255,.94); box-shadow: 0 10px 28px rgba(7,56,148,.15); }
  .terms-dialog { width: calc(100% - 12px); max-height: calc(100dvh - 12px); padding: 17px; border-radius: 18px; }
  .terms-dialog .dialog-head { top: -17px; padding-top: 15px; }
  .terms-nav { top: 66px; }
  .terms-nav button { padding: 7px 4px; font-size: 13px; }
  .terms-section { scroll-margin-top: 126px; }
  .terms-section h3 { font-size: 18px; }
  .terms-section li { font-size: 14px; }
}
