/* Family & caregivers, drawn from the approved patient-portal deck (#s-family-and-caregivers).
   Deck weights are read through the 2026-09-09 scale: its 500 is bold (400) for a name or a label,
   its 400 is body (300); tabs keep 500 by the 2026-09-10 ruling. */

#akashic-health-records-patient-portal-root .ahr-family-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* The title, its line and the two tabs, with one grey rule under all of them. */
#akashic-health-records-patient-portal-root .ahr-family-pagehead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
#akashic-health-records-patient-portal-root .ahr-family-titles {
  flex: 1 0 100%;
  min-width: 0;
}
#akashic-health-records-patient-portal-root .ahr-family-title {
  margin: 0;
}

#akashic-health-records-patient-portal-root .ahr-family-pagehead [data-slot="tabs"] {
  flex: none;
  max-width: 100%;
}
/* The shared line tabs; on a narrow phone the strip scrolls rather than wraps. */
#akashic-health-records-patient-portal-root .ahr-family-tabs {
  overflow-x: auto;
  scrollbar-width: none;
}

/* From a tablet up the list sits beside the person it has open. */
#akashic-health-records-patient-portal-root .ahr-family-panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (min-width: 768px) {
  #akashic-health-records-patient-portal-root .ahr-family-panes {
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  }
}
@media (min-width: 1024px) {
  #akashic-health-records-patient-portal-root .ahr-family-panes {
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  }
}

#akashic-health-records-patient-portal-root .ahr-family-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* One lifted card per person: face, name and relationship, then what they may do. */
#akashic-health-records-patient-portal-root .ahr-list-card.ahr-family-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}
#akashic-health-records-patient-portal-root .ahr-family-row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
#akashic-health-records-patient-portal-root .ahr-family-row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
#akashic-health-records-patient-portal-root .ahr-family-row-name,
#akashic-health-records-patient-portal-root .ahr-family-row-rel {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#akashic-health-records-patient-portal-root .ahr-family-row-name {
  font-size: 15px;
  font-weight: var(--ak-heading-weight);
  color: var(--ink-strong);
}
#akashic-health-records-patient-portal-root .ahr-family-row-rel {
  font-size: 13px;
  color: var(--ink-muted);
}
/* The stored relationship reads mid-sentence elsewhere; at the start of a line it takes a capital. */
#akashic-health-records-patient-portal-root .ahr-family-row-rel::first-letter,
#akashic-health-records-patient-portal-root .ahr-family-head-sub::first-letter {
  text-transform: uppercase;
}
#akashic-health-records-patient-portal-root .ahr-family-enter {
  flex: none;
  width: 19px;
  height: 19px;
  margin: 0 8px 0 auto;
  color: var(--primary);
}

/* The avatar: the inbox's photo-or-initials, tinted by what the person may do. */
#akashic-health-records-patient-portal-root .ahr-family-avatar {
  position: relative;
  flex: none;
}
#akashic-health-records-patient-portal-root .ahr-family-avatar--full .ahr-inbox-avatar {
  background: var(--green-soft);
  color: var(--sage-ink);
}
#akashic-health-records-patient-portal-root .ahr-family-avatar--wait .ahr-inbox-avatar {
  background: var(--amber-soft);
  color: var(--warning);
}
#akashic-health-records-patient-portal-root .ahr-family-presence {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
}

/* A declined invitation or an untiered grant is a state: coloured text with a shape. */
#akashic-health-records-patient-portal-root .access-mark {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: var(--ak-label-weight);
  white-space: nowrap;
}
#akashic-health-records-patient-portal-root .access-mark svg {
  width: 10px;
  height: 10px;
}
#akashic-health-records-patient-portal-root .access-mark.is-declined {
  color: var(--destructive);
}
#akashic-health-records-patient-portal-root .access-mark.is-active {
  color: var(--sage-ink);
}

/* "+ Invite someone" and "+ Add a child": a blue line under the list, not a button. */
#akashic-health-records-patient-portal-root .ahr-family-add {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 12px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: var(--ak-heading-weight);
  text-align: left;
  cursor: pointer;
}
#akashic-health-records-patient-portal-root .ahr-family-add-plus {
  display: grid;
  flex: none;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1.5px solid var(--primary);
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
}

/* ── The person: a centred sheet on a phone, a card beside the list from a tablet up ─────────── */
#akashic-health-records-patient-portal-root [data-slot="dialog-content"].ahr-family-sheet {
  gap: 0;
  width: calc(100vw - 22px);
  max-width: 460px;
  padding: 0 0 8px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 16px 44px rgba(31, 26, 20, 0.32);
}
#akashic-health-records-patient-portal-root [data-slot="dialog-content"].ahr-family-sheet--page {
  padding: 16px;
}

