:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #647087;
  --line: #dde3ec;
  --soft: #f6f8fb;
  --brand: #23469b;
  --brand-soft: #eef3ff;
  --danger: #b53a3a;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
  line-height: 1.7;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
}
.header-inner {
  width: min(100% - 40px, 1080px);
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .04em;
}
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand);
  color: white;
}
.header-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}
.header-meta button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--muted);
  padding: 5px 0;
}
.header-meta button:hover { color: var(--ink); }

.application-shell {
  width: min(100% - 40px, 780px);
  margin: 0 auto;
  padding: 40px 0 72px;
}
.source-badge {
  width: fit-content;
  margin-bottom: 28px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
}
.source-badge span { margin-right: 6px; opacity: .72; }
.progress-area { margin-bottom: 54px; }
.progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}
.progress-copy span:last-child { text-align: right; }
.progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f5;
}
.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width .25s ease;
}

.form-panel { display: none; }
.form-panel.is-active { display: block; animation: panel-in .2s ease; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-heading { margin-bottom: 40px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .06em;
}
.page-heading h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.25;
  letter-spacing: -.03em;
}
.page-heading > p:last-child {
  max-width: 650px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.entity-options { display: grid; gap: 14px; }
.entity-card {
  min-height: 112px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.entity-card:hover { border-color: #aebbd4; }
.entity-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand);
}
.entity-card:has(input:focus-visible),
.pill-grid label:has(input:focus-visible) span,
.simple-toggle:has(input:focus-visible),
.service-grid label:has(input:focus-visible) {
  outline: 3px solid rgba(35, 70, 155, .22);
  outline-offset: 3px;
}
.entity-card input { position: absolute; opacity: 0; pointer-events: none; }
.entity-select {
  width: 22px;
  height: 22px;
  margin-top: 3px;
  border: 2px solid #b7c1d1;
  border-radius: 50%;
  background: white;
}
.entity-card:has(input:checked) .entity-select { border: 7px solid var(--brand); }
.entity-card strong { display: block; font-size: 21px; line-height: 1.4; }
.entity-card small { display: block; margin-top: 7px; color: var(--muted); font-size: 15px; }
.advisor-link,
.inline-action {
  appearance: none;
  border: 0;
  background: none;
  color: var(--brand);
  padding: 0;
  font-weight: 650;
}
.advisor-link { margin-top: 26px; }
.inline-action { width: fit-content; margin-top: -8px; font-size: 14px; }

.field-stack,
.field { display: grid; gap: 9px; }
.field-stack { gap: 24px; }
.field > span,
.choice-group legend { color: var(--ink); font-weight: 700; }
.field em,
.choice-group em {
  margin-left: 5px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
}
.field em.required-mark { color: var(--danger); }
.field input,
.field textarea,
.field select,
.role-row input,
.role-row select {
  width: 100%;
  border: 1px solid #cdd5e1;
  border-radius: 12px;
  background: white;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input,
.field select,
.role-row input,
.role-row select { min-height: 54px; padding: 0 16px; }
.field textarea { min-height: 150px; padding: 15px 16px; resize: vertical; line-height: 1.7; }
.field input:focus,
.field textarea:focus,
.field select:focus,
.role-row input:focus,
.role-row select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(35, 70, 155, .11);
}
.field input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(181, 58, 58, .09);
}
.field small { color: var(--muted); font-size: 13px; }
.quiet-divider { height: 1px; margin: 38px 0; background: var(--line); }
.simple-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
}
.simple-toggle input,
.service-grid input {
  width: 19px;
  height: 19px;
  margin: 4px 0 0;
  accent-color: var(--brand);
}
.simple-toggle strong,
.simple-toggle small { display: block; }
.simple-toggle small { margin-top: 3px; color: var(--muted); }
.featured-field textarea { min-height: 190px; font-size: 17px; }
.writing-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 12px 0 42px;
  color: var(--muted);
  font-size: 13px;
}
.writing-prompts span::before { content: "·"; margin-right: 7px; color: var(--brand); }

