:root {
  --ua-red: #002d72;
  --ua-blue: #002d72;
  --ua-red-soft: #315b91;
  --ua-blue-soft: #315b91;
  --bg: #f7f5f2;
  --bg-strong: #ffffff;
  --panel-tint: #f6f8fc;
  --text: #10233f;
  --muted: #5e6a7c;
  --brand: var(--ua-red);
  --brand-dark: #001f4f;
  --accent: var(--ua-blue);
  --line: rgba(0, 45, 114, 0.12);
  --shadow: 0 24px 60px rgba(0, 45, 114, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(0, 45, 114, 0.12), transparent 28%),
    radial-gradient(circle at right, rgba(0, 45, 114, 0.14), transparent 22%),
    linear-gradient(180deg, #fbfcff 0%, #f3f6fb 52%, #eef2f8 100%);
}

.top-nav {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

button,
input,
select {
  font: inherit;
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0;
  color: var(--muted);
  font-weight: 700;
}

.section-divider::before,
.section-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.complaint-picker {
  border: 0;
  padding: 0;
  margin: 8px 0;
  display: grid;
  gap: 10px;
}

.complaint-picker legend {
  margin-bottom: 10px;
  font-weight: 700;
}

.complaint-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-tint);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.auth-form .complaint-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 3px 0 0;
  padding: 0;
  accent-color: #f1c400;
}

.complaint-option:has(input:checked) {
  border-color: #f1c400;
  background: rgba(241, 196, 0, 0.14);
  box-shadow: 0 0 0 3px rgba(241, 196, 0, 0.16);
}

.complaint-option:hover {
  border-color: #f1c400;
  background: rgba(241, 196, 0, 0.1);
}

.complaint-option span {
  display: grid;
  gap: 3px;
}

.complaint-option small {
  color: var(--muted);
}

.survey-status-card {
  display: grid;
  gap: 7px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-tint);
}

.survey-status-card strong {
  color: var(--ua-blue);
  font-size: 1.2rem;
}

#four-week-survey-button.hidden {
  display: none;
}

.survey-screen {
  width: min(920px, calc(100% - 32px));
  margin: 34px auto 64px;
}

.survey-card {
  width: 100%;
}

.survey-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0;
}

.survey-meta-grid > div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-tint);
}

.survey-meta-grid span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.survey-question-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.survey-question-section h2 {
  margin: 0 0 18px;
  color: var(--ua-blue);
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-size: 1.4rem;
}

.survey-question {
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.survey-question legend,
.survey-text-question > span {
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
}

.survey-scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

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

.survey-likert-option,
.survey-choice-options label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-strong);
  cursor: pointer;
}

.survey-likert-option:has(input:checked),
.survey-choice-options label:has(input:checked) {
  border-color: var(--ua-blue);
  background: rgba(0, 45, 114, 0.08);
  box-shadow: 0 0 0 2px rgba(0, 45, 114, 0.12);
}

.survey-likert-option input,
.survey-choice-options input {
  accent-color: var(--ua-blue);
}

.survey-choice-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.survey-choice-options label {
  justify-content: flex-start;
  padding-inline: 13px;
}

.survey-other-location {
  margin-top: 12px;
}

.survey-text-question {
  margin-top: 18px;
}

.survey-text-question textarea {
  width: 100%;
  margin-top: 8px;
  resize: vertical;
}

.patient-row-stat.survey-status.is-overdue {
  color: #a32121;
  font-weight: 700;
}

.patient-row-stat.survey-status.is-complete {
  color: #176b3a;
  font-weight: 700;
}

.patient-entry-screen {
  filter: blur(2px);
  opacity: 0.72;
}

.patient-entry-backdrop-card {
  text-align: center;
}

.patient-choice-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 45, 114, 0.48);
  backdrop-filter: blur(5px);
  overscroll-behavior: contain;
}

