:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --soft: #f5f5f7;
  --line: rgba(29, 29, 31, 0.12);
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --teal: #007d8c;
  --teal-dark: #005d66;
  --sage: #8fb79a;
  --coral: #d8644b;
  --amber: #bd8a31;
  --shadow: 0 28px 80px rgba(29, 29, 31, 0.11);
  --fine-shadow: 0 18px 50px rgba(29, 29, 31, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "PingFang SC", "PingFang HK", -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at 52% 0%, rgba(196, 230, 225, 0.7), transparent 34rem),
    radial-gradient(circle at 10% 36rem, rgba(216, 100, 75, 0.1), transparent 24rem),
    linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 48%, #ffffff 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background: url("care-hero-bg.png") center top / cover no-repeat;
  opacity: 0.28;
  filter: saturate(0.95) contrast(0.98);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(180deg, rgba(251, 251, 253, 0.34) 0%, rgba(245, 245, 247, 0.92) 48%, #fff 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.22));
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 0;
}

.hero {
  min-height: clamp(560px, 78vh, 780px);
  display: grid;
  align-content: space-between;
  padding: 8px 0 88px;
}

.hero-topline,
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.hero-topline {
  min-height: 76px;
  border-bottom: 0;
  padding: 0;
  background: transparent;
}

.brand-signature {
  display: inline-flex;
  align-items: center;
  width: max-content;
}

.brand-logo {
  display: block;
  width: clamp(96px, 10vw, 132px);
  height: auto;
  mix-blend-mode: multiply;
  opacity: 0.92;
}

.brand-logo--header {
  width: clamp(112px, 11vw, 146px);
  opacity: 0.86;
}

.brand-mark-image {
  display: block;
  width: clamp(72px, 7vw, 96px);
  height: auto;
  mix-blend-mode: multiply;
  opacity: 0.82;
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 0;
  color: #515154;
  font-size: 13px;
  font-weight: 650;
}

.top-meta span {
  border: 1px solid rgba(29, 29, 31, 0.07);
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.48);
  white-space: nowrap;
}

.language-trigger {
  min-height: 36px;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: #424245;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  font-weight: 650;
}

.language-trigger:hover {
  color: var(--teal-dark);
}

.brand-logo--compact {
  width: 88px;
}

.brand-logo--footer {
  width: 104px;
  opacity: 0.72;
}

.hero__copy {
  max-width: 900px;
  margin-inline: auto;
  text-align: center;
}

.patient-hero .hero__copy {
  padding: clamp(26px, 4vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.2));
  box-shadow: 0 30px 90px rgba(29, 29, 31, 0.08);
  backdrop-filter: blur(24px) saturate(1.15);
  -webkit-backdrop-filter: blur(24px) saturate(1.15);
}

.eyebrow,
.section-heading p,
.result-header p,
.panel-label {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 920px;
  margin: 0 auto 20px;
  font-size: clamp(48px, 7.2vw, 88px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero__copy > [data-i18n="heroBody"] {
  max-width: 760px;
  margin: 0 auto;
  color: #515154;
  font-size: clamp(18px, 2.1vw, 24px);
  line-height: 1.65;
}

.hero__notes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.hero__notes span {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 9px 14px;
  color: #424245;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 10px 30px rgba(29, 29, 31, 0.05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-size: 14px;
  font-weight: 650;
}

.hero__copy > p:not(.eyebrow) {
  margin-bottom: 0;
}

.workspace {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: -46px;
}

.progress-panel,
.form-card {
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(32px) saturate(1.25);
  -webkit-backdrop-filter: blur(32px) saturate(1.25);
}

.progress-panel {
  position: sticky;
  top: 18px;
  padding: 24px;
}

.care-note {
  margin-bottom: 24px;
  color: #515154;
  font-size: 15px;
  line-height: 1.8;
}

.progress-panel strong {
  font-size: 36px;
  letter-spacing: 0;
}

.progress-track,
.result-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 33, 38, 0.1);
}

.progress-track span,
.result-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--sage), var(--coral));
  transition: width 260ms ease;
}

.step-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.step-list li {
  padding: 13px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted);
  font-weight: 600;
}

.step-list li.is-active {
  border-color: rgba(11, 127, 136, 0.22);
  color: var(--teal-dark);
  background: rgba(255, 255, 255, 0.56);
}

.form-card {
  min-height: 620px;
  padding: clamp(28px, 4.4vw, 56px);
}

.form-step {
  display: none;
}

.form-step.is-active {
  display: block;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 28px;
}

