:root {
  color-scheme: light;
  --page: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f5f9ff;
  --ink: #17365f;
  --ink-strong: #0d2b50;
  --muted: #5d7795;
  --soft: #7e95b0;
  --line: #b8d3f6;
  --line-strong: #91b9ec;
  --blue: #2874f0;
  --blue-strong: #1464dc;
  --blue-soft: #eaf3ff;
  --green: #087a43;
  --green-soft: #e9f8f0;
  --red: #b42318;
  --red-soft: #fff1f0;
  --amber: #8a5a00;
  --amber-soft: #fff8e7;
  --shadow: 0 20px 60px rgba(23, 54, 95, .09), 0 2px 8px rgba(23, 54, 95, .04);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: var(--blue);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 3px solid rgba(40, 116, 240, .25);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4,
p,
ol,
ul,
dl,
dd {
  margin: 0;
}

.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;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 13px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .16s ease;
}

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

.site-header,
.site-main,
.site-footer {
  width: min(1160px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-strong);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -.035em;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 999px;
  background: var(--blue);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  background: #ffffff;
}

.participant-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .84);
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
  text-decoration: none;
}

.global-status {
  min-height: 1px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.loading-view {
  min-height: min(620px, calc(100dvh - 160px));
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.loading-view h1 {
  font-size: clamp(28px, 9vw, 42px);
  letter-spacing: -.045em;
}

.loading-view p {
  color: var(--muted);
}

.loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #d9e6f7;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.application-hero {
  display: grid;
  gap: 18px;
  padding: 34px 0 24px;
}

#applicationView[data-stage="consent"] .application-hero,
#applicationView[data-stage="consent"] .application-progress {
  display: none;
}

#applicationView[data-stage="details"] .application-hero {
  display: none;
}

#applicationView[data-stage="consent"] .intake-step {
  padding-top: 8px;
}

.consent-card {
  max-width: 760px;
  margin-inline: auto;
}

.consent-message-list {
  max-height: none;
}

.consent-composer .primary-button {
  width: 100%;
}

.eyebrow,
.step-kicker,
.card-kicker,
.success-kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 830;
  letter-spacing: .085em;
  text-transform: uppercase;
}

.application-hero h1 {
  max-width: 780px;
  margin-top: 10px;
  font-size: clamp(39px, 11vw, 66px);
  line-height: .99;
  letter-spacing: -.052em;
  font-weight: 560;
}

.hero-copy {
  max-width: 730px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.time-note {
  align-self: end;
  padding: 14px 15px;
  border: 1px solid #d5e5fa;
  border-radius: 14px;
  background: rgba(242, 248, 255, .9);
  color: #34506f;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.application-progress {
  margin-bottom: 20px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .82);
}

.application-progress ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 0;
  list-style: none;
}

.application-progress li {
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px;
  border-radius: 11px;
  color: var(--soft);
  text-align: center;
}

.application-progress li span {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  font-size: 11px;
  font-weight: 800;
}

.application-progress li strong {
  display: none;
  font-size: 12px;
  line-height: 1.2;
}

.application-progress li[aria-current="step"] {
  background: var(--blue-soft);
  color: #064b9f;
}

