/*
  Mena Made customer account side: /account (signed out, sent, signed in), the sign-in link page,
  messages (list and one conversation, also the guest link /messages/:token), /contact and its
  thanks page, /account/subscriptions with its cancel page, and the public subscription plans and
  sign-up pages. Loaded after shop.css, which holds the page frame (CustomerPage) and the form panel.

  design/rules.md: no font-size, font-weight, font-family, letter-spacing or text-transform here.
  Text uses the five styles from base.css in the markup (h1, h2/h3, p, .t-small, .t-lead).
  Built only from the shared parts: the form panel (.cform), list rows with hairlines, form
  fields, the one .btn (plus .btn--danger on a confirm), and plain links. No pills, no dots,
  no left bars, no boxes that pop out.
*/

/* ---- Shared bits ---- */
/* Notices (Notice) and POST links (PostButton quiet, button.link-button) are plain text from base.css. */
/* A row of plain links under a section's text. */

.account-links { display: flex; flex-wrap: wrap; gap: var(--mm-space-2) var(--mm-space-5); }

/* ---- The account page ---- */
.account__new { margin: 0; }
.account__out { padding-top: var(--mm-space-4); border-top: var(--mm-rule); }

/* Past orders: list rows with hairlines. Number and details left; total and status words right; links below. */
.cpage .account-orders { list-style: none; margin: 0; padding: 0; }
.account-order {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--mm-space-4); row-gap: var(--mm-space-3);
  padding: var(--mm-space-4) 0; border-top: var(--mm-rule);
}
.account-order:last-child { border-bottom: var(--mm-rule); }
.account-order:first-child { border-top: 0; } /* the section head's hairline is the first rule */
.account-order__main { display: grid; gap: 2px; min-width: 0; }
.account-order__meta { color: var(--mm-ink-soft); }
.account-order__main p { overflow-wrap: anywhere; }
.account-order__side { display: grid; gap: 2px; justify-items: end; align-content: start; text-align: right; }
.account-order__total { font-variant-numeric: tabular-nums; white-space: nowrap; }
.account-order__off { display: block; color: var(--mm-ink-soft); white-space: normal; }
.account-order__status { color: var(--mm-ink-soft); }
.account-order__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--mm-space-2) var(--mm-space-5); }
@media (max-width: 479px) {
  .account-order { grid-template-columns: minmax(0, 1fr); }
  .account-order__side { grid-auto-flow: column; justify-content: start; justify-items: start; align-items: baseline; gap: var(--mm-space-4); text-align: left; }
}

/* Loyalty reward codes */
.reward-codes { list-style: none; padding: 0; display: grid; gap: 4px; }

/* ---- Contact ---- */
.contact-about { padding: var(--mm-space-3) 0; border-top: var(--mm-rule); border-bottom: var(--mm-rule); }
.cpage .inbox-form { margin: 0; }
.cpage .inbox-form textarea { min-height: 10rem; }
.cpage .inbox-form .input--short { max-width: 14rem; }

/* ---- Messages: the conversation list, as list rows ---- */
.messages-page__new { margin: 0; }
.cpage .inbox-threads { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-width: 44rem; }
.cpage .inbox-threads > .row-item { border-top: var(--mm-rule); }
.cpage .inbox-threads > .row-item:last-child { border-bottom: var(--mm-rule); }
.cpage .inbox-thread-link {
  display: grid; gap: 4px; padding: var(--mm-space-4) 0; min-height: 56px;
  background: none; border: 0; border-radius: 0; box-shadow: none; color: var(--mm-ink); text-decoration: none;
}
.cpage .inbox-thread-link:hover { border-color: transparent; }
.cpage .inbox-thread-link:hover .inbox-thread-link__topic { text-decoration: underline; text-underline-offset: 3px; }

/* ---- Messages: one conversation, as rows with hairlines; the customer's own indented ---- */
.cpage .msgs { max-width: 44rem; gap: 0; border-bottom: var(--mm-rule); }
.cpage .msg {
  background: none; border: 0; border-top: var(--mm-rule); border-radius: 0; margin: 0;
  padding: var(--mm-space-4) 0; gap: var(--mm-space-2);
}
.cpage .msg--mine { background: none; margin: 0; padding-left: var(--mm-space-5); }
.cpage .inbox-reply, .cpage .inbox-reply .field { max-width: var(--mm-reading-max); }
@media (max-width: 479px) { .cpage .msg--mine { padding-left: var(--mm-space-4); } }

