/* The front desk's Messages, from the receptionist deck's .mcard / .l1tabs / .msplit / .mthread /
   .mpane. Weights follow the ruled scale: names at the heading weight, tabs 500, body at the body weight. */
#akashic-health-records-patient-portal-root .ahr-desk-msgs {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

#akashic-health-records-patient-portal-root .ahr-desk-msgs .ahr-desk-msgs__title {
  margin: 0;
  padding: 14px 16px 0;
  line-height: 1.55;
}

/* The strip is the shared line tabs; only its place in the card is local. */
#akashic-health-records-patient-portal-root .ahr-desk-msgs__tabs {
  display: flex;
  width: auto;
  flex: none;
  gap: 20px;
  padding: 10px 16px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

#akashic-health-records-patient-portal-root button.ahr-desk-msgs__tab {
  flex: none;
  margin: 0;
  cursor: pointer;
}

#akashic-health-records-patient-portal-root .ahr-desk-msgs__panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

/* List beside conversation inside the one card; on a phone the list is the page and a chosen
   conversation opens over it. */
#akashic-health-records-patient-portal-root .ahr-desk-split {
  display: grid;
  flex: 1;
  grid-template-columns: 352px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

#akashic-health-records-patient-portal-root .ahr-desk-split__list {
  min-width: 0;
  min-height: 0;
  padding: 10px 12px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
}

#akashic-health-records-patient-portal-root .ahr-desk-split__pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

#akashic-health-records-patient-portal-root .ahr-desk-search,
#akashic-health-records-patient-portal-root .ahr-desk-split__list .ahr-paginator__search {
  margin: 0 0 10px;
}

#akashic-health-records-patient-portal-root .ahr-desk-split__list .ahr-desk-search input[role="searchbox"],
#akashic-health-records-patient-portal-root .ahr-desk-split__list .ahr-paginator__search input[role="searchbox"] {
  height: 41px;
  border-color: var(--line);
  border-radius: 2px;
  background: var(--surface);
  font-size: 13px;
}

#akashic-health-records-patient-portal-root .ahr-desk-list {
  display: flex;
  flex-direction: column;
}

#akashic-health-records-patient-portal-root .ahr-desk-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line-soft);
  text-align: start;
  cursor: pointer;
}

#akashic-health-records-patient-portal-root .ahr-desk-row:hover {
  background: var(--line-soft);
}

#akashic-health-records-patient-portal-root .ahr-desk-row.ahr-desk-row--on {
  background: var(--blue-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}

#akashic-health-records-patient-portal-root .ahr-desk-row .ahr-inbox-avatar,
#akashic-health-records-patient-portal-root .ahr-desk-head .ahr-inbox-avatar {
  flex: none;
  width: 38px;
  height: 38px;
  font-size: 12px;
  color: var(--primary);
}

#akashic-health-records-patient-portal-root .ahr-desk-row--on .ahr-inbox-avatar,
#akashic-health-records-patient-portal-root .ahr-desk-head .ahr-inbox-avatar {
  background: var(--blue-soft);
}

#akashic-health-records-patient-portal-root .ahr-desk-row__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

#akashic-health-records-patient-portal-root .ahr-desk-row__top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
}

/* Block, not flex: an ellipsis only applies to a block's own text. */
#akashic-health-records-patient-portal-root .ahr-desk-row__name {
  display: block;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: var(--ak-heading-weight);
  line-height: 21.7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The deck's row time: 12.5px beside the name. */
#akashic-health-records-patient-portal-root .ahr-desk-row__time {
  flex: none;
  margin-left: auto;
  color: var(--ink-muted);
  font-size: 12.5px;
  white-space: nowrap;
}

#akashic-health-records-patient-portal-root .ahr-desk-row__top .ahr-count-badge {
  flex: none;
  align-self: center;
}

/* The chip is the shared square pill; only its place under the name is local. */
#akashic-health-records-patient-portal-root .ahr-desk-chip {
  margin: 3px 0;
  white-space: nowrap;
}

#akashic-health-records-patient-portal-root .ahr-desk-row__snip {
  display: block;
  width: 100%;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 19.4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A person to start a conversation with: the deck's lifted directory card. */
#akashic-health-records-patient-portal-root button.ahr-desk-person {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 60px;
  margin: 0 0 4px;
  padding: 8px 12px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--ak-card-lift);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

#akashic-health-records-patient-portal-root button.ahr-desk-person:hover {
  background: var(--line-soft);
}

#akashic-health-records-patient-portal-root .ahr-desk-person .ahr-inbox-avatar {
  flex: none;
  width: 44px;
  height: 44px;
  background: var(--blue-soft);
  color: var(--primary);
  font-size: 12px;
}

#akashic-health-records-patient-portal-root .ahr-desk-person__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#akashic-health-records-patient-portal-root .ahr-desk-person__name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: var(--ak-heading-weight);
  line-height: 21.7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#akashic-health-records-patient-portal-root .ahr-desk-person__sub {
  color: var(--primary);
  font-size: 13px;
  line-height: 20px;
}