.application-progress li[aria-current="step"] span {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.application-progress li[data-complete="true"] {
  color: var(--green);
}

.application-progress li[data-complete="true"] span {
  border-color: #8fcaae;
  background: var(--green-soft);
}

.step-card,
.brief-card,
.chat-card,
.success-card {
  border: 1px solid rgba(211, 218, 228, .95);
  background: rgba(255, 255, 255, .97);
  box-shadow: var(--shadow);
}

.step-card {
  padding: 24px 18px;
  border-radius: 20px;
}

.step-heading {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.step-heading h2,
.work-heading h2 {
  margin-top: 7px;
  font-size: clamp(28px, 8vw, 39px);
  line-height: 1.05;
  letter-spacing: -.042em;
  font-weight: 580;
}

.step-heading > p:last-child,
.work-heading > div > p:last-child {
  margin-top: 9px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.intake-step {
  width: min(780px, 100%);
  margin-inline: auto;
}

.intake-intro {
  padding: 5px 2px 18px;
}

.intake-intro h2 {
  margin-top: 7px;
  font-size: clamp(29px, 8vw, 42px);
  line-height: 1.04;
  letter-spacing: -.043em;
  font-weight: 580;
}

.intake-intro > p:last-child {
  max-width: 640px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.intake-card {
  overflow: hidden;
  border: 1px solid rgba(211, 218, 228, .98);
  border-radius: 20px;
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--shadow);
}

.intake-card-header {
  display: grid;
  gap: 15px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
}

.agent-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.agent-avatar,
.message-avatar {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue);
  color: transparent;
  font-weight: 850;
  font-size: 0;
}

.agent-avatar::after,
.message-avatar::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  background: #ffffff;
}

.agent-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.agent-avatar::after {
  inset: 14px;
}

.agent-identity h3 {
  font-size: 14px;
  line-height: 1.3;
}

.agent-identity p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.intake-progress-block {
  display: grid;
  gap: 6px;
}

.intake-progress-block > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  text-align: right;
}

.intake-progress-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebf1;
}

.intake-progress-bar span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--blue);
  transition: width .2s ease;
}