.patient-choice-popup {
  width: min(100%, 570px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 90px rgba(0, 31, 79, 0.3);
  animation: pop-in 280ms ease both;
}

.patient-choice-popup h2 {
  margin: 16px 0 0;
  font-size: clamp(2rem, 5vw, 3rem);
}

.patient-choice-popup > p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.patient-choice-actions {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.patient-path-card {
  display: block;
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: 22px;
  background: var(--panel-tint);
  color: var(--text);
  text-align: center;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.patient-path-card:hover,
.patient-path-card:focus-visible {
  transform: translateY(-2px);
  border-color: #f1c400;
  background: rgba(241, 196, 0, 0.1);
  box-shadow: 0 12px 28px rgba(0, 45, 114, 0.12);
  outline: none;
}

.patient-path-card span:last-child {
  display: grid;
  gap: 4px;
}

.patient-path-card strong {
  color: var(--ua-blue);
  font-size: 1.18rem;
}

.patient-path-card small {
  color: var(--muted);
  font-size: 0.98rem;
}

.patient-choice-back {
  display: block;
  width: max-content;
  margin: 22px auto 0;
  color: var(--muted);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.patient-returning-card {
  width: min(100%, 600px);
}

a {
  text-decoration: none;
}

.hidden {
  display: none;
}

.assigned-item-fields.hidden,
.category-editor-body.hidden {
  display: none;
}

.screen {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.screen-centered {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.welcome-screen {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: center;
  min-height: 100vh;
}

.intro-screen {
  position: relative;
}

.intro-card {
  width: min(100%, 560px);
  text-align: center;
  padding: 44px 36px;
  animation: intro-card-rise 1050ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.intro-logo-stack {
  display: grid;
  justify-items: center;
  gap: 0;
}

.intro-logo {
  width: min(500px, 100%);
  height: auto;
  filter: none;
}

.intro-eyebrow {
  margin-bottom: 0;
}

.intro-title {
  margin-top: 18px;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
}

.intro-subtitle {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.6;
}

.intro-role-actions {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.intro-role-button {
  width: 100%;
}

.intro-session-note {
  max-width: 560px;
  margin: 14px auto 0;
  color: #a2aab6;
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: center;
}

.intro-clinician-link {
  margin-top: 22px;
  border: none;
  background: transparent;
  color: #9aa4b4;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  transition: color 160ms ease, transform 160ms ease;
}

.intro-clinician-link:hover {
  color: #7d8797;
  transform: translateY(-1px);
}

.intro-version-history {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.01em;
}

.welcome-sheet-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  align-items: end;
  background: rgba(0, 45, 114, 0.18);
  padding: 20px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.welcome-sheet-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.welcome-sheet {
  width: min(100%, 680px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -24px 60px rgba(0, 45, 114, 0.16);
  padding: 28px 28px 32px;
  transform: translateY(100%);
  transition: transform 260ms ease;
  text-align: center;
}

.welcome-sheet-overlay.is-visible .welcome-sheet {
  transform: translateY(0);
}

.sheet-pill {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 45, 114, 0.08);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-pill-patient {
  background: rgba(0, 45, 114, 0.1);
  color: var(--ua-blue);
}

.sheet-title {
  margin-top: 14px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.sheet-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.sheet-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

@keyframes intro-card-rise {
  from {
    opacity: 0;
    transform: translateY(36px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-card {
    animation: none;
  }
}

.hero-column,
.card {
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.hero-column {
  padding: 40px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 28%),
    linear-gradient(155deg, rgba(0, 45, 114, 0.98), rgba(0, 45, 114, 0.92));
  color: #f8fbff;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.brand-logo-image {
  width: 78px;
  height: 78px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(0, 45, 114, 0.18));
}

.brand-logo-image.intro-logo {
  width: min(340px, 82%);
  height: auto;
  filter: none;
}

.brand-copy {
  display: grid;
  gap: 4px;
}

.brand-title {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 1.08rem;
  color: rgba(248, 251, 255, 0.88);
}

.card {
  width: min(100%, 760px);
  background: rgba(255, 255, 255, 0.94);
  padding: 32px;
}

.simple-card,
.progress-card {
  max-width: 700px;
}

.patient-progress-card > .eyebrow,
.patient-progress-card > h1,
.patient-progress-card > .support-copy,
.patient-progress-card .status-header-card,
.patient-progress-card .stat-box,
.patient-progress-card .progress-list-block {
  text-align: center;
}

.patient-progress-card > .support-copy {
  max-width: 580px;
  margin-right: auto;
  margin-left: auto;
}

.patient-progress-card .progress-header {
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

.patient-portal-card {
  max-width: 620px;
}

.patient-portal-actions {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.patient-portal-actions .large-button {
  margin-top: 0;
}

.eyebrow,
.stat-label {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 700;
}

.eyebrow {
  color: var(--accent);
}

.card .eyebrow {
  color: var(--brand);
}

h1,
h2 {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(2.35rem, 5vw, 4.35rem);
}

h2 {
  font-size: clamp(1.85rem, 4vw, 2.7rem);
}

.support-copy,
.option-subtitle,
.exercise-dose,
.exercise-tip,
.completion-message,
.welcome-user {
  color: var(--muted);
  line-height: 1.6;
}

.hero-column .support-copy,
.hero-column .welcome-user {
  color: rgba(248, 251, 255, 0.82);
}

.hero-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.hero-status-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.status-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 241, 228, 0.78);
}

.hero-status-card .welcome-user {
  margin-top: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: #ffffff;
}

.hero-list {
  margin: 24px 0 0;
  padding-left: 18px;
  line-height: 1.8;
}

.hero-list li::marker {
  color: #ffd4da;
}

.home-actions {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.compact-grid {
  margin-top: 24px;
}

.portal-card,
.status-header-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(0, 45, 114, 0.02), rgba(0, 45, 114, 0.02)), var(--bg-strong);
  box-shadow: 0 12px 28px rgba(0, 45, 114, 0.05);
}

.portal-card strong,
.status-header-card strong,
.code-pill {
  display: block;
  margin-top: 8px;
  font-size: 1.4rem;
  color: var(--ua-blue);
}

.inline-form {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.inline-button {
  width: auto;
  margin-top: 8px;
}

.password-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.password-toggle-button {
  margin-top: 0;
  white-space: nowrap;
}

.patient-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  max-height: min(68vh, 680px);
  overflow-y: auto;
  padding: 38px 12px;
  scroll-padding-block: 38px;
  scroll-snap-type: y mandatory;
  scrollbar-width: thin;
  perspective: 900px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 93%, transparent 100%);
}

.patient-row-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(0, 45, 114, 0.02), rgba(0, 45, 114, 0.02)), var(--bg-strong);
  box-shadow: 0 12px 28px rgba(0, 45, 114, 0.05);
  scroll-snap-align: center;
  opacity: 0.64;
  transform: scale(0.94) rotateX(2deg);
  transform-origin: center;
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 260ms ease, box-shadow 260ms ease;
}

.patient-row-card.is-wheel-active,
.patient-row-card:focus-within,
.patient-row-card:hover {
  opacity: 1;
  transform: scale(1) rotateX(0);
  box-shadow: 0 18px 38px rgba(0, 45, 114, 0.14);
}

.patient-search-field {
  width: min(100%, 560px);
  margin: 28px auto 0;
}

.patient-created-date {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.patient-id-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.patient-row-header,
.patient-row-actions,
.patient-row-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.patient-row-actions {
  margin-top: 16px;
}

.patient-row-stat {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 45, 114, 0.06);
  color: var(--ua-blue);
  font-size: 0.92rem;
  font-weight: 700;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.role-choice-card {
  justify-self: center;
  width: min(100%, 520px);
  text-align: center;
}

.role-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(0, 45, 114, 0.02), rgba(0, 45, 114, 0.02)), var(--bg-strong);
  box-shadow: 0 12px 28px rgba(0, 45, 114, 0.05);
  text-align: center;
}

.role-card h3 {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1.1;
}

.role-card .support-copy {
  margin: 12px 0 0;
}

.welcome-user {
  margin-top: 26px;
}

.auth-tabs {
  display: inline-flex;
  gap: 10px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(0, 45, 114, 0.08);
  margin-bottom: 24px;
}

.auth-tab,
.body-option,
.primary-button,
.nav-link {
  border: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-tab {
  padding: 10px 16px;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

.auth-tab.active {
  background: #ffffff;
  color: var(--ua-blue);
  box-shadow: 0 8px 20px rgba(0, 45, 114, 0.1);
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.form-group {
  display: grid;
  gap: 12px;
}

.auth-form input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcff;
  color: var(--text);
}

.auth-form input:focus {
  outline: 2px solid rgba(241, 196, 0, 0.3);
  border-color: #f1c400;
}

.remember-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 600;
}

.remember-choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--ua-blue);
}

.primary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 14px 20px;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--ua-red), #244a7c);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(0, 45, 114, 0.24);
  font-weight: 700;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--ua-blue), #174f91);
  color: #f8fbff;
  border: 1px solid rgba(0, 45, 114, 0.2);
  box-shadow: 0 12px 24px rgba(0, 45, 114, 0.2);
  font-weight: 700;
}

.intro-role-button-patient {
  background: linear-gradient(135deg, var(--ua-blue), #174f91);
  border: 1px solid rgba(0, 45, 114, 0.2);
  color: #f8fbff;
  box-shadow: 0 12px 24px rgba(0, 45, 114, 0.2);
}

.intro-role-button-patient:hover {
  background: linear-gradient(135deg, var(--ua-blue-soft), #25497b);
  border-color: rgba(37, 73, 123, 0.28);
  color: #f8fbff;
}

.large-button {
  width: 100%;
  margin-top: 18px;
}

.created-patient-access {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(0, 45, 114, 0.14);
  border-radius: 18px;
  background: rgba(241, 196, 0, 0.12);
  text-align: center;
}

.created-patient-access.hidden {
  display: none;
}

.created-patient-access .new-patient-id {
  color: var(--ua-blue);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  letter-spacing: 0.08em;
}

.compact-complaint-picker {
  margin: 0;
}

#reset-day-button {
  width: auto;
  margin: 18px auto 0;
  padding: 5px 10px;
  display: flex;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #8a94a6;
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.72;
}

#reset-day-button:hover {
  background: transparent;
  color: #667085;
  box-shadow: none;
  opacity: 1;
  transform: none;
  text-decoration: underline;
}

.primary-button:hover,
.auth-tab:hover,
.body-option:hover,
.nav-link:hover {
  transform: translateY(-2px);
}

.primary-button:hover {
  background: #f1c400;
  color: #002d72;
  box-shadow: 0 14px 28px rgba(241, 196, 0, 0.28);
}

.nav-link:hover {
  background: linear-gradient(135deg, var(--ua-blue-soft), #4d73a5);
}

.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.auth-hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-error {
  min-height: 24px;
  margin: 0;
  color: #ab0420;
  font-size: 0.94rem;
}

.body-options,
.exercise-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  max-height: min(72vh, 760px);
  overflow-y: auto;
  padding: 42px 12px;
  scroll-padding-block: 42px;
  scroll-snap-type: y mandatory;
  scrollbar-width: thin;
  perspective: 900px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 93%, transparent 100%);
}

.body-option,
.exercise-item,
.exercise-card-shell,
.stat-box,
.focus-card,
.progress-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--bg-strong);
}

