:root {
  color-scheme: light;
  --ink: #383150; --muted: #756d88; --line: #e4dbef; --surface: #fff; --soft: #f7f4fb;
  --purple: #5b4b9e; --purple-dark: #493b83; --purple-soft: #ede7f8;
  --teal: #476b9f; --teal-soft: #eaf0f9; --danger: #a34d7d; --warning: #8c681e;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, SimSun, serif;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; letter-spacing: 0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: #f6f2fb; }
body { margin: 0; color: var(--ink); line-height: 1.65; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 32px; border-bottom: 1px solid var(--line); background: rgba(246,242,251,.96); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand img { width: 34px; height: 34px; object-fit: contain; }
.brand strong { font-family: var(--serif); font-size: 19px; white-space: nowrap; }
.account-wrap { position: relative; min-width: 0; display: flex; align-items: center; gap: 10px; }
.return-link { color: var(--purple); text-decoration: none; font-family: var(--serif); font-size: 13px; white-space: nowrap; }
.return-link:hover { text-decoration: underline; }
.account-button { padding: 7px 18px; border: 1px solid #d8ccec; border-radius: 8px; background: #fdfbff; color: var(--purple); font-size: 13px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-button:hover { background: var(--purple-soft); }
.account-menu { position: absolute; right: 0; top: calc(100% + 10px); width: min(270px,85vw); padding: 8px; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px #38315016; }
.account-identity { padding: 8px 10px 12px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; border-bottom: 1px solid var(--line); }
.account-menu button { width: 100%; border: 0; background: transparent; padding: 10px; text-align: left; color: var(--danger); }
.account-menu button:hover { background: #f7e8f1; }
main { max-width: 1080px; margin: 0 auto; padding: 0 24px 70px; }
.product-intro { padding: 36px 0 20px; }
.product-intro h1 { font-family: var(--serif); font-size: 27px; line-height: 1.5; margin: 0 0 10px; }
.product-intro p { color: var(--muted); margin: 0; }
.product-intro .eyebrow { color: var(--danger); margin-bottom: 8px; }
body:has(#workspace:not([hidden])) .product-intro { display: none; }
.trust-note { margin-top: 20px; display: flex; gap: 12px; color: var(--muted); font-size: 12px; }
.trust-note strong { color: var(--teal); }
.signed-out { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.signed-out-copy { display: flex; align-items: center; gap: 20px; }
.signed-out h2 { font-family: var(--serif); font-size: 23px; margin: 0 0 8px; }
.signed-out p { color: var(--muted); margin: 0; }
.signed-out .eyebrow { color: var(--danger); font-size: 12px; }
.feature-mark { display: grid; place-items: center; flex-shrink: 0; width: 48px; height: 48px; border-radius: 8px; background: #f7e8f1; color: var(--danger); font-family: var(--serif); font-size: 25px; }
.workspace, .work-area, .step-panel { min-width: 0; }
.journey { padding: 26px 0 22px; }
.journey-title, .journey-foot { display: none; }
.steps { display: flex; align-items: center; justify-content: center; }
.steps button { position: relative; display: flex; align-items: center; gap: 9px; background: transparent; border: 0; padding: 7px 14px; color: #9388ab; font-family: var(--serif); }
.steps button:not(:last-child) { margin-right: 45px; }
.steps button:not(:last-child)::after { content: ""; position: absolute; left: 100%; top: 50%; width: 45px; height: 1px; background: #dcd2e9; }
.steps button > span { font-size: 17px; color: var(--danger); font-weight: 700; }
.steps strong { font-size: 14px; font-weight: 500; white-space: nowrap; }
.steps small { display: none; }
.steps .active strong { color: var(--ink); font-weight: 800; }
.steps .complete, .steps .complete > span { color: var(--teal); }
.steps .complete::after { background: #acbdd6 !important; }
.steps button:hover strong { color: var(--purple); }
.section-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 22px; }
.section-kicker { font-family: var(--serif); color: var(--danger); font-size: 12px; font-weight: 700; margin: 0 0 5px; }
.section-title h2 { font-family: var(--serif); font-size: 27px; font-weight: 800; margin: 0 0 7px; }
.section-title p:not(.section-kicker) { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.section-title > .button, .section-title > .status { margin-top: 29px; flex-shrink: 0; }
.status { color: var(--teal); background: var(--teal-soft); border: 1px solid #cbd9ec; border-radius: 6px; padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.info-strip { display: flex; gap: 12px; border-top: 1px solid var(--line); padding: 14px 0; color: var(--muted); font-size: 12px; }
.info-strip strong { color: var(--teal); white-space: nowrap; }
.document-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.document-row { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; padding: 20px; border: 1px dashed #cfc1e1; border-radius: 8px; background: #fdfbff; }
.document-row.has-documents { border-style: solid; border-color: #b0c3de; background: #edf2fa; }
.document-row.required-empty { border-color: #dcb5ce; background: #fcf6fa; }
.document-name { font-family: var(--serif); font-weight: 800; font-size: 16px; }
.required { color: var(--danger); margin-left: 4px; }
.document-hint, .uploaded { font-size: 12px; line-height: 1.65; color: var(--muted); margin-top: 8px; }
.upload-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.file-label { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; border: 1px solid #d8ccec; border-radius: 6px; padding: 6px 13px; color: var(--purple); background: white; cursor: pointer; font-size: 13px; }
.file-label:focus-within { outline: 2px solid var(--purple); outline-offset: 3px; }
.file-label:hover { background: var(--purple-soft); }
.file-label input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.cloud-row { width: 100%; display: flex; gap: 6px; }
.cloud-row input { min-width: 0; flex: 1; font-size: 12px; }
.cloud-row .button { min-height: 36px; padding: 6px 10px; font-size: 12px; }
.uploaded-file { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 8px 0; border-top: 1px solid #d5dfed; }
.uploaded-file span { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.uploaded-file .button { flex-shrink: 0; min-height: 30px; padding: 3px 8px; font-size: 12px; }
.button { border: 1px solid #d8ccec; background: #fdfbff; color: var(--ink); border-radius: 8px; padding: 10px 23px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 14px; }
.button.primary { background: var(--purple); color: white; border-color: var(--purple); }
.button.primary:hover { background: var(--purple-dark); }
.button.secondary:hover { background: var(--purple-soft); border-color: #b6a6d0; }
.button.danger { color: var(--danger); border-color: #dbb5cc; background: #fdf7fa; }
.button.danger:hover { background: #f7e8f1; }
button:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.field input, .field select, .field textarea, .cloud-row input, .auth-card input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #d8ccec; border-radius: 8px; background: #fdfbff; color: var(--ink); }
.field textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #cbbfe3; border-color: var(--purple); }
.accuracy-notice { display: flex; flex-wrap: wrap; gap: 5px 14px; padding: 14px 18px; border-left: 3px solid #b39451; background: #faf3e4; color: #72581f; font-size: 13px; line-height: 1.75; }
.accuracy-notice strong { font-family: var(--serif); }
.accuracy-notice.prominent { margin-bottom: 22px; }
.form-sections { margin-top: 24px; }
.form-section { padding: 22px 0 26px; border-top: 1px dashed #d8cde4; }
.form-section:first-child { padding-top: 0; border-top: 0; }
.form-section-head { margin-bottom: 16px; }
.form-section-head h3 { font-family: var(--serif); font-size: 18px; margin: 0 0 3px; }
.form-section-head p { font-size: 12px; color: var(--muted); margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 22px; }
.field { min-width: 0; }
.field.wide { grid-column: 1/-1; }
.field-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.field label { font-size: 13px; font-weight: 600; }
.help { position: relative; flex-shrink: 0; width: 18px; height: 18px; padding: 0; border: 1px solid #cdbfe0; border-radius: 50%; background: transparent; color: #827197; font-size: 11px; cursor: help; }
.help-text { position: absolute; left: -10px; bottom: calc(100% + 9px); width: min(300px,60vw); padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 400; line-height: 1.7; text-align: left; box-shadow: 0 8px 25px #3831501a; visibility: hidden; opacity: 0; pointer-events: none; z-index: 25; }
.help:hover .help-text, .help:focus .help-text { visibility: visible; opacity: 1; }
.needs-confirmation input, .needs-confirmation select, .needs-confirmation textarea { border-color: #b89955; background: #fffbf1; }
.uncertain-note { font-size: 12px; color: var(--warning); margin-top: 6px; }
.glossary { margin-top: 30px; padding: 24px; border: 1px solid #cad7ea; border-radius: 8px; background: #edf2fa; }
.glossary-head { margin-bottom: 18px; }
.glossary-head h3 { margin: 0 0 5px; font-family: var(--serif); font-size: 20px; }
.glossary-head p:not(.section-kicker) { margin: 0; color: var(--muted); font-size: 12px; }
.glossary-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.glossary article { position: relative; min-width: 0; min-height: 150px; padding: 20px; border: 1px solid #ded5e9; border-radius: 8px; background: #fff; }
.glossary article:nth-child(3n+2) { background: #fffaf0; border-color: #eadfc7; }
.glossary article:nth-child(3n) { background: #fdf3f8; border-color: #e8cede; }
.glossary-mark { display: inline-flex; margin-bottom: 16px; color: var(--teal); font-family: var(--serif); font-size: 12px; font-weight: 800; }
.glossary h4 { margin: 0 0 8px; font-family: var(--serif); font-size: 17px; }
.glossary article p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.review-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 26px; }
.review-item { padding: 15px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.review-item span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.match-progress { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 30px 0; gap: 12px; }
.match-progress div { display: grid; justify-items: center; align-content: start; gap: 12px; padding: 18px 10px; border-bottom: 2px solid var(--line); color: var(--muted); text-align: center; font-size: 13px; }
.match-progress span { width: 14px; height: 14px; border: 2px solid #cfc4de; border-radius: 50%; }
.match-progress .active { color: var(--purple); border-color: var(--purple); }
.match-progress .active span { border: 2px solid #ddd4ee; border-top-color: var(--purple); animation: spin 1s linear infinite; }
.match-progress .done { color: var(--teal); border-color: #a9bfde; }
.match-progress .done span { border-color: var(--teal); background: var(--teal); }
.result-state { min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px; background: #fdfbff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.result-state h3 { font-family: var(--serif); font-size: 23px; margin: 0 0 12px; }
.result-state p { margin: 0; color: var(--muted); line-height: 1.8; max-width: 650px; }
.result-state.success { background: var(--teal-soft); border-color: #cbd9ec; }
.result-state.error { background: #f7e8f1; border-color: #e7cada; }
.report-viewer { margin-top: 24px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: white; }
.report-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--soft); }
.report-viewer-head strong { font-family: var(--serif); }
.report-viewer-head span { color: var(--muted); font-size: 12px; }
.report-viewer iframe { display: block; width: 100%; height: min(72vh,860px); border: 0; background: white; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: min(520px,calc(100vw - 32px)); background: #443a66; color: white; border-radius: 8px; padding: 12px 20px; z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }
.toast.error { background: #81335f; }
.auth-mask { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: #38315066; backdrop-filter: blur(4px); z-index: 50; overflow-y: auto; }
.auth-card { position: relative; width: min(430px,100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 30px; border-radius: 8px; background: white; text-align: center; box-shadow: 0 20px 70px #38315026; }
.auth-close { position: absolute; top: 10px; right: 14px; padding: 0 5px; border: 0; background: transparent; color: var(--muted); font-size: 26px; }
.auth-logo { width: 145px; height: 50px; object-fit: contain; }
.auth-card h2 { font-family: var(--serif); margin: 12px 0; }
.auth-profile-notice { display: grid; gap: 4px; padding: 13px; text-align: left; background: var(--teal-soft); color: var(--muted); font-size: 12px; }
.auth-profile-notice strong { color: var(--teal); }
.auth-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; padding: 4px; border-radius: 8px; margin: 18px 0 14px; background: var(--purple-soft); }
.auth-tabs button { border: 0; border-radius: 6px; background: transparent; padding: 8px 3px; font-size: 12px; color: var(--muted); }
.auth-tabs button.active { background: var(--purple); color: white; }
.auth-card input { margin-bottom: 10px; }
.auth-code-row { display: flex; gap: 8px; }
.auth-code-row input { min-width: 0; flex: 1; }
.auth-code-row button { height: 42px; border: 1px solid #d8ccec; border-radius: 8px; background: var(--purple-soft); color: var(--purple); padding: 0 12px; white-space: nowrap; }
.auth-submit { width: 100%; }
.auth-error { display: none; text-align: left; padding: 8px 10px; color: var(--danger); background: #f7e8f1; font-size: 12px; margin-bottom: 10px; }
.auth-error.show { display: block; }
.auth-terms { font-size: 11px; color: var(--muted); }
.auth-terms a { color: var(--purple); }
@keyframes spin { to { transform: rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .match-progress .active span { animation: none; } .toast { transition: none; } }
@media(max-width:850px) {
  .document-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .steps button:not(:last-child) { margin-right: 18px; }
  .steps button:not(:last-child)::after { width: 18px; }
  .steps button { padding: 7px 9px; }
}
@media(max-width:600px) {
  .topbar { height: 60px; padding: 0 14px; gap: 12px; }
  .brand { gap: 8px; }
  .brand img { width: 30px; height: 30px; }
  .brand strong { font-size: 16px; }
  .account-button { max-width: 140px; padding: 7px 10px; font-size: 12px; }
  main { padding: 0 16px 40px; }
  .journey { padding: 20px 0; }
  .steps { justify-content: space-between; }
  .steps button { flex-direction: column; gap: 2px; padding: 4px 0; }
  .steps strong { font-size: 12px; }
  .steps button:not(:last-child) { margin-right: 0; }
  .steps button:not(:last-child)::after { display: none; }
  .section-title { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
  .section-title h2 { font-size: 24px; }
  .section-title > .button, .section-title > .status { margin-top: 0; }
  .document-list, .form-grid, .review-summary, .glossary-grid { grid-template-columns: 1fr; }
  .document-row { padding: 18px; gap: 14px; }
  .field.wide { grid-column: auto; }
  .help-text { left: -40px; width: min(260px,60vw); }
  .accuracy-notice { padding: 12px 14px; }
  .glossary { padding: 18px 14px; }
  .glossary article { min-height: 0; padding: 17px; }
  .report-viewer iframe { height: 68vh; }
  .match-progress { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .actions { gap: 8px; }
  .actions .button { flex: 1; padding: 10px 12px; }
  .signed-out { align-items: stretch; flex-direction: column; }
  .signed-out-copy { align-items: flex-start; }
  .feature-mark { display: none; }
  .product-intro h1 { font-size: 24px; }
  .trust-note { flex-direction: column; gap: 4px; }
}
