/* Bills & payments, drawn from the approved patient-portal deck (#s-bills-and-payments).
   Deck weights are read through the 2026-09-09 scale: the deck's 500 is bold (400) for a heading or
   a figure and label (350) for a status word; its 400 is body (300). */

/* The view title and its line, as the deck's .view-title and .view-sub: the shared page title
   (.ak-page-title / __sub) draws both; this only stacks them. */
#akashic-health-records-patient-portal-root .ahr-bills-head {
  display: grid;
}

/* ── The list: one lifted card per bill, three lines at every width ─────────────────────────── */
#akashic-health-records-patient-portal-root .ahr-list-card.ahr-bill-row {
  display: grid;
  gap: 2px;
  width: 100%;
  min-width: 0;
  text-align: left;
  cursor: pointer;
}
#akashic-health-records-patient-portal-root .ahr-bill-l1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
#akashic-health-records-patient-portal-root .ahr-bill-org {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#akashic-health-records-patient-portal-root .ahr-bill-l3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
#akashic-health-records-patient-portal-root .ahr-bill-date {
  white-space: nowrap;
}
#akashic-health-records-patient-portal-root .ahr-bill-money {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
#akashic-health-records-patient-portal-root .ahr-bill-amount {
  font-size: 15px;
  font-weight: var(--ak-heading-weight);
  color: var(--ink-strong);
}
/* Amber means owed: past due or part paid (deck .stk:has(.st.due|.st.part) .mn b). */
#akashic-health-records-patient-portal-root .ahr-bill-amount[data-owed] {
  color: var(--warning);
}
#akashic-health-records-patient-portal-root .ahr-bill-remaining {
  font-size: 11px;
  color: var(--ink-muted);
}

/* The status word: 13px beside a 17px mark, italic in a row, upright in the bill's header. */
#akashic-health-records-patient-portal-root .ahr-bill-mark {
  gap: 4px;
  font-size: 13px;
  font-weight: var(--ak-label-weight);
}
#akashic-health-records-patient-portal-root .ahr-bill-l1 .ahr-bill-mark {
  font-style: italic;
}
#akashic-health-records-patient-portal-root .ahr-bill-l1 .ahr-bill-mark[data-state="paid"] {
  color: var(--sage-deep);
}

/* ── Not asked yet ─────────────────────────────────────────────────────────────────────────────── */
#akashic-health-records-patient-portal-root .ahr-bill-soft {
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--paper);
  font-size: 13px;
  color: var(--ink-muted);
}
/* Failed is the shared error notice (ui/alert) and not allowed is the shared panel card, so neither
   has a rule here. */

/* ── The bill, opened ───────────────────────────────────────────────────────────────────────── */
/* Two classes on the slot so this beats the shared dialog rule's max-content width. 380px is the
   deck's invoice overlay (#s-bills-and-payments, laptop). */
#akashic-health-records-patient-portal-root [data-slot="dialog-content"].ahr-bill-dialog {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 380px;
  min-width: 0;
  max-width: calc(100vw - 2rem);
  max-height: 85vh;
  padding: 0;
  overflow: hidden;
  border-color: var(--line);
  border-radius: 8px;
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog-top {
  flex: none;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 8px 12px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog-ttl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog-x {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  color: var(--ink-muted);
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog-x:hover {
  background: var(--sunken);
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog-x svg {
  width: 18px;
  height: 18px;
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog-body {
  min-height: 0;
  padding: 12px;
  overflow-y: auto;
}

/* The body's blocks sit 12px apart; the lines and their totals are one block, 8px between. */
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail {
  display: grid;
  gap: 12px;
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail > *,
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-lines > *,
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-lines > * > *,
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-paid > *,
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-totals > * {
  margin-block: 0;
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-label {
  display: block;
  margin: 13px 0 6px;
  font-size: 13px;
  font-weight: var(--ak-heading-weight);
  color: var(--ink-strong);
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-box {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--ak-card-radius);
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-box > * {
  border-color: var(--line-soft);
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-line {
  gap: 12px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink-strong);
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-line > :last-child {
  flex: none;
  font-variant-numeric: tabular-nums;
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-totals {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-sum {
  font-size: 13px;
  color: var(--ink-muted);
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-total {
  font-size: 15px;
  color: var(--ink-strong);
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-total > :first-child {
  font-size: 15px;
  font-weight: var(--ak-body-weight);
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-total > :last-child {
  font-size: 18px;
  font-weight: var(--ak-heading-weight);
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-paid {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-paid-sum {
  gap: 8px;
  font-size: 13px;
  color: var(--ink-strong);
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-paid-sum [data-slot="invoice-status"] {
  gap: 4px;
  font-size: 13px;
  font-weight: var(--ak-label-weight);
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-payment {
  padding: 6px 12px;
  font-size: 13px;
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-note {
  padding: 8px 12px;
  border-radius: var(--ak-card-radius);
  background: var(--paper);
  font-size: 13px;
  color: var(--ink-muted);
}
/* "Payment amount:" is the deck's small uppercase field label (.flab) beside a 96px field. */
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-amount {
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--ak-card-radius);
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-amount-label {
  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-bill-dialog .invoice-detail-amount-field {
  width: 96px;
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-amount-field > span {
  font-size: 13px;
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-amount-field input {
  padding-left: 20px;
}
#akashic-health-records-patient-portal-root .ahr-bill-dialog .invoice-detail-foot {
  gap: 8px;
  padding-top: 2px;
}