.body-option {
  width: 100%;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 16px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 45, 114, 0.05);
}

.category-option {
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: flex-start;
}

.category-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--ua-red);
}

.builder-card {
  max-width: 980px;
  margin: 0 auto;
}

.clinician-portal-card {
  max-width: 820px;
  text-align: center;
}

.clinician-portal-card > .support-copy {
  max-width: 680px;
  margin-right: auto;
  margin-left: auto;
}

.clinician-portal-card > .portal-grid:not(.compact-grid) {
  width: min(100%, 520px);
  grid-template-columns: 1fr;
  margin-right: auto;
  margin-left: auto;
}

.clinician-portal-card .portal-card {
  text-align: left;
}

.clinician-portal-card > .compact-grid {
  width: min(100%, 700px);
  margin-right: auto;
  margin-left: auto;
}

.clinician-portal-card > .clinician-actions-grid {
  width: min(100%, 520px);
  grid-template-columns: 1fr;
}

.builder-section {
  margin-top: 28px;
}

.builder-heading {
  margin-bottom: 16px;
}

.builder-heading h2,
.category-editor h3 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.safety-banner {
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(0, 45, 114, 0.1);
  background: linear-gradient(180deg, rgba(0, 45, 114, 0.03), rgba(0, 45, 114, 0.04));
}