#akashic-health-records-patient-portal-root .ahr-desk-skeleton-mark {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

#akashic-health-records-patient-portal-root .ahr-desk-skeleton-line {
  width: 70%;
  height: 12px;
  margin: 4px 0;
}

#akashic-health-records-patient-portal-root .ahr-desk-skeleton-line--short {
  width: 45%;
}

#akashic-health-records-patient-portal-root .ahr-desk-empty {
  padding: 32px 12px;
}

#akashic-health-records-patient-portal-root .ahr-desk-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 12px;
  border: 1px solid var(--red-line);
  border-radius: 2px;
  background: var(--red-soft);
}

#akashic-health-records-patient-portal-root .ahr-desk-error p {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

#akashic-health-records-patient-portal-root .ahr-desk-error button {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
}

/* Nothing chosen yet: a short invitation at the top of the pane, not a centred icon. */
#akashic-health-records-patient-portal-root .ahr-desk-pick {
  justify-content: flex-start;
  align-self: center;
  max-width: 320px;
  padding: 40px 18px;
}

#akashic-health-records-patient-portal-root .ahr-desk-pick > p:first-child {
  margin: 0 0 7px;
  color: var(--ink-strong);
  font-size: 15px;
  font-weight: var(--ak-heading-weight);
  line-height: 23.25px;
}

#akashic-health-records-patient-portal-root .ahr-desk-pick > p + p {
  font-size: 13px;
  line-height: 20.15px;
}

#akashic-health-records-patient-portal-root .ahr-desk-opening {
  padding: 40px 18px;
  color: var(--ink-muted);
  font-size: 13px;
  text-align: center;
}

/* Who is answering the shared conversation: above it on the desktop, under its name on a phone. */
#akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-desk-claim {
  flex: none;
  order: -1;
}

#akashic-health-records-patient-portal-root .ahr-desk-split__pane .ahr-claim-strip {
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 0;
  background: var(--surface);
}

#akashic-health-records-patient-portal-root .ahr-desk-split__pane .ahr-claim-strip__label {
  color: var(--ink-muted);
  font-size: 13.5px;
}

#akashic-health-records-patient-portal-root .ahr-desk-split__pane .ahr-claim-strip .btn {
  margin-left: auto;
}

#akashic-health-records-patient-portal-root .ahr-desk-split__pane .ahr-claim-strip .btn-blue {
  min-height: 35px;
  padding: 7px 13px;
  border-radius: 2px;
  font-size: 13.5px;
}

/* A read or a send that did not go through, as the deck's alert: triangle, what failed, what now. */
#akashic-health-records-patient-portal-root .ahr-desk-alert {
  display: flex;
  flex: none;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 14px;
  padding: 12px;
  border: 1px solid var(--red-line);
  background: var(--red-soft);
  color: var(--danger);
}

#akashic-health-records-patient-portal-root .ahr-chat-foot .ahr-desk-alert {
  margin: 0 0 12px;
}

#akashic-health-records-patient-portal-root .ahr-desk-alert__mark {
  flex: none;
  margin-top: 1px;
  color: var(--danger);
}

#akashic-health-records-patient-portal-root .ahr-desk-alert p {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 14px;
}

#akashic-health-records-patient-portal-root .ahr-desk-alert p.ahr-desk-alert__title {
  margin: 0;
  color: var(--danger);
  font-weight: var(--ak-heading-weight);
}

#akashic-health-records-patient-portal-root .ahr-desk-alert .btn {
  margin-top: 10px;
}

/* The conversation, as the desk deck draws it inside the pane. */
#akashic-health-records-patient-portal-root .ahr-chat--desk {
  flex: 1;
  min-height: 0;
  height: auto;
  gap: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-desk-head {
  display: flex;
  flex: none;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}

#akashic-health-records-patient-portal-root .ahr-desk-head__who {
  flex: 1;
  min-width: 0;
}

#akashic-health-records-patient-portal-root .ahr-desk-head__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}

/* The desk names the person in body ink, as the deck does, not in the sage title colour. */
#akashic-health-records-patient-portal-root .ahr-desk-head .ahr-thread-title {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#akashic-health-records-patient-portal-root .ahr-desk-head .ahr-desk-chip {
  margin: 0;
}

#akashic-health-records-patient-portal-root .ahr-desk-head__meta {
  margin: 2px 0 0;
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 19.4px;
}

/* The way back is the phone's; the desktop pane has the list beside it. */
#akashic-health-records-patient-portal-root button.ahr-desk-head__close {
  display: none;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -6px -10px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}

#akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-chat-nag {
  padding: 9px 14px;
  border-top: 1px solid var(--amber-line);
  border-bottom: 1px solid var(--amber-line);
  background: var(--amber-soft);
  color: var(--amber-ink);
  font-size: 13px;
}

#akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-chat-nag button {
  color: var(--primary);
  font-size: 13px;
}

#akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-chat-body {
  padding: 0 14px 10px;
  background: var(--surface);
}

#akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-chat-days,
#akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-chat-day-group,
#akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-chat-stack {
  display: grid;
  gap: 10px;
}

/* The day as a small capital rule across the conversation. */
#akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-chat-day {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: var(--ak-body-weight);
  letter-spacing: 0.08em;
}

#akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-chat-day::before,
#akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-chat-day::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

#akashic-health-records-patient-portal-root .ahr-desk-msg {
  display: flex;
  gap: 9px;
}

#akashic-health-records-patient-portal-root .ahr-desk-msg .ahr-inbox-avatar,
#akashic-health-records-patient-portal-root .ahr-desk-msg__indent {
  flex: none;
  width: 28px;
  height: 28px;
  background: var(--blue-soft);
  color: var(--primary);
  font-size: 10px;
}

#akashic-health-records-patient-portal-root .ahr-desk-msg__indent {
  background: transparent;
}

#akashic-health-records-patient-portal-root .ahr-desk-msg__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  max-width: 78%;
}

#akashic-health-records-patient-portal-root .ahr-desk-msg--me {
  justify-content: flex-end;
}

#akashic-health-records-patient-portal-root .ahr-desk-msg--me .ahr-desk-msg__col {
  align-items: flex-end;
}

#akashic-health-records-patient-portal-root p.ahr-desk-msg__who {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 7px;
  margin: 0 0 4px;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--ak-heading-weight);
  line-height: 20px;
}

#akashic-health-records-patient-portal-root p.ahr-desk-msg__who > span {
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: var(--ak-body-weight);
}

#akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-msg-bubble {
  padding: 9px 12px;
  border-radius: 8px;
}

#akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-msg-bubble--them {
  border: 1px solid var(--line);
}

#akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-chat-foot {
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

#akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-chat-foot > .flex {
  align-items: center;
  gap: 9px;
}

#akashic-health-records-patient-portal-root .ahr-chat--desk button.ahr-attach {
  width: 26px;
  height: auto;
  color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .ahr-chat--desk button.ahr-attach svg {
  width: 18px;
  height: 18px;
  color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-composer-field {
  border-radius: 2px;
}

#akashic-health-records-patient-portal-root .ahr-chat--desk .btn.ahr-composer-send {
  min-height: 34px;
  height: 34px;
  border-radius: 2px;
}

#akashic-health-records-patient-portal-root .ahr-chat--desk .btn.ahr-desk-send {
  width: 34px;
  padding: 0;
}

@media (pointer: coarse) {
  #akashic-health-records-patient-portal-root button.ahr-desk-msgs__tab {
    min-height: 44px;
  }

  #akashic-health-records-patient-portal-root .ahr-desk-row {
    min-height: 44px;
  }

  #akashic-health-records-patient-portal-root .ahr-chat--desk .btn.ahr-composer-send,
  #akashic-health-records-patient-portal-root .ahr-chat--desk .btn.ahr-desk-send {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
}

@media (max-width: 767px) {
  /* On a phone the inbox is the page and the page scrolls; no box inside it. */
  #akashic-health-records-patient-portal-root .ahr-desk-page,
  #akashic-health-records-patient-portal-root .ahr-desk-msgs,
  #akashic-health-records-patient-portal-root .ahr-desk-split,
  #akashic-health-records-patient-portal-root .ahr-desk-split__list {
    height: auto;
    overflow: visible;
  }

  #akashic-health-records-patient-portal-root .ahr-desk-split {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
  }

  #akashic-health-records-patient-portal-root .ahr-desk-split__list {
    border-right: 0;
  }

  #akashic-health-records-patient-portal-root .ahr-desk-split__pane {
    display: none;
  }

  /* The phone's conversation is a sheet over the inbox, below the header, closed by its X. */
  #akashic-health-records-patient-portal-root .ahr-desk-split--thread .ahr-desk-split__pane {
    position: fixed;
    inset: 52px 0 0;
    z-index: 50;
    display: flex;
    border-radius: 12px 12px 0 0;
    background: var(--surface);
    box-shadow: 0 0 0 100vmax var(--scrim);
  }

  #akashic-health-records-patient-portal-root .ahr-desk-split--thread .ahr-chat--desk {
    border-radius: 12px 12px 0 0;
  }

  #akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-desk-head {
    align-items: center;
    padding: 18px 16px;
    border-top: 0;
    border-bottom: 1px solid var(--line);
  }

  #akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-desk-head .ahr-inbox-avatar {
    display: none;
  }

  #akashic-health-records-patient-portal-root .ahr-chat--desk .ahr-desk-claim {
    order: 0;
  }

  #akashic-health-records-patient-portal-root button.ahr-desk-head__close {
    display: inline-flex;
    margin: -10px -10px -10px 0;
  }
}