.choice-group {
  min-width: 0;
  margin: 40px 0;
  padding: 0;
  border: 0;
}
.choice-group > p {
  margin: 5px 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.pill-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-grid label { position: relative; }
.pill-grid input { position: absolute; opacity: 0; pointer-events: none; }
.pill-grid span {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: #48546a;
  font-size: 14px;
  transition: .15s ease;
}
.pill-grid label:hover span { border-color: #abb7cc; }
.pill-grid input:checked + span {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.participant-list { display: grid; gap: 22px; }
.participant-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.participant-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.participant-heading strong { font-size: 18px; }
.remove-participant {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 2px;
  font-size: 13px;
}
.participant-card > .field + .choice-group,
.participant-card > .choice-group + .field { margin-top: 28px; }
.participant-card .choice-group { margin-bottom: 28px; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 58px; }
.input-suffix > span {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.participant-contact,
.enterprise-representative {
  margin-top: 30px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.subsection-heading { margin-bottom: 18px; }
.subsection-heading strong,
.subsection-heading small { display: block; }
.subsection-heading strong { font-size: 16px; }
.subsection-heading small { margin-top: 3px; color: var(--muted); font-size: 13px; }
.representative-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.foreign-phone-hint { color: var(--brand) !important; }
.add-person-button {
  width: 100%;
  min-height: 54px;
  margin-top: 16px;
  border: 1px dashed #aebbd0;
  border-radius: 12px;
  background: var(--soft);
  color: var(--brand);
  font-weight: 700;
}
.capital-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 34px;
  padding: 22px 0 4px;
  border-top: 1px solid var(--line);
}
.capital-total span { color: var(--muted); }
.capital-total strong { font-size: 24px; }

.role-list { display: grid; }
.role-row {
  display: grid;
  grid-template-columns: minmax(230px, .9fr) minmax(260px, 1.1fr);
  align-items: center;
  gap: 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.role-row:first-child { border-top: 1px solid var(--line); }
.role-row strong,
.role-row small { display: block; }
.role-row small { margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.supervisor-choice { margin: 24px 0 0; padding: 0 0 24px; border: 0; border-bottom: 1px solid var(--line); min-width: 0; }
.supervisor-choice legend { font-weight: 700; }
.supervisor-choice p { margin: 6px 0 16px; color: var(--muted); font-size: 14px; }
.supervisor-choice .field { margin-top: 18px; }
#additional-people:not(:empty) { margin-top: 28px; }
.material-note { font-size: 14px; color: var(--muted); line-height: 1.7; }

.material-section,
.service-section,
.contact-section { margin-top: 44px; }
.material-section:first-of-type { margin-top: 0; }
.material-section h2,
.service-section h2,
.contact-section h2 { margin: 0; font-size: 20px; }
.service-section > p,
.contact-section > p { margin: 6px 0 18px; color: var(--muted); font-size: 14px; }
.checklist {
  display: grid;
  gap: 14px;
  margin: 18px 0 22px;
  padding: 0;
  list-style: none;
}
.checklist li { display: grid; gap: 8px; padding: 20px 0; border-bottom: 1px solid var(--line); color: #445067; overflow-wrap: anywhere; }
.checklist li::before {
  content: none;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  display: grid;
  place-items: center;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}
.checklist li small { font-size: 14px; color: var(--muted); }
.material-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 5px; }
.material-actions button, .file-action { border: 1px solid var(--line); background: white; color: var(--brand); border-radius: 9px; padding: 10px 14px; font-size: 14px; cursor: pointer; }
.file-action { position: relative; overflow: hidden; }
.file-action input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.file-action:focus-within { outline: 2px solid var(--brand); outline-offset: 3px; }
.upload-box {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
  border: 1px dashed #b8c2d2;
  border-radius: 14px;
  background: var(--soft);
  cursor: pointer;
}
.upload-box input { width: 106px; max-width: 106px; color: transparent; }
.upload-box input::file-selector-button {
  border: 0;
  border-radius: 9px;
  background: var(--brand);
  color: white;
  padding: 10px 14px;
  font-weight: 700;
}
.upload-box strong,
.upload-box small { display: block; }
.upload-box small { margin-top: 3px; color: var(--muted); font-size: 13px; }
.file-list {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.service-grid label {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-height: 54px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.service-grid label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.contact-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-error { color: var(--danger) !important; font-weight: 650; }

.review-list { border-top: 1px solid var(--line); }
.review-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: start;
  gap: 22px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.review-row > span { color: var(--muted); font-size: 14px; }
.review-row strong,
.review-row small { display: block; }
.review-row strong { font-size: 16px; }
.review-row small { margin-top: 5px; color: var(--muted); font-size: 13px; }
.review-row button {
  border: 0;
  background: none;
  color: var(--brand);
  padding: 0;
  font-size: 13px;
}
.submission-note {
  margin: 34px 0 24px;
  padding: 20px;
  border-radius: 12px;
  background: var(--soft);
}
.submission-note p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.form-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 54px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.primary-button,
.back-button {
  min-height: 52px;
  border-radius: 11px;
  padding: 0 24px;
  font-weight: 750;
}
.primary-button { border: 1px solid var(--brand); background: var(--brand); color: white; }
.primary-button:hover { background: #193a8b; }
.back-button { border: 1px solid var(--line); background: white; color: var(--ink); }
.back-button:hover { background: var(--soft); }
.submit-button { width: 100%; }
.prototype-note {
  margin: 52px 0 0;
  color: #8a93a5;
  text-align: center;
  font-size: 12px;
}

.success-dialog {
  width: min(100% - 32px, 440px);
  padding: 36px;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(20, 30, 50, .24);
  text-align: center;
}
.success-dialog::backdrop { background: rgba(14, 23, 38, .48); }
.success-dialog h2 { margin: 14px 0 8px; }
.success-dialog p { color: var(--muted); }
.success-dialog .primary-button { margin-top: 14px; }
.success-mark {
  width: 50px;
  height: 50px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 24px;
  font-weight: 800;
}

[hidden] { display: none !important; }

@media (max-width: 640px) {
  .header-inner,
  .application-shell { width: min(100% - 30px, 780px); }
  .header-inner { min-height: 60px; }
  .header-meta { gap: 12px; }
  .header-meta #save-status { display: none; }
  .application-shell { padding-top: 26px; }
  .progress-area { margin-bottom: 38px; }
  .page-heading { margin-bottom: 30px; }
  .page-heading h1 { font-size: 30px; }
  .page-heading > p:last-child { font-size: 15px; }
  .entity-card { min-height: 0; padding: 19px; }
  .entity-card strong { font-size: 18px; }
  .entity-card small { font-size: 14px; }
  .participant-card { padding: 20px 17px; }
  .representative-fields,
  .service-grid,
  .contact-fields { grid-template-columns: 1fr; }
  .role-row { grid-template-columns: 1fr; gap: 13px; }
  .review-row { grid-template-columns: 88px 1fr; gap: 12px; }
  .review-row button { grid-column: 2; justify-self: start; }
  .upload-box { align-items: flex-start; flex-direction: column; }
  .form-navigation {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin: 42px -15px 0;
    padding: 14px 15px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .97);
  }
  .form-navigation .primary-button { margin-left: auto; }
}

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