/* My Account (#477): every endpoint, signed in and signed out, in the Front Porch look. Markup: page-my-account.php and
   woocommerce/myaccount/*.php (inc/pages/account.php). WooCommerce's own markup is the shared layer's,
   pages/woocommerce.css (#479), which prints first: notices, woocommerce_form_field() rows and inputs, the select
   chevron, show password and the strength meter, buttons, tables and their phone cards, order details and addresses,
   the payment box and card form, the Digital Files table. This file holds only what is My Account's own (layout and
   tabs, dashboard, status labels, the order summary, updates and tracking, address cards, form layout, the signed-out
   panels) and a few adjustments to the shared layer for this page, each with its reason. Never copy a shared rule here:
   dev-test-my-account.sh fails on a declaration this file repeats. Everything is scoped to .ma (the page's <main>);
   shared components (.btn, .chip, .empty, .crumbs, .pg-h) are used, never restyled. Phones first: tabs as a scrolling
   chip row (every chip, wrapped, on the dashboard); from 900 px the tabs sit in a column beside the page. */

.ma-h { padding-bottom: 18px; }
.ma-wc { padding-bottom: 8px; }
.ma .woocommerce > p:empty { display: none; }

/* ---------- layout + tabs ---------- */
.ma-grid { display: grid; gap: 22px; }
.ma-c { min-width: 0; }
.ma-nav { min-width: 0; }
.ma-nav-hi { display: none; }
.ma-nav ul { display: flex; gap: 8px; overflow-x: auto; margin-right: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px 2px; scrollbar-width: thin; }
.ma-nav li { flex: none; }
.ma-nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--white); color: var(--navy); font-weight: 600; font-size: .92rem; white-space: nowrap; text-decoration: none; }
.ma-nav a:hover { border-color: var(--roof); text-decoration: none; }
.ma-nav a .ic { width: 18px; height: 18px; color: var(--roof); }
.ma-nav a[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.ma-nav a[aria-current="page"] .ic { color: var(--white); }
/* The dashboard is where a phone visitor picks a section, so there every tab shows, wrapped, rather than a row that
   scrolls sideways; the dashboard repeats none of them below (preview note #42: no tiles). Other tabs keep the row. */
@media (max-width: 899px) {
	.ma--dashboard .ma-nav ul { flex-wrap: wrap; overflow: visible; margin-right: 0; padding-right: 2px; }
}

@media (min-width: 900px) {
	.ma-grid { grid-template-columns: 236px minmax(0, 1fr); gap: 48px; align-items: start; }
	.ma-nav { position: sticky; top: calc(var(--hdr-h) + 16px); }
	.ma-nav-hi { display: block; font: 400 1.2rem/1.3 var(--serif); color: var(--navy); padding: 0 0 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
	.ma-nav ul { display: grid; gap: 2px; overflow: visible; margin: 0; padding: 0; }
	.ma-nav a { display: flex; width: 100%; border: 0; border-left: 3px solid transparent; border-radius: 0 4px 4px 0; padding: 0 12px; font-size: .98rem; white-space: normal; }
	.ma-nav a:hover { background: var(--mist); }
	.ma-nav a[aria-current="page"] { background: var(--mist); border-left-color: var(--brick); color: var(--navy); }
	.ma-nav a[aria-current="page"] .ic { color: var(--roof); }
	.ma-nav .ma-nav-out { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
	.ma-nav .ma-nav-out a { color: var(--muted); }
}

/* ---------- section heads, small text ---------- */
.ma-sec { margin-top: 30px; }
.ma-sec:first-child { margin-top: 0; }
.ma-sec-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
/* one heading size for every h2 on the page, WooCommerce's and the plugin's titles included (the shared layer's 1.35rem
   suits the checkout's narrower columns) */
.ma-sec h2, .ma-c > h2, .ma .woocommerce-order-details__title, .ma .woocommerce-column__title, .ma .woocommerce-order-downloads__title, .ma .hwb-digital-files h2, .ma-track h2, .ma-form > h2 { font-size: 1.45rem; }
.ma-sec h2, .ma-c > h2, .ma .hwb-digital-files h2, .ma-track h2, .ma-form > h2 { margin: 0 0 10px; }
.ma-sec-h h2 { margin: 0; }
.ma .more { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; white-space: nowrap; }
.ma .more .ic { width: 18px; height: 18px; }
.ma-hi { font: 400 1.35rem/1.3 var(--serif); color: var(--navy); margin-bottom: 22px; }
.ma-hi .note { display: block; font: 400 .9rem/1.5 var(--sans); margin-top: 4px; }
.ma-hi .note a { text-decoration: underline; text-underline-offset: 3px; }
.ma-hi-e { color: var(--navy); overflow-wrap: anywhere; } /* the email a new account is greeted by (note #40) */
.ma-lede { color: var(--muted); max-width: 62ch; margin-bottom: 16px; }
.ma-hint { display: block; font-size: .86rem; color: var(--muted); margin-top: 2px; }
.ma-help { margin-top: 28px; }
.ma-help a { text-decoration: underline; text-underline-offset: 3px; }
.ma-back { margin-top: 26px; }
.ma-back a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; }
.ma-back .ic { width: 18px; height: 18px; }
.ma-empty { margin: 0; }
.ma-empty p { max-width: 46ch; color: var(--muted); }
.ma-empty .btn { margin-top: 4px; }

/* ---------- order status ---------- */
.ma-st { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; line-height: 1.5; white-space: nowrap; background: var(--mist-2); color: var(--navy); }
.ma-st--done { background: var(--garden-t); color: var(--garden); }
.ma-st--act { background: var(--brick-t); color: var(--brick); }
.ma-st--off { background: var(--mist); color: var(--muted); }

/* ---------- dashboard ---------- */
.ma-rl { border-top: 1px solid var(--line); }
.ma-rl li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "n d s" "t t t"; gap: 4px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ma-rl-n { grid-area: n; font-weight: 700; display: inline-flex; align-items: center; min-height: 44px; }
.ma-rl-d { grid-area: d; color: var(--muted); font-size: .92rem; }
.ma-rl .ma-st { grid-area: s; }
.ma-rl-t { grid-area: t; }
@media (min-width: 640px) {
	.ma-rl li { grid-template-columns: 90px minmax(0, 1fr) auto 150px; grid-template-areas: "n d s t"; }
	.ma-rl-t { text-align: right; }
}

/* ---------- tables: the shared layer's .shop_table; the orders list's own parts ---------- */
.ma-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ma-acts .btn { min-height: 40px; padding: 0 14px; font-size: .9rem; }
.ma-orders tbody th a { font-weight: 700; display: inline-flex; align-items: center; min-height: 40px; }
.ma-orders td, .ma-orders tbody th { vertical-align: middle; }
.ma-pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.ma .order-again { margin-top: 14px; }

/* phones: the shared layer's cards, with a cell's values together at the right edge after its label (the shared cards
   spread them apart: an order's total and its item count would sit at opposite ends of the row) */
@media (max-width: 699px) {
	.ma .shop_table_responsive tbody th, .ma .shop_table_responsive tbody td { justify-content: flex-end; }
	.ma .shop_table_responsive [data-title]::before { margin-right: auto; }
	.ma .shop_table_responsive td > .note { margin-left: -6px; }
	.ma .shop_table_responsive .ma-acts { justify-content: flex-end; }
}

/* ---------- one order ---------- */
.ma-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; padding: 16px 18px; background: var(--mist); border-radius: 8px; margin-bottom: 26px; }
.ma-sum dt { font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ma-sum dd { margin: 2px 0 0; font-weight: 600; color: var(--navy); }
.ma-sum .note { font-weight: 400; }
@media (min-width: 760px) { .ma-sum { grid-template-columns: auto auto auto 1fr; gap: 14px 36px; } }
.ma-notes ol { display: grid; gap: 10px; }
.ma-notes li { border-left: 3px solid var(--roof); background: var(--mist); border-radius: 0 6px 6px 0; padding: 10px 14px; }
.ma-notes .meta { font-size: .82rem; color: var(--muted); font-weight: 600; }
.ma-notes .description p { margin-top: 4px; }
.ma-track { margin: 30px 0 28px; }
.ma-track:first-child { margin-top: 0; }
.ma-track-l { display: grid; gap: 10px; }
.ma-track-l li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; border: 1.5px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.ma-track-i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--mist); color: var(--roof); flex: none; }
.ma-track-t { display: grid; gap: 1px; flex: 1 1 180px; min-width: 0; }
.ma-track-t b { color: var(--navy); }
.ma-track-n { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ma-track-a { flex: none; }
/* spacing between WooCommerce's and the plugin's blocks on an order */
.ma .woocommerce-order-details { margin-bottom: 26px; }
.ma .hwb-digital-files { margin: 22px 0 0; }

/* ---------- addresses (the Addresses tab's cards; an order's addresses are the shared layer's) ---------- */
.ma-addrs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 700px) { .ma-addrs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ma-addr { display: flex; flex-direction: column; gap: 10px; border: 1.5px solid var(--line); border-radius: 8px; padding: 16px 18px; line-height: 1.55; overflow-wrap: anywhere; }
.ma-addr h2 { font-size: 1.3rem; margin: 0; }
.ma-addr address { font-style: normal; flex: 1; }
.ma-addr p:last-child { margin-top: 4px; }

/* ---------- forms: layout (the rows, fields and password tools are the shared layer's) ---------- */
.ma-form { max-width: 640px; }
.ma-form > h2 { margin-bottom: 4px; }
.ma-req { margin-bottom: 16px; }
.ma-req .required { color: var(--brick); text-decoration: none; border: 0; font-weight: 700; } /* outside a form row */
.ma-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
/* rows are spaced by the .ma-fields grid and the rule below, not by the shared layer's bottom margin */
.ma .form-row { margin: 0; }
.ma-form > .form-row + .form-row, .ma-pw .form-row + .form-row, .ma-pw .hwb-email-change-note + .form-row { margin-top: 16px; }
@media (min-width: 600px) {
	.ma-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.ma-fields > .form-row { grid-column: 1 / -1; }
	.ma-fields > .form-row-first { grid-column: 1; }
	.ma-fields > .form-row-last { grid-column: 2; }
}
.ma-pw { border: 0; padding: 0; margin: 28px 0 0; min-width: 0; }
.ma-pw legend { padding: 0; font: 400 1.3rem/1.3 var(--serif); color: var(--navy); }
.ma-pw > legend + .form-row { margin-top: 12px; }
.ma-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 22px; }
.ma-actions .btn { min-height: 48px; padding: 0 24px; font-size: 1rem; }
/* WooCommerce's strength meter disables Save while a new password is weak: the shared layer's filled submit button
   (button.button[type="submit"]) outranks its own :disabled look, so it's set again here */