.section-heading h2,
.result-header h2 {
  margin-bottom: 0;
  font-size: clamp(31px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: 0;
}

.section-heading span {
  display: block;
  margin-top: 12px;
  color: #6e6e73;
  font-size: 17px;
  line-height: 1.75;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label,
.question {
  display: grid;
  gap: 9px;
}

label span,
.question-title {
  color: #334347;
  font-size: 15px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--ink);
  background: rgba(245, 245, 247, 0.72);
  padding: 12px 14px;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

textarea {
  resize: vertical;
  line-height: 1.7;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(11, 127, 136, 0.68);
  background: var(--panel-strong);
  box-shadow: 0 0 0 4px rgba(11, 127, 136, 0.12);
}

.field-wide {
  grid-column: 1 / -1;
}

.question-stack {
  display: grid;
  gap: 14px;
}

.question {
  padding: 20px;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.choice span {
  display: grid;
  min-height: 64px;
  place-items: center;
  border: 1px solid rgba(29, 29, 31, 0.1);
  border-radius: 14px;
  padding: 9px;
  color: #515154;
  background: rgba(245, 245, 247, 0.78);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.choice input:checked + span {
  border-color: rgba(11, 127, 136, 0.6);
  color: var(--teal-dark);
  background: rgba(225, 244, 242, 0.9);
  transform: translateY(-1px);
}

.result-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 18px;
  align-items: center;
}

.result-header p {
  grid-column: 1 / -1;
}

#scoreBadge {
  min-width: 92px;
  border-radius: 999px;
  padding: 10px 14px;
  color: #fff;
  background: var(--teal-dark);
  font-weight: 800;
  text-align: center;
}

.result-summary {
  margin: 20px 0;
  color: #515154;
  font-size: 17px;
  line-height: 1.9;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.result-grid article,
.recommendation {
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  padding: 18px;
}

.result-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.result-grid strong {
  font-size: 28px;
}

.recommendation {
  margin-top: 14px;
}

.submit-record {
  margin-top: 18px;
}

.completion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.completion-note {
  min-height: 28px;
  margin: 12px 0 0;
  color: var(--teal-dark);
  font-weight: 750;
  line-height: 1.6;
}

.recommendation h3 {
  margin-bottom: 12px;
  font-size: 18px;
}

.recommendation ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: #3d4d52;
  line-height: 1.75;
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
}

.button {
  min-width: 132px;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
}

.button-primary {
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent),
    linear-gradient(135deg, var(--teal-dark), var(--teal));
  box-shadow: 0 14px 28px rgba(7, 91, 98, 0.2);
}

.button-ghost {
  color: var(--teal-dark);
  border-color: rgba(11, 127, 136, 0.22);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(29, 29, 31, 0.04);
}

.doctor-dashboard {
  gap: 18px;
}

.doctor-shell {
  padding-top: 28px;
}

.admin-header {
  margin-bottom: 34px;
}

.admin-link {
  border: 1px solid rgba(0, 93, 102, 0.18);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--teal-dark);
  background: rgba(255, 255, 255, 0.68);
  font-weight: 800;
  text-decoration: none;
}

.dashboard-hero,
.metric-row article,
.record-list-panel,
.record-detail-panel {
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(32px) saturate(1.25);
  -webkit-backdrop-filter: blur(32px) saturate(1.25);
}

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  padding: clamp(28px, 4vw, 48px);
}

.dashboard-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: 0;
}

.dashboard-hero span {
  display: block;
  max-width: 680px;
  margin-top: 14px;
  color: #515154;
  font-size: 18px;
  line-height: 1.75;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric-row article {
  padding: 22px;
}

.metric-row span,
.dashboard-heading span,
.record-item small,
.detail-topline span,
.detail-profile span,
.detail-score span,
.detail-mini-grid span {
  color: var(--muted);
}

.metric-row span {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
}

.metric-row strong {
  font-size: 42px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.86fr) minmax(0, 1.4fr);
  gap: 18px;
  align-items: start;
}

.record-list-panel,
.record-detail-panel {
  min-height: 520px;
  padding: 22px;
}

.dashboard-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 16px;
}

.dashboard-heading h2,
.record-detail h2 {
  margin: 0;
  font-size: 24px;
}

.record-list {
  display: grid;
  gap: 10px;
}

.record-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 16px;
  padding: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.54);
  cursor: pointer;
  text-align: left;
}

.record-item.is-active {
  border-color: rgba(0, 125, 140, 0.42);
  background: rgba(225, 244, 242, 0.72);
}

.record-item span {
  display: grid;
  gap: 4px;
}

.record-item strong {
  font-size: 16px;
}

