/* Explicit record states, with text labels as well as color. No extra animation. */
@media screen {
  .patient-color-legend { display:flex; flex-wrap:wrap; gap:7px 12px; margin:0 0 14px; color:#5a6c76; font-size:12px; line-height:1.6; }
  .patient-color-legend>span { padding:2px 6px; border-radius:4px; }
  .patient-results .patient-card,.patient-card-surface { align-items:flex-start; }
  .patient-card-info { align-items:flex-start; }
  .patient-results .patient-avatar.avatar-green { background:#168044; border:1px solid #168044; color:#fff; box-shadow:none; }
  .patient-results .patient-avatar.avatar-red { background:#bd3545; border:1px solid #bd3545; color:#fff; box-shadow:none; }
  .patient-results .patient-avatar.avatar-blue { background:#286bb5; border:1px solid #286bb5; color:#fff; box-shadow:none; }
  .patient-results .patient-avatar.avatar-empty { background:#e8edf0; border:1px solid #cbd6dc; color:#526570; box-shadow:none; }
  .patient-status-tags { display:flex; flex-wrap:wrap; gap:5px; margin:8px 0 5px; }
  .patient-status-tags>span,.patient-stenosis-tag,.patient-preop-tag { display:inline-block; font-size:12px; line-height:1.65; padding:2px 6px; border-radius:5px; overflow-wrap:anywhere; }
  .state-green { color:#126333; background:#e5f5e9; }
  .state-red,.patient-stenosis-tag { color:#9f2535; background:#fcebed; }
  .state-blue { color:#205a9c; background:#e8f1fd; }
  .state-unknown { color:#526570; background:#edf1f3; }
  .recent-surgery-tag { color:#68409e; background:#f0eafa; font-weight:600; }
  .patient-preop-tag { color:#815119; background:#fff2dc; }
  .patient-clinical-source { padding-top:6px; margin-top:4px; border-top:1px solid #e3ebed; }
  .patient-source-date,.patient-source-note { color:#586f7a; font-size:11px; line-height:1.6; overflow-wrap:anywhere; }
  .patient-source-note { margin-top:4px; }
  .patient-flow { color:#214656; font-size:13px; line-height:1.8; overflow-wrap:anywhere; margin:2px 0; }
  .patient-flow strong { font-size:16px; font-variant-numeric:tabular-nums; }
  .patient-results .patient-card.recent-surgery,.env-mobile .patient-results .patient-card.recent-surgery { border-left:4px solid #8d6abb; }
  .patient-results .patient-card.stenosis,.env-mobile .patient-results .patient-card.stenosis { border-left:4px solid #ca5060; }
  .patient-card-right { align-self:flex-start; }
  .patient-latest-operation { margin-top:7px; padding:7px 9px; background:#f3f7fb; border:1px solid #dce6ef; border-radius:7px; }
  .patient-operation-heading { display:block; color:#445f74; font-size:11px; margin-bottom:3px; }
  .patient-operation-row,.surgery-marker-line { display:flex; flex-wrap:wrap; align-items:center; gap:5px; line-height:1.6; }
  .patient-operation-row+.patient-operation-row { margin-top:5px; }
  .patient-operation-date { color:#425a70; font-size:11px; font-variant-numeric:tabular-nums; }
  .surgery-procedure-tag,.surgery-balloon-tag,.surgery-balloon-unknown,.drug-balloon-tag { display:inline-block; padding:2px 7px; border-radius:5px; font-size:12px; line-height:1.65; overflow-wrap:anywhere; }
  .surgery-procedure-tag { color:#285c83; background:#e3eef8; font-weight:600; }
  .surgery-balloon-tag { color:#5c537e; background:#efedf7; }
  .surgery-balloon-unknown { color:#64717c; background:#edf0f3; }
  .drug-balloon-tag { color:#87500b; background:#fff0c8; border:1px solid #e4c274; font-weight:600; }
  .patient-drug-history { margin-top:6px; }
  /* The legacy surgery color uses !important; override it only for drug history. */
  .surgery-card.drug-balloon-record { border-left:4px solid #d2a137; border-left-color:#d2a137 !important; }
  .record-summary>.surgery-marker-line { flex-basis:100%; margin-bottom:4px; }
  #surgery-view-body>.surgery-marker-line { margin-bottom:14px; padding:10px; background:#f4f7fa; border-radius:7px; }
  .overview-drug-history { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding-top:12px; }
  .overview-drug-history button { border:1px solid #d0a84d; border-radius:6px; background:#fffaf0; color:#805517; padding:7px 10px; cursor:pointer; }
}
@media screen and (max-width:480px) {
  .patient-card-right { max-width:62px; }
  .patient-record-count { padding:4px; line-height:1.65; }
  .patient-card-info { gap:8px; }
  .patient-color-legend { gap:5px; font-size:11px; }
}