.compact-safety {
  margin-top: 18px;
}

.hero-safety {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
}

.hero-safety strong,
.hero-safety .safety-list {
  color: #ffffff;
}

.safety-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.category-editors {
  display: grid;
  gap: 18px;
}

.category-editor,
.assigned-item-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--bg-strong);
}

.category-editor {
  padding: 22px;
  box-shadow: 0 12px 28px rgba(0, 45, 114, 0.06);
}

.category-editor-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.category-editor-header,
.category-editor-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.toggle-chevron {
  font-size: 1.6rem;
  color: var(--ua-blue);
  line-height: 1;
}

.category-editor-body {
  margin-top: 16px;
}

.warning-copy {
  margin: 10px 0 0;
  color: var(--ua-red);
  line-height: 1.6;
}

.assigned-item-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.assigned-item-card {
  padding: 18px;
}

.assigned-item-card.is-active {
  border-color: rgba(0, 45, 114, 0.28);
  box-shadow: 0 16px 28px rgba(0, 45, 114, 0.08);
}

.assigned-item-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.assigned-item-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  flex: 1;
}

.assigned-item-toggle input {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--ua-red);
}

.assigned-item-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.assigned-item-fields {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.assigned-item-details-toggle {
  margin-top: 0;
  gap: 8px;
  white-space: nowrap;
}

.assigned-item-toggle-chevron {
  font-size: 1.2rem;
  line-height: 1;
}

.chart-list {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.chart-row {
  display: grid;
  grid-template-columns: 72px 1fr 54px;
  gap: 10px;
  align-items: center;
}

.chart-label,
.chart-value {
  font-size: 0.92rem;
  color: var(--muted);
}

.chart-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 45, 114, 0.08);
  overflow: hidden;
}

