#akashic-health-records-patient-portal-root .register-portal-use {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

#akashic-health-records-patient-portal-root .register-portal-use legend {
  margin-bottom: 6px;
  padding: 0;
  font-size: 11.5px;
  font-weight: var(--ak-label-weight);
  line-height: 17.8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

#akashic-health-records-patient-portal-root label.register-portal-use__option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  cursor: pointer;
}

#akashic-health-records-patient-portal-root label.register-portal-use__option--selected {
  border-color: var(--primary);
  box-shadow: inset 3px 0 0 var(--primary);
}

#akashic-health-records-patient-portal-root label.register-portal-use__option input {
  margin-top: 3px;
  accent-color: var(--primary);
}

#akashic-health-records-patient-portal-root .register-portal-use__label {
  display: block;
  font-size: 13.5px;
  color: var(--ink-strong);
}

#akashic-health-records-patient-portal-root .register-portal-use__detail {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* The deck's drawn radio: a ring, thick and primary once chosen. The ring is --faint, not the
   deck's --line, which is too pale to meet the 3:1 floor for a control. */
#akashic-health-records-patient-portal-root label.register-portal-use__option input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 15px;
  height: 15px;
  min-height: 0;
  margin-top: 2px;
  padding: 0;
  border: 1.5px solid var(--faint);
  border-radius: 50%;
  background: var(--surface);
}

#akashic-health-records-patient-portal-root label.register-portal-use__option input[type="radio"]:checked {
  border: 4px solid var(--primary);
}

#akashic-health-records-patient-portal-root label.register-portal-use__option input[type="radio"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* The register dialog, from the receptionist deck's .ovsheet / .df / .dopt. */
#akashic-health-records-patient-portal-root [data-slot="dialog-content"].ahr-reg {
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 36px);
  gap: 12px;
  padding: 10px 14px 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

/* A scrolling body and a pinned footer, so Save stays in view while the form scrolls. */
#akashic-health-records-patient-portal-root .ahr-reg .ahr-reg__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
  overscroll-behavior: contain;
}

#akashic-health-records-patient-portal-root .ahr-reg > [data-slot="dialog-close"] {
  top: 16px;
  right: 14px;
}

#akashic-health-records-patient-portal-root .ahr-reg .ahr-reg__head {
  flex: none;
  padding: 10px 42px 0 14px;
  text-align: left;
}

#akashic-health-records-patient-portal-root .ahr-reg__form {
  display: grid;
  gap: 12px;
}

#akashic-health-records-patient-portal-root .ahr-reg__pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

#akashic-health-records-patient-portal-root .ahr-reg__field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

#akashic-health-records-patient-portal-root .ahr-reg .ahr-reg__label {
  font-size: 11.5px;
  font-weight: var(--ak-label-weight);
  line-height: 17.8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

#akashic-health-records-patient-portal-root .ahr-reg input:not([type="radio"]):not([type="checkbox"]),
#akashic-health-records-patient-portal-root .ahr-reg [data-slot="select-trigger"] {
  height: 37px;
  min-height: 0;
  padding: 7px 9px;
  border-radius: 5px;
  font-size: 13.5px;
  color: var(--ink-strong);
}

#akashic-health-records-patient-portal-root .ahr-reg .ahr-reg__error {
  padding: 10px 12px;
  border-left: 3px solid var(--danger);
  background: var(--red-soft);
  font-size: 12.5px;
  color: var(--danger);
}

#akashic-health-records-patient-portal-root .ahr-reg__matches {
  display: grid;
  gap: 4px;
}

#akashic-health-records-patient-portal-root .ahr-reg .ahr-reg__note {
  margin: 0;
  font-size: 12px;
  color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .ahr-reg .ahr-reg__foot {
  flex-wrap: wrap;
  padding: 12px 14px 16px;
}

#akashic-health-records-patient-portal-root .ahr-reg__foot .ahr-reg__error {
  flex: 1 0 100%;
}

#akashic-health-records-patient-portal-root .ahr-reg__foot .btn {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 2px;
  font-size: 13px;
}

/* A possible existing record: the deck's .dwarn, an amber note with its rule on the left. */
#akashic-health-records-patient-portal-root .ahr-dup {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--warning);
  background: var(--amber-soft);
  font-size: 12.5px;
  color: var(--ink);
}

#akashic-health-records-patient-portal-root .ahr-dup .ahr-dup__title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: var(--ak-heading-weight);
  color: var(--ink-strong);
}

#akashic-health-records-patient-portal-root .ahr-dup .ahr-dup__text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
}

#akashic-health-records-patient-portal-root .ahr-dup .ahr-dup__text--caution {
  color: var(--amber-ink);
}

#akashic-health-records-patient-portal-root .ahr-dup__fields {
  display: grid;
  gap: 2px;
  margin: 0;
}

#akashic-health-records-patient-portal-root .ahr-dup__field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

#akashic-health-records-patient-portal-root .ahr-dup__field dt {
  flex: none;
  width: 104px;
  color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .ahr-dup__field dd {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--ink-strong);
}

#akashic-health-records-patient-portal-root .ahr-dup__verdict {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .ahr-dup__verdict svg {
  width: 14px;
  height: 14px;
}

#akashic-health-records-patient-portal-root .ahr-dup__verdict--same {
  color: var(--ink-strong);
}

#akashic-health-records-patient-portal-root .ahr-dup__verdict--same svg {
  color: var(--sage-deep);
}

#akashic-health-records-patient-portal-root .ahr-dup__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

#akashic-health-records-patient-portal-root .ahr-dup__actions .btn {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 2px;
  font-size: 13px;
}

#akashic-health-records-patient-portal-root .ahr-dup .ahr-dup__note {
  margin: 0;
  font-size: 12px;
  color: var(--ink-muted);
}

/* A phone opens it as a sheet from under the header. */
@media (max-width: 640px) {
  #akashic-health-records-patient-portal-root [data-slot="dialog-content"].ahr-reg {
    top: 52px;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: none;
    border-radius: 14px 14px 0 0;
    transform: none;
    translate: none;
  }
}

/* The desk's own registrations: one row per receipt, wrapping on a narrow screen. */
#akashic-health-records-patient-portal-root .ahr-reg__receipts {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

#akashic-health-records-patient-portal-root .ahr-reg__receipt-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#akashic-health-records-patient-portal-root .ahr-reg__receipt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