.intake-message-list {
  min-height: 230px;
  max-height: min(48dvh, 470px);
  display: flex;
  flex-direction: column;
  gap: 15px;
  overflow-y: auto;
  padding: 18px 14px 24px;
  background: linear-gradient(180deg, #f7f9fc 0%, #f4f7fa 100%);
  overscroll-behavior: contain;
  scroll-padding-block: 18px;
}

.intake-message {
  max-width: min(92%, 590px);
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.intake-message[data-role="user"] {
  grid-template-columns: minmax(0, 1fr);
  align-self: flex-end;
}

.message-avatar {
  width: 30px;
  height: 30px;
}

.message-avatar::after {
  inset: 10px;
}

.intake-message > div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 15px 15px 15px 5px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(27, 39, 62, .045);
}

.intake-message[data-role="user"] > div {
  border-color: var(--blue);
  border-radius: 15px 15px 5px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 7px 18px rgba(40, 116, 240, .15);
}

.intake-message[data-kind="consent"] > div {
  border-color: #bdd6f7;
  background: #f7fbff;
}

.message-speaker {
  display: block;
  margin-bottom: 4px;
  color: var(--soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.intake-message[data-role="user"] .message-speaker {
  color: rgba(255, 255, 255, .72);
}

.intake-message p {
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#applicationForm.intake-composer {
  position: sticky;
  bottom: 0;
  z-index: 4;
  gap: 10px;
  padding: 13px 13px calc(13px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -10px 28px rgba(27, 39, 62, .045);
  backdrop-filter: blur(16px);
}

.intake-composer-shell {
  position: relative;
}

.intake-composer-shell textarea {
  width: 100%;
  min-height: 54px;
  max-height: 150px;
  padding: 14px 76px 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: #fbfcfd;
  color: var(--ink);
  line-height: 1.45;
  resize: none;
}

.intake-composer-shell textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(40, 116, 240, .09);
  outline: 0;
}

.intake-composer-shell textarea[aria-invalid="true"] {
  border-color: var(--red);
}

.intake-quick-replies {
  display: grid;
  gap: 9px;
}

.account-credentials {
  padding: 1px;
}

.account-fieldset {
  min-width: 0;
  margin: 0;
  padding: 15px;
  border: 1px solid #bdd6f7;
  border-radius: 14px;
  background: #f5f9ff;
}

.account-fieldset legend {
  padding: 0 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 790;
}

.account-fieldset > p:first-of-type {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.account-field-grid {
  display: grid;
  gap: 11px;
  margin-top: 13px;
}

.account-field-grid label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 740;
}

.account-field-grid input {
  width: 100%;
  min-height: 50px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
}

.account-field-grid input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(40, 116, 240, .09);
  outline: 0;
}

.account-field-grid input[aria-invalid="true"] {
  border-color: var(--red);
}

.account-fieldset .field-hint,
.account-fieldset .field-error {
  margin-top: 9px;
}

.show-password {
  width: fit-content;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #3d495b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 680;
}

.show-password input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
}

.intake-option-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.intake-option-fieldset > legend {
  margin-bottom: 9px;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

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

.intake-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.intake-option:not(.intake-consent-option) input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.intake-option:not(.intake-consent-option) span,
.quick-reply-button {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.intake-option:not(.intake-consent-option) input:checked + span {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: #064a9f;
  box-shadow: inset 0 0 0 1px var(--blue);
}

.intake-option:not(.intake-consent-option) input:focus-visible + span {
  outline: 3px solid rgba(40, 116, 240, .25);
  outline-offset: 2px;
}

.quick-reply-button {
  width: fit-content;
  cursor: pointer;
}

.choice-continue-button {
  width: 100%;
  min-height: 46px;
  margin-top: 9px;
  padding: 9px 14px;
  border: 0;
  border-radius: 11px;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 780;
}

.choice-continue-button:disabled {
  opacity: .5;
}

.intake-consent-fieldset {
  padding: 12px;
  border: 1px solid #bdd6f7;
  border-radius: 13px;
  background: #f5f9ff;
}

.intake-consent-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.intake-consent-option input {
  width: 19px;
  height: 19px;
  margin: 2px 0 0;
  accent-color: var(--blue);
}

.intake-consent-option span {
  color: #334155;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-line;
}

.consent-actions,
.intake-actions {
  display: grid;
  gap: 8px;
}

.consent-actions {
  margin-top: 11px;
}

.text-button {
  min-height: 42px;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 740;
}

.text-button:hover {
  background: var(--blue-soft);
}

.intake-error {
  padding-inline: 3px;
}

#applicationForm {
  display: grid;
  gap: 25px;
  padding-top: 24px;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.form-field {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.form-field > label,
.label-row label,
.choice-fieldset legend {
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.4;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fbfcfd;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.form-field input {
  min-height: 50px;
  padding: 0 14px;
}

.form-field textarea {
  min-height: 112px;
  padding: 13px 14px;
  line-height: 1.5;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(40, 116, 240, .09);
  outline: 0;
}

.form-field input[aria-invalid="true"],
.form-field textarea[aria-invalid="true"] {
  border-color: var(--red);
  background: #fffafa;
}

.compact-field {
  max-width: 460px;
}

.field-hint,
.privacy-copy,
.button-note,
.composer-help,
.readiness-help,
.brief-notice,
.submit-work p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.field-error,
.inline-error {
  color: var(--red);
  font-size: 12px;
  font-weight: 690;
  line-height: 1.45;
}

.choice-fieldset,
.assignment-picker {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-fieldset legend,
.assignment-picker legend {
  padding: 0;
}

.choice-fieldset > .field-hint {
  margin-top: 5px;
}

.choice-grid {
  display: grid;
  gap: 10px;
  margin-top: 11px;
}

.choice-grid label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.choice-grid input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice-grid span {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: #354154;
  font-size: 13px;
  font-weight: 690;
  line-height: 1.3;
  text-align: center;
}

.choice-grid input:checked + span {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: #064a9f;
  box-shadow: inset 0 0 0 1px var(--blue);
}

.choice-grid input:focus-visible + span {
  outline: 3px solid rgba(40, 116, 240, .25);
  outline-offset: 3px;
}

.choice-fieldset[aria-invalid="true"] .choice-grid span {
  border-color: #e2aaa4;
}

.choice-fieldset > .field-error {
  margin-top: 8px;
}

.label-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.label-row span {
  flex: 0 0 auto;
  color: var(--soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.consent-panel {
  display: grid;
  gap: 13px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.consent-row {
  display: grid;
  grid-template-columns: 21px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  cursor: pointer;
}

.consent-row + .field-error + .consent-row {
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.consent-row input {
  width: 19px;
  height: 19px;
  margin: 1px 0 0;
  accent-color: var(--blue);
}

.consent-row span {
  color: #3d495b;
  font-size: 12px;
  line-height: 1.55;
}

.consent-row strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 13px;
}

.error-summary,
.chat-error {
  padding: 13px 14px;
  border: 1px solid #efbbb6;
  border-radius: 12px;
  background: var(--red-soft);
  color: #7a271a;
}

.error-summary {
  margin-top: 19px;
}

.error-summary strong {
  font-size: 13px;
}

.error-summary p,
.chat-error p {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
}

.primary-button,
.send-button {
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-weight: 790;
}

.primary-button {
  width: 100%;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  box-shadow: 0 12px 28px rgba(40, 116, 240, .2);
}

.primary-button:hover:not(:disabled),
.send-button:hover:not(:disabled) {
  background: var(--blue-strong);
}

.primary-button:disabled,
.send-button:disabled {
  opacity: .55;
}

.primary-button[data-loading="true"] {
  cursor: wait;
}

.button-progress {
  display: none;
}

.primary-button[data-loading="true"] .button-label {
  display: none;
}

.primary-button[data-loading="true"] .button-progress {
  display: inline;
}

.button-note {
  text-align: center;
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.assignment-grid {
  display: grid;
  gap: 12px;
  padding-top: 24px;
}

.assignment-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.assignment-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.assignment-card {
  min-height: 162px;
  display: flex;
  flex-direction: column;
  padding: 19px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 37, 61, .04);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.assignment-option:hover .assignment-card {
  border-color: #a9b8ca;
  transform: translateY(-1px);
}

.assignment-option input:checked + .assignment-card {
  border-color: var(--blue);
  background: #f7fbff;
  box-shadow: inset 0 0 0 1px var(--blue), 0 12px 28px rgba(40, 116, 240, .1);
}

.assignment-option input:focus-visible + .assignment-card {
  outline: 3px solid rgba(40, 116, 240, .25);
  outline-offset: 3px;
}

.assignment-card small {
  color: var(--blue);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.assignment-card strong {
  margin-top: 9px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.assignment-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.assignment-card .assignment-result {
  margin-top: auto;
  padding-top: 13px;
  color: #304056;
  font-size: 12px;
  font-weight: 690;
}

.step-actions {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.work-heading {
  display: grid;
  gap: 16px;
  padding: 20px 0;
}

.turn-progress {
  justify-self: start;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid #d4e4fa;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #14549d;
  font-size: 12px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.work-layout {
  display: grid;
  gap: 14px;
}

.brief-card,
.chat-card {
  border-radius: 18px;
  overflow: hidden;
}

.protected-brief {
  padding: 20px 18px;
  -webkit-user-select: none;
  user-select: none;
}

.brief-card h3,
.chat-card h3 {
  margin-top: 6px;
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: -.03em;
}

.brief-section,
.result-card {
  margin-top: 19px;
}

.brief-section h4,
.result-card h4,
.readiness-card h4 {
  font-size: 12px;
  font-weight: 820;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.brief-section p,
.result-card p,
.brief-section li {
  margin-top: 6px;
  color: #435066;
  font-size: 14px;
  line-height: 1.53;
}

.brief-section ul {
  margin-top: 5px;
  padding-left: 19px;
}

.result-card {
  padding: 14px;
  border: 1px solid #d6e5fa;
  border-radius: 13px;
  background: #f2f8ff;
}

.result-card h4 {
  color: #16589f;
}

.brief-notice {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.chat-card {
  display: flex;
  flex-direction: column;
  min-height: 610px;
}

.chat-header {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.chat-header p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.chat-error {
  margin: 13px 14px 0;
}

.message-list {
  min-height: 250px;
  max-height: min(52dvh, 560px);
  display: flex;
  flex-direction: column;
  gap: 13px;
  overflow-y: auto;
  padding: 17px 14px;
  background: #f7f9fc;
  overscroll-behavior: contain;
}

.chat-empty {
  min-height: 210px;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.chat-empty strong {
  color: var(--ink);
  font-size: 16px;
}

.chat-empty span {
  max-width: 390px;
  font-size: 13px;
  line-height: 1.5;
}

.message {
  width: fit-content;
  max-width: min(88%, 680px);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(25, 38, 61, .04);
}

.message[data-role="user"] {
  align-self: flex-end;
  border-color: #0b65d8;
  background: var(--blue);
  color: #fff;
}

.message[data-state="sending"] {
  box-shadow: 0 4px 14px rgba(25, 38, 61, .04), inset 0 0 0 1px rgba(255, 255, 255, .18);
  opacity: .92;
}

.message-loading {
  min-width: 92px;
}

.message-with-resources {
  width: min(100%, 680px);
}

.message-meta {
  margin-bottom: 5px;
  color: var(--soft);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.message[data-role="user"] .message-meta {
  color: rgba(255, 255, 255, .72);
}

.message-content {
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.typing-indicator {
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.typing-indicator > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--soft);
  animation: typing-pulse 1.15s ease-in-out infinite;
}

.typing-indicator > span:nth-child(2) {
  animation-delay: .14s;
}

.typing-indicator > span:nth-child(3) {
  animation-delay: .28s;
}

@keyframes typing-pulse {
  0%, 60%, 100% {
    opacity: .35;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.message-resources {
  display: grid;
  gap: 9px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.message-resources-title {
  color: var(--ink);
  font-size: 11px;
  letter-spacing: .02em;
}

.study-resource-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid #c7dcf7;
  border-radius: 12px;
  background: var(--surface-soft);
}

.study-resource-summary {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.study-resource-badge {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .05em;
}

.study-resource-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.study-resource-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-resource-copy small {
  color: var(--muted);
  font-size: 11px;
}

.study-resource-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.study-resource-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 760;
  text-align: center;
  text-decoration: none;
}

.study-resource-action:hover:not(:disabled) {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.study-resource-preview {
  max-height: min(42dvh, 340px);
  margin: 0;
  overflow: auto;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.readiness-card {
  margin: 0 14px 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.readiness-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.readiness-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.readiness-list {
  display: grid;
  gap: 8px;
  margin-top: 11px;
  padding: 0;
  list-style: none;
}

.readiness-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.readiness-marker {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--soft);
  font-size: 12px;
  font-weight: 850;
}

.readiness-item[data-status="passed"] {
  color: #16663f;
}

.readiness-item[data-status="passed"] .readiness-marker {
  border-color: #82c2a3;
  background: var(--green-soft);
  color: var(--green);
}

.readiness-item[data-status="failed"] {
  color: var(--red);
}

.readiness-item[data-status="failed"] .readiness-marker {
  border-color: #e4aaa4;
  background: var(--red-soft);
  color: var(--red);
}

.readiness-help {
  margin-top: 10px;
}

.task-data-notice {
  margin: 0 14px 14px;
  padding: 12px 13px;
  border: 1px solid #d8e4f3;
  border-radius: 12px;
  background: #f7faff;
}

.task-data-notice h4 {
  color: #244466;
  font-size: 12px;
}

.task-data-notice p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.composer-form {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: auto;
  padding: 15px 14px calc(15px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 -12px 32px rgba(27, 39, 62, .05);
  backdrop-filter: blur(16px);
}

.composer-form[data-awaiting="true"] {
  cursor: wait;
}

.composer-form[data-awaiting="true"] .composer-shell {
  opacity: .72;
}

.composer-form[data-awaiting="true"] textarea,
.send-button[data-loading="true"] {
  cursor: wait;
}

.composer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.composer-heading label {
  font-size: 13px;
  font-weight: 780;
}

.composer-heading span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 740;
}

.composer-shell {
  position: relative;
}

.composer-shell textarea {
  width: 100%;
  min-height: 86px;
  max-height: 180px;
  padding: 12px 75px 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fbfcfd;
  color: var(--ink);
  line-height: 1.5;
  resize: none;
}

.composer-shell textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(40, 116, 240, .09);
  outline: 0;
}

.composer-shell textarea[aria-invalid="true"] {
  border-color: var(--red);
}

.send-button {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 58px;
  min-height: 44px;
  padding: 0 11px;
  font-size: 12px;
}

.composer-help {
  margin-top: 7px;
}

.composer-form .field-error {
  margin-top: 6px;
}

.submit-work {
  display: grid;
  gap: 8px;
  padding: 16px 14px 18px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.success-card {
  width: min(670px, 100%);
  margin: 54px auto 90px;
  padding: 34px 21px;
  border-radius: 22px;
  text-align: center;
}

.success-kicker {
  color: var(--green);
}

.success-card h1 {
  margin-top: 12px;
  font-size: clamp(37px, 11vw, 57px);
  line-height: 1;
  letter-spacing: -.052em;
}

.success-card > p:not(.success-kicker, .success-note) {
  max-width: 530px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.success-details {
  margin-top: 25px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  text-align: left;
}

.success-details div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 15px;
}

.success-details dt {
  color: var(--muted);
  font-size: 12px;
}

.success-details dd {
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 720;
}

.success-note {
  margin-top: 20px;
  color: var(--green);
  font-size: 13px;
  font-weight: 720;
}

.success-account-link {
  margin-top: 20px;
  text-decoration: none;
}

.site-footer {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
  color: var(--soft);
  font-size: 12px;
}

@media (min-width: 520px) {
  .site-header,
  .site-main,
  .site-footer {
    width: min(1160px, calc(100% - 48px));
  }

  .application-progress li strong {
    display: block;
  }

  .intake-card-header {
    grid-template-columns: minmax(0, 1fr) 150px;
    align-items: center;
    padding: 18px 20px;
  }

  .intake-message-list {
    padding: 22px 20px 28px;
  }

  #applicationForm.intake-composer {
    padding-inline: 20px;
  }

  .intake-option-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .consent-actions,
  .intake-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

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

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

  .step-card {
    padding: 30px;
  }

  .protected-brief,
  .chat-header {
    padding: 23px;
  }

  .brief-notice {
    padding-inline: 23px;
  }

  .message-list {
    padding: 20px;
  }

  .readiness-card {
    margin-inline: 20px;
  }

  .task-data-notice {
    margin-inline: 20px;
  }

  .composer-form,
  .submit-work {
    padding-inline: 20px;
  }
}

@media (min-width: 760px) {
  .application-hero {
    grid-template-columns: minmax(0, 1fr) 290px;
    align-items: end;
    padding: 50px 0 32px;
  }

  .application-progress {
    margin-bottom: 26px;
  }

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

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

  .step-actions {
    grid-template-columns: minmax(0, 1fr) minmax(230px, 300px);
    align-items: center;
  }

  .step-actions .button-note {
    text-align: left;
  }

  .work-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    padding: 28px 0 24px;
  }

  .turn-progress {
    justify-self: end;
  }
}

@media (min-width: 980px) {
  .step-card {
    padding: 38px 42px;
  }

  #detailsStep {
    width: min(850px, 100%);
    margin-inline: auto;
  }

  .work-layout {
    grid-template-columns: minmax(300px, 370px) minmax(0, 1fr);
    align-items: start;
    gap: 18px;
  }

  .brief-card {
    position: sticky;
    top: 20px;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
  }

  .chat-card {
    min-height: calc(100dvh - 150px);
  }

  .message-list {
    min-height: 340px;
    max-height: calc(100dvh - 520px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