.chart-fill {
  height: 100%;
  border-radius: 999px;
}

.completion-tone {
  background: linear-gradient(90deg, var(--ua-blue), var(--ua-red));
}

.pain-before-tone {
  background: linear-gradient(90deg, rgba(0, 45, 114, 0.55), var(--ua-blue));
}

.pain-after-tone {
  background: linear-gradient(90deg, rgba(0, 45, 114, 0.45), var(--ua-red));
}

.monthly-pain-tone {
  background: linear-gradient(90deg, #f1c400, #002d72);
}

.analytics-section {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.76);
}

.analytics-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.analytics-heading h2 {
  margin: 6px 0 0;
}

.analytics-note {
  max-width: 220px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: right;
}

.trend-summary-card,
.analytics-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg-strong);
}

.trend-summary-card {
  margin-top: 18px;
}

.symptom-summary-panel {
  margin-top: 18px;
}

.symptom-summary-panel h2 {
  margin: 6px 0 0;
  color: var(--ua-blue);
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
}

.symptom-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.symptom-chart-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-strong);
}

.symptom-chart-card h3 {
  margin: 0;
  color: var(--ua-blue);
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.symptom-legend-dot.pain,
.symptom-line.pain,
.symptom-dot.pain {
  color: var(--ua-red);
  fill: var(--ua-red);
  stroke: var(--ua-red);
}

.symptom-legend-dot.stiffness,
.symptom-line.stiffness,
.symptom-dot.stiffness {
  color: var(--ua-blue);
  fill: var(--ua-blue);
  stroke: var(--ua-blue);
}

.symptom-chart {
  min-height: 230px;
  margin-top: 10px;
  overflow-x: auto;
}

.symptom-chart svg {
  display: block;
  min-width: 420px;
  width: 100%;
  height: 230px;
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
}

.symptom-grid-line {
  stroke: rgba(0, 45, 114, 0.14);
  stroke-width: 1;
}

.symptom-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.symptom-dot {
  stroke: var(--bg-strong);
  stroke-width: 2;
}

.symptom-x-label,
.symptom-y-label {
  fill: var(--muted);
  font-size: 14px;
}

.symptom-x-label {
  text-anchor: middle;
}

.symptom-y-label {
  text-anchor: end;
}

@media (max-width: 760px) {
  .symptom-chart-grid {
    grid-template-columns: 1fr;
  }
}

.trend-summary-card > strong {
  color: var(--ua-blue);
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  font-size: 1.45rem;
}

.trend-summary-card > p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.trend-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.trend-stat-row > span {
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(0, 45, 114, 0.07);
  color: var(--muted);
  font-size: 0.86rem;
}

.trend-stat-row strong {
  margin-left: 3px;
  color: var(--ua-blue);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.analytics-chart {
  max-height: 330px;
  overflow-y: auto;
  padding-right: 4px;
}

.empty-analytics {
  margin: 12px 0 0;
  color: var(--muted);
}

.adherence-stat-grid {
  margin-top: 18px;
}

.adherence-success-box {
  border: 1px solid rgba(38, 132, 59, 0.2);
  background: rgba(38, 132, 59, 0.06);
}

.adherence-warning-box {
  border: 1px solid rgba(241, 196, 0, 0.35);
  background: rgba(241, 196, 0, 0.08);
}

.adherence-explanation {
  margin: 16px 0 0;
}

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

.builder-field {
  display: grid;
  gap: 8px;
}

.builder-field span {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ua-blue);
}

.builder-field input,
.builder-field textarea,
.builder-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcff;
  color: var(--text);
}

.builder-field input:focus,
.builder-field textarea:focus,
.builder-field select:focus {
  outline: 2px solid rgba(241, 196, 0, 0.3);
  border-color: #f1c400;
}

.progress-list-panel {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.progress-list-block {
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(0, 45, 114, 0.02), rgba(0, 45, 114, 0.02)), var(--bg-strong);
}

.progress-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.option-title,
.exercise-title {
  display: block;
  margin-bottom: 4px;
}

