:root {
  --shadow-subtle: 0 14px 34px rgba(23, 32, 51, 0.055);
  --shadow-panel: 0 10px 26px rgba(23, 32, 51, 0.04);
}

/* Clean UI redesign - action-first system */
:root {
  --color-bg-app: #f7f8fb;
  --color-bg-surface: #ffffff;
  --color-bg-subtle: #f1f4f8;
  --color-bg-primary: #182033;
  --color-bg-ai: #eef5ff;
  --color-bg-privacy: #fff8e5;
  --color-bg-wellbeing: #ecfaf7;
  --color-brand-x: #2563eb;
  --color-brand-x-highlight: #2563eb;
  --color-brand-wellbeing: #168a82;
  --color-brand-mark: #f55b41;
  --color-brand-mark-highlight: #ff765e;
  --color-brand-mark-deep: #b83b2a;
  --color-brand-mark-shadow: rgba(245, 91, 65, 0.16);
  --color-accent-care: #f55b41;
  --color-accent-care-hover: #df4a32;
  --color-accent-care-soft: #fff1ed;
  --color-accent-care-text: #9f2f20;
  --color-accent-care-border: rgba(245, 91, 65, 0.24);
  --color-accent-care-shadow: rgba(245, 91, 65, 0.16);
  --color-text-primary: #182033;
  --color-text-secondary: #647084;
  --color-text-muted: #8a94a6;
  --color-border-default: #dde3eb;
  --color-border-focus: #f55b41;
  --shadow-subtle: none;
  --shadow-panel: none;
  --radius-sm: 8px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --radius-xl: 8px;
}

body {
  background: var(--color-bg-app);
}

body::before,
.hero-background::after {
  display: none;
}

a {
  color: var(--color-brand-x);
  font-weight: 760;
  text-decoration-color: rgba(37, 99, 235, 0.24);
}

a:hover {
  color: var(--color-accent-care-text);
}

:focus-visible {
  outline: 3px solid rgba(245, 91, 65, 0.28);
  outline-offset: 3px;
}

button,
.button-link {
  background: var(--color-accent-care);
  border-color: var(--color-accent-care);
  border-radius: 8px;
  box-shadow: none;
  color: #ffffff;
  font-weight: 850;
  min-height: 44px;
  padding-inline: 16px;
  transform: none;
}

button:hover,
.button-link:hover {
  background: var(--color-accent-care-hover);
  border-color: var(--color-accent-care-hover);
  color: #ffffff;
  transform: none;
}

.button-link.secondary,
button.secondary,
.button-link.subtle {
  background: #ffffff;
  border-color: var(--color-border-default);
  color: var(--color-text-primary);
}

.button-link.secondary:hover,
button.secondary:hover,
.button-link.subtle:hover {
  background: var(--color-bg-subtle);
  border-color: #cad3df;
  color: var(--color-text-primary);
}

.button-link.danger,
button.danger {
  background: #b42318;
  border-color: #b42318;
  color: #ffffff;
}

.button-link.subtle-danger,
button.subtle-danger {
  background: #fff7f5;
  border-color: rgba(180, 35, 24, 0.22);
  color: #b42318;
}

.button-link.subtle-danger:hover,
button.subtle-danger:hover {
  background: #ffe8e3;
  color: #8f1d14;
}

.site-header {
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(221, 227, 235, 0.9);
}

.site-header__inner {
  min-height: 68px;
  padding-block: 10px;
}

.brand-mark img,
.app-sidebar__brand img {
  filter: drop-shadow(0 8px 18px rgba(245, 91, 65, 0.12));
}

.site-nav {
  gap: 4px;
}

.site-nav a,
.site-nav button,
.site-nav__badge {
  border-radius: 8px;
  color: var(--color-text-secondary);
  font-weight: 760;
  min-height: 36px;
}

.site-nav a:hover,
.site-nav button:hover {
  background: var(--color-bg-subtle);
  border-color: transparent;
}

.site-nav .nav-cta {
  background: var(--color-accent-care);
  border-color: var(--color-accent-care);
  color: #ffffff;
}

.site-header--app,
.site-header--app + .messages {
  margin-left: 236px;
}

.site-header--app .site-header__inner {
  min-height: 70px;
}

.app-layout {
  grid-template-columns: 236px minmax(0, 1fr);
}

.app-sidebar {
  background: #ffffff;
  border-right: 1px solid rgba(221, 227, 235, 0.92);
  gap: 14px;
  padding: 18px 14px 14px;
  width: 236px;
}

.app-sidebar__header {
  min-height: 40px;
}

.app-sidebar__brand .brand-wordmark--sidebar {
  font-size: 1.18rem;
}

.app-sidebar__collapse,
.mobile-menu-button,
.app-sidebar__close {
  background: #ffffff;
  border-color: var(--color-border-default);
  border-radius: 8px;
}

.app-topbar__context {
  color: var(--color-text-secondary);
  font-size: 0.94rem;
  font-weight: 780;
}

.app-topbar__mark {
  background: var(--color-accent-care-soft);
  border-color: var(--color-accent-care-border);
  color: var(--color-accent-care);
}

.app-sidebar__section {
  gap: 4px;
}

.app-sidebar__section-label {
  background: transparent;
  border: 0;
  color: var(--color-text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  min-height: 24px;
  padding-inline: 8px;
}

.app-sidebar__nav {
  gap: 3px;
}

.app-sidebar__nav a,
.app-sidebar__logout button {
  border-radius: 8px;
  color: var(--color-text-secondary);
  font-size: 0.92rem;
  font-weight: 760;
  min-height: 40px;
  padding-inline: 10px;
}

.app-sidebar__nav a:hover,
.app-sidebar__logout button:hover {
  background: var(--color-bg-subtle);
  border-color: transparent;
}

.app-sidebar__nav a.is-active {
  background: var(--color-accent-care-soft);
  border-color: transparent;
  color: var(--color-accent-care-text);
}

.app-sidebar__nav a.is-active .ui-icon {
  color: var(--color-accent-care);
}

.app-sidebar__profile {
  background: var(--color-bg-subtle);
  border-radius: 8px;
}

.app-sidebar__avatar {
  background: var(--color-accent-care-soft);
  border-color: var(--color-accent-care-border);
  color: var(--color-accent-care-text);
}

.app-sidebar-is-collapsed .site-header--app,
.app-sidebar-is-collapsed .site-header--app + .messages {
  margin-left: 72px;
}

.app-sidebar-is-collapsed .app-layout {
  grid-template-columns: 72px minmax(0, 1fr);
}

.app-sidebar-is-collapsed .app-sidebar {
  width: 72px;
}

.app-layout + .site-footer {
  background: #ffffff;
  border-top-color: rgba(221, 227, 235, 0.9);
}

.app-layout + .site-footer .site-footer__inner {
  padding-left: 292px;
}

.app-sidebar-is-collapsed .app-layout + .site-footer .site-footer__inner {
  padding-left: 128px;
}

.page-shell,
.content-shell,
.auth-shell {
  max-width: 1160px;
}

.content-shell {
  gap: 20px;
  padding: 28px 24px 56px;
}

.hero-shell,
.auth-layout {
  min-height: calc(100vh - 150px);
  padding-block: 42px 52px;
}

h1,
.patient-dashboard-page h1,
.summary-consultation-copy h1,
.document-upload-hero h1,
.document-detail-hero__copy h1,
.legal-page h1,
.demo-shell h1,
.account-hero h1,
.question-detail-page h1 {
  color: var(--color-text-primary);
  font-size: clamp(2.05rem, 4vw, 3.45rem);
  letter-spacing: 0;
  line-height: 1.03;
}

h2,
.section-title {
  letter-spacing: 0;
}

.eyebrow {
  color: var(--color-accent-care-text);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.lede {
  color: var(--color-text-secondary);
  font-size: 1.06rem;
  line-height: 1.62;
}

.muted,
.helptext {
  color: var(--color-text-secondary);
}

.hero-card,
.panel,
.list-row,
.timeline-row,
.timeline-entry,
.citation-row,
.summary-block,
.empty-state,
.notice-panel,
.feature-card,
.source-block,
.auth-card,
.patient-hero__copy,
.next-step-card,
.quick-action-card,
.care-status-panel,
.activity-card,
.document-card,
.summary-consultation-copy,
.summary-control-panel,
.summary-topic-card,
.summary-evidence-card,
.summary-next-actions,
.share-form-card,
.share-access-card,
.audit-event-card,
.form-card,
.document-upload-card,
.document-upload-support .next-step-card,
.document-detail-hero__copy,
.document-detail-card,
.document-use-panel,
.legal-card,
.demo-scene,
.demo-close,
.account-hero__copy,
.account-hero__aside,
.account-section,
.account-actions,
.medical-summary-panel,
.medical-summary-block,
.medical-section,
.medical-excerpt-card,
.medical-item-card,
.medical-scope-summary,
.medical-status-strip {
  box-shadow: none;
  border-radius: 8px;
}

.patient-hero,
.summary-consultation-hero,
.document-upload-hero,
.document-detail-hero,
.account-hero,
.management-hero {
  gap: 18px;
}

.patient-hero__copy,
.summary-consultation-copy,
.document-upload-hero__copy,
.document-detail-hero__copy,
.account-hero__copy,
.medical-hero__main {
  background: transparent;
  border: 0;
  padding: 0;
}

.patient-dashboard-page {
  background: var(--color-bg-app);
}

.hero-background {
  background: var(--color-bg-app);
}

.hero-copy,
.page-intro,
.summary-consultation-copy,
.patient-hero__copy,
.document-upload-hero__copy {
  gap: 14px;
}

.hero-visual > img {
  border-radius: 8px;
  box-shadow: none;
}

.trust-strip,
.summary-meta-strip,
.dossier-status-chips,
.medical-patient-meta {
  gap: 7px;
}

.trust-pill,
.status-pill,
.dossier-status-chip,
.medical-status-chip,
.identity-pill {
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 820;
  min-height: 28px;
  padding: 5px 10px;
}

.status-pill {
  background: #eaf8ef;
  color: #17643a;
}

.status-pill.neutral,
.trust-pill,
.dossier-status-chip,
.medical-status-chip {
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  color: var(--color-text-secondary);
}

.status-pill.warning {
  background: #fff8e5;
  color: #8a5a00;
}

.trust-pill.accent {
  background: var(--color-accent-care-soft);
  border-color: var(--color-accent-care-border);
  color: var(--color-accent-care-text);
}

.page-kicker {
  gap: 8px;
}

.next-step-card,
.summary-control-panel,
.share-form-card {
  background: #ffffff;
  border: 1px solid var(--color-accent-care-border);
  gap: 12px;
  padding: 20px;
}

.next-step-card h2,
.summary-control-panel h2,
.share-form-card h2 {
  font-size: 1.12rem;
  line-height: 1.25;
}

.next-step-card .button-link,
.summary-control-panel .inline-form button,
.share-form-card button[type="submit"] {
  width: 100%;
}

.primary-action-strip,
.care-status-panel,
.document-upload-card,
.form-card,
.auth-card,
.document-detail-card,
.document-use-panel,
.account-section,
.legal-card,
.demo-scene,
.demo-close,
.medical-summary-panel,
.medical-section {
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  padding: 20px;
}

.primary-action-strip {
  gap: 14px;
}

.primary-action-strip .section-heading,
.primary-action-strip .section-title {
  margin: 0;
}

.quick-action-grid {
  gap: 10px;
}

.quick-action-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  display: grid;
  gap: 6px 12px;
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 0;
  padding: 14px;
}

.quick-action-card .feature-icon {
  color: var(--color-accent-care);
  grid-row: span 2;
  height: 22px;
  margin: 0;
  width: 22px;
}

.quick-action-card:hover {
  border-color: var(--color-accent-care-border);
  box-shadow: none;
}

.quick-action-card strong {
  font-size: 0.94rem;
}

.quick-action-card span {
  font-size: 0.84rem;
}

.support-link-row {
  border-top: 1px solid var(--color-border-default);
  padding-top: 12px;
}

.patient-support-grid,
.auth-proof {
  display: none;
}

.feature-grid,
.panel-grid {
  gap: 12px;
}

.feature-card,
.panel {
  background: transparent;
  border: 1px solid var(--color-border-default);
  padding: 16px;
}

.feature-icon {
  color: var(--color-accent-care);
}

.patient-activity,
.document-library,
.summary-topic-list,
.summary-evidence-list,
.summary-source-row-list,
.timeline-entry-list,
.medical-summary-block-list,
.medical-excerpt-list,
.medical-timeline-list,
.list-panel {
  gap: 10px;
}

.activity-card,
.share-access-card,
.audit-event-card,
.list-row,
.summary-topic-card,
.summary-evidence-card,
.summary-block,
.medical-summary-block,
.medical-excerpt-card,
.medical-item-card,
.timeline-row,
.timeline-entry {
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  padding: 16px;
}

.activity-card,
.timeline-entry {
  gap: 16px;
  grid-template-columns: 96px minmax(0, 1fr);
}

.activity-date,
.timeline-entry__date {
  border-right-color: var(--color-border-default);
  padding-right: 14px;
}

.activity-date time,
.timeline-entry__date time,
.summary-meta-strip > span > .ui-icon,
.dossier-status-chip .ui-icon,
.medical-status-chip .ui-icon {
  color: var(--color-accent-care);
}

.activity-date span,
.timeline-entry__date span {
  font-size: 1.62rem;
}

.timeline-entry__date-label {
  font-size: 0.9rem;
  line-height: 1.25;
}

.activity-title-row h3,
.timeline-entry__header h3,
.timeline-entry__header h4,
.summary-topic-card h3,
.summary-evidence-card h3,
.medical-summary-block h3,
.medical-item-card h3 {
  font-size: 1.02rem;
}

.activity-title-row p,
.activity-note,
.timeline-entry__header p,
.timeline-entry__note,
.document-card p,
.summary-topic-card p,
.summary-evidence-card p,
.medical-note {
  color: var(--color-text-secondary);
  line-height: 1.52;
}

.activity-source,
.timeline-entry__meta,
.source-actions,
.summary-control-links,
.action-row {
  gap: 8px;
}

.activity-source,
.timeline-entry__meta {
  background: var(--color-bg-subtle);
  border: 0;
  border-radius: 8px;
  color: var(--color-text-secondary);
  padding: 10px 12px;
}

.timeline-entry--compact {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--color-border-default);
  padding: 12px 0 0;
}

