:root {
  --green: #07c160;
  --green-dark: #05964a;
  --ink: #18231d;
  --muted: #66736c;
  --line: #e6ece8;
  --surface: #fff;
  --bg: #f3f7f4;
  --danger: #d93025;
  --warning: #a86500;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { padding-bottom: calc(28px + env(safe-area-inset-bottom)); font-size: 15px; }
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

.nav-bar {
  min-height: 68px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(135deg, #079f52, var(--green));
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 20px rgba(7, 143, 73, .18);
}
.nav-copy { display: flex; flex-direction: column; gap: 3px; }
.nav-copy strong { font-size: 18px; letter-spacing: .02em; }
.nav-copy span { font-size: 11px; opacity: .82; }
.nav-action {
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 999px;
  padding: 6px 13px;
  color: #fff;
  background: rgba(255,255,255,.12);
}
.network-banner { padding: 8px 16px; color: #7a3b00; background: #fff0d7; text-align: center; font-size: 12px; }

.steps {
  max-width: 680px;
  margin: 14px auto;
  padding: 14px 10px;
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.step { flex: 1; display: flex; align-items: center; flex-direction: column; gap: 6px; position: relative; }
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 14px;
  left: calc(50% + 18px);
  width: calc(100% - 36px);
  height: 2px;
  background: #e5ebe7;
}
.step.done:not(:last-child)::after { background: var(--green); }
.step-num {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #849088;
  background: #edf1ee;
  font-size: 12px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.step.active .step-num, .step.done .step-num { color: #fff; background: var(--green); }
.step-label { color: #859089; font-size: 11px; }
.step.active .step-label, .step.done .step-label { color: var(--green-dark); font-weight: 600; }

.page-container, .history-card, .footer { width: calc(100% - 24px); max-width: 680px; margin-left: auto; margin-right: auto; }
.card, .hero-card {
  margin-bottom: 12px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 7px 24px rgba(28, 55, 39, .055);
}
.hero-card {
  padding: 27px 22px;
  color: #fff;
  background: linear-gradient(145deg, #132e20, #17683f);
  border: 0;
  overflow: hidden;
  position: relative;
}
.hero-card::after {
  content: "";
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 34px solid rgba(255,255,255,.06);
  position: absolute;
  right: -55px;
  bottom: -70px;
}
.hero-card h1 { margin: 13px 0 8px; font-size: 25px; }
.hero-card p { max-width: 460px; margin: 0; color: rgba(255,255,255,.78); line-height: 1.7; font-size: 13px; }
.hero-badge { display: inline-flex; padding: 4px 9px; border-radius: 999px; color: #bdf4d4; background: rgba(7,193,96,.18); font-size: 11px; }

.card-title { margin-bottom: 11px; font-size: 17px; font-weight: 700; }
.card-desc { margin: 0 0 10px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.compact-login { margin-top: 18px; padding: 24px 20px; }
.login-badge { display: inline-flex; margin-bottom: 12px; padding: 5px 10px; color: #06753a; background: #ddf7e8; border-radius: 999px; font-size: 11px; font-weight: 700; }
.invite-missing { margin-top: 18px; }
.eyebrow { margin-bottom: 6px; color: #89948e; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.status-card { display: flex; justify-content: space-between; align-items: center; }
.status-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.status-line code { color: #617067; font-size: 11px; }
.status-tag { display: inline-flex; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-tag.success { color: #06753a; background: #ddf7e8; }
.status-tag.pending { color: #8a5700; background: #fff1ce; }
.status-tag.error { color: #b1261e; background: #ffe2df; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--green-dark); background: #f7faf8; font-size: 23px; }

.form-label { display: block; margin: 0 0 7px; color: #4f5c54; font-size: 13px; font-weight: 600; }
.top-gap { margin-top: 17px; }
.req { margin-left: 3px; color: var(--danger); }
.form-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: #f8faf9;
  border: 1px solid #dde5df;
  border-radius: 10px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(7,193,96,.11); }
.form-textarea {
  width: 100%; min-height: 112px; padding: 12px 14px; resize: vertical;
  color: var(--ink); background: #f8faf9; border: 1px solid #dde5df; border-radius: 10px; outline: none;
}
.form-textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(7,193,96,.11); }
.form-hint { margin-top: 6px; color: #8b9690; font-size: 11px; line-height: 1.5; }
.form-hint-important { color: #a86500; font-weight: 600; }
.check-row { margin: 17px 0 0; display: flex; align-items: flex-start; gap: 9px; color: #59675f; font-size: 12px; line-height: 1.55; }
.check-row input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--green); }

.btn-primary, .btn-ghost {
  width: 100%;
  min-height: 46px;
  margin-top: 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary { color: #fff; background: var(--green); border: 1px solid var(--green); }
.btn-primary:active { background: var(--green-dark); }
.btn-primary:disabled { opacity: .62; cursor: wait; }
.btn-ghost { color: var(--green-dark); background: #fff; border: 1px solid #a9dabf; }
.text-button { width: 100%; margin-top: 18px; padding: 8px; color: #7b8780; background: transparent; border: 0; font-size: 12px; }

.icp-form-card { padding: 18px 16px; }
.icp-form-steps { margin: 17px -3px 20px; display: flex; gap: 3px; }
.icp-form-step { min-width: 0; padding: 0; flex: 1; color: #89948e; background: transparent; border: 0; }
.icp-form-step span { width: 28px; height: 28px; margin: 0 auto 5px; display: grid; place-items: center; color: #7d8982; background: #edf1ee; border-radius: 50%; font-size: 11px; font-weight: 700; }
.icp-form-step small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.icp-form-step.active span, .icp-form-step.done span { color: #fff; background: var(--green); }
.icp-form-step.active small, .icp-form-step.done small { color: var(--green-dark); font-weight: 700; }
.section-heading { margin: 25px 0 13px; padding-left: 10px; border-left: 3px solid var(--green); font-size: 15px; font-weight: 750; }
.section-heading:first-child { margin-top: 0; }
.field-grid, .upload-grid, .button-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.button-grid > .btn-primary, .button-grid > .btn-ghost { margin-top: 16px; }
.upload-grid { margin-top: 18px; }
.upload-field { margin-top: 17px; }
.upload-button { min-height: 76px; padding: 12px; display: flex; align-items: center; justify-content: center; color: #607068; background: #f7faf8; border: 1px dashed #bfcfc5; border-radius: 11px; text-align: center; font-size: 12px; cursor: pointer; }
.upload-button.uploaded { color: #06753a; background: #eef9f3; border-color: #9dd6b8; }
.file-input { width: 1px; height: 1px; position: absolute; opacity: 0; overflow: hidden; }
.checkbox-list { max-height: 260px; padding: 8px 12px; overflow: auto; background: #f8faf9; border: 1px solid #dde5df; border-radius: 10px; }
.checkbox-item { padding: 8px 0; display: flex; align-items: flex-start; gap: 8px; color: #4f5c54; font-size: 12px; line-height: 1.45; }
.checkbox-item input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--green); }
.check-row.compact { margin-top: 9px; }
.material-list { margin-top: 12px; border-top: 1px solid var(--line); }
.material-list > div { padding: 9px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #536158; font-size: 11px; border-bottom: 1px solid var(--line); }
.material-list button { color: var(--danger); background: transparent; border: 0; }
.face-box { margin-top: 12px; }
.break-all { word-break: break-all; }
.reject-line { padding: 7px 0; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid rgba(180, 60, 50, .12); }
.reject-line:first-of-type { border-top: 0; }
.state-icon.success { color: #06753a; background: #ddf7e8; }

.notice, .tip-warn, .error-box, .summary-section { margin: 12px 0; padding: 12px; border-radius: 10px; font-size: 12px; line-height: 1.65; }
.notice.warn, .tip-warn { color: #785000; background: #fff6db; border: 1px solid #f3dd9d; }
.notice.info, .summary-section { color: #3d5c4c; background: #f0f7f3; border: 1px solid #d7e8dd; }
.error-box { color: #9e2820; background: #fff0ef; border: 1px solid #fac9c5; }
.error-title, .summary-title { margin-bottom: 5px; font-weight: 700; }
.error-msg { word-break: break-word; }
.summary-section pre { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.terms { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: #748078; font-size: 12px; }
.terms summary { cursor: pointer; color: #526158; font-weight: 600; }
.terms p { margin: 10px 0 0; line-height: 1.75; }

.center-card { padding-top: 28px; text-align: center; }
.state-icon { width: 50px; height: 50px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; color: #9b6500; background: #fff0c5; font-size: 25px; font-weight: 800; }
.state-icon.danger { color: #b32920; background: #ffe1df; }
.loading-card { display: flex; align-items: center; justify-content: center; min-height: 120px; color: var(--muted); }
.loading-spinner { width: 16px; height: 16px; display: inline-block; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .65s linear infinite; }
.loading-spinner.dark { margin-right: 8px; border-color: #b8d8c6; border-top-color: var(--green); }
@keyframes spin { to { transform: rotate(360deg); } }

.history-card { margin-top: 12px; }
.history-item { display: flex; padding: 9px 0; }
.history-dot { width: 8px; height: 8px; margin: 6px 11px 0 0; flex: 0 0 auto; border-radius: 50%; background: #c9d1cc; }
.history-dot.active { background: var(--green); box-shadow: 0 0 0 4px rgba(7,193,96,.1); }
.history-content { flex: 1; display: flex; justify-content: space-between; gap: 14px; color: #49564e; font-size: 12px; }
.history-content time { color: #929b96; white-space: nowrap; font-size: 11px; }
.footer { padding: 14px 8px 0; color: #8b958f; text-align: center; font-size: 10px; line-height: 1.7; }

.toast {
  max-width: calc(100% - 48px);
  padding: 11px 18px;
  position: fixed;
  left: 50%;
  bottom: calc(34px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 100;
  color: #fff;
  background: rgba(23,32,27,.92);
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  animation: toast-in .18s ease-out;
}
.toast.error { background: rgba(171,41,31,.94); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (min-width: 720px) {
  .nav-bar { padding-left: max(24px, calc((100% - 680px) / 2)); padding-right: max(24px, calc((100% - 680px) / 2)); }
  .page-container { margin-top: 0; }
}

@media (max-width: 390px) {
  .field-grid, .upload-grid { grid-template-columns: 1fr; }
  .icp-form-step small { font-size: 8px; }
}

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