.ma .ma-actions button:disabled, .ma button[type="submit"]:disabled { background: var(--faint); border-color: var(--faint); color: var(--white); cursor: not-allowed; }

/* ---------- signed out: log in, create an account, lost and reset password ---------- */
.ma-auth { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 520px; }
.ma-auth--2 { max-width: none; }
@media (min-width: 800px) { .ma-auth--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; } }
.ma-panel { border: 1.5px solid var(--line); border-radius: 8px; padding: 22px 20px; background: var(--white); min-width: 0; }
.ma-panel--new { background: var(--mist); border-color: var(--mist); }
.ma-panel--one { max-width: 560px; }
.ma-panel > h2 { font-size: 1.5rem; margin-bottom: 14px; }
.ma-panel .ma-form { max-width: none; }
/* the panel is the box: no second one from the shared stylesheet's page-level log-in form */
.ma-panel form.woocommerce-form-login, .ma-panel form.woocommerce-form-register { border: 0; border-radius: 0; padding: 0; margin: 0; background: none; max-width: none; }
.ma-panel form.woocommerce-form-login > p:first-child { color: inherit; font-size: inherit; margin-bottom: 0; }
.ma-panel .form-row + .form-row { margin-top: 16px; }
.ma-remember { margin-top: 10px !important; }
.ma-panel .ma-actions { margin-top: 12px; }
.ma-panel .ma-actions .btn { width: 100%; }
.ma .woocommerce-privacy-policy-text { margin-top: 12px; }
@media (max-width: 560px) {
	.ma-panel { padding: 18px 16px; }
}

/* ---------- add payment method (WooCommerce's form; the card fields are Authorize.Net's, styled by the shared layer) ---------- */
.ma #add_payment_method { max-width: 640px; }
.ma #add_payment_method .form-row { margin-top: 16px; }
.ma #place_order { min-height: 48px; padding: 0 24px; } /* the size of this page's other form buttons (.ma-actions) */

/* the plugin's Digital Files tab prints its own "Digital Files" heading under the page's h1 */
.ma--digital-files .ma-c > h2:first-of-type { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 560px) {
	.ma-h h1 { font-size: 2rem; }
	.ma-sec h2, .ma-c > h2, .ma .woocommerce-order-details__title, .ma .woocommerce-column__title, .ma-track h2, .ma-form > h2 { font-size: 1.3rem; }
}

/* the dashboard greets by name in its own heading: the sidebar doesn't repeat it there */
.ma--dashboard .ma-nav-hi { display: none; }
