/* =========================================================================
   Caregiver portal.

   Narrower than the physician panel on purpose: the family sees what has
   happened and what to do next, not the screening scores behind it.
   ========================================================================= */

.pgc-portal { padding: 0 0 40px; }
.pgc-portal .pgc-view { padding: 14px 14px 0; }

/* ----------------------------------------------------------------- head */

.pgc-portal-head,
.pgc-record-head {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -14px -14px 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--pgc-border);
}
.pgc-portal-head > div { flex: 1; min-width: 0; }
.pgc-portal-head strong { display: block; font-size: 16px; font-weight: 800; }
.pgc-portal-head span { display: block; font-size: 12.5px; color: var(--pgc-muted); }

.pgc-record-head .pgc-back { margin: 0; flex: none; }
.pgc-record-who { flex: 1; min-width: 0; }
.pgc-record-who strong { display: block; font-size: 16px; font-weight: 800; }
.pgc-record-who span { display: block; font-size: 12.5px; color: var(--pgc-muted); }

/* -------------------------------------------------------- patient cards */

.pgc-patient-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.pgc-patient {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border: 1.5px solid var(--pgc-border);
  border-radius: var(--pgc-r-lg);
  background: var(--pgc-surface);
  font-family: var(--pgc-font);
  text-align: right;
  cursor: pointer;
  box-shadow: var(--pgc-shadow-sm);
  transition: border-color .15s ease;
}
.pgc-patient:hover { border-color: var(--pgc-primary-100); }

.pgc-patient-avatar {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--pgc-primary-50);
  color: var(--pgc-primary-700);
  font-size: 19px;
  font-weight: 800;
  flex: none;
}
.pgc-patient-body { flex: 1; min-width: 0; }
.pgc-patient-body strong { display: block; font-size: 16.5px; font-weight: 700; }
.pgc-patient-body span { display: block; font-size: 13px; color: var(--pgc-muted); }
.pgc-patient-next {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--pgc-success-bg);
  border: 1px solid var(--pgc-success-border);
  color: var(--pgc-success);
  font-size: 12.5px;
  font-weight: 600;
}
.pgc-patient-next svg { width: 13px; height: 13px; }

/* --------------------------------------------------------------- visits */

.pgc-visit {
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--pgc-border);
  border-radius: var(--pgc-r-lg);
  background: var(--pgc-surface);
}
.pgc-visit--upcoming {
  border-color: var(--pgc-success-border);
  background: var(--pgc-success-bg);
}
.pgc-visit-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.pgc-visit-date { font-size: 15.5px; font-weight: 800; }
.pgc-visit-plan {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--pgc-border);
  font-size: 14.5px;
  line-height: 1.95;
  white-space: pre-line;
}
.pgc-visit-plan strong { display: block; margin-bottom: 4px; font-size: 13.5px; color: var(--pgc-primary-700); }
.pgc-visit-followup {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pgc-warning);
}

/* ---------------------------------------------------------------- plans */

.pgc-offer {
  padding: 16px;
  margin-bottom: 10px;
  border: 1.5px solid var(--pgc-border);
  border-radius: var(--pgc-r-lg);
  background: var(--pgc-surface);
}
.pgc-offer h4 { margin-bottom: 4px !important; }
.pgc-offer p { font-size: 14px; color: var(--pgc-ink-soft); line-height: 1.85; }
.pgc-offer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--pgc-border);
}
.pgc-offer-price { font-size: 16px; font-weight: 800; color: var(--pgc-primary-700); }

.pgc-plan-doc {
  padding: 16px;
  margin-bottom: 10px;
  border: 1px solid var(--pgc-border);
  border-radius: var(--pgc-r-lg);
  background: var(--pgc-surface);
}
.pgc-plan-doc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.pgc-plan-doc-body {
  font-size: 15px;
  line-height: 2.05;
  white-space: pre-line;
}
.pgc-plan-doc-print {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--pgc-border);
}

@media print {
  .pgc-portal .pgc-view > *:not([data-panel="plans"]),
  .pgc-tabs,
  .pgc-record-head,
  .pgc-btn { display: none !important; }
  .pgc-plan-doc { border: 0; padding: 0; }
}


/* ---- narrow phones ----
   Kept here rather than in base.css: base.css loads first, so an override for
   a class this file also styles has to live in this file to take effect. */
@media (max-width: 360px) {
  .pgc-portal .pgc-view { padding-left: 10px; padding-right: 10px; }
}


/* ------------------------------------------------------------- summary tab
   The landing panel. Big, few things, each one tappable straight through to
   the tab it summarises — the family opening this is usually a relative on a
   phone who wants one fact, not a records browser. */

.pgc-next-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 16px 15px;
  margin-bottom: 12px;
  border: 1.5px solid var(--pgc-primary);
  border-radius: var(--pgc-r-lg);
  background: var(--pgc-primary-50);
}
.pgc-next-card--empty {
  border-color: var(--pgc-border);
  background: var(--pgc-surface);
}
.pgc-next-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--pgc-muted);
}
.pgc-next-label svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pgc-next-when { font-size: 18px; font-weight: 800; line-height: 1.5; }

.pgc-summary-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  padding: 14px 15px;
  margin-bottom: 10px;
  border: 1.5px solid var(--pgc-border);
  border-radius: var(--pgc-r-lg);
  background: var(--pgc-surface);
  font-family: var(--pgc-font);
  text-align: right;
  cursor: pointer;
}
.pgc-summary-card:hover { border-color: var(--pgc-border-strong); }
.pgc-summary-card-label { font-size: 13px; font-weight: 700; color: var(--pgc-muted); }
.pgc-summary-card-body {
  font-size: 15px;
  line-height: 1.8;
  /* Two lines is a preview; the full text lives in the tab this opens. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pgc-summary-card-when { font-size: 12px; color: var(--pgc-muted); }

.pgc-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.pgc-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 84px;
  padding: 12px 6px;
  border: 1.5px solid var(--pgc-border);
  border-radius: var(--pgc-r-lg);
  background: var(--pgc-surface);
  font-family: var(--pgc-font);
  font-size: 13px;
  font-weight: 700;
  color: var(--pgc-ink);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.pgc-quick-btn svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: var(--pgc-primary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pgc-quick-btn:active { background: var(--pgc-surface-3); }


/* Six tabs balance as two rows of three; the shared default of four would
   leave a ragged 4 + 2. */
.pgc-portal .pgc-tabs--wrap { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 620px) {
  .pgc-portal .pgc-tabs--wrap { display: flex; }
}