.record-item em,
.risk-pill {
  align-self: start;
  border-radius: 999px;
  padding: 7px 10px;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.risk-low {
  color: #176b45;
  background: rgba(143, 183, 154, 0.22);
}

.risk-mid {
  color: #795012;
  background: rgba(189, 138, 49, 0.22);
}

.risk-high {
  color: #8a2e20;
  background: rgba(216, 100, 75, 0.22);
}

.empty-list,
.empty-state span {
  color: var(--muted);
  line-height: 1.75;
}

.record-detail {
  display: grid;
  gap: 18px;
}

.empty-state {
  align-content: center;
  min-height: 470px;
}

.detail-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.detail-score {
  display: grid;
  gap: 8px;
  border-radius: 18px;
  padding: 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
}

.detail-score strong {
  font-size: 54px;
  line-height: 1;
}

.detail-score span {
  color: rgba(255, 255, 255, 0.84);
  font-weight: 700;
  line-height: 1.55;
}

.detail-profile,
.answer-group {
  display: grid;
  gap: 10px;
}

.detail-profile span {
  border-bottom: 1px solid rgba(29, 29, 31, 0.08);
  padding-bottom: 10px;
  line-height: 1.65;
}

.detail-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-mini-grid article,
.answer-group {
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
  padding: 16px;
}

.detail-mini-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.answer-group h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.language-gate {
  position: fixed;
  top: 112px;
  right: 38px;
  z-index: 20;
  width: min(420px, calc(100% - 32px));
}

.language-gate.is-hidden {
  display: none;
}

.language-card {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--fine-shadow);
  backdrop-filter: blur(26px) saturate(1.22);
  -webkit-backdrop-filter: blur(26px) saturate(1.22);
}

.language-card .brand-logo {
  width: 92px;
  opacity: 0.86;
}

.language-card p {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.language-card h1 {
  margin: 0;
  font-size: 23px;
  line-height: 1.15;
}

.language-card h2 {
  margin: 8px 0 0;
  color: #515154;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
}

.language-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 18px;
}

.language-actions .button {
  width: 100%;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: end;
  margin-top: 56px;
  border-top: 1px solid rgba(29, 29, 31, 0.1);
  padding: 26px 0 34px;
}

.footer-copy {
  display: grid;
  gap: 6px;
  justify-items: end;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.footer-copy p {
  margin: 0;
}

.report-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(245, 245, 247, 0.72);
  backdrop-filter: blur(28px) saturate(1.18);
  -webkit-backdrop-filter: blur(28px) saturate(1.18);
}

.report-modal.is-hidden {
  display: none;
}

.report-sheet {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(520px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 24px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.report-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  aspect-ratio: 1;
  border: 0;
  border-radius: 999px;
  color: #515154;
  background: rgba(245, 245, 247, 0.9);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.report-sheet h2 {
  margin: 0;
  padding-right: 38px;
  font-size: 25px;
  line-height: 1.2;
}

.report-sheet p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

#reportPreview {
  display: block;
  width: 100%;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(29, 29, 31, 0.08);
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.report-actions .button {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border-top: 1px solid rgba(29, 29, 31, 0.08);
  padding-top: 10px;
  color: #424245;
  line-height: 1.55;
}

.answer-row strong {
  color: var(--teal-dark);
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .workspace,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    align-items: start;
    flex-direction: column;
  }

  .progress-panel {
    position: static;
  }

  .step-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .hero {
    min-height: 420px;
    padding-bottom: 44px;
  }

  .hero-topline {
    min-height: auto;
    align-items: center;
    border-radius: 0;
    flex-direction: row;
    gap: 16px;
    padding: 0 0 8px;
  }

  .top-meta {
    display: flex;
    width: auto;
    gap: 0;
    font-size: 12px;
  }

  .top-meta span {
    padding: 7px 8px;
    white-space: normal;
    text-align: center;
  }

  .language-trigger {
    min-height: 32px;
    padding: 0;
  }

  h1 {
    font-size: clamp(42px, 13vw, 58px);
  }

  .hero__copy > p:not(.eyebrow) {
    font-size: 17px;
    line-height: 1.7;
  }

  .workspace {
    margin-top: -20px;
  }

  .patient-hero .hero__copy {
    border-radius: 24px;
    padding: 24px 18px;
  }

  .brand-logo {
    width: 104px;
  }

  .brand-logo--header {
    width: 108px;
  }

  .brand-mark-image {
    width: 100px;
  }

  .brand-logo--compact,
  .language-card .brand-logo {
    width: 96px;
  }

  .progress-panel,
  .form-card,
  .dashboard-hero,
  .metric-row article,
  .record-list-panel,
  .record-detail-panel {
    border-radius: 18px;
  }

  .field-grid,
  .result-grid,
  .step-list,
  .metric-row,
  .detail-mini-grid {
    grid-template-columns: 1fr;
  }

  .answer-row {
    grid-template-columns: 1fr;
  }

  .answer-row strong {
    text-align: left;
    white-space: normal;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .result-header {
    grid-template-columns: 1fr;
  }

  #scoreBadge {
    width: max-content;
  }

  .actions {
    position: sticky;
    bottom: 0;
    padding-top: 12px;
    background: linear-gradient(rgba(246, 250, 247, 0), rgba(246, 250, 247, 0.9) 35%);
  }

  .completion-actions,
  .language-actions {
    display: grid;
  }

  .report-actions {
    display: grid;
  }

  .language-gate {
    top: 108px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .footer-copy {
    justify-items: start;
  }
}