#akashic-health-records-patient-portal-root .ahr-family-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}
#akashic-health-records-patient-portal-root .ahr-family-pane .ahr-family-head {
  padding: 0 0 12px;
}
#akashic-health-records-patient-portal-root .ahr-family-head-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}
#akashic-health-records-patient-portal-root .ahr-family-head-name {
  margin: 0;
  font-size: 15px;
  font-weight: var(--ak-heading-weight);
  color: var(--ink-strong);
}
#akashic-health-records-patient-portal-root .ahr-family-head-sub {
  font-size: 13px;
  color: var(--ink-muted);
}
#akashic-health-records-patient-portal-root .ahr-family-edit {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: var(--ak-heading-weight);
  cursor: pointer;
}
#akashic-health-records-patient-portal-root .ahr-family-edit svg {
  width: 16px;
  height: 16px;
}

#akashic-health-records-patient-portal-root .ahr-family-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}
#akashic-health-records-patient-portal-root .ahr-family-pane .ahr-family-actions {
  padding: 0;
}
#akashic-health-records-patient-portal-root .ahr-family-note {
  margin: 12px 4px 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-muted);
}

/* One thing you can do about this person: icon, what it is, what it means, and a quiet arrow. */
#akashic-health-records-patient-portal-root .ahr-family-action {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 12px;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 0 10px;
  width: 100%;
  min-height: 44px;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--ak-card-lift);
  color: var(--ink-strong);
  text-align: left;
  cursor: pointer;
}
#akashic-health-records-patient-portal-root .ahr-family-action:hover:not(:disabled) {
  background: var(--line-soft);
}
#akashic-health-records-patient-portal-root .ahr-family-action:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
#akashic-health-records-patient-portal-root .ahr-family-action:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
#akashic-health-records-patient-portal-root .ahr-family-action-icon {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  width: 20px;
  height: 20px;
  color: var(--primary);
}
#akashic-health-records-patient-portal-root .ahr-family-action-label {
  grid-column: 2;
  grid-row: 1;
  font-size: 15px;
  font-weight: var(--ak-heading-weight);
  color: var(--ink-strong);
}
#akashic-health-records-patient-portal-root .ahr-family-action-sub {
  grid-column: 2;
  grid-row: 2;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-muted);
}
#akashic-health-records-patient-portal-root .ahr-family-action-go {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  width: 12px;
  height: 12px;
  color: var(--faint);
}
#akashic-health-records-patient-portal-root .ahr-family-action--danger .ahr-family-action-icon,
#akashic-health-records-patient-portal-root .ahr-family-action--danger .ahr-family-action-label {
  color: var(--danger);
}

/* Beside the list (the pane is the shared panel card) the rows are lighter: one line each. */
#akashic-health-records-patient-portal-root .ahr-family-pane .ahr-family-action {
  padding: 12px 0;
  box-shadow: none;
  border-bottom: 1px solid var(--line-soft);
}
#akashic-health-records-patient-portal-root .ahr-family-pane .ahr-family-action-label {
  font-size: 13px;
}
#akashic-health-records-patient-portal-root .ahr-family-pane .ahr-family-action-sub {
  display: none;
}

#akashic-health-records-patient-portal-root .access-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#akashic-health-records-patient-portal-root .access-action-error {
  margin: 0;
  font-size: 13px;
  color: var(--destructive);
}

/* ── Inviting someone: who, how they are related, and what they may do ─────────────────────── */
#akashic-health-records-patient-portal-root .ahr-family-invite {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#akashic-health-records-patient-portal-root .ahr-family-invite .care-access-group {
  margin-bottom: 0;
}
#akashic-health-records-patient-portal-root .ahr-family-invite .ahr-family-invite-first {
  margin-top: 0;
}
#akashic-health-records-patient-portal-root .ahr-family-invite .ahr-family-invite-field {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-strong);
}
#akashic-health-records-patient-portal-root .ahr-family-invite .ahr-family-invite-field::placeholder {
  color: var(--faint);
}
#akashic-health-records-patient-portal-root .ahr-family-invite .ahr-family-invite-rel [data-slot="field"] > label[data-slot="field-label"] {
  margin: 8px 0 2px;
  font-size: 11.5px;
  font-weight: var(--ak-label-weight);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
#akashic-health-records-patient-portal-root .ahr-family-invite-rel [data-slot="select-trigger"],
#akashic-health-records-patient-portal-root .ahr-family-invite-rel [role="combobox"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

/* ── Their activity on your record: what they opened or changed, newest first ───────────────── */
#akashic-health-records-patient-portal-root .ahr-family-pane-more {
  margin-top: 12px;
}
#akashic-health-records-patient-portal-root .ahr-family-activity-view {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#akashic-health-records-patient-portal-root .ahr-family-activity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
}
#akashic-health-records-patient-portal-root .ahr-family-activity-list {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
#akashic-health-records-patient-portal-root .ahr-family-activity-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
}
#akashic-health-records-patient-portal-root .ahr-family-activity-icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
}
#akashic-health-records-patient-portal-root .ahr-family-activity-what {
  min-width: 0;
  color: var(--ink-strong);
}
#akashic-health-records-patient-portal-root .ahr-family-activity-when {
  color: var(--ink-muted);
  white-space: nowrap;
}
#akashic-health-records-patient-portal-root .ahr-family-activity-note,
#akashic-health-records-patient-portal-root .ahr-family-activity-window {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
}