.option-subtitle {
  display: block;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.stat-box,
.focus-card,
.progress-panel {
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(0, 45, 114, 0.02), rgba(0, 45, 114, 0.02)),
    var(--bg-strong);
}

.stat-box strong {
  display: block;
  font-size: 1.8rem;
  margin-top: 8px;
  color: var(--ua-blue);
}

.week-stat-box {
  border: 1px solid rgba(0, 45, 114, 0.1);
}

.progress-header,
.session-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.progress-track {
  height: 14px;
  border-radius: 999px;
  background: rgba(0, 45, 114, 0.08);
  overflow: hidden;
  margin-top: 12px;
}

.progress-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #c7352a 0%, #e97824 32%, #f1c400 64%, #26843b 100%);
  clip-path: inset(0 calc(100% - var(--progress, 0%)) 0 0);
  transition: clip-path 240ms ease;
}

.session-card {
  max-width: 860px;
  margin: 0 auto;
}

.session-card .session-header {
  display: grid;
  grid-template-columns: 1fr;
}

.session-card .session-header > div {
  width: 100%;
  text-align: center;
}

.session-card .day-pill {
  justify-self: center;
  margin-top: 14px;
  text-align: center;
}

.day-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0, 45, 114, 0.12);
  color: var(--ua-red);
  font-weight: 700;
}

.focus-card {
  margin-top: 24px;
}

.focus-card p {
  margin: 8px 0 0;
  font-size: 1.1rem;
}

.session-card .focus-card,
.session-card > .completion-message,
.session-card > .exercise-source-note {
  text-align: center;
}

.exercise-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 18px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: default;
}

.exercise-preview-button:hover,
.exercise-preview-button:focus-visible {
  border-color: #f1c400;
  background: #f1c400;
  color: #002d72;
  transform: translateY(-1px);
  outline: none;
}

.exercise-picture-hint {
  min-width: 106px;
  min-height: 48px;
  padding: 12px 18px;
  border: 2px solid #002d72;
  border-radius: 999px;
  background: #002d72;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.exercise-card-shell {
  background: var(--bg-strong);
  overflow: hidden;
  scroll-snap-align: center;
  opacity: 0.64;
  transform: scale(0.94) rotateX(2deg);
  transform-origin: center;
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 260ms ease, box-shadow 260ms ease;
}

.exercise-card-shell.is-wheel-active,
.exercise-card-shell:focus-within,
.exercise-card-shell:hover {
  opacity: 1;
  transform: scale(1) rotateX(0);
  box-shadow: 0 18px 38px rgba(0, 45, 114, 0.14);
}

@media (prefers-reduced-motion: reduce) {
  .exercise-card-shell,
  .patient-row-card {
    transition: none;
    transform: none;
  }
}

.exercise-item input {
  position: absolute;
  opacity: 0;
}

.exercise-content {
  display: grid;
  gap: 4px;
}

.exercise-progress-text {
  color: var(--ua-blue);
  font-size: 0.95rem;
  font-weight: 700;
}

.weekly-progress-block {
  display: grid;
  gap: 9px;
  padding: 0 18px 14px;
}

.weekly-progress-heading,
.weekly-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.weekly-bonus-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.weekly-progress-track {
  flex: 1;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 45, 114, 0.1);
}

.weekly-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c7352a 0%, #e97824 32%, #f1c400 64%, #26843b 100%);
  clip-path: inset(0 calc(100% - var(--progress, 0%)) 0 0);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.1);
  transition: clip-path 240ms ease;
}

.weekly-bonus-step {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid #f1c400;
  border-radius: 50%;
  background: #fff;
  transition: transform 180ms ease, background 180ms ease;
}

.weekly-bonus-step.is-complete {
  border-color: #26843b;
  background: #26843b;
  transform: scale(1.08);
}

.exercise-completed-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: calc(100% - 36px);
  min-height: 54px;
  margin: 0 18px 12px;
  border: 2px solid #002d72;
  border-radius: 16px;
  background: rgba(0, 45, 114, 0.1);
  color: #002d72;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.set-progress-fill {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: var(--set-progress, 0%);
  background: linear-gradient(90deg, #002d72 0%, #315b91 55%, #f1c400 100%);
  transition: width 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.set-progress-label {
  position: relative;
  z-index: 1;
}

.exercise-completed-button::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #f1c400;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.exercise-completed-button.has-set-progress {
  color: #fff;
}