/* ---- Bread subscriptions in the account ---- */
.subs-card { display: grid; gap: var(--mm-space-4); max-width: 44rem; scroll-margin-top: var(--mm-space-5); }
.subs-card__head { display: grid; gap: 4px; }
.subs-card__head .rule-head { margin-bottom: 0; }
.subs-card__status { color: var(--mm-ink-soft); }
.cpage .subs-card .kv > div:last-child { border-bottom: 0; }
.subs-box { display: grid; gap: var(--mm-space-2); padding-top: var(--mm-space-4); border-top: var(--mm-rule); }
.cpage .subs-box h3 { margin: 0; }
.subs-box .subs-action, .subs-box > form { margin-top: var(--mm-space-1); }
.subs-box.danger-zone { margin-top: var(--mm-space-3); }
.subs-due { display: grid; gap: var(--mm-space-3); justify-items: start; padding-top: var(--mm-space-4); border-top: var(--mm-rule); }
.subs-actions { display: flex; flex-wrap: wrap; gap: var(--mm-space-3) var(--mm-space-5); align-items: center; }
.subs-change { display: grid; gap: var(--mm-space-3); justify-items: start; padding-top: var(--mm-space-2); }
.subs-change .field { width: 100%; max-width: 24rem; }
.subs-change + .subs-change { margin-top: var(--mm-space-3); }
.cpage .subs-payments { border-top: 0; }
.cpage .subs-payments td:first-child { padding-right: var(--mm-space-3); width: 100%; }
.cpage .subs-payments td:nth-child(2) { white-space: nowrap; padding-right: var(--mm-space-4); }
.cpage .subs-payments tr:last-child td { border-bottom: 0; }
.subs-summary__list { list-style: none; padding: 0; display: grid; gap: var(--mm-space-2); }
.subs-summary__list li { display: flex; flex-wrap: wrap; gap: var(--mm-space-2) var(--mm-space-4); align-items: baseline; }
.subs-summary__status { color: var(--mm-ink-soft); }
.subs-none { display: grid; gap: var(--mm-space-4); }
@media (max-width: 479px) {
  .subs-box > .subs-action .btn, .subs-change .btn, .subs-due .btn { width: 100%; }
  .subs-change .btn { justify-self: stretch; }
}

/* ---- Subscription plans (public): list rows with hairlines, like the account's orders ---- */
.plans { list-style: none; padding: 0; margin: 0; display: grid; max-width: 48rem; }
.plan { display: grid; gap: var(--mm-space-4); padding: var(--mm-space-5) 0; border-top: var(--mm-rule); }
.plan:last-child { border-bottom: var(--mm-rule); }
.plan__body { display: grid; gap: var(--mm-space-2); min-width: 0; }
.plan__buy { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--mm-space-3); }
.plan__buy p { font-variant-numeric: tabular-nums; }
.plan__fees, .plan__full { color: var(--mm-ink-soft); }
@media (min-width: 640px) {
  .plan { grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--mm-space-6); align-items: start; }
  .plan__buy { flex-direction: column; align-items: flex-end; justify-content: flex-start; text-align: right; min-width: 10rem; }
}
@media (max-width: 479px) { .plan__buy .btn { width: 100%; } }

/* Practice payment card details (aria-hidden ruled rows) */
.practice-card-details { font-variant-numeric: tabular-nums; }

/* ---- Notifications (features/push/views.tsx): on the account page and the order page ---- */
/* Hidden until public/js/push.js finds a browser that can do web push; then plain text links. */
.push-box__actions { display: flex; flex-wrap: wrap; gap: var(--mm-space-2) var(--mm-space-5); }
.push-box [data-push-state] { margin: 0 0 var(--mm-space-2); }
.push-box[data-state="blocked"] .push-box__actions { display: none; }
