/**
 * patient-home.css — Patient investigations refinements.
 *
 * Keeps the default patient page focused on investigations and hides
 * cross-cutting work unless there is something actionable.
 */

.ps-aci-card-name {
  letter-spacing: 0;
}

.ps-overview-section--investigations {
  margin-bottom: 0;
}

.ps-aci-card--stage {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px 20px;
}

.ps-aci-card--stage .ps-aci-card-cta {
  height: 36px;
  min-width: 112px;
}

.ps-aci-card--stage .ps-aci-card-head {
  margin-bottom: 5px;
}

.ps-aci-card-copy {
  max-width: 680px;
  margin: 0 0 7px;
  font-size: 13px;
  color: var(--ps-text-soft);
  line-height: 1.45;
}

.ps-aci-card-side {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  min-width: 154px;
}

.ps-inline-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--ps-accent) 18%, var(--ps-border));
  border-radius: 14px;
  background: var(--ps-bg-surface);
  text-decoration: none;
  color: inherit;
}

.ps-inline-alert:hover {
  background: color-mix(in srgb, var(--ps-accent) 3%, var(--ps-bg-surface));
}

.ps-inline-alert-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--ps-accent-dim);
  color: var(--ps-accent-text);
  font-size: 13px;
}

.ps-inline-alert-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.ps-inline-alert-body strong {
  font-size: 13.5px;
  color: var(--ps-text);
}

.ps-inline-alert-body span {
  font-size: 12.5px;
  color: var(--ps-text-soft);
}

.ps-inline-alert-action {
  color: var(--ps-accent-text);
  font-size: 12.5px;
  font-weight: 700;
}

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

.ps-message-layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  min-height: 520px;
}

.ps-message-list,
.ps-message-thread {
  border: 1px solid var(--ps-border);
  border-radius: 14px;
  background: var(--ps-bg-surface);
}

.ps-message-list {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ps-message-thread-row {
  width: 100%;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid var(--ps-border-soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.ps-message-thread-row:hover,
.ps-message-thread-row.is-active {
  background: var(--ps-accent-dim);
}

.ps-message-row-title,
.ps-message-turn-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ps-message-row-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ps-text);
}

.ps-message-unread {
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ps-accent);
  color: #fff;
  font-size: 11px;
  line-height: 19px;
  text-align: center;
}

.ps-message-row-copy {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ps-text-soft);
  font-size: 12.5px;
  line-height: 1.4;
}

.ps-message-row-time {
  color: var(--ps-text-dim);
  font-size: 11.5px;
}

.ps-message-thread {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.ps-message-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--ps-border-soft);
}

.ps-message-thread-head h2 {
  margin: 0;
  color: var(--ps-text);
  font-size: 15px;
}

.ps-message-thread-head p {
  margin: 3px 0 0;
  color: var(--ps-text-dim);
  font-size: 12px;
}

.ps-message-turns {
  flex: 1;
  padding: 18px;
  overflow: auto;
}

.ps-message-turn {
  max-width: 78%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--ps-border-soft);
  border-radius: 12px;
  background: var(--ps-bg-warm);
}

.ps-message-turn.is-mine {
  margin-left: auto;
  background: var(--ps-accent-dim);
  border-color: color-mix(in srgb, var(--ps-accent) 18%, var(--ps-border));
}

.ps-message-turn-meta {
  margin-bottom: 6px;
  color: var(--ps-text-dim);
  font-size: 11px;
  font-weight: 600;
}

.ps-message-turn-copy {
  white-space: pre-wrap;
  color: var(--ps-text);
  font-size: 13.5px;
  line-height: 1.55;
}

.ps-message-reply {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--ps-border-soft);
  background: var(--ps-bg-surface);
}

.ps-message-reply textarea {
  flex: 1;
  min-height: 44px;
  max-height: 140px;
  resize: vertical;
  border: 1px solid var(--ps-border);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ps-text);
}

.ps-message-reply button {
  align-self: flex-end;
  height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: var(--ps-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 720px) {
  .ps-aci-card--stage {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .ps-aci-card--stage .ps-aci-card-cta {
    width: 100%;
  }

  .ps-aci-card-side {
    align-items: stretch;
    min-width: 0;
  }

  .ps-message-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .ps-message-turn {
    max-width: 100%;
  }

  .ps-message-reply {
    flex-direction: column;
  }
}