.exercise-completed-button:hover,
.exercise-completed-button:focus-visible {
  border-color: #f1c400;
  background: rgba(0, 45, 114, 0.14);
  outline: none;
}

.exercise-completed-button.is-complete {
  border-color: #f1c400;
  color: #002d72;
}

.exercise-completed-button.is-complete::after {
  transform: scaleX(1);
}

.exercise-completed-button.is-complete.just-completed {
  color: #fff;
  animation: set-completion-bounce 420ms 540ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.exercise-completed-button.is-complete.just-completed::after {
  transition-delay: 960ms;
}

@keyframes set-completion-bounce {
  0% { transform: scale(1); color: #fff; }
  48% { transform: scale(1.035); color: #fff; }
  72% { transform: scale(0.992); color: #fff; }
  100% { transform: scale(1); color: #002d72; }
}

@media (prefers-reduced-motion: reduce) {
  .exercise-completed-button.is-complete.just-completed {
    animation: none;
    color: #002d72;
  }

  .exercise-completed-button.is-complete.just-completed::after {
    transition-delay: 0ms;
  }
}

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

.exercise-completed-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.exercise-completed-button.is-complete:disabled {
  opacity: 1;
  cursor: default;
}

.exercise-source-note {
  margin: 22px 0 0;
  color: #a2aab6;
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: center;
}

.session-completion-progress {
  display: grid;
  gap: 10px;
  margin: 28px 0 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-tint);
}

.session-completion-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--ua-blue);
}

.session-completion-heading span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.session-completion-track {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 45, 114, 0.1);
}

.session-completion-fill {
  display: block;
  width: var(--session-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #002d72 0%, #315b91 58%, #f1c400 100%);
  transition: width 520ms cubic-bezier(0.22, 1, 0.36, 1), background 260ms ease;
}

.session-completion-track.is-complete .session-completion-fill {
  background: #f1c400;
}

.exercise-source-note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.completion-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 16px;
}

.completion-chip {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 45, 114, 0.14);
  background: rgba(0, 45, 114, 0.04);
  color: var(--ua-blue);
  font-weight: 700;
  cursor: pointer;
}

.completion-chip.is-complete {
  background: linear-gradient(135deg, var(--ua-red), #244a7c);
  border-color: rgba(0, 45, 114, 0.18);
  color: #fff;
}

.rating-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 31, 79, 0.68);
  backdrop-filter: blur(5px);
  overscroll-behavior: contain;
}

.rating-overlay.hidden {
  display: none;
}

.rating-popup {
  width: min(100%, 520px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 30px;
  border-radius: 28px;
  background: #fff;
  color: var(--text);
  text-align: center;
  box-shadow: 0 28px 90px rgba(0, 31, 79, 0.34);
  animation: pop-in 240ms ease both;
}

.rating-popup .completion-badge {
  background: rgba(0, 45, 114, 0.09);
  color: var(--ua-blue);
}

.rating-popup h2 {
  margin: 16px 0 0;
  font-size: clamp(2rem, 6vw, 2.8rem);
}

.rating-popup p {
  margin: 10px 0 0;
  color: var(--muted);
}

.rating-scale {
  position: relative;
  height: 190px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  margin-top: 24px;
  border-block: 1px solid rgba(0, 45, 114, 0.12);
  background: linear-gradient(to bottom, #fff 0%, rgba(241, 196, 0, 0.08) 38%, rgba(241, 196, 0, 0.16) 50%, rgba(241, 196, 0, 0.08) 62%, #fff 100%);
}

.rating-scale::-webkit-scrollbar {
  display: none;
}

.rating-wheel-spacer {
  height: 65px;
}

.rating-number {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 12px;
  width: 100%;
  height: 60px;
  scroll-snap-align: center;
  border: 0;
  background: transparent;
  color: var(--ua-blue);
  font-size: 2rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, color 150ms ease;
}

.rating-number-value {
  grid-column: 2;
}

.rating-number-description {
  grid-column: 3;
  justify-self: start;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.rating-number:hover,
.rating-number:focus-visible {
  transform: scale(1.08);
  color: #001f4f;
  outline: none;
}

.rating-continue {
  width: 100%;
  margin-top: 22px;
}

.rating-scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.centered-intro {
  text-align: center;
}

.centered-intro .support-copy {
  margin-inline: auto;
}

.account-prompt {
  margin: -4px 0 0;
  color: #8a94a5;
  text-align: center;
  font-size: 0.9rem;
}

.account-prompt a {
  color: inherit;
  font-weight: 700;
}

.exercise-image-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 31, 79, 0.72);
  opacity: 0;
  transition: opacity 480ms ease-out;
  will-change: opacity;
}

.exercise-image-overlay.hidden {
  display: none;
}

.exercise-image-overlay.is-visible {
  opacity: 1;
}

.exercise-image-popup {
  position: relative;
  width: min(100%, 720px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 26px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(0, 31, 79, 0.38);
  opacity: 0;
  transform: translateY(28px) scale(0.965);
  transition: transform 540ms cubic-bezier(0.22, 1, 0.36, 1), opacity 480ms ease-out;
  will-change: transform, opacity;
}

.exercise-image-overlay.is-visible .exercise-image-popup {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .exercise-image-overlay,
  .exercise-image-popup {
    transition-duration: 1ms;
  }
}

.exercise-image-popup h2 {
  padding-right: 42px;
}

.exercise-image-popup img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.exercise-image-dose {
  margin: 8px 0 0;
  color: var(--muted);
}

.exercise-how-to-copy {
  margin-top: 22px;
  padding: 20px;
  border-radius: 18px;
  background: var(--panel-tint);
}

.exercise-how-to-copy h3 {
  margin: 0;
  color: var(--ua-blue);
  font-size: 1.2rem;
}

.exercise-how-to-copy ol {
  margin: 14px 0 0;
  padding-left: 1.4rem;
  line-height: 1.55;
}

.exercise-how-to-copy li + li {
  margin-top: 8px;
}

.exercise-how-to-tip {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ua-blue);
  font-weight: 700;
  line-height: 1.5;
}

.exercise-image-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #f1c400;
  color: #002d72;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.exercise-warning {
  margin-top: 12px;
}