.timeline-entry--compact:first-child {
  border-top: 0;
  padding-top: 0;
}

.timeline-entry--compact .timeline-entry__date {
  padding-right: 0;
}

.timeline-entry--compact .timeline-entry__date time {
  background: var(--color-bg-subtle);
  border-color: var(--color-border-default);
}

.timeline-entry--compact .timeline-entry__date span {
  font-size: 1.18rem;
}

.timeline-entry--compact .timeline-entry__meta {
  background: transparent;
  padding: 0;
}

.timeline-entry--wellbeing .status-pill {
  background: var(--color-bg-wellbeing);
  border-color: rgba(31, 159, 153, 0.18);
  color: #14736f;
}

.source-actions .button-link,
.activity-footer .button-link,
.document-action-strip .button-link {
  min-height: 38px;
}

.activity-footer,
.summary-next-actions {
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  padding: 16px;
}

.care-status-panel--quiet,
.dossier-status-summary {
  background: transparent;
  border-color: var(--color-border-default);
  padding: 16px;
}

.dossier-status-details {
  border-top-color: var(--color-border-default);
}

.summary-safety-callout,
.notice-panel.ai,
.medical-safety-callout {
  background: var(--color-bg-ai);
  border-color: rgba(37, 99, 235, 0.16);
  color: #183b72;
}

.summary-safety-callout .ui-icon,
.medical-safety-callout .ui-icon {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.16);
  color: var(--color-brand-x);
}

.notice-panel,
.empty-state {
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  padding: 16px;
}

.empty-state {
  text-align: left;
}

.upload-dropzone {
  background: #ffffff;
  border-color: var(--color-accent-care-border);
  border-radius: 8px;
  min-height: 220px;
}

.upload-dropzone__icon {
  background: var(--color-accent-care);
}

.upload-dropzone.is-dragging,
.upload-dropzone.has-file {
  background: var(--color-accent-care-soft);
  border-color: var(--color-accent-care);
  box-shadow: none;
}

.document-upload-support {
  gap: 12px;
}

.document-upload-support .privacy-rail {
  background: transparent;
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  padding: 16px;
}

.extraction-step {
  background: var(--color-bg-subtle);
  border: 0;
  border-radius: 8px;
}

.extraction-step .ui-icon {
  color: var(--color-accent-care);
}

.summary-topic-card__number,
.medical-summary-block__number,
.source-index {
  background: var(--color-accent-care-soft);
  border-color: var(--color-accent-care-border);
  color: var(--color-accent-care-text);
}

.summary-source-row blockquote,
.summary-evidence-card blockquote,
.medical-source-card blockquote,
.medical-excerpt-card blockquote,
.citation-row blockquote {
  background: var(--color-bg-subtle);
  border-left-color: var(--color-accent-care);
  border-radius: 0 8px 8px 0;
}

.summary-source-note--inline {
  align-items: center;
  background: var(--color-bg-subtle);
  border: 0;
  border-radius: 8px;
  color: var(--color-text-secondary);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.88rem;
  gap: 6px;
  padding: 10px 12px;
}

.summary-source-note--inline a {
  color: var(--color-accent-care-text);
  font-weight: 820;
}

.summary-source-note--inline span {
  color: var(--color-text-muted);
}

.summary-evidence-section--compact {
  gap: 0;
  margin-top: 2px;
}

.summary-evidence-disclosure {
  border-top: 1px solid var(--color-border-default);
  color: var(--color-text-secondary);
  padding-top: 10px;
}

.summary-evidence-disclosure > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  list-style: none;
  min-height: 38px;
}

.summary-evidence-disclosure > summary::-webkit-details-marker {
  display: none;
}

