/* The patient's medication list, drawn as the approved deck (patient-portal.html#s-medications).
   Two columns from tablet up: the list on the left, what is not here on the right. Weights follow the
   later scale - names at the heading weight, captions at the label weight - and small secondary text
   is muted rather than faint. */

#akashic-health-records-patient-portal-root .ak-meds {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* The shell's own 8px plus these 4 put the list 12px in from the title, as the deck draws it. */
  padding: 4px 4px 16px;
}

@media (min-width: 900px) {
  #akashic-health-records-patient-portal-root .ak-meds {
    display: grid;
    max-width: 1180px;
    grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
  }
}

#akashic-health-records-patient-portal-root .ak-meds__col {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
}

#akashic-health-records-patient-portal-root .ak-meds__h3 {
  margin: 2px 0 -4px;
  padding: 0 2px;
}

/* One medicine: a lifted card, 4px from the next, its left edge saying who put it there - blue for a
   prescription, the faint rule for one the patient added. */
#akashic-health-records-patient-portal-root .ak-meds__row {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 4px;
  border-left-color: var(--primary);
  text-align: left;
  cursor: pointer;
}

#akashic-health-records-patient-portal-root .ak-meds__row--own {
  border-left-color: var(--faint);
}

#akashic-health-records-patient-portal-root .ak-meds__past .ak-meds__row {
  border-left-color: rgb(var(--primary-rgb) / 0.35);
  background: var(--paper);
}

#akashic-health-records-patient-portal-root .ak-meds__past .ak-meds__row--own {
  border-left-color: var(--line);
}

#akashic-health-records-patient-portal-root .ak-meds__text {
  display: block;
  min-width: 0;
  flex: 1;
}

#akashic-health-records-patient-portal-root .ak-meds__name {
  display: block;
}

#akashic-health-records-patient-portal-root .ak-meds__past .ak-meds__name,
#akashic-health-records-patient-portal-root .ak-meds__past .ak-meds__schedule {
  color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .ak-meds__schedule {
  display: block;
  margin-top: 2px;
  font-size: var(--ak-font-13);
  color: var(--ink);
}

/* The shared org line; only its place is here. */
#akashic-health-records-patient-portal-root .ak-meds__org {
  margin-top: 4px;
}

#akashic-health-records-patient-portal-root .ak-meds__by {
  display: block;
  margin-top: 2px;
}

#akashic-health-records-patient-portal-root .ak-meds__chevron {
  flex: none;
  align-self: center;
  color: var(--faint);
}

/* Adding a medicine sits under the list as a quiet line with a ringed plus, the deck's .add. */
#akashic-health-records-patient-portal-root .ak-meds__add {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 0;
  background: none;
  font-size: var(--ak-font-13);
  font-weight: var(--ak-heading-weight);
  cursor: pointer;
}

#akashic-health-records-patient-portal-root .ak-meds__plus {
  display: grid;
  width: 17px;
  height: 17px;
  flex: none;
  place-items: center;
  border: 1.5px solid var(--primary);
  border-radius: 50%;
}

#akashic-health-records-patient-portal-root .ak-meds__plus svg {
  width: 11px;
  height: 11px;
}

#akashic-health-records-patient-portal-root .ak-meds__empty {
  margin: 0 0 4px;
}

/* The right column is reading, not a list: plain notes on the paper. */
#akashic-health-records-patient-portal-root .ak-meds__aside {
  display: grid;
  gap: 14px;
  margin: 0 0 4px;
}

#akashic-health-records-patient-portal-root .ak-meds__aside b {
  display: block;
  font-size: var(--ak-font-13);
  font-weight: var(--ak-heading-weight);
  color: var(--ink-strong);
}

#akashic-health-records-patient-portal-root .ak-meds__aside span {
  display: block;
  margin-top: 2px;
  font-size: var(--ak-font-13);
  line-height: 1.5;
  color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .ak-meds__link {
  padding: 0;
  border: 0;
  background: none;
  font-size: var(--ak-font-13);
  font-weight: var(--ak-heading-weight);
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

#akashic-health-records-patient-portal-root .ak-meds__fill-by {
  display: block;
  margin-top: 4px;
  font-size: var(--ak-font-13);
  color: var(--ink-muted);
}