.session-subcopy {
  margin-top: 10px;
}

.code-pill {
  display: inline-flex;
  width: auto;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}

.completion-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 45, 114, 0.48);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 50;
  overscroll-behavior: contain;
}

.completion-overlay.hidden {
  display: none;
}

.completion-popup {
  width: min(100%, 420px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(0, 45, 114, 0.96), rgba(0, 45, 114, 0.94));
  color: #fff;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 45, 114, 0.3);
  animation: pop-in 280ms ease;
}

html:has(.patient-choice-overlay),
body:has(.patient-choice-overlay),
html:has(.welcome-sheet-overlay.is-visible),
body:has(.welcome-sheet-overlay.is-visible),
html:has(.rating-overlay:not(.hidden)),
body:has(.rating-overlay:not(.hidden)),
html:has(.exercise-image-overlay.is-visible),
body:has(.exercise-image-overlay.is-visible),
html:has(.completion-overlay:not(.hidden)),
body:has(.completion-overlay:not(.hidden)) {
  overflow: hidden;
  overscroll-behavior: none;
}

.completion-badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  font-weight: 700;
}

.completion-popup h2 {
  margin-top: 16px;
  color: #fff;
}

.completion-popup p {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.08rem;
}

.completion-popup > .popup-button {
  display: inline-flex;
  justify-content: center;
  margin-top: 22px;
}

.new-patient-id {
  display: inline-block;
  margin-inline: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #f1c400;
  letter-spacing: 0.04em;
}

.partial-popup {
  text-align: center;
}

.partial-popup .popup-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 24px;
}

.partial-popup .popup-button {
  width: 100%;
  min-height: 54px;
  margin-top: 0;
  justify-content: center;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.completion-message {
  min-height: 28px;
  margin: 14px 0 0;
}

@media (max-width: 820px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-heading {
    display: grid;
  }

  .analytics-note {
    max-width: none;
    text-align: left;
  }

  .welcome-screen {
    grid-template-columns: 1fr;
    padding-top: 24px;
  }
}

@media (max-width: 640px) {
  .screen {
    width: min(100% - 20px, 100%);
  }

  .top-nav {
    width: min(100% - 20px, 100%);
    align-items: center;
  }

  .hero-column,
  .card,
  .body-option,
  .exercise-item,
  .stat-box,
  .focus-card,
  .progress-panel {
    border-radius: 24px;
  }

  .hero-column,
  .card {
    padding: 22px;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-logo-image {
    width: 64px;
    height: 64px;
  }

  .hero-status-grid {
    grid-template-columns: 1fr;
  }

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

  .role-grid,
  .portal-grid,
  .builder-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .sheet-actions {
    grid-template-columns: 1fr;
  }

  .progress-header,
  .session-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .body-option {
    grid-template-columns: 1fr;
  }
}