.summary-evidence-disclosure > summary::after {
  align-items: center;
  border: 1px solid var(--color-border-default);
  border-radius: 999px;
  color: var(--color-text-muted);
  content: "+";
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.88rem;
  font-weight: 820;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.summary-evidence-disclosure[open] > summary::after {
  content: "-";
}

.summary-evidence-disclosure > summary > span:first-child {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.summary-evidence-disclosure .eyebrow {
  color: var(--color-text-muted);
  font-size: 0.66rem;
  margin: 0;
}

.summary-evidence-disclosure strong {
  color: var(--color-text-primary);
  font-size: 0.98rem;
  line-height: 1.2;
}

.summary-evidence-disclosure > p {
  font-size: 0.84rem;
  margin: 4px 0 10px;
  max-width: 620px;
}

.summary-evidence-list--compact {
  gap: 8px;
  grid-template-columns: 1fr;
  max-width: 560px;
}

.summary-evidence-section--compact .summary-evidence-card {
  align-items: center;
  background: transparent;
  border-color: var(--color-border-default);
  box-shadow: none;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
}

.summary-evidence-section--compact .source-index {
  font-size: 0.72rem;
  height: 24px;
  width: 24px;
}

.summary-evidence-section--compact .summary-evidence-card h3 {
  font-size: 0.9rem;
  margin: 0 0 2px;
}

.summary-evidence-section--compact .summary-evidence-card p {
  font-size: 0.78rem;
  line-height: 1.4;
}

.summary-evidence-section--compact .button-link {
  font-size: 0.78rem;
  min-height: 32px;
  padding: 6px 10px;
}

.summary-consultation-page .summary-consultation-copy {
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  padding: 22px;
}

.summary-consultation-page .summary-consultation-section {
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  gap: 16px;
  padding: 18px;
}

.summary-consultation-page .summary-consultation-section .summary-topic-list {
  gap: 0;
}

.summary-consultation-page .summary-consultation-section .summary-topic-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 16px 0 0;
}

.summary-consultation-page .summary-consultation-section .summary-topic-card + .summary-topic-card {
  border-top: 1px solid var(--color-border-default);
  margin-top: 16px;
}

.summary-consultation-page .summary-evidence-section--compact {
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  margin-top: 0;
  padding: 14px 16px;
}

.summary-consultation-page .summary-evidence-disclosure {
  border-top: 0;
  padding-top: 0;
}

.share-form-card input,
.share-form-card select,
.share-form-card textarea,
.form-card input,
.form-card select,
.form-card textarea,
.auth-card input,
.auth-card select,
.auth-card textarea,
.document-upload-card input,
.document-upload-card select,
.document-upload-card textarea,
.account-section input,
.account-section select,
.account-section textarea {
  border-color: var(--color-border-default);
  border-radius: 8px;
}

.share-form-card input:focus,
.share-form-card select:focus,
.share-form-card textarea:focus,
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus,
.auth-card input:focus,
.auth-card select:focus,
.auth-card textarea:focus,
.document-upload-card input:focus,
.document-upload-card select:focus,
.document-upload-card textarea:focus,
.account-section input:focus,
.account-section select:focus,
.account-section textarea:focus {
  border-color: var(--color-accent-care);
  box-shadow: 0 0 0 3px rgba(245, 91, 65, 0.12);
}

.wellbeing-page .quick-action-card .feature-icon,
.wellbeing-page .activity-date time,
.wellbeing-page .timeline-entry__date time,
.wellbeing-page .dossier-status-chip .ui-icon {
  color: var(--color-brand-wellbeing);
}

.wellbeing-safety-note {
  background: var(--color-bg-wellbeing);
  border-color: rgba(22, 138, 130, 0.18);
}

.medical-anchor-nav {
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  box-shadow: none;
}

.medical-anchor-nav a {
  border-radius: 8px;
}

.medical-anchor-nav a:hover {
  background: var(--color-bg-subtle);
}

.medical-status-strip,
.medical-scope-summary {
  background: #ffffff;
  border: 1px solid var(--color-border-default);
}

.medical-hero {
  background: transparent;
  border: 0;
  padding: 0;
}

.demo-guide,
.dossier-map {
  border-radius: 8px;
  box-shadow: none;
}

.dossier-map {
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  color: var(--color-text-primary);
}

.dossier-map .eyebrow,
.dossier-map .muted {
  color: var(--color-text-secondary);
}

.dossier-node {
  background: var(--color-bg-subtle);
  border: 0;
  border-radius: 8px;
}

.dossier-node strong {
  color: var(--color-accent-care);
}

.home-flow {
  border-top: 1px solid var(--color-border-default);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-flow li {
  display: grid;
  gap: 7px;
  padding: 18px 22px 0 0;
}

.home-flow li + li {
  border-left: 1px solid var(--color-border-default);
  padding-left: 22px;
}

.home-flow .ui-icon {
  color: var(--color-accent-care);
  height: 22px;
  margin: 0 0 4px;
  width: 22px;
}

.home-flow strong {
  color: var(--color-text-primary);
  font-size: 1rem;
}

.home-flow span {
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.share-workspace {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 336px);
}

.share-workspace--compact {
  max-width: 1120px;
}

.share-main-column {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.share-intro {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 16px;
}

.share-intro h1 {
  font-size: clamp(1.9rem, 3vw, 2.45rem);
  line-height: 1.08;
  margin: 0;
  max-width: 580px;
}

.share-intro .lede {
  max-width: 540px;
}

.share-back-link {
  justify-self: start;
  min-height: 34px;
}

.share-scope-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.share-scope-list span {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  border-radius: 999px;
  color: var(--color-text-secondary);
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 820;
  gap: 6px;
  min-height: 28px;
  padding: 5px 9px;
}

.share-scope-list .ui-icon {
  color: var(--color-accent-care);
  height: 14px;
  margin: 0;
  width: 14px;
}

.share-scope-list--quiet span {
  background: var(--color-bg-subtle);
  border-color: transparent;
}

.share-form-card--primary {
  align-self: start;
  border-color: var(--color-accent-care-border);
  display: grid;
  gap: 12px;
  padding: 16px;
  position: sticky;
  top: 88px;
}

.share-form-card__header {
  display: grid;
  gap: 4px;
}

.share-form-field {
  display: grid;
  gap: 6px;
}

.share-option-list {
  display: grid;
  gap: 8px;
}

.share-option {
  align-items: start;
  background: #f8fafc;
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 18px minmax(0, 1fr);
  line-height: 1.35;
  margin: 0;
  padding: 9px 10px;
}

.share-option input[type="checkbox"] {
  margin: 3px 0 0;
}

.share-option strong,
.share-option small {
  display: block;
}

.share-option strong {
  font-size: 0.88rem;
}

.share-option small {
  color: var(--color-text-secondary);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.45;
  margin-top: 3px;
}

.share-management-section {
  gap: 10px;
  padding: 16px;
}

.share-access-card--lean {
  border-radius: 8px;
  grid-template-columns: 1fr;
  padding: 14px;
}

.share-access-card--lean .inline-form {
  justify-self: start;
  margin: 0;
}

.share-empty-state {
  padding: 14px;
}

.share-history {
  display: grid;
  gap: 0;
  padding: 16px;
}

.share-history summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  list-style: none;
}

.share-history summary::-webkit-details-marker {
  display: none;
}

.share-history summary strong {
  display: block;
  font-size: 1rem;
  line-height: 1.25;
}

.share-history[open] summary {
  border-bottom: 1px solid var(--color-border-default);
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.share-history__empty {
  background: #fbfdff;
  border: 1px dashed var(--color-border-default);
  border-radius: 8px;
  padding: 14px;
}

.share-history__empty h2 {
  font-size: 1rem;
  margin: 0 0 4px;
}

.upload-guidance {
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  color: var(--color-text-secondary);
  padding: 14px 16px;
}

.upload-guidance summary {
  align-items: center;
  color: var(--color-text-primary);
  cursor: pointer;
  display: flex;
  font-weight: 850;
  gap: 8px;
  min-height: 34px;
}

.upload-guidance summary .ui-icon {
  color: var(--color-accent-care);
  margin: 0;
}

.upload-guidance ul,
.upload-guidance p {
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .site-header--app,
  .site-header--app + .messages,
  .app-sidebar-is-collapsed .site-header--app,
  .app-sidebar-is-collapsed .site-header--app + .messages {
    margin-left: 0;
  }

  .app-layout + .site-footer .site-footer__inner,
  .app-sidebar-is-collapsed .app-layout + .site-footer .site-footer__inner {
    padding-inline: 24px;
  }

  .app-sidebar {
    box-shadow: 16px 0 40px rgba(24, 32, 51, 0.14);
  }

  .hero-shell,
  .auth-layout {
    padding-block: 30px 42px;
  }

  .patient-hero,
  .summary-consultation-hero,
  .document-upload-hero,
  .document-upload-grid,
  .share-workspace,
  .management-hero,
  .document-detail-hero,
  .document-record-header,
  .account-hero {
    grid-template-columns: 1fr;
  }

  .share-form-card--primary {
    position: static;
  }

  .document-detail-grid--record {
    grid-template-columns: 1fr;
  }

  .document-record-actions {
    justify-content: flex-start;
    max-width: none;
  }

  .activity-card,
  .timeline-entry {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .question-list-page .question-workspace__header {
    align-items: start;
    display: grid;
  }

  .question-list-page .question-workspace__header .action-row {
    justify-content: start;
  }
}

@media (max-width: 680px) {
  .site-header__inner {
    padding-inline: 16px;
  }

  .site-nav a,
  .site-nav button {
    padding-inline: 10px;
  }

  .content-shell,
  .page-shell,
  .auth-shell,
  .section-band {
    padding-inline: 16px;
  }

  .content-shell {
    gap: 16px;
    padding-top: 20px;
  }

  .hero-shell,
  .auth-layout {
    padding-top: 24px;
  }

  .action-row,
  .source-actions,
  .summary-next-actions .action-row {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .button-link,
  button {
    width: 100%;
  }

  .patient-identity--hero {
    align-items: flex-start;
  }

  .patient-identity--hero .patient-avatar {
    margin-top: 2px;
  }

  .primary-action-strip,
  .care-status-panel,
  .document-upload-card,
  .form-card,
  .auth-card,
  .summary-control-panel,
  .share-form-card,
  .question-list-page .question-ask-panel,
  .activity-card,
  .timeline-entry,
  .summary-topic-card,
  .summary-evidence-card,
  .medical-summary-block,
  .medical-excerpt-card,
  .medical-item-card {
    padding: 16px;
  }

  .quick-action-card {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .activity-card,
  .timeline-entry {
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .question-list-page .question-workspace__header h1 {
    font-size: 2rem;
  }

  .question-list-page .question-ask-panel__footer,
  .question-list-page .question-history-card {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .question-list-page .question-ask-panel button[type="submit"] {
    min-width: 0;
  }

  .document-record-facts,
  .document-timeline-summary,
  .document-metadata-clean {
    grid-template-columns: 1fr;
  }

  .document-use-panel--compact {
    align-items: start;
    display: grid;
  }

  .document-readiness-strip {
    justify-content: flex-start;
  }

  .document-timeline-summary .status-pill {
    justify-self: start;
  }

  .activity-date,
  .timeline-entry__date {
    border-right: 0;
    border-bottom: 1px solid var(--color-border-default);
    padding: 0 0 10px;
  }

  .activity-date time,
  .timeline-entry__date time {
    align-items: baseline;
    display: flex;
    gap: 8px;
  }

  .activity-date span,
  .timeline-entry__date span {
    font-size: 1.2rem;
  }

  .activity-title-row,
  .timeline-entry__header,
  .share-history summary,
  .summary-section-heading,
  .dossier-status-summary__header,
  .medical-section__header {
    align-items: flex-start;
    display: grid;
    gap: 10px;
  }

  .summary-topic-card__header,
  .medical-summary-block__header {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .summary-topic-card__number,
  .medical-summary-block__number {
    height: 32px;
    width: 32px;
  }

  .summary-evidence-list,
  .feature-grid,
  .panel-grid,
  .care-status-list,
  .extraction-step-list,
  .dossier-map__grid {
    grid-template-columns: 1fr;
  }

  .document-upload-hero__aside {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
  }

  .home-flow {
    grid-template-columns: 1fr;
  }

  .home-flow li {
    border-left: 0;
    border-top: 1px solid var(--color-border-default);
    padding: 16px 0 0;
  }

  .home-flow li:first-child {
    border-top: 0;
  }

  .home-flow li + li {
    border-left: 0;
    padding-left: 0;
  }
}

/* QSP premium flow pass: compact, patient-friendly questionnaire layout. */
.qsp-page .qsp-shell {
  gap: 18px;
  max-width: 1160px;
  padding-top: 22px;
}

.qsp-page .qsp-form {
  display: grid;
  gap: 16px;
}

.qsp-page .qsp-hero {
  background:
    linear-gradient(135deg, rgba(234, 251, 248, 0.88), rgba(255, 255, 255, 0.97) 56%, rgba(255, 241, 236, 0.42)),
    var(--color-bg-surface);
  border: 1px solid rgba(31, 159, 153, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: none;
  gap: 14px;
  padding: 20px 22px;
}

.qsp-page .qsp-hero h1 {
  font-size: clamp(2rem, 3.4vw, 3.05rem);
  line-height: 1.04;
  max-width: 900px;
}

.qsp-page .qsp-hero .lede {
  font-size: 1rem;
  line-height: 1.58;
  max-width: 820px;
}

.qsp-page .qsp-hero__badge {
  background: rgba(255, 255, 255, 0.8);
}

.qsp-page .qsp-response-scale--inline {
  display: none !important;
}

.qsp-page .qsp-response-scale--inline .section-title {
  font-size: 1.08rem;
  line-height: 1.25;
  margin: 0;
}

.qsp-page .qsp-response-scale__options {
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.66);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
}

.qsp-page .qsp-scale-chip {
  min-height: 58px;
  padding: 9px 6px;
}

.qsp-page .qsp-scale-chip strong {
  background: var(--color-bg-wellbeing);
  color: var(--color-brand-wellbeing);
}

.qsp-page .qsp-scale-chip span {
  color: var(--color-text-secondary);
  font-size: 0.72rem;
}

.qsp-page .qsp-method-note {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(203, 213, 225, 0.64);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  overflow: hidden;
}

.qsp-page .qsp-method-note summary {
  align-items: center;
  color: var(--color-text-primary);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 900;
  gap: 8px;
  list-style: none;
  min-height: 44px;
  padding: 0 16px;
}

.qsp-page .qsp-method-note summary::-webkit-details-marker {
  display: none;
}

.qsp-page .qsp-method-note .ui-icon {
  color: var(--color-brand-wellbeing);
  height: 17px;
  width: 17px;
}

.qsp-page .qsp-method-note p {
  border-top: 1px solid rgba(203, 213, 225, 0.54);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
  padding: 12px 16px 14px;
}

.qsp-page .qsp-flow {
  display: grid;
  gap: 18px;
}

.qsp-page .qsp-intake-grid {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
}

.qsp-page .qsp-panel,
.qsp-page .questionnaire-section--domain {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(203, 213, 225, 0.62);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 36px rgba(23, 32, 51, 0.035);
}

.qsp-page .qsp-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.qsp-page .qsp-panel .section-heading {
  margin: 0;
}

.qsp-page .qsp-panel textarea {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.48);
  border-radius: 10px;
  box-sizing: border-box;
  color: var(--color-text-primary);
  font: inherit;
  min-height: 136px;
  padding: 12px 14px;
  width: 100%;
}

.qsp-page .qsp-symptom-chips,
.qsp-page .qsp-symptom-chips > div,
.qsp-page .qsp-symptom-chips ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qsp-page .qsp-symptom-chips > div > div,
.qsp-page .qsp-symptom-chips li {
  width: auto;
}

.qsp-page .qsp-symptom-chips label {
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 999px;
  box-shadow: none;
  min-height: 38px;
  padding: 8px 13px;
  width: auto;
}

.qsp-page .questionnaire-section--domain {
  overflow: hidden;
}

.qsp-page .qsp-domain__header {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(234, 251, 248, 0.58)),
    #ffffff;
  border-bottom: 1px solid rgba(203, 213, 225, 0.5);
  display: grid;
  gap: 12px;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  padding: 18px 22px;
}

.qsp-page .qsp-domain__number {
  background: linear-gradient(145deg, var(--color-brand-wellbeing), #14736f);
  box-shadow: 0 10px 20px rgba(31, 159, 153, 0.16);
  height: 36px;
  width: 36px;
}

.qsp-page .qsp-domain__meta {
  background: #ffffff;
  border-color: rgba(31, 159, 153, 0.18);
  color: #145d59;
}

.qsp-page .questionnaire-item-list {
  display: grid;
}

.qsp-page .questionnaire-item {
  background: #ffffff;
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: center;
  padding: 14px 20px;
}

.qsp-page .questionnaire-item + .questionnaire-item {
  border-top: 1px solid rgba(203, 213, 225, 0.42);
}

.qsp-page .qsp-question__prompt {
  align-items: center;
  color: var(--color-text-primary);
  display: flex;
  font-size: 0.98rem;
  font-weight: 820;
  gap: 10px;
  line-height: 1.42;
}

.qsp-page .questionnaire-item__code {
  background: var(--color-bg-wellbeing);
  border-color: rgba(31, 159, 153, 0.22);
  color: var(--color-brand-wellbeing);
}

.qsp-page .questionnaire-form .likert-options {
  background: rgba(248, 250, 252, 0.76);
  border: 1px solid rgba(203, 213, 225, 0.66);
  border-radius: 12px;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 6px;
}

.qsp-page .questionnaire-form .likert-options::before {
  display: none;
}

.qsp-page .questionnaire-form .likert-option {
  align-content: center;
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.58);
  border-radius: 9px;
  color: var(--color-text-primary);
  min-height: 58px;
  padding: 8px 5px;
}

.qsp-page .questionnaire-form .likert-option:hover {
  background: rgba(234, 251, 248, 0.5);
  border-color: rgba(31, 159, 153, 0.24);
}

.qsp-page .questionnaire-form .likert-option strong {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--color-text-primary);
  font-size: 0.9rem;
  height: auto;
  width: auto;
}

.qsp-page .qsp-likert .likert-option small {
  color: var(--color-text-secondary);
  display: block;
  font-size: 0.64rem;
  font-weight: 850;
  line-height: 1.1;
  margin-top: 2px;
}

.qsp-page .questionnaire-form .likert-option:has(input:checked) {
  background: var(--color-bg-wellbeing);
  border-color: rgba(31, 159, 153, 0.38);
  box-shadow: 0 8px 18px rgba(31, 159, 153, 0.1);
}

.qsp-page .questionnaire-form .likert-option:has(input:checked) strong {
  background: var(--color-brand-wellbeing);
  border-radius: 999px;
  color: var(--color-text-inverse);
  display: inline-flex;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.qsp-page .questionnaire-form .likert-option:has(input:checked) small {
  color: #145d59;
}

.qsp-page .qsp-action-bar {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(234, 251, 248, 0.72)),
    #ffffff;
  border: 1px solid rgba(31, 159, 153, 0.2);
  border-radius: var(--radius-lg);
}

@media (max-width: 980px) {
  .qsp-page .qsp-response-scale--inline,
  .qsp-page .qsp-intake-grid {
    grid-template-columns: 1fr;
  }

  .qsp-page .qsp-response-scale--inline {
    gap: 14px;
  }
}

@media (max-width: 680px) {
  .qsp-page .qsp-shell {
    gap: 14px;
    padding-top: 14px;
  }

  .qsp-page .qsp-hero {
    border-radius: var(--radius-md);
    padding: 18px;
  }

  .qsp-page .qsp-hero__top {
    align-items: stretch;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr auto;
  }

  .qsp-page .qsp-hero h1 {
    font-size: 2rem;
  }

  .qsp-page .qsp-response-scale--inline,
  .qsp-page .qsp-panel,
  .qsp-page .questionnaire-section--domain,
  .qsp-page .qsp-action-bar {
    border-radius: var(--radius-md);
  }

  .qsp-page .qsp-response-scale--inline,
  .qsp-page .qsp-panel {
    padding: 16px;
  }

  .qsp-page .qsp-scale-chip {
    min-height: 50px;
    padding: 7px 3px;
  }

  .qsp-page .qsp-scale-chip span {
    font-size: 0.62rem;
  }

  .qsp-page .qsp-symptom-chips,
  .qsp-page .qsp-symptom-chips > div,
  .qsp-page .qsp-symptom-chips ul {
    display: grid;
    gap: 7px;
  }

  .qsp-page .qsp-symptom-chips label {
    border-radius: var(--radius-sm);
    width: 100%;
  }

  .qsp-page .qsp-domain__header {
    gap: 10px;
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 16px;
  }

  .qsp-page .qsp-domain__number {
    height: 30px;
    width: 30px;
  }

  .qsp-page .qsp-domain__meta {
    grid-column: 2;
    justify-self: start;
  }

  .qsp-page .questionnaire-item {
    padding: 16px;
  }

  .qsp-page .questionnaire-form .likert-options {
    gap: 4px;
    padding: 4px;
  }

  .qsp-page .questionnaire-form .likert-option {
    min-height: 44px;
    padding: 6px 2px;
  }

  .qsp-page .qsp-likert .likert-option small {
    display: none;
  }

  .qsp-page .questionnaire-form .likert-option:has(input:checked) strong {
    height: 26px;
    width: 26px;
  }

  .qsp-page .qsp-action-bar {
    display: grid;
    gap: 12px;
    position: static;
  }

  .qsp-page .qsp-action-bar .account-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

.caregiver-home-shell .list-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.caregiver-home-shell .list-row {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: none;
}

.auth-layout {
  gap: 28px;
  padding-top: 32px;
}

.auth-layout .hero-copy h1 {
  font-size: 3rem;
  line-height: 1.04;
  max-width: 680px;
}

.auth-card,
.auth-proof .feature-card,
.legal-card,
.demo-scene,
.demo-close,
.form-card,
.share-form-card,
.onboarding-card,
.onboarding-support .next-step-card,
.account-hero__copy,
.account-hero__aside,
.account-section,
.account-actions,
.care-status-panel,
.management-section,
.share-access-card,
.audit-event-card,
.evidence-panel,
.evidence-card,
.summary-block,
.citation-row,
.empty-state,
.notice-panel,
.detail-panel,
.panel {
  box-shadow: none;
}

.auth-card,
.form-card,
.share-form-card,
.onboarding-card,
.account-section,
.document-detail-card,
.document-detail-hero__copy,
.legal-card,
.demo-scene,
.demo-close {
  border-radius: var(--radius-md);
}

.auth-card h1 {
  font-size: 2.05rem;
  line-height: 1.08;
}

.auth-card form,
.form-card,
.share-form-card {
  gap: 14px;
}

.auth-card .muted a,
.auth-card > p a {
  align-items: center;
  display: inline-flex;
  min-height: 32px;
}

.auth-card p,
.form-card p,
.share-form-card p {
  max-width: 100%;
}

.legal-page,
.demo-shell,
.onboarding-shell,
.account-shell,
.document-detail-shell,
.question-detail-page .content-shell {
  padding-top: 28px;
}

.legal-page h1,
.demo-shell h1,
.account-hero h1,
.document-detail-hero__copy h1,
.question-detail-page h1 {
  font-size: 2.7rem;
  line-height: 1.04;
}

.legal-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.legal-card,
.demo-scene,
.demo-close {
  background: rgba(255, 255, 255, 0.9);
}

.demo-layout {
  gap: 18px;
}

.demo-guide {
  box-shadow: none;
}

.demo-guide a {
  min-height: 38px;
}

.app-layout + .site-footer .site-footer__links a {
  align-items: center;
  display: inline-flex;
  min-height: 32px;
}

.activity-title-row h3 a,
.list-row h2 a,
.citation-meta h3 a {
  align-items: center;
  display: inline-flex;
  min-height: 32px;
}

.document-edit-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
}

.document-edit-form input,
.document-edit-form select,
.document-edit-form textarea {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

.document-edit-form {
  border-radius: var(--radius-md);
}

.document-edit-note {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 104px;
}

.sensitive-action-hero .patient-hero__copy,
.sensitive-action-card {
  border-color: rgba(180, 35, 24, 0.18);
}

.sensitive-action-card {
  background: rgba(255, 255, 255, 0.92);
}

.sensitive-action-card h2 {
  font-size: 1.25rem;
  margin: 0;
}

.question-detail-page .page-intro {
  max-width: 940px;
}

.question-detail-page .evidence-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.question-detail-page .summary-block {
  background: rgba(255, 255, 255, 0.92);
}

.question-detail-page .citation-row {
  display: grid;
  gap: 14px;
}

.question-list-page .question-workspace {
  gap: 18px;
}

.question-list-page .question-workspace__header {
  align-items: end;
  border-bottom: 1px solid var(--color-border-default);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding-bottom: 18px;
}

.question-list-page .question-workspace__header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.04;
  margin: 0 0 10px;
  max-width: 760px;
}

.question-list-page .question-workspace__header .lede {
  max-width: 720px;
}

.question-list-page .question-workspace__header .action-row {
  flex: 0 0 auto;
}

.question-list-page .question-ask-panel {
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  padding: 20px;
}

.question-list-page .question-ask-form {
  display: grid;
  gap: 14px;
}

.question-list-page .field-group {
  display: grid;
  gap: 8px;
}

.question-list-page .field-group label {
  color: var(--color-text-primary);
  font-size: 0.9rem;
  font-weight: 850;
}

.question-list-page .field-group textarea {
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  color: var(--color-text-primary);
  font: inherit;
  line-height: 1.5;
  min-height: 132px;
  padding: 12px 14px;
  resize: vertical;
  width: 100%;
}

.question-list-page .field-group textarea:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 4px rgba(245, 91, 65, 0.12);
  outline: 0;
}

.question-list-page .question-ask-panel__footer {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.question-list-page .question-safety-note {
  align-items: center;
  color: var(--color-text-secondary);
  display: inline-flex;
  font-size: 0.88rem;
  gap: 8px;
  line-height: 1.42;
  margin: 0;
}

.question-list-page .question-safety-note .ui-icon {
  color: var(--color-brand-x);
  flex: 0 0 auto;
  height: 18px;
  width: 18px;
}

.question-list-page .question-ask-panel button[type="submit"] {
  flex: 0 0 auto;
  min-width: 168px;
}

.question-list-page .question-history-panel {
  display: grid;
  gap: 12px;
}

.question-list-page .question-history-list {
  display: grid;
  gap: 10px;
}

.question-list-page .question-history-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 16px;
}

.question-list-page .question-history-card h3 {
  font-size: 1rem;
  line-height: 1.3;
  margin: 0 0 6px;
}

.question-list-page .question-history-card p {
  color: var(--color-text-secondary);
  line-height: 1.45;
  margin: 0;
}

.patient-dashboard-page .empty-state,
.patient-dashboard-page .notice-panel,
.legal-card,
.demo-scene,
.demo-close {
  border-color: rgba(203, 213, 225, 0.76);
}

.document-detail-grid .detail-panel,
.document-primary-panel,
.document-file-panel {
  box-shadow: none;
}

.document-detail-shell--record {
  gap: 16px;
  max-width: 1120px;
}

.document-record-header {
  align-items: start;
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 20px;
}

.document-record-header__main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.document-record-header h1 {
  font-size: clamp(2rem, 3.8vw, 2.85rem);
  line-height: 1.04;
  margin: 0;
}

.document-record-header .lede {
  max-width: 760px;
}

.document-record-actions {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  max-width: 360px;
}

.document-record-actions .button-link {
  min-height: 38px;
}

.document-record-facts {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  max-width: 780px;
}

.document-record-facts div {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  padding: 10px 12px;
}

.document-record-facts dt,
.document-record-facts dd {
  margin: 0;
}

.document-record-facts dt {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.document-record-facts dd {
  color: var(--color-text-primary);
  font-size: 0.92rem;
  font-weight: 760;
  line-height: 1.35;
  margin-top: 3px;
}

.document-status-note {
  background: rgba(255, 248, 229, 0.62);
  padding: 14px 16px;
}

.document-use-panel--compact {
  align-items: center;
  background: transparent;
  border-radius: 0;
  border-width: 1px 0;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 12px 0;
}

.document-use-panel--compact .eyebrow {
  margin: 0;
}

.document-readiness-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.document-readiness-strip span {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  border-radius: 999px;
  color: var(--color-text-secondary);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 820;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
}

.document-readiness-strip span:not(.is-muted) .ui-icon {
  color: var(--color-accent-care);
}

.document-readiness-strip .is-muted {
  opacity: 0.72;
}

.document-detail-grid--record {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
}

.document-detail-grid--record .detail-panel {
  min-height: 0;
}

.document-detail-grid--record .document-primary-panel {
  display: grid;
  gap: 14px;
  grid-row: auto;
}

.document-record-main,
.document-record-rail {
  display: grid;
  gap: 14px;
}

.document-record-rail {
  align-content: start;
}

.document-record-rail .detail-panel {
  min-height: 0;
  padding: 16px;
}

.document-timeline-panel {
  background: #ffffff;
  border-color: rgba(31, 159, 153, 0.24);
}

.document-timeline-summary {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: 78px minmax(0, 1fr) auto;
}

.document-timeline-summary time {
  align-content: center;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  display: grid;
  min-height: 66px;
  padding: 8px;
  text-align: center;
}

.document-timeline-summary time span {
  color: var(--color-accent-care-text);
  font-size: 1.4rem;
  font-weight: 950;
  line-height: 1;
}

.document-timeline-summary time strong {
  color: var(--color-text-secondary);
  font-size: 0.72rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.document-timeline-summary h3 {
  font-size: 1.08rem;
  line-height: 1.25;
  margin: 0 0 5px;
}

.document-timeline-summary p {
  color: var(--color-text-secondary);
  line-height: 1.48;
  margin: 0;
}

.document-primary-panel--clean {
  display: grid;
  gap: 16px;
  max-width: none;
  padding: 20px;
}

.document-metadata-clean {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.document-metadata-clean .metadata-list__wide {
  grid-column: 1 / -1;
}

.document-notes-panel {
  max-width: none;
}

.account-actions {
  background: transparent;
  border: 0;
  padding-left: 0;
  padding-right: 0;
}

.medical-shell {
  gap: 16px;
  max-width: 1200px;
  padding-top: 24px;
}

.medical-hero,
.medical-anchor-nav,
.medical-summary-panel,
.medical-section,
.medical-summary-block,
.medical-timeline-item,
.medical-document-row,
.document-upload-card,
.document-upload-support .next-step-card,
.document-detail-hero__copy,
.document-detail-card,
.document-use-panel {
  box-shadow: none;
}

.medical-hero {
  padding: 22px;
}

.medical-status-strip {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
}

.medical-status-chip,
.medical-summary-context,
.medical-summary-source-count {
  border-radius: var(--radius-sm);
}

.medical-status-chip {
  justify-content: flex-start;
}

.document-upload-shell {
  padding-top: 28px;
}

.document-upload-hero h1 {
  font-size: 3.05rem;
}

.upload-dropzone {
  min-height: 238px;
  padding: 24px;
}

/* DS application pass v3: less-is-more refinements */
.primary-action-strip,
.medical-scope-summary {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: var(--radius-md);
  display: grid;
  gap: 14px;
  padding: 18px;
}

.primary-action-strip .section-heading,
.primary-action-strip .section-title {
  margin: 0;
}

.quick-action-grid--lean {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-action-grid--lean .quick-action-card {
  min-height: 118px;
}

.support-link-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.support-link-row span {
  color: var(--color-text-secondary);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.support-link-row a,
.delegation-permission-details summary {
  align-items: center;
  color: var(--color-text-primary);
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 850;
  gap: 7px;
  line-height: 1.35;
  min-height: 36px;
  padding-block: 7px;
  text-decoration: none;
}

.support-link-row a:hover,
.delegation-permission-details summary:hover {
  color: var(--color-bg-primary);
}

.patient-support-grid {
  display: none;
}

.delegation-summary {
  color: var(--color-text-secondary);
  font-size: 0.92rem;
  margin: 4px 0 0;
}

.delegation-permission-details {
  margin-top: 6px;
}

.delegation-permission-details summary {
  cursor: pointer;
}

.delegation-permission-details .delegation-permission-strip {
  margin-top: 8px;
}

.caregiver-actions {
  min-width: min(100%, 360px);
}

.medical-scope-summary {
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  padding: 12px 14px;
}

.medical-scope-summary p {
  align-items: center;
  color: var(--color-text-secondary);
  display: flex;
  font-size: 0.88rem;
  font-weight: 780;
  gap: 8px;
  margin: 0;
}

.medical-scope-summary .ui-icon {
  color: var(--color-brand-x);
  flex: 0 0 auto;
}

.medical-empty-state {
  align-content: start;
  gap: 8px;
}

.medical-empty-state .eyebrow {
  color: var(--color-text-secondary);
  margin: 0;
}

.medical-scope-note {
  background: rgba(248, 250, 252, 0.86);
}

.patient-dashboard-page .patient-activity {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: var(--radius-lg);
  box-shadow: none;
  gap: 16px;
  padding: 20px;
}

.patient-dashboard-page .patient-activity > .section-heading {
  border-bottom: 1px solid rgba(203, 213, 225, 0.58);
  padding-bottom: 16px;
}

.patient-dashboard-page .patient-activity > .section-heading .muted {
  max-width: 760px;
}

.patient-dashboard-page .patient-activity > .activity-card,
.patient-dashboard-page .patient-activity > .timeline-entry,
.patient-dashboard-page .patient-activity > .empty-state {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(203, 213, 225, 0.64);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.patient-dashboard-page .patient-activity .activity-source,
.patient-dashboard-page .patient-activity .timeline-entry__meta {
  background: rgba(239, 246, 255, 0.58);
  border-color: rgba(37, 99, 235, 0.14);
}

.patient-dashboard-page .patient-activity > .activity-footer {
  background: transparent;
  border: 0;
  border-radius: 0;
  border-top: 1px solid rgba(203, 213, 225, 0.58);
  box-shadow: none;
  padding: 16px 0 0;
}

.wellbeing-page .wellbeing-timeline-section {
  background:
    linear-gradient(145deg, rgba(234, 251, 248, 0.62), rgba(255, 255, 255, 0.9)),
    var(--color-bg-surface);
  border-color: rgba(31, 159, 153, 0.22);
  gap: 14px;
}

.wellbeing-page .wellbeing-timeline-section > .section-heading {
  border-bottom-color: rgba(31, 159, 153, 0.18);
}

.wellbeing-page .wellbeing-timeline-section > .activity-card,
.wellbeing-page .wellbeing-timeline-section > .timeline-entry,
.wellbeing-page .wellbeing-timeline-section > .empty-state {
  border-color: rgba(31, 159, 153, 0.18);
}

.wellbeing-page .wellbeing-timeline-section > .empty-state {
  background: rgba(255, 255, 255, 0.62);
  box-shadow: none;
}

.wellbeing-page .wellbeing-timeline-section .activity-source,
.wellbeing-page .wellbeing-timeline-section .timeline-entry__meta {
  background: rgba(234, 251, 248, 0.66);
  border-color: rgba(31, 159, 153, 0.16);
}

.wellbeing-entry-shell {
  gap: 18px;
  max-width: 1160px;
  padding-top: 22px;
}

.wellbeing-entry-hero {
  background:
    linear-gradient(135deg, rgba(234, 251, 248, 0.88), rgba(255, 255, 255, 0.96) 54%, rgba(255, 241, 236, 0.42)),
    var(--color-bg-surface);
  border: 1px solid rgba(31, 159, 153, 0.2);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  overflow: hidden;
  padding: 20px 22px;
  position: relative;
}

.wellbeing-entry-hero::before {
  background: linear-gradient(90deg, var(--color-brand-wellbeing), var(--color-brand-mark));
  content: "";
  height: 3px;
  inset: 0 0 auto;
  position: absolute;
}

.wellbeing-entry-hero__copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.wellbeing-entry-back {
  justify-self: start;
  margin-bottom: 2px;
}

.wellbeing-entry-hero h1 {
  font-size: 2.5rem;
  line-height: 1.04;
  margin: 0;
  max-width: 860px;
}

.wellbeing-entry-hero .lede {
  color: var(--color-text-secondary);
  font-size: 1.05rem;
  line-height: 1.58;
  margin: 0;
  max-width: 800px;
}

.wellbeing-entry-form {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.86)),
    var(--color-bg-surface);
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 22px;
  padding: 22px;
}

.wellbeing-entry-form--care {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wellbeing-entry-section,
.wellbeing-entry-field {
  min-width: 0;
}

.wellbeing-entry-section {
  display: grid;
  gap: 14px;
}

.wellbeing-entry-section--wide,
.wellbeing-entry-details,
.wellbeing-entry-actions {
  grid-column: 1 / -1;
}

.wellbeing-entry-section__heading {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 38px minmax(0, 1fr);
}

.wellbeing-entry-section__heading .eyebrow {
  margin: 0 0 3px;
}

.wellbeing-entry-section__heading h2 {
  font-size: 1.18rem;
  line-height: 1.22;
  margin: 0;
}

.wellbeing-entry-section__icon {
  align-items: center;
  background: var(--color-bg-wellbeing);
  border: 1px solid rgba(31, 159, 153, 0.18);
  border-radius: 999px;
  color: var(--color-brand-wellbeing);
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.wellbeing-entry-section__icon .ui-icon {
  height: 18px;
  width: 18px;
}

.wellbeing-entry-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wellbeing-entry-grid--report {
  align-items: start;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
}

.wellbeing-entry-field {
  align-content: start;
  display: grid;
  gap: 8px;
  margin: 0;
}

.wellbeing-entry-field label,
.wellbeing-entry-details > summary {
  color: var(--color-text-primary);
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.3;
}

.wellbeing-entry-field input,
.wellbeing-entry-field select,
.wellbeing-entry-field textarea {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.48);
  border-radius: 10px;
  box-sizing: border-box;
  color: var(--color-text-primary);
  font: inherit;
  font-weight: 650;
  max-width: 100%;
  min-height: 50px;
  min-width: 0;
  padding: 12px 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  width: 100%;
}

.wellbeing-entry-field textarea {
  line-height: 1.55;
  min-height: 152px;
  resize: vertical;
}

.wellbeing-entry-form--report #id_description {
  min-height: 220px;
}

.wellbeing-entry-field input:focus,
.wellbeing-entry-field select:focus,
.wellbeing-entry-field textarea:focus {
  background: #fff;
  border-color: rgba(31, 159, 153, 0.58);
  box-shadow: 0 0 0 4px rgba(31, 159, 153, 0.12);
  outline: 0;
}

.wellbeing-entry-field--textarea > label,
.wellbeing-entry-details .wellbeing-entry-field > label,
.wellbeing-entry-details--documents > .related-document-field > label {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.wellbeing-voice-panel {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(234, 251, 248, 0.92), rgba(255, 255, 255, 0.82)),
    var(--color-bg-wellbeing);
  border-color: rgba(31, 159, 153, 0.22);
  border-radius: var(--radius-md);
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 0;
  padding: 18px;
}

.wellbeing-voice-panel h2 {
  font-size: 1.08rem;
}

.wellbeing-voice-panel .muted {
  margin: 0;
}

.wellbeing-voice-panel .action-row {
  justify-content: end;
  width: auto;
}

.wellbeing-voice-panel .action-row button {
  min-width: 106px;
  width: auto;
}

.wellbeing-voice-panel .pwa-install-status {
  grid-column: 1 / -1;
  margin: 0;
}

.wellbeing-entry-details {
  background: rgba(248, 250, 252, 0.64);
  border: 1px solid rgba(203, 213, 225, 0.68);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.wellbeing-entry-details > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  list-style: none;
  min-height: 54px;
  padding: 0 16px;
}

.wellbeing-entry-details > summary::-webkit-details-marker {
  display: none;
}

.wellbeing-entry-details > summary span,
.wellbeing-entry-details > summary small {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.wellbeing-entry-details > summary .ui-icon {
  color: var(--color-brand-wellbeing);
  height: 17px;
  width: 17px;
}

.wellbeing-entry-details > summary small {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(203, 213, 225, 0.62);
  border-radius: 999px;
  color: var(--color-text-secondary);
  font-size: 0.72rem;
  font-weight: 900;
  min-height: 26px;
  padding: 4px 9px;
  text-transform: uppercase;
}

.wellbeing-entry-details[open] > summary {
  border-bottom: 1px solid rgba(203, 213, 225, 0.58);
}

.wellbeing-entry-details .wellbeing-entry-field,
.wellbeing-entry-details .related-document-field {
  padding: 16px;
}

.wellbeing-entry-details .related-document-field ul {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.wellbeing-entry-details .related-document-field li {
  min-width: 0;
}

.wellbeing-entry-actions {
  align-items: center;
  border-top: 1px solid rgba(203, 213, 225, 0.58);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 18px;
}

.wellbeing-entry-actions .button-link,
.wellbeing-entry-actions button {
  min-width: 168px;
}

.summary-evidence-section,
.summary-evidence-list,
.summary-evidence-card,
.summary-source-row,
.summary-source-row-list {
  min-width: 0;
}

.summary-evidence-card .citation-meta,
.summary-source-row .citation-meta {
  min-width: 0;
}

.summary-evidence-card .citation-meta > div,
.summary-source-row .citation-meta > div {
  min-width: 0;
}

.summary-evidence-card h3,
.summary-evidence-card p,
.summary-evidence-card a,
.summary-source-row h4,
.summary-source-row p,
.summary-source-row a {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.summary-evidence-card blockquote,
.summary-source-row blockquote {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.dossier-status-summary {
  background: rgba(255, 255, 255, 0.58);
  border-radius: var(--radius-md);
  gap: 12px;
  padding: 16px;
}

.dossier-status-summary__header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.dossier-status-summary .eyebrow {
  color: var(--color-text-secondary);
}

.dossier-status-summary .section-title {
  font-size: 1.05rem;
  line-height: 1.22;
}

.dossier-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dossier-status-chip {
  align-items: center;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(203, 213, 225, 0.66);
  border-radius: 999px;
  color: var(--color-text-primary);
  display: inline-flex;
  font-size: 0.84rem;
  font-weight: 850;
  gap: 7px;
  line-height: 1.2;
  min-height: 34px;
  padding: 7px 11px;
}

.dossier-status-chip .ui-icon {
  color: var(--color-brand-x);
  height: 15px;
  width: 15px;
}

.dossier-status-chip.is-muted {
  color: var(--color-text-secondary);
}

.dossier-status-chip.is-muted .ui-icon {
  color: var(--color-text-muted);
}

.dossier-status-details {
  border-top: 1px solid rgba(203, 213, 225, 0.58);
  padding-top: 8px;
}

.dossier-status-details summary {
  align-items: center;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.3;
  min-height: 34px;
}

.dossier-status-details summary:hover {
  color: var(--color-bg-primary);
}

.dossier-status-detail-list {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}

.dossier-status-detail-list p {
  border-top: 1px solid rgba(203, 213, 225, 0.42);
  color: var(--color-text-secondary);
  display: grid;
  font-size: 0.9rem;
  gap: 10px;
  grid-template-columns: minmax(132px, 180px) minmax(0, 1fr);
  line-height: 1.45;
  margin: 0;
  padding-top: 8px;
}

.dossier-status-detail-list p:first-child {
  border-top: 0;
  padding-top: 0;
}

.dossier-status-detail-list strong {
  color: var(--color-text-primary);
}

.qsp-shell,
.qsp-form,
.questionnaire-form,
.questionnaire-section,
.questionnaire-item,
.likert-options {
  min-width: 0;
}

.qsp-shell {
  gap: 20px;
  max-width: 1180px;
  padding-top: 24px;
}

.qsp-hero {
  background:
    linear-gradient(145deg, rgba(234, 251, 248, 0.62), rgba(255, 255, 255, 0.96)),
    var(--color-bg-surface);
  border: 1px solid rgba(31, 159, 153, 0.18);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 20px;
  padding: 24px;
}

.qsp-hero__top {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.qsp-hero__main {
  max-width: 840px;
}

.qsp-hero h1 {
  font-size: 2.75rem;
  line-height: 1.03;
  margin: 0;
  max-width: 780px;
}

.qsp-hero .lede {
  max-width: 760px;
}

.qsp-guidance {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qsp-guidance__item {
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(203, 213, 225, 0.58);
  border-radius: var(--radius-md);
  display: grid;
  gap: 12px;
  grid-template-columns: 38px minmax(0, 1fr);
  padding: 14px;
}

.qsp-guidance__item strong {
  color: var(--color-text-primary);
  display: block;
  font-size: 0.96rem;
  margin-bottom: 3px;
}

.qsp-guidance__item p {
  color: var(--color-text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
}

.qsp-form {
  display: grid;
  gap: 18px;
}

.qsp-step-strip {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(203, 213, 225, 0.64);
  border-radius: var(--radius-md);
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 6px;
}

.qsp-step {
  align-items: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  display: flex;
  font-size: 0.86rem;
  font-weight: 850;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
}

.qsp-step strong {
  align-items: center;
  background: var(--color-bg-subtle);
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 999px;
  color: var(--color-text-primary);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.75rem;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.qsp-step.is-current {
  background: var(--color-bg-wellbeing);
  color: var(--color-brand-wellbeing);
}

.qsp-step.is-current strong {
  background: var(--color-brand-wellbeing);
  border-color: var(--color-brand-wellbeing);
  color: var(--color-text-inverse);
}

.qsp-intake-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr);
}

.qsp-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: var(--radius-md);
  display: grid;
  gap: 14px;
  padding: 20px;
}

.qsp-panel textarea {
  border-radius: var(--radius-sm);
  min-height: 116px;
}

.qsp-symptom-chips,
.qsp-symptom-chips > div,
.qsp-symptom-chips ul {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  grid-template-columns: none;
  list-style: none;
  margin: 0;
  padding: 0;
}

.qsp-symptom-chips > div > div,
.qsp-symptom-chips li {
  display: inline-flex;
  min-width: 0;
  width: auto;
}

.qsp-symptom-chips label {
  align-items: center;
  background: rgba(248, 250, 252, 0.82);
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 999px;
  color: var(--color-text-primary);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 800;
  gap: 8px;
  line-height: 1.25;
  max-width: 100%;
  min-height: 38px;
  overflow-wrap: anywhere;
  padding: 9px 13px;
  position: relative;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.qsp-symptom-chips label::before {
  background: #ffffff;
  border: 1px solid rgba(100, 116, 139, 0.34);
  border-radius: 999px;
  content: "";
  flex: 0 0 auto;
  height: 10px;
  width: 10px;
}

.qsp-symptom-chips label:has(input:focus-visible) {
  box-shadow: 0 0 0 3px rgba(31, 159, 153, 0.18);
}

.qsp-symptom-chips label:has(input:checked) {
  background: var(--color-bg-wellbeing);
  border-color: rgba(31, 159, 153, 0.38);
  color: #145d59;
}

.qsp-symptom-chips label:has(input:checked)::before {
  background: var(--color-brand-wellbeing);
  border-color: var(--color-brand-wellbeing);
  box-shadow: inset 0 0 0 2px #ffffff;
}

.qsp-symptom-chips input[type="checkbox"] {
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.qsp-response-scale {
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(203, 213, 225, 0.68);
  border-radius: var(--radius-md);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(220px, 0.62fr) minmax(0, 1fr);
  padding: 18px 20px;
}

.qsp-response-scale .section-title {
  font-size: 1.1rem;
  line-height: 1.25;
}

.qsp-response-scale__options {
  background: var(--color-bg-subtle);
  border: 1px solid rgba(203, 213, 225, 0.68);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  overflow: hidden;
  padding: 0;
}

.qsp-scale-chip {
  align-items: center;
  color: var(--color-text-secondary);
  display: grid;
  gap: 2px;
  justify-items: center;
  min-height: 54px;
  padding: 8px 6px;
  text-align: center;
}

.qsp-scale-chip + .qsp-scale-chip {
  border-left: 1px solid rgba(203, 213, 225, 0.68);
}

.qsp-scale-chip strong {
  align-items: center;
  background: rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  color: var(--color-text-primary);
  display: inline-flex;
  font-size: 0.8rem;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.qsp-scale-chip span {
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.15;
}

.questionnaire-section--domain {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: var(--radius-md);
  display: grid;
  gap: 0;
  overflow: hidden;
}

.qsp-domain__header {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(234, 251, 248, 0.46), rgba(255, 255, 255, 0.92)),
    var(--color-bg-surface);
  border-bottom: 1px solid rgba(203, 213, 225, 0.58);
  display: grid;
  gap: 12px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  padding: 18px 20px;
}

.qsp-domain__number {
  align-items: center;
  background: var(--color-brand-wellbeing);
  border-radius: 999px;
  color: var(--color-text-inverse);
  display: inline-flex;
  font-size: 0.92rem;
  font-weight: 950;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.qsp-domain__meta {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(203, 213, 225, 0.64);
  border-radius: 999px;
  color: var(--color-text-secondary);
  font-size: 0.78rem;
  font-weight: 850;
  padding: 6px 10px;
}

.questionnaire-item-list {
  display: grid;
  gap: 0;
}

.questionnaire-item {
  background: transparent;
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 0.9fr);
  overflow: visible;
  padding: 18px 20px;
}

.questionnaire-item + .questionnaire-item {
  border-top: 1px solid rgba(203, 213, 225, 0.52);
  margin-top: 0;
}

.questionnaire-item legend {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  font-size: 0.98rem;
  font-weight: 780;
  line-height: 1.42;
  max-width: none;
  overflow-wrap: anywhere;
  padding: 0;
}

.questionnaire-item__code {
  align-items: center;
  background: var(--color-bg-wellbeing);
  border: 1px solid rgba(31, 159, 153, 0.22);
  border-radius: 999px;
  color: var(--color-brand-wellbeing);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 950;
  justify-content: center;
  letter-spacing: 0;
  min-height: 22px;
  min-width: 34px;
  padding: 3px 8px;
}

.questionnaire-form .likert-options {
  align-self: start;
  background: var(--color-bg-subtle);
  border: 1px solid rgba(203, 213, 225, 0.68);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 0;
  padding: 3px;
}

.questionnaire-form .likert-option {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--color-text-primary);
  cursor: pointer;
  display: grid;
  justify-items: center;
  line-height: 1.2;
  min-height: 50px;
  padding: 7px 5px;
  position: relative;
  text-align: center;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.questionnaire-form .likert-option:hover {
  background: rgba(255, 255, 255, 0.78);
}

.questionnaire-form .likert-option:has(input:focus-visible) {
  box-shadow: 0 0 0 3px rgba(31, 159, 153, 0.18);
}

.questionnaire-form .likert-option:has(input:checked) {
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(31, 159, 153, 0.35), 0 8px 18px rgba(31, 159, 153, 0.1);
  color: #145d59;
}

.questionnaire-form .likert-option input[type="radio"] {
  accent-color: var(--color-brand-wellbeing);
  height: 1px;
  left: 50%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 50%;
  width: 1px;
}

.likert-option__content {
  align-items: center;
  display: grid;
  gap: 2px;
  justify-items: center;
  min-width: 0;
}

.questionnaire-form .likert-option strong {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 950;
  height: 24px;
  justify-content: center;
  line-height: 1;
  width: 24px;
}

.questionnaire-form .likert-option:has(input:checked) strong {
  background: var(--color-brand-wellbeing);
  color: var(--color-text-inverse);
}

.questionnaire-form .likert-option small {
  color: var(--color-text-muted);
  font-size: 0.66rem;
  font-weight: 850;
  line-height: 1.05;
}

.questionnaire-form .likert-option:has(input:checked) small {
  color: #145d59;
}

.qsp-panel--observations textarea {
  min-height: 128px;
}

.qsp-action-bar {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: var(--radius-md);
  bottom: 14px;
  box-shadow: 0 18px 42px rgba(23, 32, 51, 0.08);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px;
  position: sticky;
  z-index: 7;
}

.qsp-action-bar__copy {
  display: grid;
  gap: 2px;
}

.qsp-action-bar__copy strong {
  color: var(--color-text-primary);
  font-size: 0.96rem;
}

.qsp-action-bar__copy span {
  color: var(--color-text-secondary);
  font-size: 0.86rem;
}

.qsp-shell {
  gap: 24px;
  max-width: 1320px;
}

.qsp-hero {
  background:
    linear-gradient(120deg, rgba(234, 251, 248, 0.92), rgba(255, 255, 255, 0.98) 52%, rgba(255, 241, 236, 0.5)),
    var(--color-bg-surface);
  border-color: rgba(31, 159, 153, 0.16);
  box-shadow: 0 24px 70px rgba(23, 32, 51, 0.07);
  overflow: hidden;
  padding: 30px;
  position: relative;
}

.qsp-hero::before {
  background: linear-gradient(90deg, var(--color-brand-wellbeing), rgba(245, 91, 65, 0.68));
  content: "";
  height: 4px;
  inset: 0 0 auto;
  position: absolute;
}

.qsp-hero__badge {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(31, 159, 153, 0.2);
  border-radius: 999px;
  color: var(--color-brand-wellbeing);
  font-size: 0.76rem;
  font-weight: 950;
  padding: 7px 10px;
}

.qsp-hero h1 {
  font-size: clamp(2.35rem, 4vw, 4rem);
  letter-spacing: 0;
  max-width: 900px;
}

.qsp-hero .lede {
  color: var(--color-text-secondary);
  font-size: 1.08rem;
  line-height: 1.7;
}

.qsp-hero__metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 860px;
}

.qsp-metric {
  align-items: center;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(203, 213, 225, 0.56);
  border-radius: var(--radius-md);
  display: grid;
  gap: 10px;
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 72px;
  padding: 12px;
}

.qsp-metric > span {
  align-items: center;
  background: var(--color-bg-wellbeing);
  border-radius: 999px;
  color: var(--color-brand-wellbeing);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.qsp-metric--accent > span {
  background: var(--color-accent-care-soft);
  color: var(--color-accent-care-text);
}

.qsp-metric .ui-icon {
  height: 17px;
  width: 17px;
}

.qsp-metric strong,
.qsp-metric small {
  display: block;
  line-height: 1.2;
}

.qsp-metric strong {
  color: var(--color-text-primary);
  font-size: 0.95rem;
  font-weight: 920;
}

.qsp-metric small {
  color: var(--color-text-secondary);
  font-size: 0.78rem;
  font-weight: 760;
  margin-top: 2px;
}

.qsp-workspace {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
}

.qsp-compass {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 92px;
}

.qsp-compass__card,
.qsp-compass .qsp-response-scale,
.qsp-compass__note {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(203, 213, 225, 0.66);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 36px rgba(23, 32, 51, 0.045);
}

.qsp-compass__card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.qsp-compass__card h2 {
  font-size: 1.28rem;
  line-height: 1.18;
  margin: 0;
}

.qsp-compass__card p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
}

.qsp-compass .qsp-step-strip {
  background: transparent;
  border: 0;
  border-radius: 0;
  gap: 8px;
  grid-template-columns: 1fr;
  padding: 0;
}

.qsp-compass .qsp-step {
  background: rgba(248, 250, 252, 0.7);
  border: 1px solid rgba(203, 213, 225, 0.58);
  min-height: 42px;
}

.qsp-compass .qsp-step.is-current {
  background: linear-gradient(135deg, rgba(234, 251, 248, 0.92), rgba(255, 255, 255, 0.94));
  border-color: rgba(31, 159, 153, 0.28);
}

.qsp-compass .qsp-response-scale {
  align-items: stretch;
  gap: 14px;
  grid-template-columns: 1fr;
  padding: 18px;
}

.qsp-compass .qsp-response-scale__options {
  background: transparent;
  border: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.qsp-compass .qsp-scale-chip {
  align-items: center;
  background: rgba(248, 250, 252, 0.72);
  border: 1px solid rgba(203, 213, 225, 0.58);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 10px;
  grid-template-columns: 32px minmax(0, 1fr);
  justify-items: start;
  min-height: 42px;
  padding: 7px 9px;
  text-align: left;
}

.qsp-compass .qsp-scale-chip + .qsp-scale-chip {
  border-left: 1px solid rgba(203, 213, 225, 0.58);
}

.qsp-compass .qsp-scale-chip strong {
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(23, 32, 51, 0.06);
}

.qsp-compass__note {
  align-items: flex-start;
  display: grid;
  gap: 10px;
  grid-template-columns: 28px minmax(0, 1fr);
  padding: 16px;
}

.qsp-compass__note span {
  color: var(--color-brand-wellbeing);
}

.qsp-compass__note p {
  color: var(--color-text-secondary);
  font-size: 0.86rem;
  line-height: 1.52;
  margin: 0;
}

.qsp-flow {
  display: grid;
  gap: 18px;
}

.qsp-intake-grid {
  grid-template-columns: 1fr;
}

.qsp-panel,
.questionnaire-section--domain {
  border-color: rgba(203, 213, 225, 0.58);
  box-shadow: 0 16px 44px rgba(23, 32, 51, 0.045);
}

.qsp-panel {
  background: rgba(255, 255, 255, 0.94);
  border-radius: var(--radius-lg);
  padding: 22px;
}

@media (min-width: 1540px) {
  .qsp-intake-grid {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  }
}

.qsp-symptom-chips label {
  background: #ffffff;
  border-color: rgba(203, 213, 225, 0.72);
  box-shadow: 0 1px 0 rgba(23, 32, 51, 0.02);
  min-height: 40px;
}

.qsp-symptom-chips label:has(input:checked) {
  box-shadow: 0 8px 18px rgba(31, 159, 153, 0.08);
}

.questionnaire-section--domain {
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-lg);
}

.qsp-domain__header {
  background: #ffffff;
  border-bottom-color: rgba(203, 213, 225, 0.42);
  grid-template-columns: 44px minmax(0, 1fr) auto;
  padding: 22px 24px;
}

.qsp-domain__number {
  background:
    linear-gradient(145deg, var(--color-brand-wellbeing), #14736f);
  box-shadow: 0 10px 20px rgba(31, 159, 153, 0.18);
  height: 38px;
  width: 38px;
}

.qsp-domain__meta {
  background: var(--color-bg-wellbeing);
  border-color: rgba(31, 159, 153, 0.18);
  color: #145d59;
}

.questionnaire-item {
  gap: 20px;
  grid-template-columns: minmax(260px, 0.95fr) minmax(330px, 0.75fr);
  padding: 22px 24px;
}

.questionnaire-item + .questionnaire-item {
  border-top-color: rgba(203, 213, 225, 0.42);
}

.questionnaire-item legend {
  color: var(--color-text-primary);
  font-size: 1rem;
  font-weight: 760;
}

.questionnaire-item__code {
  background: rgba(234, 251, 248, 0.9);
  min-width: 36px;
}

.questionnaire-form .likert-options {
  background: transparent;
  border: 0;
  gap: 0;
  padding: 0;
  position: relative;
}

.questionnaire-form .likert-options::before {
  background: rgba(203, 213, 225, 0.72);
  content: "";
  height: 2px;
  left: 10%;
  position: absolute;
  right: 10%;
  top: 18px;
}

.questionnaire-form .likert-option {
  border-radius: var(--radius-sm);
  min-height: 50px;
  padding: 0 3px;
}

.questionnaire-form .likert-option:hover {
  background: transparent;
}

.questionnaire-form .likert-option strong {
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.74);
  box-shadow: 0 4px 12px rgba(23, 32, 51, 0.06);
  height: 34px;
  position: relative;
  width: 34px;
  z-index: 1;
}

.qsp-likert .likert-option small {
  display: none;
}

.questionnaire-form .likert-option:has(input:checked) {
  background: transparent;
  box-shadow: none;
}

.questionnaire-form .likert-option:has(input:checked) strong {
  background: var(--color-brand-wellbeing);
  border-color: var(--color-brand-wellbeing);
  box-shadow: 0 0 0 5px rgba(31, 159, 153, 0.13), 0 12px 22px rgba(31, 159, 153, 0.22);
  color: var(--color-text-inverse);
  transform: translateY(-1px);
}

.questionnaire-form .likert-option:has(input:checked) small {
  color: #145d59;
  font-weight: 950;
}

.qsp-action-bar {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(234, 251, 248, 0.78)),
    #ffffff;
  border-color: rgba(31, 159, 153, 0.2);
  border-radius: var(--radius-lg);
}

@media (max-width: 980px) {
  .wellbeing-entry-hero {
    grid-template-columns: 1fr;
  }

  .wellbeing-entry-form--care,
  .wellbeing-entry-grid--report {
    grid-template-columns: 1fr;
  }

  .wellbeing-voice-panel {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .qsp-workspace {
    grid-template-columns: 1fr;
  }

  .qsp-compass {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.86fr);
    position: static;
  }

  .qsp-compass__note {
    grid-column: 1 / -1;
  }

  .qsp-guidance,
  .qsp-intake-grid {
    grid-template-columns: 1fr;
  }

  .questionnaire-item {
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .questionnaire-form .likert-options {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .auth-layout {
    gap: 18px;
    padding-top: 20px;
  }

  .auth-layout .hero-copy h1 {
    font-size: 2.05rem;
    line-height: 1.05;
  }

  .auth-card h1 {
    font-size: 1.72rem;
  }

  .auth-proof {
    display: none;
  }

  .legal-page,
  .demo-shell,
  .onboarding-shell,
  .account-shell,
  .document-detail-shell,
  .question-detail-page .content-shell {
    padding-top: 16px;
  }

  .legal-page h1,
  .demo-shell h1,
  .account-hero h1,
  .document-detail-hero__copy h1,
  .question-detail-page h1 {
    font-size: 1.92rem;
    line-height: 1.05;
  }

  .legal-grid,
  .question-detail-page .evidence-list,
  .document-edit-grid,
  .quick-action-grid--lean,
  .medical-scope-summary {
    grid-template-columns: 1fr;
  }

  .primary-action-strip {
    padding: 16px;
  }

  .patient-dashboard-page .patient-activity {
    gap: 14px;
    padding: 16px;
  }

  .patient-dashboard-page .patient-activity > .section-heading {
    padding-bottom: 14px;
  }

  .patient-dashboard-page .patient-activity > .activity-card,
  .patient-dashboard-page .patient-activity > .empty-state {
    padding: 16px;
  }

  .patient-dashboard-page .patient-activity > .activity-footer {
    padding-top: 14px;
  }

  .patient-dashboard-page .patient-activity > .section-heading .button-link,
  .patient-dashboard-page .patient-activity > .activity-footer .button-link {
    justify-content: center;
    width: 100%;
  }

  .wellbeing-page .wellbeing-timeline-section {
    gap: 12px;
  }

  .wellbeing-entry-shell {
    gap: 14px;
    padding-top: 14px;
  }

  .wellbeing-entry-hero {
    border-radius: var(--radius-md);
    padding: 18px;
  }

  .wellbeing-entry-hero h1 {
    font-size: 2rem;
    line-height: 1.06;
  }

  .wellbeing-entry-hero .lede {
    font-size: 1rem;
  }

  .wellbeing-entry-form {
    border-radius: var(--radius-md);
    gap: 18px;
    padding: 16px;
  }

  .wellbeing-entry-grid,
  .wellbeing-entry-grid--report,
  .wellbeing-voice-panel {
    grid-template-columns: 1fr;
  }

  .wellbeing-entry-section__heading {
    gap: 10px;
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .wellbeing-entry-section__icon {
    height: 34px;
    width: 34px;
  }

  .wellbeing-entry-field input,
  .wellbeing-entry-field select,
  .wellbeing-entry-field textarea {
    min-height: 48px;
  }

  .wellbeing-entry-form--report #id_description {
    min-height: 184px;
  }

  .wellbeing-voice-panel {
    padding: 14px;
  }

  .wellbeing-voice-panel .action-row {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .wellbeing-voice-panel .action-row button {
    min-width: 0;
    width: 100%;
  }

  .wellbeing-entry-details > summary {
    gap: 10px;
    min-height: 50px;
    padding: 0 12px;
  }

  .wellbeing-entry-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .wellbeing-entry-actions button {
    order: -1;
  }

  .wellbeing-entry-actions .button-link,
  .wellbeing-entry-actions button {
    min-width: 0;
    width: 100%;
  }

  .dossier-status-summary {
    padding: 14px;
  }

  .dossier-status-summary__header {
    align-items: stretch;
    flex-direction: column;
  }

  .dossier-status-chips {
    display: grid;
  }

  .dossier-status-detail-list p {
    gap: 3px;
    grid-template-columns: 1fr;
  }

  .qsp-shell {
    gap: 14px;
    padding-top: 14px;
  }

  .qsp-hero {
    border-radius: var(--radius-md);
    gap: 16px;
    padding: 18px;
  }

  .qsp-hero__top {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .qsp-hero h1 {
    font-size: 2rem;
    line-height: 1.06;
  }

  .qsp-hero__metrics {
    grid-template-columns: 1fr;
  }

  .qsp-metric {
    min-height: 58px;
  }

  .qsp-compass {
    grid-template-columns: 1fr;
  }

  .qsp-compass__card,
  .qsp-compass .qsp-response-scale,
  .qsp-compass__note {
    border-radius: var(--radius-md);
  }

  .qsp-guidance__item {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 12px;
  }

  .qsp-step-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qsp-compass .qsp-step-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qsp-step {
    font-size: 0.8rem;
    min-height: 36px;
    padding: 7px 8px;
  }

  .qsp-panel {
    padding: 16px;
  }

  .qsp-symptom-chips ul {
    display: grid;
    gap: 7px;
  }

  .qsp-symptom-chips,
  .qsp-symptom-chips > div {
    display: grid;
    gap: 7px;
  }

  .qsp-symptom-chips > div > div,
  .qsp-symptom-chips li {
    display: block;
    width: 100%;
  }

  .qsp-symptom-chips label {
    border-radius: var(--radius-sm);
    width: 100%;
  }

  .qsp-response-scale {
    align-items: stretch;
    gap: 12px;
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .qsp-response-scale__options {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .qsp-compass .qsp-response-scale__options {
    gap: 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .qsp-compass .qsp-scale-chip {
    border-radius: 0;
    gap: 2px;
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 50px;
    text-align: center;
  }

  .qsp-scale-chip {
    min-height: 50px;
    padding: 7px 3px;
  }

  .qsp-scale-chip span {
    font-size: 0.64rem;
  }

  .qsp-domain__header {
    gap: 10px;
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 16px;
  }

  .qsp-domain__number {
    height: 30px;
    width: 30px;
  }

  .qsp-domain__meta {
    grid-column: 2;
    justify-self: start;
  }

  .questionnaire-item {
    gap: 12px;
    padding: 16px;
  }

  .questionnaire-item legend {
    gap: 8px;
  }

  .questionnaire-form .likert-options {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .questionnaire-form .likert-option {
    align-content: center;
    min-height: 42px;
    overflow: hidden;
    padding: 7px 3px;
  }

  .questionnaire-form .likert-options::before {
    top: 20px;
  }

  .likert-option__content {
    align-items: center;
    display: flex;
    gap: 0;
    justify-content: center;
    line-height: 1;
    width: 100%;
  }

  .questionnaire-form .likert-option strong {
    font-size: 0.84rem;
    height: 25px;
    width: 25px;
  }

  .questionnaire-form .likert-option small {
    display: none !important;
  }

  .qsp-action-bar {
    align-items: stretch;
    display: grid;
    gap: 12px;
    position: static;
  }

  .qsp-action-bar .account-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .primary-action-strip .section-heading {
    display: none;
  }

  .support-link-row {
    align-items: stretch;
    display: grid;
    gap: 6px;
  }

  .support-link-row a {
    border-top: 1px solid rgba(203, 213, 225, 0.58);
    min-height: 40px;
  }

  .wellbeing-action-grid .quick-action-card span {
    max-width: 230px;
  }

  .caregiver-home-shell .list-row {
    gap: 14px;
  }

  .caregiver-actions {
    min-width: 0;
  }

  .document-edit-note {
    position: static;
  }

  .document-upload-hero h1 {
    font-size: 1.85rem;
  }

  .upload-dropzone {
    min-height: 240px;
    padding: 22px 16px;
  }

  .medical-shell {
    padding-top: 18px;
  }

  .medical-hero,
  .medical-summary-panel,
  .medical-document-row,
  .medical-timeline-item {
    padding: 16px;
  }

  .app-layout + .site-footer .site-footer__links a {
    align-items: center;
    display: inline-flex;
    min-height: 32px;
  }
}

/* QSP final override: keep this after legacy QSP rules. */
.qsp-page .qsp-shell {
  gap: 18px;
  max-width: 1160px;
  padding-top: 22px;
}

.qsp-page .qsp-form {
  display: grid;
  gap: 16px;
}

.qsp-page .qsp-hero {
  background:
    linear-gradient(135deg, rgba(234, 251, 248, 0.88), rgba(255, 255, 255, 0.97) 56%, rgba(255, 241, 236, 0.42)),
    var(--color-bg-surface);
  border: 1px solid rgba(31, 159, 153, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: none;
  gap: 14px;
  padding: 20px 22px;
}

.qsp-page .qsp-hero h1 {
  font-size: clamp(2rem, 3.4vw, 3.05rem);
  line-height: 1.04;
  max-width: 900px;
}

.qsp-page .qsp-hero .lede {
  font-size: 1rem;
  line-height: 1.58;
  max-width: 820px;
}

.qsp-page .qsp-response-scale--inline {
  display: none !important;
}

.qsp-page .qsp-response-scale__options {
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.66);
  border-radius: 12px;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
}

.qsp-page .qsp-response-scale--inline + .questionnaire-section--domain {
  margin-top: -6px;
}

.qsp-page .qsp-scale-chip {
  min-height: 58px;
  padding: 9px 6px;
}

.qsp-page .qsp-scale-chip strong {
  background: var(--color-bg-wellbeing);
  color: var(--color-brand-wellbeing);
}

.qsp-page .qsp-scale-chip span {
  color: var(--color-text-secondary);
  font-size: 0.72rem;
}

.qsp-page .qsp-method-note {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(203, 213, 225, 0.64);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  overflow: hidden;
}

.qsp-page .qsp-method-note summary {
  align-items: center;
  color: var(--color-text-primary);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 900;
  gap: 8px;
  list-style: none;
  min-height: 44px;
  padding: 0 16px;
}

.qsp-page .qsp-method-note summary::-webkit-details-marker {
  display: none;
}

.qsp-page .qsp-method-note .ui-icon {
  color: var(--color-brand-wellbeing);
  height: 17px;
  width: 17px;
}

.qsp-page .qsp-method-note p {
  border-top: 1px solid rgba(203, 213, 225, 0.54);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
  padding: 12px 16px 14px;
}

.qsp-page .qsp-flow {
  display: grid;
  gap: 18px;
}

.qsp-page .qsp-intake-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
}

.qsp-page .qsp-panel,
.qsp-page .questionnaire-section--domain {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(203, 213, 225, 0.62);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 36px rgba(23, 32, 51, 0.035);
}

.qsp-page .qsp-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.qsp-page .qsp-panel textarea {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.48);
  border-radius: 10px;
  box-sizing: border-box;
  color: var(--color-text-primary);
  font: inherit;
  min-height: 136px;
  padding: 12px 14px;
  width: 100%;
}

.qsp-page .qsp-symptom-chips,
.qsp-page .qsp-symptom-chips > div,
.qsp-page .qsp-symptom-chips ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qsp-page .qsp-symptom-chips > div > div,
.qsp-page .qsp-symptom-chips li {
  width: auto;
}

.qsp-page .qsp-symptom-chips label {
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 999px;
  box-shadow: none;
  min-height: 38px;
  padding: 8px 13px;
  width: auto;
}

.qsp-page .questionnaire-section--domain {
  overflow: hidden;
}

.qsp-page .qsp-domain__header {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(234, 251, 248, 0.58)),
    #ffffff;
  border-bottom: 1px solid rgba(203, 213, 225, 0.5);
  display: grid;
  gap: 12px;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  padding: 18px 22px;
}

.qsp-page .qsp-domain__number {
  background: linear-gradient(145deg, var(--color-brand-wellbeing), #14736f);
  box-shadow: 0 10px 20px rgba(31, 159, 153, 0.16);
  height: 36px;
  width: 36px;
}

.qsp-page .qsp-domain__meta {
  background: #ffffff;
  border-color: rgba(31, 159, 153, 0.18);
  color: #145d59;
}

.qsp-page .questionnaire-item {
  background: #ffffff;
  border: 0;
  border-radius: 0;
  display: grid;
  align-items: center;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  padding: 14px 20px;
}

.qsp-page .questionnaire-item + .questionnaire-item {
  border-top: 1px solid rgba(203, 213, 225, 0.42);
}

.qsp-page .qsp-question__prompt {
  align-items: center;
  color: var(--color-text-primary);
  display: flex;
  font-size: 0.98rem;
  font-weight: 820;
  gap: 10px;
  line-height: 1.42;
  margin: 0;
  min-width: 0;
}

.qsp-page .questionnaire-item > legend.sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  display: block;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.qsp-page .questionnaire-form .likert-options {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(5, 42px);
  justify-content: end;
  padding: 0;
}

.qsp-page .questionnaire-form .likert-options::before {
  display: none;
}

.qsp-page .questionnaire-form .likert-option {
  align-items: center;
  aspect-ratio: 1;
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.58);
  border-radius: 999px;
  color: var(--color-text-primary);
  display: grid;
  justify-items: center;
  min-height: 42px;
  padding: 0;
  position: relative;
}

.qsp-page .questionnaire-form .likert-option:hover {
  background: rgba(234, 251, 248, 0.72);
  border-color: rgba(31, 159, 153, 0.24);
}

.qsp-page .likert-option__content {
  align-items: center;
  display: grid;
  gap: 2px;
  grid-template-columns: auto auto;
  justify-content: center;
  line-height: 1;
}

.qsp-page .questionnaire-form .likert-option strong {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--color-text-primary);
  font-size: 0.78rem;
  height: auto;
  line-height: 1;
  width: auto;
}

.qsp-page .likert-option__health-icon {
  height: 15px;
  margin: 0;
  stroke-width: 2.4;
  width: 15px;
}

.qsp-page .likert-option--score-0 .likert-option__health-icon {
  color: #94a3b8;
}

.qsp-page .likert-option--score-1 .likert-option__health-icon {
  color: #60a5a0;
}

.qsp-page .likert-option--score-2 .likert-option__health-icon {
  color: #168a82;
}

.qsp-page .likert-option--score-3 .likert-option__health-icon {
  color: #f59e0b;
}

.qsp-page .likert-option--score-4 .likert-option__health-icon {
  color: #f55b41;
}

.qsp-page .qsp-likert .likert-option small.sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  display: block;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.qsp-page .questionnaire-form .likert-option:has(input:checked) {
  background: var(--color-brand-wellbeing);
  border-color: var(--color-brand-wellbeing);
  box-shadow: 0 0 0 4px rgba(31, 159, 153, 0.12);
  color: var(--color-text-inverse);
}

.qsp-page .questionnaire-form .likert-option:has(input:checked) strong {
  background: transparent;
  color: var(--color-text-inverse);
}

.qsp-page .questionnaire-form .likert-option:has(input:checked) .likert-option__health-icon {
  color: var(--color-text-inverse);
}

.qsp-page .qsp-rating {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, 44px);
  justify-content: end;
}

.qsp-page .qsp-rating__choice {
  align-items: center;
  aspect-ratio: 1;
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 999px;
  color: var(--color-text-primary);
  cursor: pointer;
  display: grid;
  justify-items: center;
  margin: 0;
  min-height: 44px;
  padding: 0;
  position: relative;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.qsp-page .qsp-rating__choice input[type="radio"] {
  height: 1px;
  left: 50%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 50%;
  width: 1px;
}

.qsp-page .qsp-rating__content {
  align-items: center;
  display: grid;
  gap: 2px;
  grid-template-columns: 1fr;
  justify-items: center;
  line-height: 1;
}

.qsp-page .qsp-rating__icon {
  height: 17px;
  margin: 0;
  stroke-width: 2.35;
  width: 17px;
}

.qsp-page .qsp-rating__choice strong {
  color: currentColor;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.qsp-page .qsp-rating__choice small.sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  display: block;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.qsp-page .qsp-rating__choice--score-0 .qsp-rating__icon {
  color: #94a3b8;
}

.qsp-page .qsp-rating__choice--score-1 .qsp-rating__icon {
  color: #60a5a0;
}

.qsp-page .qsp-rating__choice--score-2 .qsp-rating__icon {
  color: var(--color-brand-wellbeing);
}

.qsp-page .qsp-rating__choice--score-3 .qsp-rating__icon {
  color: #f59e0b;
}

.qsp-page .qsp-rating__choice--score-4 .qsp-rating__icon {
  color: #f55b41;
}

.qsp-page .qsp-rating__choice:hover {
  background: rgba(234, 251, 248, 0.72);
  border-color: rgba(31, 159, 153, 0.28);
}

.qsp-page .qsp-rating__choice:has(input:focus-visible) {
  box-shadow: 0 0 0 4px rgba(31, 159, 153, 0.16);
}

.qsp-page .qsp-rating__choice:has(input:checked) {
  background: var(--color-brand-wellbeing);
  border-color: var(--color-brand-wellbeing);
  box-shadow: 0 0 0 4px rgba(31, 159, 153, 0.12);
  color: var(--color-text-inverse);
}

.qsp-page .qsp-rating__choice:has(input:checked) .qsp-rating__icon {
  color: var(--color-text-inverse);
}

.qsp-page .qsp-action-bar {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(234, 251, 248, 0.72)),
    #ffffff;
  border: 1px solid rgba(31, 159, 153, 0.2);
  border-radius: var(--radius-lg);
}

@media (max-width: 980px) {
  .qsp-page .qsp-response-scale--inline,
  .qsp-page .qsp-intake-grid {
    grid-template-columns: 1fr;
  }

  .qsp-page .questionnaire-item {
    align-items: start;
    gap: 10px;
    grid-template-columns: 1fr;
  }

  .qsp-page .questionnaire-form .likert-options {
    grid-template-columns: repeat(5, minmax(42px, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  .qsp-page .qsp-rating {
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    justify-content: stretch;
    width: 100%;
  }
}

@media (max-width: 680px) {
  .qsp-page .qsp-shell {
    gap: 14px;
    padding-top: 14px;
  }

  .qsp-page .qsp-hero,
  .qsp-page .qsp-response-scale--inline,
  .qsp-page .qsp-panel,
  .qsp-page .questionnaire-section--domain,
  .qsp-page .qsp-action-bar {
    border-radius: var(--radius-md);
  }

  .qsp-page .qsp-hero,
  .qsp-page .qsp-response-scale--inline,
  .qsp-page .qsp-panel,
  .qsp-page .questionnaire-item {
    padding: 16px;
  }

  .qsp-page .qsp-hero h1 {
    font-size: 2rem;
  }

  .qsp-page .qsp-symptom-chips,
  .qsp-page .qsp-symptom-chips > div,
  .qsp-page .qsp-symptom-chips ul {
    display: grid;
    gap: 7px;
  }

  .qsp-page .qsp-symptom-chips label {
    border-radius: var(--radius-sm);
    width: 100%;
  }

  .qsp-page .qsp-domain__header {
    gap: 10px;
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 16px;
  }

  .qsp-page .qsp-domain__number {
    height: 30px;
    width: 30px;
  }

  .qsp-page .qsp-domain__meta {
    grid-column: 2;
    justify-self: start;
  }

  .qsp-page .questionnaire-form .likert-options {
    gap: 5px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 0;
  }

  .qsp-page .questionnaire-form .likert-option {
    min-height: 40px;
    padding: 0;
  }

  .qsp-page .qsp-rating {
    gap: 6px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .qsp-page .qsp-rating__choice {
    min-height: 42px;
  }

  .qsp-page .qsp-likert .likert-option small:not(.sr-only) {
    display: none;
  }

  .qsp-page .questionnaire-form .likert-option:has(input:checked) strong {
    height: auto;
    width: auto;
  }

  .qsp-page .qsp-action-bar {
    display: grid;
    gap: 12px;
    position: static;
  }

  .qsp-page .qsp-action-bar .account-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }
}
