/* Screen typography and color. Print styles are defined separately. */
:root {
  --ink: #243238;
  --body: #3b4b52;
  --muted: #526169;
  --line: #cbd2d5;
  --teal: #146973;
  --teal-dark: #0e535c;
  --wash: #eceeef;
  --paper-muted: #f1f2f3;
  --quiet: #e2e6e7;
  --control-border: #778991;
  --upload: #3a6188;
  --upload-dark: #2d5175;
  --secondary: #4b5d70;
  --on-teal: #e8f5f5;
  --ui-font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Noto Sans SC", system-ui, sans-serif;
}
body {
  font-family: var(--ui-font);
  font-size: 15px;
  line-height: 1.75;
  font-weight: 400;
  background: var(--wash);
  letter-spacing: 0;
}
html[lang=en] body { font-family: var(--ui-font); }
.header { border-top: 2px solid var(--teal-dark); border-bottom-color: var(--line); }
.header-inner, .container { max-width: 1248px; padding-left: 32px; padding-right: 32px; }
.header-inner { min-height: 84px; }
.brand-logo { width: 306px; }
.research-pill { font-size: 12px; padding: 6px 12px; background: var(--paper-muted); border-color: var(--line); }
.research-pill small { font-size: 11px; }
.header-tools { gap: 20px; }
.language-button { font-size: 12px; padding: 7px 11px; border-radius: 8px; gap: 10px; }
.hero { margin: 32px 0 22px; gap: 28px; }
.hero h1, html[lang=en] .hero h1 {
  margin: 0 0 8px;
  font: 400 28px/1.45 var(--ui-font);
  letter-spacing: 0;
  text-wrap: balance;
}
html[lang|="zh"] .hero h1 {
  font-weight: 700;
  letter-spacing: .04em;
}
.hero-copy, html[lang=en] .hero-copy { font-size: 15px; line-height: 1.75; max-width: 760px; color: var(--body); }
.privacy-note { font-size: 13px; padding-left: 24px; gap: 12px; margin-top: 18px; }
.privacy-note strong { font-weight: 600; }
.privacy-note p { font-size: 13px; margin-top: 4px; }
.privacy-note .icon { width: 22px; height: 24px; }
.scope-banner { min-height: 52px; padding: 12px 20px; gap: 12px; margin-bottom: 24px; font-size: 13px; line-height: 1.6; border-radius: 4px; background: #e3ecee; border-color: var(--line); border-left: 3px solid var(--teal); }
.scope-banner .icon { width: 16px; height: 16px; }
.scope-range { font-family: inherit; font-size: 14px; font-weight: 400; }
.scope-reminder { font-size: 13px; }
.workspace { grid-template-columns: 1.1fr 1fr; gap: 24px; }
.card { border: 1px solid var(--line); border-radius: 6px; padding: 25px; box-shadow: none; }
.input-card, .result-card, html[lang=en] .input-card, html[lang=en] .result-card { min-height: 0; }
.section-top { margin-bottom: 7px; gap: 12px; }
h2, html[lang=en] h2 { font-size: 21px; font-weight: 700; line-height: 1.5; gap: 12px; letter-spacing: 0; }
.required-hint { font-size: 13px; color: var(--muted); }
.required { margin-left: 3px; color: #b95043; }
.subtle { font-size: 14px; line-height: 1.75; color: var(--body); }
.field-note { font-size: 13px; line-height: 1.75; color: var(--body); }
.section-description { margin-bottom: 22px; }
.report-upload { margin-bottom: 24px; border-radius: 10px; border-color: #dfe9e5; background: #f6f9f7; }
.report-upload > summary { min-height: 76px; padding: 13px 15px; gap: 12px; border-radius: 10px; }
.report-icon { width: 36px; height: 38px; border-radius: 9px; }
.report-icon .icon { width: 20px; height: 20px; }
.report-copy strong { font-size: 15px; line-height: 1.55; font-weight: 700; text-wrap: balance; }
.report-copy small { font-size: 13px; line-height: 1.65; margin-top: 3px; }
.optional-tag { font-size: 12px; padding: 1px 0; border-color: transparent; background: transparent; color: var(--muted); }
summary > .icon-chevron { width: 14px; height: 14px; }
.group-title { color: var(--teal-dark); font-size: 16px; font-weight: 700; line-height: 1.6; margin-bottom: 16px; padding-left: 0; }
.group-title::before { content: none; }
.field-grid { gap: 18px 16px; }
.field { font-size: 15px; }
.field-label, .field > span:not(.input-wrap) { min-height: 24px; line-height: 1.55; row-gap: 2px; margin-bottom: 7px; }
.field b { font-size: 15px; font-weight: 400; }
.field-context, html[lang=en] .field-context { font-size: 12px; color: var(--muted); font-weight: 400; flex-shrink: 0; }
.compact-dimensions .compact-dimension-heading > strong { font-size: 15px; font-weight: 400; }
.compact-dimensions .compact-unit-label, .compact-dimensions .compact-dimension-footer p, .compact-dimension-error { font-size: 13px; }
.compact-dimensions .compact-dimension-footer p { text-wrap: wrap; }
.compact-dimensions .compact-estimate output { font-family: var(--ui-font); }
input[type=number], input[type=password], select { height: 48px; padding: 11px 13px; border-color: var(--control-border); border-radius: 5px; background-color: #fff; font-size: 15px; line-height: 1.65; }
input[type=number] { padding-right: 61px; font-variant-numeric: tabular-nums; }
input::placeholder { color: var(--muted); font-weight: 400; }
select { color: var(--muted); padding-right: 32px; }
.input-unit { right: 13px; font-family: inherit; font-size: 12px; color: var(--muted); }
.mri-section { margin-top: 24px; padding-top: 22px; border-color: var(--line); }
.missing-details { margin-top: 8px; }
.missing-details > summary { font-size: 13px; min-height: 34px; gap: 7px; color: var(--teal); }
.consent-block { margin-top: 17px; padding-top: 12px; border-color: var(--line); }
.check-row { font-size: 15px; line-height: 1.7; margin: 8px 0; gap: 10px; color: var(--body); align-items: flex-start; }
.check-row input[type=checkbox] { width: 15px; height: 15px; margin-top: 5px; accent-color: #136265; }
.form-actions { padding-top: 30px; gap: 10px; }
.button { min-height: 48px; font-size: 14px; border-radius: 6px; font-weight: 500; }
.button.primary { background: #136265; border-color: #136265; box-shadow: none; }
.button.secondary { border-color: #dce5e8; background: #fff; color: #5a6d77; }
.badge { font-size: 12px; padding: 4px 10px; line-height: 1.5; font-weight: 400; }
.badge.muted { background: var(--quiet); color: var(--muted); }
.primary-result { border-radius: 12px; background: var(--teal-dark); border-color: var(--teal-dark); padding: 18px 22px 15px; color: var(--teal-dark); }
.outcome-meta { font: 600 13px/1.5 var(--ui-font); letter-spacing: .2px; }
.outcome-meta small { font: 400 11px/1.6 var(--ui-font); padding: 2px 7px; border-color: #cee3d5; background: #e3efe7; border-radius: 5px; }
html[lang=en] .outcome-meta small { font-family: inherit; }
.outcome-title, html[lang=en] .outcome-title { font-size: 18px; line-height: 1.55; font-weight: 700; margin-top: 6px; }
.risk-number { font: 500 clamp(40px, 4vw, 52px)/1.15 var(--ui-font); margin: 12px 0 9px; letter-spacing: 0; color: var(--teal-dark); font-variant-numeric: tabular-nums; }
.risk-number span, .secondary-number span { font-size: .52em; font-weight: 400; margin-inline-start: .18em; vertical-align: baseline; }
progress { height: 5px; }
progress::-webkit-progress-bar { background: #dce5df; }
.scale { font-family: inherit; font-size: 11px; color: var(--body); margin-top: 4px; }
.secondary-result { margin-top: 14px; min-height: 92px; padding: 15px 18px; border-radius: 10px; border-color: var(--line); }
.secondary-result small { font-size: 12px; color: var(--muted); }
.secondary-result small span { margin-left: 6px; }
.secondary-result strong { font-size: 16px; line-height: 1.6; font-weight: 600; margin-top: 4px; }
.secondary-number { font: 500 clamp(28px, 3vw, 34px)/1.2 var(--ui-font); color: #36515d; }
.derived-section { margin-top: 22px; padding-top: 20px; border-color: var(--line); }
.derived-heading { margin-bottom: 12px; }
.derived-heading h3 { font-size: 16px; font-weight: 700; }
.derived-heading > small { font-size: 12px; color: var(--muted); }
.derived-grid { gap: 10px; }
.derived-grid > div { display: flex; flex-direction: column; justify-content: space-between; min-height: 74px; border-radius: 9px; background: var(--paper-muted); padding: 10px 14px; }
.derived-grid small { font-size: 13px; line-height: 1.6; color: var(--body); }
.derived-grid em { font: 400 10px/1.6 var(--ui-font); color: var(--muted); }
.derived-grid strong { font: 400 24px/1.35 var(--ui-font); margin-top: 7px; color: var(--ink); }
.interpret-box.interpretation-card { margin-top: 22px; padding: 16px 18px; border-radius: 10px; }
.interpretation-card[data-tone="neutral"] { background: #f6f8f7; border-color: #e0e8e4; }
.interpretation-card h3 { font-size: 13px; line-height: 1.65; gap: 7px; color: var(--interpret-accent); font-weight: 700; }
.interpretation-card h4, html[lang=en] .interpretation-card h4,
.interpretation-card[data-state="waiting"] h4 { font-size: 15px; font-weight: 600; line-height: 1.65; margin: 9px 0 5px; color: var(--ink); }
.interpretation-card .interpret-copy, html[lang=en] .interpretation-card .interpret-copy { font-size: 14px; line-height: 1.75; color: var(--body); }
.model-details { margin-top: 16px; }
.model-details > summary, .model-details[open] > summary { min-height: 38px; display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 700; color: var(--teal); }
.model-details .model-description p, html[lang=en] .model-details .model-description p { font-size: 13px; line-height: 1.9; text-align: start; }
#result-time:empty { display: none; }
.result-actions { padding-top: 18px; margin-top: auto; gap: 10px; border-color: var(--line); }
.result-actions .button { min-height: 46px; font-size: 13px; }
.result-actions .button:disabled { background: #f5f8f8; border-color: #e4ebed; color: #7a8d94; }
.below-card { margin: 22px 0 24px; gap: 8px; color: var(--muted); font-size: 11px; line-height: 1.85; }
footer { padding: 20px 0 25px; font-size: 11px; color: var(--muted); border-color: var(--line); }
.text-button { font-size: inherit; color: var(--teal); }
html[lang=en] .hero > div { max-width: 800px; }
html[lang=en] .field-label { flex-wrap: wrap; }
@media(max-width: 900px) {
  .header-inner, .container { padding-left: 24px; padding-right: 24px; }
  .hero { flex-wrap: wrap; }
  .privacy-note { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .input-card, .result-card { min-height: 0; }
  .form-actions { margin-top: 0; padding-top: 24px; }
  .result-actions { margin-top: 24px; }
  .scope-reminder { margin-left: 0; }
}
@media(max-width: 480px) {
  .header-inner, .container { padding-left: 18px; padding-right: 18px; }
  .header-inner { min-height: 72px; gap: 12px; }
  .brand-logo { width: 250px; }
  .research-pill { display: none; }
  .language-button { padding: 6px 8px; font-size: 11px; gap: 7px; }
  .hero { margin-top: 24px; margin-bottom: 20px; }
  .hero h1, html[lang=en] .hero h1 { font-size: 22px; }
  .hero-copy, html[lang=en] .hero-copy { font-size: 14px; line-height: 1.75; }
  .scope-banner { padding: 12px 14px; column-gap: 8px; row-gap: 7px; font-size: 12px; }
  .scope-range { font-size: 13px; border: 0; padding-left: 0; margin-left: 25px; }
  .scope-reminder { font-size: 12px; flex-basis: 100%; margin-left: 25px; }
  .workspace { gap: 20px; }
  .card { padding: 21px 16px; border-radius: 6px; }
  h2, html[lang=en] h2 { font-size: 20px; }
  .section-description { margin-bottom: 18px; }
  .report-upload > summary { padding: 12px; gap: 10px; }
  .report-copy strong { font-size: 14px; }
  .report-copy small { font-size: 12px; }
  .report-icon { width: 32px; height: 36px; }
  .optional-tag { font-size: 10px; padding: 1px 4px; }
  .field-grid { gap: 17px 12px; }
  input[type=number], select { height: 47px; padding-left: 11px; }
  .input-unit { font-size: 11px; right: 10px; }
  .field-context { font-size: 11px; }
  .primary-result { padding: 18px; }
  .derived-grid > div { padding: 12px; }
  .derived-grid small { font-size: 12px; }
  .derived-grid em { font-size: 10px; }
  .below-card { font-size: 12px; text-align: left; align-items: flex-start; }
  footer { font-size: 10px; row-gap: 10px; }
}

/* Keep calculated guidance as readable as the initial empty state. */
.interpret-metrics { font-size: 12px; gap: 7px 10px; }
.interpret-value { font-size: 14px; padding: 3px 8px; }
.interpret-relation { font-size: 12px; }
.interpret-clinical { font-size: 13px; line-height: 1.85; }
.interpret-note, .interpret-precision { font-size: 13px; line-height: 1.75; }
.tiny { font-size: 12px; line-height: 1.8; }

/* Keep form controls quiet and give the primary outcome the strongest hierarchy. */
.section-top { gap: 8px 12px; flex-wrap: wrap; }
.report-upload { background: var(--paper-muted); border-color: var(--line); border-radius: 6px; }
.report-upload > summary:hover { background: var(--quiet); }
.report-icon { color: var(--teal); background: var(--quiet); border-radius: 5px; }
.button.primary:hover:not(:disabled) { background: var(--teal-dark); }
.button.secondary { border-color: var(--line); color: var(--ink); }
.button.secondary:hover:not(:disabled) { background: var(--quiet); border-color: var(--control-border); }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
.outcome-meta, .primary-result p { color: var(--body); }
.outcome-meta small { background: transparent; border-color: var(--line); color: var(--teal-dark); }
progress { background: #dce5df; }
progress::-webkit-progress-value { background: var(--teal); }
progress::-moz-progress-bar { background: var(--teal); }
.secondary-number, .derived-grid strong { font-variant-numeric: tabular-nums; }
.secondary-result { border-radius: 6px; }
.derived-grid > div { border-radius: 5px; }
.interpret-box.interpretation-card { border-radius: 6px; }
.field-note, .result-caption, .scope-reminder { color: var(--body); }
footer .text-button { font-size: inherit; }
dialog { border-radius: 10px; }
dialog::backdrop { background: #172d3a66; backdrop-filter: none; }
@media (max-width: 480px) {
  .outcome-meta { flex-wrap: wrap; }
  input[type=number], input[type=password], select { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Report upload, record retention and calculated results. */
.scope-banner { background: var(--quiet); }
.scope-banner strong, .scope-banner .icon { color: var(--teal-dark); }
.report-upload { background: var(--paper-muted); }
.report-upload > summary:hover, .button.secondary:hover:not(:disabled) { background: var(--quiet); }
.report-icon { background: var(--quiet); }
.report-copy small { color: var(--body); }
.button.primary { background: var(--teal); border-color: var(--teal); }
.check-row input[type=checkbox] { accent-color: var(--teal); }
.research-share { margin: 8px 0 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper-muted); }
.research-share .check-row { margin: 0 0 10px; }
.research-share .field { max-width: 360px; }
#follow-up-phone {
  display: block;
  width: 100%;
  height: 44px;
  padding: 8px 11px;
  border: 1px solid var(--control-border);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}
#follow-up-phone:disabled { background: var(--quiet); cursor: not-allowed; }
#research-share-status { color: var(--body); }
.primary-result {
  background: var(--paper-muted);
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  color: var(--ink);
}
.outcome-meta, .primary-result p, .scale { color: var(--body); }
.outcome-meta small { background: transparent; border-color: var(--line); color: var(--body); }
.risk-number { color: var(--teal-dark); }
progress { background: #dce5df; }
progress::-webkit-progress-bar { background: #dce5df; }
progress::-webkit-progress-value { background: var(--teal); }
progress::-moz-progress-bar { background: var(--teal); }
.derived-grid > div { background: var(--paper-muted); }
#login-dialog p { font-size: 14px; line-height: 1.7; }

@media (max-width: 480px) {
  .form-actions, .result-actions { gap: 8px; }
}

/* Use solid colors for major actions and neutral surfaces for supporting content. */
.header { border: 0; background: #f0feff; }
.language-button, .research-pill { background: var(--quiet); }
.hero {
  display: block;
  margin: 0 0 24px;
  padding: 17px 0 19px;
  background: #126f77;
}
.hero > .hero-inner, html[lang=en] .hero > .hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1248px;
}
.hero h1, html[lang=en] .hero h1 {
  color: #fff;
}
.hero .hero-copy, .hero .privacy-note :is(p, .icon) { color: var(--on-teal); }
.privacy-note { border-color: #73a9ad; margin-top: 0; color: #fff; }
.scope-banner {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--quiet);
  color: var(--body);
}
.scope-range { border-color: #b5c0c4; }
.card { border-radius: 10px; }
.section-top h2 { color: var(--teal-dark); }
.report-upload { border-radius: 9px; }
.report-upload > summary { border-radius: 8px; background: var(--upload); color: #fff; }
.report-upload > summary:hover { background: var(--upload-dark); }
.report-upload[open] > summary { border-radius: 8px 8px 0 0; }
.report-upload > summary :is(.optional-tag, .icon-chevron, .report-copy strong, .report-copy small) { color: #fff; }
.report-icon { border-radius: 7px; background: var(--upload-dark); color: #fff; }
:is(input[type=number], input[type=password], select, #follow-up-phone) { border-radius: 9px; }
.button { border-radius: 10px; }
.research-share { border-radius: 10px; }
.badge:not(.warn, .muted) { background: var(--teal); color: #fff; }
.primary-result {
  border: 1px solid var(--teal-dark);
  border-radius: 10px;
  background: var(--teal-dark);
  color: #fff;
}
.primary-result :is(.outcome-meta, .outcome-title, .risk-number) { color: #fff; }
.primary-result :is(p, .scale) { color: var(--on-teal); }
.outcome-meta small { background: transparent; border-color: #89c3c3; color: #fff; }
progress { background: #3b7680; }
progress::-webkit-progress-bar { background: #3b7680; }
progress::-webkit-progress-value { background: #8bdfca; }
progress::-moz-progress-bar { background: #8bdfca; }
.secondary-result { border-color: var(--secondary); border-radius: 9px; background: var(--secondary); }
.secondary-result :is(small, strong, .secondary-number, p) { color: #fff; }
.derived-heading h3, .derived-grid strong { color: var(--teal-dark); }
.derived-grid > div { border-radius: 8px; background: var(--quiet); }
.interpret-box.interpretation-card { border-radius: 9px; background: var(--paper-muted); border-color: var(--line); }
.interpretation-card[data-tone="assessment"] {
  --interpret-accent: #773f16;
  background: #ede8e2;
  border-color: #d5c7b9;
}
.interpretation-card[data-tone="assessment"] .interpret-value { color: #fff; background: var(--interpret-accent); border-color: var(--interpret-accent); }
@media (max-width: 480px) {
  .hero { margin-bottom: 16px; padding-block: 14px; }
}
