/* The desk booking dialog, from the receptionist deck's .bkdlg / .bkcard / .fi. */
#akashic-health-records-patient-portal-root [data-slot="dialog-content"].ahr-desk-booking-dialog {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 560px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: hidden;
}

#akashic-health-records-patient-portal-root .ahr-desk-booking-dialog > [data-slot="dialog-close"] {
  top: 21px;
  right: 16px;
}

#akashic-health-records-patient-portal-root .ahr-desk-booking-dialog > [data-slot="dialog-close"] svg {
  width: 18px;
  height: 18px;
}

#akashic-health-records-patient-portal-root .ahr-receptionist-book-appointment {
  display: flex;
  flex-direction: column;
  /* As tall as its content, as the deck draws it; the body scrolls once the screen caps it. */
  height: auto;
  max-height: calc(100vh - 40px);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

#akashic-health-records-patient-portal-root .ahr-receptionist-book-appointment__header {
  flex: none;
  padding: 15px 48px 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}

#akashic-health-records-patient-portal-root p.ahr-receptionist-book-appointment__title {
  margin: 0;
}

#akashic-health-records-patient-portal-root .ahr-receptionist-book-appointment__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 12px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#akashic-health-records-patient-portal-root .ahr-receptionist-book-appointment__footer {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}

#akashic-health-records-patient-portal-root .ahr-bk-go {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Book and the section buttons are the shared buttons; each section is the shared card (.ak-card). */

#akashic-health-records-patient-portal-root .ahr-bk-card__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 9px;
  font-size: 13px;
  font-weight: var(--ak-label-weight);
  line-height: 1.55;
  color: var(--ink-strong);
}

#akashic-health-records-patient-portal-root .ahr-bk-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#akashic-health-records-patient-portal-root .ahr-bk-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

#akashic-health-records-patient-portal-root .ahr-bk-row > * {
  min-width: 0;
}

#akashic-health-records-patient-portal-root label.ahr-bk-label,
#akashic-health-records-patient-portal-root span.ahr-bk-label {
  display: block;
  margin: 0 0 5px;
  font-size: 11.5px;
  font-weight: var(--ak-label-weight);
  line-height: 1.55;
  color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .ahr-bk-label .ahr-bk-req {
  color: var(--danger);
}

#akashic-health-records-patient-portal-root .ahr-bk-label .ahr-bk-opt {
  font-weight: var(--ak-body-weight);
  color: var(--faint);
}

#akashic-health-records-patient-portal-root .ahr-bk-field,
#akashic-health-records-patient-portal-root button.ahr-bk-field[data-slot="select-trigger"] {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: auto;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: none;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-strong);
}

#akashic-health-records-patient-portal-root .ahr-bk-field::placeholder,
#akashic-health-records-patient-portal-root .ahr-bk-field[data-placeholder] {
  color: var(--faint);
}

#akashic-health-records-patient-portal-root .ahr-bk-field:focus-visible {
  border-color: var(--primary);
  outline: 2px solid var(--ring);
  outline-offset: 0;
}

#akashic-health-records-patient-portal-root .ahr-bk-field:disabled,
#akashic-health-records-patient-portal-root button.ahr-bk-field[data-slot="select-trigger"]:disabled {
  border-color: var(--line-soft);
  background: var(--sunken);
  color: var(--faint);
  opacity: 1;
}

#akashic-health-records-patient-portal-root textarea.ahr-bk-field {
  display: block;
  min-height: 62px;
  line-height: 1.45;
  resize: none;
}

#akashic-health-records-patient-portal-root .ahr-bk-field [data-slot="select-value"] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The deck's caret, a small filled triangle, in place of the stroked chevron. */
#akashic-health-records-patient-portal-root .ahr-bk-field > svg {
  display: none;
}

#akashic-health-records-patient-portal-root button.ahr-bk-field[data-slot="select-trigger"]::after {
  content: "";
  flex: none;
  width: 0;
  height: 0;
  border-top: 5px solid var(--faint);
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

#akashic-health-records-patient-portal-root .ahr-bk-assist {
  display: flex;
  justify-content: flex-end;
  margin-top: 7px;
}

#akashic-health-records-patient-portal-root button.ahr-bk-ghost {
  padding: 3px 7px;
  border: 0;
  border-radius: 6px;
  background: none;
  font-size: 12.5px;
  font-weight: var(--ak-body-weight);
  line-height: 1.55;
  color: var(--primary);
  cursor: pointer;
}

#akashic-health-records-patient-portal-root button.ahr-bk-ghost:disabled {
  color: var(--faint);
  cursor: default;
}

#akashic-health-records-patient-portal-root button.ahr-bk-ghost:hover:not(:disabled) {
  background: var(--blue-soft);
}

#akashic-health-records-patient-portal-root p.ahr-bk-note {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .ahr-bk-card > p.ahr-bk-note:first-of-type {
  margin-top: 0;
}

#akashic-health-records-patient-portal-root p.ahr-bk-note--error {
  color: var(--danger);
}

/* The deck's .bknote: an amber box (no shared warning notice yet) that names what was noticed, above what it concerns. */
#akashic-health-records-patient-portal-root .ahr-bk-notice {
  padding: 8px 12px;
  border: 1px solid var(--amber-line);
  border-radius: 8px;
  background: var(--amber-soft);
  font-size: 13px;
  line-height: 1.5;
  color: var(--amber-ink);
}

#akashic-health-records-patient-portal-root .ahr-bk-notice p {
  margin: 3px 0 0;
  font-size: 13px;
  color: inherit;
}

#akashic-health-records-patient-portal-root .ahr-bk-notice p.ahr-bk-notice__title {
  margin: 0;
  font-weight: var(--ak-label-weight);
}

