/* PRD v70.0 — Patient profile section. Tokens from style.css; .btn/.form-input reused. */
.profile-page { max-width: 672px; margin: 0 auto; padding: var(--space-5) var(--space-5) var(--space-8); display: flex; flex-direction: column; gap: var(--space-5); }
.profile-back { align-self: flex-start; }
.profile-header { display: flex; align-items: center; gap: var(--space-4); }
.profile-avatar { width: 56px; height: 56px; font-size: var(--text-lg); flex-shrink: 0; }
.profile-header-text { flex: 1; min-width: 0; }
.profile-name { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.2; margin: 0; color: var(--color-text); overflow-wrap: anywhere; }
.profile-subtitle { margin: 2px 0 0; font-size: var(--text-sm); color: var(--color-text-secondary); }
.profile-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: var(--space-2) var(--space-5); }
.profile-row { display: grid; grid-template-columns: 168px 1fr; gap: var(--space-2) var(--space-4); align-items: baseline; padding: var(--space-3) 0; border-bottom: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent); }
.profile-row:last-child { border-bottom: none; }
.profile-row-label { font-size: var(--text-sm); color: var(--color-text-secondary); }
.profile-row-label-hint { display: block; font-size: var(--text-xs); color: var(--color-text-muted); }
.profile-row-body { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.profile-row-main { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.profile-value { font-size: var(--text-base); color: var(--color-text); overflow-wrap: anywhere; }
.profile-value--empty { color: var(--color-text-muted); }
.profile-origin { font-size: var(--text-xs); color: var(--color-text-muted); white-space: nowrap; }
.profile-origin--user { color: var(--color-accent); font-weight: 600; }
.profile-fill { background: none; border: none; padding: 0; font: inherit; font-size: var(--text-sm); color: var(--color-accent); cursor: pointer; text-decoration: underline; min-height: 44px; }
.profile-unparsed, .profile-field-hint { font-size: var(--text-xs); color: var(--color-text-muted); }
.profile-field-error { font-size: var(--text-xs); color: var(--color-error); }
.profile-card[data-mode="edit"] .form-input[aria-invalid="true"] { border-color: var(--color-error); }
.profile-date-wrap { position: relative; }
.profile-date-wrap .form-input { padding-right: 40px; }
.profile-date-wrap svg { position: absolute; right: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--color-text-muted); pointer-events: none; }
.profile-segmented { display: inline-flex; border: 1px solid var(--color-border); border-radius: var(--radius-btn); overflow: hidden; }
.profile-segmented button { background: var(--color-surface); border: none; padding: var(--space-2) var(--space-4); font: inherit; font-size: var(--text-sm); color: var(--color-text-secondary); cursor: pointer; min-height: 44px; }
.profile-segmented button + button { border-left: 1px solid var(--color-border); }
.profile-segmented button[aria-pressed="true"] { background: var(--color-accent-light); color: var(--color-accent); font-weight: 600; }
.profile-segmented button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.profile-actions { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-4) 0 var(--space-2); }
.profile-banner { background: var(--color-error-light); color: var(--color-error-dark); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); font-size: var(--text-sm); margin: var(--space-3) 0; }
.profile-note { font-size: var(--text-sm); color: var(--color-text-secondary); line-height: 1.5; margin: 0; }
.profile-load-error { text-align: center; padding: var(--space-6) 0; display: flex; flex-direction: column; gap: var(--space-3); align-items: center; }
.profile-load-error-title { font-weight: 600; color: var(--color-text); }
.profile-load-error-hint { font-size: var(--text-sm); color: var(--color-text-secondary); }
.profile-skeleton-row { height: 20px; margin: var(--space-4) 0; border-radius: var(--radius-md); }
.profile-spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: var(--radius-full); animation: profile-spin 0.8s linear infinite; }
@keyframes profile-spin { to { transform: rotate(360deg); } }
.profile-card[aria-busy="true"] { opacity: 0.7; }

/* bar button: hidden with the trigger when there are no patients (chat.css rule for the trigger) */
.global-patient-bar[data-has-patients="false"] .patient-profile-btn { display: none; }
.global-patient-bar .patient-profile-btn[aria-pressed="true"] { background: var(--color-accent-light); border-color: var(--color-accent); color: var(--color-accent); }

@media (max-width: 768px) {
  .global-patient-bar .patient-profile-btn .patient-profile-btn-text { display: none; }
  .global-patient-bar .patient-profile-btn { padding: var(--space-2); }
  .profile-page { padding: var(--space-4) var(--space-4) var(--space-8); }
  .profile-row { grid-template-columns: 1fr; gap: var(--space-1); }
  .profile-actions { flex-direction: column-reverse; }
  .profile-actions .btn { width: 100%; min-height: 44px; }
  .profile-edit-btn .profile-edit-btn-text { display: none; }
  .profile-segmented { display: flex; }
  .profile-segmented button { flex: 1; }
  .profile-card .form-input { min-height: 44px; }
  .btn.profile-back, .btn.profile-edit-btn, .profile-load-error .btn { min-height: 44px; }
}
