/* A shared home for the patient's balance, payment methods and payment history. */
.finance-view { min-width: 0; }
.finance-account-tag { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid #dce7ef; border-radius: 999px; color: #52708a; background: #fff; font-size: 11px; line-height: 1.5; }
.finance-account-tag .icon { width: 16px; height: 16px; flex-shrink: 0; }
.finance-summary-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,.85fr); align-items: start; gap: 24px; margin-bottom: 30px; }
.finance-summary-grid > * { min-width: 0; }
.finance-summary-grid .records-finance-methods { margin: 0; }
.finance-history-switch { display: flex; width: fit-content; max-width: 100%; gap: 5px; padding: 5px; margin-bottom: 20px; background: #edf3f8; border: 1px solid #e0e9f1; border-radius: 15px; }
.finance-history-switch > button { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; min-width: 0; padding: 11px 18px; border: 1px solid transparent; border-radius: 11px; color: #566e83; font-size: 13px; font-weight: 600; line-height: 1.5; white-space: normal; }
.finance-history-switch > button > .icon { width: 18px; height: 18px; flex-shrink: 0; }
.finance-history-switch > button[aria-pressed="true"] { background: #fff; color: #204e7c; border-color: #d6e3ee; box-shadow: 0 2px 7px #24436109; }
.finance-history-switch > button:hover { color: #174d80; }
.finance-history-switch > button:focus-visible { outline: 3px solid #2270b6; outline-offset: 3px; }
.finance-history-content { min-width: 0; }
.finance-view .wallet-history { margin-top: 0; }
.finance-view .wallet-hero { border-radius: 20px; }

/* Appointment actions remain recognisable buttons at every screen size. */
.appointment-row:not(.compact) { display: grid; grid-template-columns: 54px minmax(0,1fr) auto; gap: 16px 18px; align-items: start; padding: 24px 0; }
.appointment-row:not(.compact) .appointment-details { min-width: 0; }
.appointment-row:not(.compact) .appointment-details h3 { overflow-wrap: anywhere; line-height: 1.6; }
.appointment-row:not(.compact) .appointment-details p { overflow-wrap: anywhere; line-height: 1.7; }
.appointment-row:not(.compact) .appointment-time { padding-top: 3px; max-width: 210px; }
.appointment-row:not(.compact) .appointment-row-actions { grid-column: 2 / -1; display: flex; flex-direction: row; justify-content: flex-start; align-items: stretch; gap: 10px; width: auto; margin: 0; }
.appointment-row-actions > .appointment-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 11px 16px; border: 1px solid; border-radius: 12px; font-size: 13px; font-weight: 600; line-height: 1.5; text-align: center; white-space: normal; text-decoration: none; transition: background .15s,border-color .15s; }
.appointment-row-actions > .appointment-action > .icon { width: 18px; height: 18px; flex: 0 0 18px; }
.appointment-row-actions > .appointment-action > span { min-width: 0; }
.appointment-row-actions > .appointment-action-details { color: #245d8e; background: #edf5fc; border-color: #c9ddeb; }
.appointment-row-actions > .appointment-action-details:hover { background: #e0eef9; border-color: #88b3d6; }
.appointment-row-actions > .appointment-action-cancel { color: #923d35; background: #fff8f5; border-color: #e4c7bf; }
.appointment-row-actions > .appointment-action-cancel:hover { background: #fcece6; border-color: #bd8a7d; }
.appointment-row-actions > .appointment-action:focus-visible { outline: 3px solid #2270b6; outline-offset: 3px; }
.appointment-row-actions > .appointment-action:disabled { opacity: .6; cursor: wait; }

@media (max-width: 1100px) {
  .finance-summary-grid { grid-template-columns: minmax(0,1fr); gap: 20px; }
}
@media (max-width: 680px) {
  .finance-view > .portal-page-heading { gap: 14px; }
  .finance-account-tag { font-size: 11px; }
  .finance-summary-grid { gap: 18px; margin-bottom: 22px; }
  html:not(.vision-mode) .finance-view .wallet-filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); overflow: visible; gap: 5px; }
  html:not(.vision-mode) .finance-view .wallet-filters > button { min-width: 0; padding-inline: 4px; white-space: normal; }
  .finance-history-switch { width: 100%; margin-bottom: 16px; }
  .finance-history-switch > button { flex: 1; padding: 10px 8px; gap: 7px; min-height: 48px; font-size: 12px; }
  .finance-history-switch > button > .icon { width: 17px; height: 17px; }
  .appointment-row:not(.compact) { grid-template-columns: 44px minmax(0,1fr); gap: 10px 14px; padding: 21px 0; }
  .appointment-row:not(.compact) .appointment-details > h3 { font-size: 14px; margin-top: 3px; }
  .appointment-row:not(.compact) .appointment-details > p { font-size: 12px; }
  .appointment-row:not(.compact) .appointment-time { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 8px; max-width: 100%; padding: 0; }
  .appointment-row:not(.compact) .appointment-time > strong { font-size: 17px; }
  .appointment-row:not(.compact) .appointment-time > .pill { font-size: 10px; }
  .appointment-row:not(.compact) .appointment-row-actions { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.3fr); gap: 9px; margin-top: 5px; }
  .appointment-row:not(.compact) .appointment-row-actions > .appointment-action { min-width: 0; width: 100%; min-height: 48px; padding: 11px 8px; font-size: 12px; }
  .appointment-row:not(.compact) .appointment-row-actions > .appointment-action:only-child { grid-column: 1 / -1; }
}
@media (max-width: 360px) {
  .finance-history-switch { flex-direction: column; }
  .finance-history-switch > button { justify-content: flex-start; padding-inline: 12px; }
  .appointment-row:not(.compact) .appointment-row-actions { grid-template-columns: minmax(0,1fr); }
}
html.vision-mode .finance-account-tag { background: #fff!important; border: 1px solid #111!important; border-radius: 8px; }
html.vision-mode .finance-summary-grid { grid-template-columns: minmax(0,1fr); }
html.vision-mode .finance-history-switch { width: 100%; background: #fff!important; border: 1px solid #111; }
html.vision-mode .finance-history-switch > button { border: 1px solid #111; box-shadow: none; }
html.vision-mode .finance-history-switch > button[aria-pressed="true"],
html.vision-mode .finance-history-switch > button[aria-pressed="true"] > span { background: #111!important; color: #fff!important; }
html.vision-mode .finance-history-switch > button[aria-pressed="true"] > .icon { color: #fff!important; }
html.vision-mode .appointment-row:not(.compact) { grid-template-columns: 56px minmax(0,1fr); }
html.vision-mode .appointment-row:not(.compact) .appointment-time { grid-column: 2; align-items: flex-start; justify-self: start; max-width: 100%; }
html.vision-mode .appointment-row:not(.compact) .appointment-row-actions { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
html.vision-mode .appointment-row-actions > .appointment-action { justify-content: center; min-height: 50px; width: 100%; background: #fff!important; color: #111!important; border: 2px solid #111!important; }
html.vision-mode .appointment-row-actions > .appointment-action:focus-visible { outline-color: #111!important; }
@media (max-width: 680px) {
  html.vision-mode .finance-history-switch { flex-direction: column; }
  html.vision-mode .finance-history-switch > button { justify-content: flex-start; }
  html.vision-mode .appointment-row:not(.compact) .appointment-time { align-items: flex-start; flex-direction: column; }
}