#akashic-health-records-patient-portal-root .ahr-bk-notice p.ahr-bk-notice__fine {
  margin-top: 5px;
  font-size: 11.5px;
}

#akashic-health-records-patient-portal-root .ahr-bk-notice ul {
  margin: 3px 0 0;
  padding-left: 18px;
  list-style: disc;
}

#akashic-health-records-patient-portal-root .ahr-bk-notice li {
  font-size: 13px;
}

#akashic-health-records-patient-portal-root .ahr-bk-notice .btn {
  margin-top: 8px;
}

/* A failed read is the shared error notice; only the spacing of its lines is local. */
#akashic-health-records-patient-portal-root .ahr-bk-notice--failed p {
  margin: 3px 0 0;
}

#akashic-health-records-patient-portal-root .ahr-bk-notice--failed p.ahr-bk-notice__title {
  margin: 0;
}

#akashic-health-records-patient-portal-root .ahr-bk-notice--failed .btn {
  margin-top: 8px;
}

/* The patient search's results, under the field. */
#akashic-health-records-patient-portal-root .ahr-receptionist-patient-search {
  position: relative;
}

/* In the flow, not floating: floated over the scrolling body they added no height, so the dialog
   stayed short and cut them off at its footer. Now they grow it up to the viewport cap. */
#akashic-health-records-patient-portal-root .ahr-receptionist-patient-search__results {
  margin-top: 4px;
  max-height: 16rem;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(31, 26, 20, 0.16);
}

#akashic-health-records-patient-portal-root button.ahr-receptionist-patient-search__result {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

#akashic-health-records-patient-portal-root button.ahr-receptionist-patient-search__result:hover {
  background: var(--paper);
}

#akashic-health-records-patient-portal-root .ahr-receptionist-patient-search__name {
  display: block;
  font-size: 13.5px;
  color: var(--ink-strong);
}

#akashic-health-records-patient-portal-root .ahr-receptionist-patient-search__sub {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .ahr-receptionist-patient-search__empty {
  padding: 10px 11px;
  font-size: 13px;
  color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root button.ahr-bk-suggestion {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

#akashic-health-records-patient-portal-root button.ahr-bk-suggestion:hover {
  border-color: var(--primary);
}

#akashic-health-records-patient-portal-root .ahr-bk-suggestion__name {
  display: block;
  font-size: 13.5px;
  color: var(--ink-strong);
}

#akashic-health-records-patient-portal-root .ahr-bk-suggestion__why {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
}

/* A phone opens it as a sheet from the bottom, with the deck's 48px fields and targets. */
@media (max-width: 640px) {
  #akashic-health-records-patient-portal-root [data-slot="dialog-content"].ahr-desk-booking-dialog {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 86vh;
    border-radius: 14px 14px 0 0;
    transform: none;
    translate: none;
  }

  #akashic-health-records-patient-portal-root .ahr-receptionist-book-appointment {
    height: auto;
    max-height: 86vh;
  }

  #akashic-health-records-patient-portal-root .ahr-desk-booking-dialog > [data-slot="dialog-close"] {
    top: 5px;
    right: 4px;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
  }

  #akashic-health-records-patient-portal-root .ahr-bk-row {
    grid-template-columns: minmax(0, 1fr);
  }

  #akashic-health-records-patient-portal-root .ahr-bk-field,
  #akashic-health-records-patient-portal-root button.ahr-bk-field[data-slot="select-trigger"] {
    min-height: 48px;
    font-size: 15px;
  }

  #akashic-health-records-patient-portal-root textarea.ahr-bk-field {
    min-height: 74px;
  }

  #akashic-health-records-patient-portal-root label.ahr-bk-label,
  #akashic-health-records-patient-portal-root span.ahr-bk-label {
    font-size: 12.5px;
  }

  #akashic-health-records-patient-portal-root button.ahr-bk-ghost {
    display: flex;
    align-items: center;
    min-height: 48px;
    font-size: 14px;
  }

  /* A phone keeps the touch floor on the section and Book buttons. */
  #akashic-health-records-patient-portal-root .ahr-bk-card__title .btn {
    min-height: 44px;
  }

  #akashic-health-records-patient-portal-root .ahr-bk-card__title .ak-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  #akashic-health-records-patient-portal-root .ahr-bk-go .btn {
    min-height: 48px;
  }
}

#akashic-health-records-patient-portal-root .ahr-bk-assist--above {
  margin: 0 0 6px;
}

#akashic-health-records-patient-portal-root p.ahr-bk-note--above {
  margin: 0 0 6px;
}

#akashic-health-records-patient-portal-root .ahr-bk-task-action {
  min-width: 220px;
}

/* The host theme strips quote marks; the patient's own words are shown as a quotation. */
#akashic-health-records-patient-portal-root .ahr-bk-notice q {
  quotes: "\201C" "\201D";
}

#akashic-health-records-patient-portal-root .ahr-bk-notice q::before {
  content: open-quote;
}

#akashic-health-records-patient-portal-root .ahr-bk-notice q::after {
  content: close-quote;
}

/* The chosen patient as the clinician deck's .picked row: flush, ruled beneath, no box. */
#akashic-health-records-patient-portal-root .ahr-selected-patient {
  padding: 0 0 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
}

#akashic-health-records-patient-portal-root .ahr-selected-patient__label {
  margin-bottom: 2px;
  font-size: 11.5px;
  color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .ahr-selected-patient__name {
  font-size: 13.5px;
  color: var(--ink-strong);
}

#akashic-health-records-patient-portal-root .ahr-selected-patient__meta {
  font-size: 11.5px;
  color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .ahr-selected-patient + .ahr-booking-someone-else {
  margin-top: 13px;
  font-size: 13px;
  font-weight: 500;
}
