:root {
  --md-red: #b3262d;
  --md-red-dark: #8f1f25;
  --ink: #263238;
  --muted: #68757d;
  --line: #e4e8ea;
  --surface: #ffffff;
  --surface-soft: #fffaf6;
  --surface-warm: #fbf2ec;
  --blue: #245b85;
  --blue-soft: #edf5fb;
  --shadow: 0 10px 28px rgba(33, 43, 54, 0.08);
  --radius-lg: 18px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #fffdfb 0, #fff9f5 48%, #f7f1ed 100%);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

button, textarea, input { font: inherit; }

.site-header {
  background:
    radial-gradient(circle at 82% 18%, rgba(179,38,45,.07), transparent 24%),
    linear-gradient(135deg, #fffdfb 0%, #fff8f3 58%, #fffdfb 100%);
  border-bottom: 1px solid #eadfd8;
  box-shadow: 0 4px 18px rgba(92, 62, 45, .06);
}

.brand-shell {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.mdacc-logo {
  width: 150px;
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
}

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

.header-coco-avatar {
  width: 128px;
  height: 128px;
  flex: 0 0 128px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  background: #f9eee8;
  box-shadow:
    0 0 0 2px #efd8cf,
    0 10px 26px rgba(113, 70, 55, .14);
}

.title-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.title-block h1 {
  margin: 0;
  font-size: clamp(1.85rem, 3vw, 2.55rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: #24313a;
}

.coco-subtitle {
  margin: 2px 0 0;
  font-size: 1.02rem;
  line-height: 1.15;
  font-weight: 650;
  color: var(--md-red-dark);
}

.study-info {
  margin-top: 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.study-number {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .97rem;
  line-height: 1.3;
  color: #52616a;
}

.study-number-link {
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.study-number strong { color: #27343b; }
.study-number-placeholder { margin-top: 8px; }
.study-icon { font-size: .95rem; }

.welcome-avatar {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 10px;
  border: 2px solid #f0d9d9;
}

.user-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  object-fit: cover;
}

.message-stack {
  display: flex;
  flex-direction: column;
}

.user-stack {
  align-items: flex-end;
}

.user-label {
  color: var(--blue);
  margin: 0 4px 5px 0;
}

.title-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.coco-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.coco-title-row h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: #20282d;
}

.coco-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f7e8e9;
  color: var(--md-red-dark);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .01em;
}







.study-number strong { color: #27343b; }
.study-number-placeholder { margin-top: 8px; }
.study-icon { font-size: .95rem; }

.clinicaltrials-link {
  width: fit-content;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}

.clinicaltrials-link:hover,
.clinicaltrials-link:focus { text-decoration: underline; }

.main-shell {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 28px 120px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.status-card,
.thinking-card {
  align-self: center;
  text-align: center;
  color: var(--muted);
  padding: 18px;
}

.loader {
  width: 42px;
  height: 42px;
  border: 5px solid #eceff1;
  border-top-color: var(--md-red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

.loader-small { width: 28px; height: 28px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

.chat-container {
  flex: 1;
  min-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(255,255,255,.9);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message-row {
  display: flex;
  width: 100%;
  align-items: flex-end;
  gap: 10px;
}

.user-row { justify-content: flex-end; }
.coco-row { justify-content: flex-start; }

.coco-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #b3262d, #d75a61);
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(179,38,45,.2);
}

.message-bubble {
  max-width: min(76%, 760px);
  padding: 13px 16px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.user-message {
  background: #245b85;
  color: #fff;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 5px 16px rgba(36,91,133,.14);
}

.coco-message {
  background: #fbf2ec;
  border: 1px solid #ebe2db;
  border-radius: 16px 16px 16px 4px;
  color: #2e383e;
}

.message-label {
  margin-bottom: 5px;
  color: var(--md-red-dark);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.answerContent p:first-child { margin-top: 0; }
.answerContent p:last-child { margin-bottom: 0; }
.answerContent ul, .answerContent ol { padding-left: 1.35rem; }
.answerContent a { color: var(--blue); }

.intro-message { margin-bottom: 4px; }

.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 22px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: #8b9499;
  border-radius: 50%;
  animation: pulse 1.1s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.composer {
  position: fixed;
  z-index: 50;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0) 0%,
      rgba(255,255,255,.92) 28%,
      rgba(255,255,255,.98) 100%
    );
}

.composer-inner {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.composer-pill {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 8px 7px 12px;

  background: #fff;
  border: 1px solid #dde2e5;
  border-radius: 30px;

  box-shadow:
    0 4px 18px rgba(33,43,54,.10),
    0 1px 2px rgba(33,43,54,.05);
}

.composer-pill:focus-within {
  border-color: #ccd5da;
  box-shadow:
    0 6px 22px rgba(33,43,54,.12),
    0 0 0 1px rgba(36,91,133,.04);
}


#questionInput {
  flex: 1;
  min-width: 0;

  height: auto;
  min-height: 38px;
  max-height: 140px;

  margin: 0;
  padding: 8px 4px 7px;

  resize: none;
  overflow-y: hidden;

  border: 0;
  outline: 0;
  background: transparent;

  color: var(--ink);
  font-size: 1rem;
  line-height: 1.4;
}

#questionInput::placeholder {
  color: #7f898f;
  opacity: 1;
}

#questionInput:focus {
  border: 0;
  outline: 0;
  box-shadow: none;
}

.composer-mic {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;

  display: grid;
  place-items: center;
  align-self: flex-end;

  padding: 0;
  border: 0;
  border-radius: 50%;

  background: transparent;
  color: #222b30;

  font-size: 1.1rem;
  cursor: pointer;
}

.composer-mic:hover {
  background: #f1f3f4;
}

.composer-mic.listening {
  background: #f8dddd;
  color: var(--md-red-dark);
}

.send-button {
  width: 40px;
  height: 40px;
  min-height: 40px;
  flex: 0 0 40px;

  display: grid;
  place-items: center;
  align-self: flex-end;

  padding: 0;
  border: 0;
  border-radius: 50%;

  background: #4a86f7;
  color: #fff;

  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;

  cursor: pointer;

  box-shadow: 0 3px 10px rgba(74,134,247,.28);

  transition:
    transform .15s ease,
    background .15s ease,
    box-shadow .15s ease;
}

.send-button:hover {
  background: #3d78e8;
  box-shadow: 0 5px 14px rgba(74,134,247,.32);
}

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

.send-button:disabled {
  opacity: .45;
  cursor: default;
  box-shadow: none;
}

.composer-hint {
  max-width: 900px;
  margin: 5px auto 0;
  padding-right: 8px;

  text-align: right;
  color: #8a9499;
  font-size: .70rem;
}

.welcome-card,
.upload-card,
.upload-progress-card {
  width: min(100%, 760px);
  margin: 36px auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
}

.welcome-card {
  text-align: center;
}

.welcome-card h2,
.upload-card h2 { margin: 6px 0 8px; }

.warm-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  color: #fff;
  background: linear-gradient(145deg, #b3262d, #d75a61);
  font-size: 1.3rem;
  font-weight: 800;
}

.welcome-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.welcomeButton,
.primary-link-button,
.secondary-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 11px;
  text-decoration: none;
  font-weight: 700;
}

.primary-link-button { background: var(--md-red); color: #fff; }
.primary-link-button:hover { background: var(--md-red-dark); }
.secondary-link-button { background: #f2f4f5; color: #34434b; }
.secondary-link-button:hover { background: #e8ecee; }

.section-eyebrow,
.modal-kicker {
  color: var(--md-red-dark);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

#uploadForm {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

#pdfFileInput {
  flex: 1;
  min-width: 0;
  padding: 10px;
  border: 1px solid #d2d8dc;
  border-radius: 10px;
  background: #fff;
}

#uploadProgressSection { display: none; }
#uploadProgressText { font-weight: 700; color: var(--blue); }
#uploadProgressOuter {
  height: 10px;
  margin: 12px 0;
  background: #edf0f2;
  overflow: hidden;
  border-radius: 999px;
}
#uploadProgressBar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--md-red), #d55a61);
  transition: width .25s ease;
}
#uploadProgressDetail { white-space: pre-line; color: #57656d; }

.small-note {
  margin: 14px 0 0;
  color: #7b878e;
  font-size: .86rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20,25,28,.62);
}

.modal-card {
  width: min(100%, 650px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 24px 70px rgba(0,0,0,.25);
  line-height: 1.55;
}

.modal-card h2 { margin: 5px 0 16px; }
.modal-card p { color: #4e5b62; }
.modal-actions { text-align: center; margin-top: 22px; }
.modal-actions .primary-button { min-width: 140px; }

.error-text { color: #a51d24 !important; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 460px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-logo { width: 145px; height: auto; margin-bottom: 20px; }
.auth-card h1 { margin: 0 0 8px; font-size: 1.8rem; }
.auth-card p { color: #647078; }
.auth-field { display: grid; gap: 6px; margin-top: 14px; }
.auth-field label { font-weight: 700; font-size: .9rem; }
.auth-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfd6da;
  border-radius: 10px;
  padding: 10px 12px;
}
.auth-field input:focus { outline: 3px solid rgba(36,91,133,.09); border-color: #8baec8; }
.auth-card .primary-button { width: 100%; margin-top: 18px; }
.auth-error { color: #a51d24; background: #fff0f0; border: 1px solid #f0c8ca; border-radius: 10px; padding: 10px 12px; }

@media (max-width: 760px) {
  .brand-shell {
    padding: 14px;
    gap: 14px;
    align-items: center;
  }

  .mdacc-logo { width: 105px; margin-top: 0; }
  .coco-identity { gap: 12px; align-items: center; }
  .header-coco-avatar { width: 96px; height: 96px; flex-basis: 96px; border-width: 3px; }
  .user-avatar { width: 30px; height: 30px; flex-basis: 30px; }
  .coco-title-row h1 { font-size: 1.65rem; }
  .coco-badge { font-size: .68rem; min-height: 24px; }
  .coco-subtitle { font-size: .9rem; }
  .study-number, .clinicaltrials-link { font-size: .82rem; }

  .main-shell { padding: 12px 10px 116px; }
  .chat-container { padding: 14px 10px; border-radius: 14px; }
  .message-bubble { max-width: 84%; }
  .coco-avatar { width: 32px; height: 32px; flex-basis: 32px; font-size: .85rem; }

  .composer { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  .composer-inner { gap: 6px; }
  #questionInput { font-size: 16px; min-height: 46px; }
  .send-button { padding: 0 13px; }
  .composer-hint { display: none; }

  .welcome-card,
  .upload-card,
  .upload-progress-card { margin-top: 18px; padding: 20px 16px; }
  #uploadForm { flex-direction: column; align-items: stretch; }
  #uploadButton { width: 100%; }
}

@media (max-width: 480px) {
  .brand-shell { gap: 9px; padding: 12px 10px; }
  .mdacc-logo { width: 78px; }
  .coco-identity { gap: 8px; }
  .header-coco-avatar { width: 76px; height: 76px; flex-basis: 76px; border-width: 3px; }
  .user-avatar { width: 28px; height: 28px; flex-basis: 28px; }
  .coco-badge { display: none; }
  .coco-title-row h1 { font-size: 1.45rem; }
  .coco-subtitle { font-size: .82rem; line-height: 1.25; }
  .study-info { margin-top: 7px; }
  .message-bubble { max-width: 88%; }
  .icon-button { width: 42px; flex-basis: 42px; }
  .send-button { min-width: 58px; }
}
/* =========================
   Patient authorization error
   ========================= */

.patient-error-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
    background: radial-gradient( circle at 80% 15%, rgba(179, 38, 45, .07), transparent 28% ), linear-gradient( 180deg, #fffdfb 0%, #fff8f3 55%, #f7f1ed 100% );
}

.patient-error-card {
    width: 100%;
    max-width: 560px;
    padding: 34px 38px 38px;
    background: #ffffff;
    border: 1px solid #eadfd8;
    border-radius: 20px;
    box-shadow: 0 18px 48px rgba(67, 47, 39, .10);
    text-align: center;
}

.patient-error-logo {
    width: 145px;
    height: auto;
    margin-bottom: 24px;
}

.patient-error-coco {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 22px;
    text-align: left;
}

.patient-error-avatar {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
    background: #f9eee8;
    box-shadow: 0 0 0 2px #efd8cf, 0 6px 16px rgba(113, 70, 55, .12);
}

.patient-error-coco-name {
    font-size: 1.25rem;
    line-height: 1.1;
    font-weight: 700;
    color: #27343b;
}

.patient-error-coco-subtitle {
    margin-top: 2px;
    font-size: .92rem;
    font-weight: 600;
    color: #8f2530;
}

.patient-error-icon {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2px auto 16px;
    border-radius: 50%;
    background: #fbe9e7;
    color: #a5272f;
    font-size: 1.6rem;
    font-weight: 800;
}

.patient-error-card h1 {
    margin: 0 0 12px;
    color: #27343b;
    font-size: 1.65rem;
    line-height: 1.2;
}

.patient-error-message {
    margin: 0 auto;
    max-width: 440px;
    color: #4f5c63;
    font-size: 1rem;
    line-height: 1.6;
}

.patient-error-help {
    margin: 20px auto 0;
    padding-top: 18px;
    max-width: 440px;
    border-top: 1px solid #eee4de;
    color: #737d82;
    font-size: .9rem;
    line-height: 1.5;
}

@media (max-width: 600px) {

    .patient-error-shell {
        padding: 16px 12px;
    }

    .patient-error-card {
        padding: 26px 20px 30px;
        border-radius: 16px;
    }

    .patient-error-logo {
        width: 120px;
        margin-bottom: 20px;
    }

    .patient-error-avatar {
        width: 54px;
        height: 54px;
        flex-basis: 54px;
    }

    .patient-error-card h1 {
        font-size: 1.4rem;
    }
}

/* =========================
   Staff login
   ========================= */

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
    background: radial-gradient( circle at 82% 16%, rgba(179, 38, 45, .07), transparent 28% ), linear-gradient( 180deg, #fffdfb 0%, #fff8f3 55%, #f7f1ed 100% );
}

.login-card {
    width: 100%;
    max-width: 480px;
    padding: 32px 36px 36px;
    background: #fff;
    border: 1px solid #eadfd8;
    border-radius: 20px;
    box-shadow: 0 18px 48px rgba(67, 47, 39, .10);
}

.login-logo {
    display: block;
    width: 140px;
    height: auto;
    margin: 0 auto 22px;
}

.login-coco-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
}

.login-coco-avatar {
    width: 66px;
    height: 66px;
    flex: 0 0 66px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
    background: #f9eee8;
    box-shadow: 0 0 0 2px #efd8cf, 0 6px 16px rgba(113, 70, 55, .12);
}

.login-coco-text {
    text-align: left;
}

    .login-coco-text h1 {
        margin: 0;
        font-size: 1.55rem;
        line-height: 1.05;
        color: #27343b;
    }

    .login-coco-text p {
        margin: 3px 0 0;
        color: #8f2530;
        font-size: .96rem;
        font-weight: 650;
    }

.login-divider {
    height: 1px;
    margin: 24px 0 22px;
    background: #eee4de;
}

.login-card h2 {
    margin: 0 0 6px;
    text-align: center;
    color: #27343b;
    font-size: 1.45rem;
}

.login-intro {
    margin: 0 0 22px;
    text-align: center;
    color: #68747a;
    font-size: .95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
}

    .login-form label {
        margin: 0 0 6px;
        color: #37444a;
        font-size: .92rem;
        font-weight: 650;
    }

    .login-form input {
        width: 100%;
        margin-bottom: 16px;
        padding: 11px 12px;
        border: 1px solid #d7d1cc;
        border-radius: 9px;
        background: #fff;
        color: #27343b;
        font-size: 1rem;
        outline: none;
    }

        .login-form input:focus {
            border-color: #b3262d;
            box-shadow: 0 0 0 3px rgba(179, 38, 45, .10);
        }

.login-captcha {
    padding: 14px 14px 0;
    margin-bottom: 16px;
    background: #fff8f4;
    border: 1px solid #eee0d8;
    border-radius: 10px;
}

.login-button {
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-radius: 10px;
    background: #b3262d;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

    .login-button:hover {
        background: #982027;
        box-shadow: 0 7px 18px rgba(179, 38, 45, .20);
    }

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

.login-error {
    margin: 0 0 18px;
    padding: 11px 13px;
    border-radius: 9px;
    background: #fbe9e7;
    border: 1px solid #f1cbc7;
    color: #8f2530;
    font-size: .92rem;
    line-height: 1.4;
}

@media (max-width: 600px) {

    .login-shell {
        padding: 16px 12px;
    }

    .login-card {
        padding: 26px 20px 28px;
        border-radius: 16px;
    }

    .login-logo {
        width: 118px;
        margin-bottom: 18px;
    }

    .login-coco-avatar {
        width: 56px;
        height: 56px;
        flex-basis: 56px;
    }

    .login-coco-text h1 {
        font-size: 1.35rem;
    }
}

/* =========================
   Patient CAPTCHA
   ========================= */

.captcha-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
    background: radial-gradient( circle at 82% 16%, rgba(179, 38, 45, .07), transparent 28% ), linear-gradient( 180deg, #fffdfb 0%, #fff8f3 55%, #f7f1ed 100% );
}

.captcha-card {
    width: 100%;
    max-width: 500px;
    padding: 32px 36px 36px;
    background: #fff;
    border: 1px solid #eadfd8;
    border-radius: 20px;
    box-shadow: 0 18px 48px rgba(67, 47, 39, .10);
    text-align: center;
}

.captcha-logo {
    width: 140px;
    height: auto;
    margin-bottom: 22px;
}

.captcha-coco-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
}

.captcha-coco-avatar {
    width: 66px;
    height: 66px;
    flex: 0 0 66px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
    background: #f9eee8;
    box-shadow: 0 0 0 2px #efd8cf, 0 6px 16px rgba(113, 70, 55, .12);
}

.captcha-coco-text {
    text-align: left;
}

    .captcha-coco-text h1 {
        margin: 0;
        color: #27343b;
        font-size: 1.55rem;
        line-height: 1.05;
    }

    .captcha-coco-text p {
        margin: 3px 0 0;
        color: #8f2530;
        font-size: .96rem;
        font-weight: 650;
    }

.captcha-divider {
    height: 1px;
    margin: 24px 0 22px;
    background: #eee4de;
}

.captcha-card h2 {
    margin: 0 0 8px;
    color: #27343b;
    font-size: 1.45rem;
}

.captcha-intro {
    margin: 0 auto 20px;
    max-width: 390px;
    color: #68747a;
    font-size: .95rem;
    line-height: 1.5;
}

.captcha-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.captcha-widget {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 8px 0;
}

.captcha-button {
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-radius: 10px;
    background: #b3262d;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

    .captcha-button:hover {
        background: #982027;
        box-shadow: 0 7px 18px rgba(179, 38, 45, .20);
    }

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

.captcha-error {
    margin: 0 0 18px;
    padding: 11px 13px;
    border-radius: 9px;
    background: #fbe9e7;
    border: 1px solid #f1cbc7;
    color: #8f2530;
    font-size: .92rem;
    line-height: 1.4;
}

.captcha-note {
    margin: 20px 0 0;
    color: #7b858a;
    font-size: .84rem;
    line-height: 1.45;
}

@media (max-width: 600px) {

    .captcha-shell {
        padding: 16px 12px;
    }

    .captcha-card {
        padding: 26px 20px 28px;
        border-radius: 16px;
    }

    .captcha-logo {
        width: 118px;
        margin-bottom: 18px;
    }

    .captcha-coco-avatar {
        width: 56px;
        height: 56px;
        flex-basis: 56px;
    }

    .captcha-coco-text h1 {
        font-size: 1.35rem;
    }

    .captcha-widget {
        overflow-x: auto;
    }
}


/* =========================================================
   Compact header while scrolling
   Default header remains exactly as the normal large header.
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  transition:
    background .20s ease,
    box-shadow .20s ease,
    border-color .20s ease;
}

.brand-shell,
.coco-identity,
.header-coco-avatar,
.title-block h1,
.coco-subtitle,
.study-info,
.mdacc-logo-link {
  transition:
    width .20s ease,
    height .20s ease,
    flex-basis .20s ease,
    padding .20s ease,
    margin .20s ease,
    gap .20s ease,
    opacity .16s ease,
    transform .20s ease,
    font-size .20s ease;
}

/* When the patient scrolls, show only "Meet CoCo" + small avatar. */
.site-header.coco-header-collapsed {
  background: rgba(255, 253, 251, .97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 3px 14px rgba(67, 47, 39, .08);
}

.site-header.coco-header-collapsed .brand-shell {
  min-height: 50px;
  padding-top: 6px;
  padding-bottom: 6px;
  gap: 0;
  justify-content: center;
}

.site-header.coco-header-collapsed .mdacc-logo-link {
  display: none;
}

.site-header.coco-header-collapsed .coco-identity {
  width: auto;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.site-header.coco-header-collapsed .title-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 0;
  padding: 0;
}

.site-header.coco-header-collapsed .title-block h1 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.site-header.coco-header-collapsed .coco-subtitle,
.site-header.coco-header-collapsed .study-info,
.site-header.coco-header-collapsed .coco-badge {
  display: none;
}

.site-header.coco-header-collapsed .header-coco-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-width: 2px;
  box-shadow:
    0 0 0 1px #efd8cf,
    0 3px 8px rgba(113, 70, 55, .10);
}

@media (max-width: 760px) {
  .site-header.coco-header-collapsed .brand-shell {
    min-height: 46px;
    padding: 5px 10px;
  }

  .site-header.coco-header-collapsed .title-block h1 {
    font-size: 1.02rem;
  }

  .site-header.coco-header-collapsed .header-coco-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }
}


@media (max-width: 600px) {
  .composer {
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }

  .composer-inner {
    max-width: none;
  }

  .composer-pill {
    min-height: 54px;
    padding: 6px 7px 6px 10px;
    border-radius: 27px;
  }

  #questionInput {
    min-height: 38px;
    padding: 8px 2px 7px;
    font-size: 16px;
  }

  .composer-mic {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .send-button {
    width: 38px;
    height: 38px;
    min-height: 38px;
    flex-basis: 38px;
  }

  .composer-hint {
    display: none;
  }
}
