:root {
  color-scheme: light;
  --page: #f7fafc;
  --surface: #ffffff;
  --surface-soft: #eef3f6;
  --ink: #17232d;
  --muted: #607381;
  --line: #c5d2da;
  --accent: #006ab8;
  --accent-dark: #0b2b45;
  --accent-soft: #e8f4fb;
  --danger: #a12a2a;
  --danger-soft: #fff0f0;
  --success: #17613a;
  --success-soft: #eaf7ef;
  --shadow: 0 12px 36px rgba(24, 33, 43, 0.09);
  font-family: "Noto Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.55;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  color: var(--ink);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
}

button,
input,
textarea {
  font: inherit;
}

button,
label,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

a,
button,
input,
textarea,
summary {
  outline-offset: 3px;
}

:focus-visible {
  outline: 3px solid #006ab8;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  color: #fff;
  background: var(--accent-dark);
  border-radius: 0.45rem;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem max(1rem, calc((100vw - 1040px) / 2));
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 14px rgba(24, 33, 43, 0.05);
}

.header-identity {
  min-width: 0;
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.brand-lockup {
  display: flex;
  flex: 0 0 auto;
  gap: 0.8rem;
  align-items: center;
}

.brand-lockup img {
  display: block;
  max-width: 100%;
  object-fit: contain;
}

.brand-lockup__twt {
  width: 150px;
  height: 42px;
}

.brand-lockup__ibss {
  width: 100px;
  height: 42px;
}

.brand-lockup__divider {
  width: 1px;
  height: 34px;
  background: var(--line);
}

.header-context {
  display: grid;
  gap: 0.15rem;
}

.header-context__title {
  display: block;
  color: var(--ink);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 750;
}

.header-context__line {
  color: var(--muted);
  font-size: 0.88rem;
}

.header-tools {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.save-status {
  display: grid;
  gap: 0.35rem;
  max-width: 22rem;
  padding: 0.45rem 0.65rem;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  font-size: 0.82rem;
  line-height: 1.35;
}

.save-status--saved,
.save-status--restored {
  color: var(--success);
  background: var(--success-soft);
}

.save-status--localOnly,
.save-status--retrying,
.save-status--unavailable,
.save-status--localUnavailable,
.save-status--clearFailed,
.save-status--conflict {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #e5b4b4;
}

.save-status__actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.save-status__action {
  min-height: 2rem;
  padding: 0.25rem 0.45rem;
  color: var(--ink);
  background: var(--surface);
}

.reset-dialog__error {
  margin: 0.75rem 0 0;
  color: var(--danger);
  font-weight: 650;
}

.segmented-control {
  display: inline-flex;
  padding: 0.2rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}

.segmented-control__button {
  min-height: 2.45rem;
  padding: 0.45rem 0.85rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0.42rem;
  cursor: pointer;
}

.segmented-control__button[data-active="true"] {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 1px 3px rgba(24, 33, 43, 0.18);
}

#survey-main {
  width: min(100% - 2rem, 920px);
  min-height: calc(100vh - 12rem);
  margin: 2rem auto;
}

.survey-shell {
  padding: clamp(1.2rem, 4vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.localized {
  display: inline;
}

.localized__en,
.localized__zh {
  display: inline;
}

.screen-heading {
  margin: 0 0 1.5rem;
}

.screen-title {
  margin: 0.3rem 0 0;
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  line-height: 1.2;
}

.module-kicker,
.case-ribbon__eyebrow {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.screen-intro,
.submission-action-hint {
  display: block;
  max-width: 72ch;
  margin-top: 0.7rem;
  color: var(--muted);
}

.progress-region {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 30%);
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.3rem;
}

.progress-region__label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.progress-region__bar {
  width: 100%;
  height: 0.65rem;
  overflow: hidden;
  accent-color: var(--accent);
  border-radius: 999px;
}

.case-ribbon {
  display: grid;
  gap: 0.2rem;
  margin: 0 0 1.35rem;
  padding: 0.8rem 1rem;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0.45rem;
}

.case-ribbon[hidden] {
  display: none;
}

.case-ribbon__value {
  font-weight: 650;
}

.participant-summary {
  display: grid;
  gap: 1rem;
  margin: 0 0 1.5rem;
  padding: 1.1rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.participant-summary__section h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.participant-summary__section > .localized {
  display: block;
  margin-top: 0.25rem;
}

.participant-summary ul,
.custody-notice__list {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

.participant-summary li + li,
.custody-notice__list li + li {
  margin-top: 0.35rem;
}

.item-stack {
  display: grid;
  gap: 1.35rem;
}

.survey-item {
  padding: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.survey-item--information {
  background: var(--accent-soft);
  border-color: #bfd7e1;
}

.item-heading {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.item-heading__text {
  font-size: 1.04rem;
  font-weight: 680;
}

.item-heading__badges {
  flex: 0 0 auto;
  padding: 0.2rem 0.5rem;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
}

.item-help,
.privacy-warning {
  display: block;
  margin: 0.45rem 0 0.7rem;
  color: var(--muted);
}

.privacy-warning {
  padding: 0.65rem 0.75rem;
  color: #68480b;
  background: #fff8df;
  border-left: 3px solid #d39b20;
  border-radius: 0.35rem;
}

.option-group,
.compound-group,
.repeat-card {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.option-group {
  display: grid;
  gap: 0.55rem;
}

.option-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.7rem;
  align-items: start;
  padding: 0.75rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  cursor: pointer;
}

.option-card:hover {
  border-color: #8fb3c3;
  background: #fbfdfe;
}

.option-card:has(.option-card__control:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.option-card__control {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.18rem 0 0;
  accent-color: var(--accent);
}

.option-card__marker {
  display: none;
}

.text-control {
  width: 100%;
  min-height: 2.7rem;
  padding: 0.65rem 0.75rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #9daab7;
  border-radius: 0.5rem;
}

.text-control--number {
  max-width: 18rem;
}

.text-control--area {
  resize: vertical;
}

.text-control[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}

.compound-group,
.repeat-stack {
  display: grid;
  gap: 1rem;
}

.compound-field,
.repeat-card,
.repeat-field {
  display: grid;
  gap: 0.45rem;
}

.compound-field,
.repeat-card {
  padding: 0.9rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}

.compound-field__label,
.repeat-field__label,
.repeat-card__legend {
  font-weight: 650;
}

.repeat-card__legend {
  padding: 0 0.3rem;
}

.character-counter {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
}

.field-errors,
.error-summary {
  color: var(--danger);
}

.field-error {
  display: block;
  margin-top: 0.45rem;
  font-weight: 650;
}

.error-summary {
  margin: 0 0 1rem;
  padding: 0.75rem;
  background: var(--danger-soft);
  border: 1px solid #e5abab;
  border-radius: 0.5rem;
}

.error-summary[hidden],
.field-errors[hidden] {
  display: none;
}

.survey-nav {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.button {
  min-height: 2.7rem;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  font-weight: 680;
  cursor: pointer;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button--primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.button--primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.button--secondary,
.button--quiet {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.button--danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.review-list {
  display: grid;
  gap: 0.8rem;
}

.review-card {
  padding: 1rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}

.review-card h2,
.review-card h3 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
}

.review-answer ul {
  margin: 0;
  padding-left: 1.25rem;
}

.review-fields {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) 2fr;
  gap: 0.35rem 1rem;
  margin: 0;
}

.review-fields dt {
  color: var(--muted);
}

.review-fields dd {
  margin: 0;
}

.review-instances {
  display: grid;
  gap: 0.75rem;
}

.custody-notice {
  margin-top: 1.2rem;
  padding: 1rem;
  background: var(--accent-soft);
  border: 1px solid #bfd7e1;
  border-radius: 0.65rem;
}

.custody-notice__heading {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.submission-status {
  margin-top: 1rem;
  padding: 0.9rem;
  border-radius: 0.55rem;
}

.submission-status--submitting,
.submission-status--retry {
  background: #fff8df;
  border: 1px solid #ead28b;
}

.submission-status--failure,
.submission-status--rejected {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #e5abab;
}

.submission-status__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.site-footer {
  width: min(100% - 2rem, 920px);
  margin: 0 auto 2rem;
  display: flex;
  gap: 1.25rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  font-size: 0.86rem;
}

.footer-brands .brand-lockup__twt {
  width: 120px;
  height: 34px;
}

.footer-brands .brand-lockup__ibss {
  width: 80px;
  height: 34px;
}

.footer-brands .brand-lockup__divider {
  height: 28px;
}

.site-footer__notice {
  max-width: 52rem;
  text-align: end;
}

dialog {
  width: min(92vw, 680px);
  max-height: 88vh;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  box-shadow: 0 22px 60px rgba(24, 33, 43, 0.24);
}

dialog::backdrop {
  background: rgba(24, 33, 43, 0.55);
}

.submission-dialog__content,
.reset-dialog > :not(.dialog-actions) {
  padding: 1.25rem;
}

.submission-dialog__content {
  max-height: 68vh;
  overflow: auto;
}

.submission-dialog__body {
  display: grid;
  gap: 0.8rem;
}

.submission-dialog__review {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.dialog-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
}

@media (max-width: 1040px) {
  .site-header {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .header-tools {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .site-header {
    padding-inline: 1rem;
  }

  .header-identity {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .header-tools {
    justify-content: space-between;
  }

  .save-status {
    width: 100%;
    max-width: none;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer__notice {
    text-align: start;
  }

  #survey-main {
    width: min(100% - 1rem, 920px);
    margin: 0.75rem auto 1.5rem;
  }

  .survey-shell {
    padding: 1rem;
    border-radius: 0.7rem;
  }

  .progress-region {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .item-heading {
    flex-direction: column;
  }

  .review-fields {
    grid-template-columns: 1fr;
  }

  .review-fields dd + dt {
    margin-top: 0.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .skip-link,
  .header-tools,
  .survey-nav,
  dialog {
    display: none !important;
  }

  .site-header {
    position: static;
    padding: 0 0 0.75rem;
    border-bottom: 1px solid #17232d;
    box-shadow: none;
  }

  .site-footer {
    width: 100%;
    margin: 1rem 0 0;
    padding: 0.75rem 0 0;
    border: 0;
    border-top: 1px solid #17232d;
    border-radius: 0;
  }

  body,
  html {
    background: #fff;
  }

  #survey-main {
    width: 100%;
    margin: 0;
  }

  .survey-shell {
    padding: 0;
    border: 0;
    box-shadow: none;
  }
}
