/* My account on phones and tablets: shell, navigation pills, notices, orders, wallet, order details, forms.
   Loaded after tmc-owner-clean-ui (see functions.php), account pages only. The Wins page has its own file
   (mobile-wins-ui.css). Keeps the site palette and type; desktop (>= 901px) keeps the sidebar layout.
   Specificity: the My account layers (style.css, myaccount-form-align.css, Additional CSS in the
   database) are heavy on !important, so every rule is scoped under body.woocommerce-account.logged-in
   and uses !important only where one of those layers sets the same property. */

body.woocommerce-account {
  --tmc-m-ink: #071426;
  --tmc-m-muted: #5b6b82;
  --tmc-m-line: #d8e0eb;
  --tmc-m-soft: #f3f7fc;
  /* white on #147cff is 3.9:1 (fails AA for 13px text); the owner clean-ui blue is 5.5:1 and is what the buttons use */
  --tmc-m-accent: var(--tmc-clean-blue, #086db1);
  --tmc-m-accent-deep: var(--tmc-clean-blue-hover, #07558b);
  --tmc-m-ok-bg: #e4f6ec;
  --tmc-m-ok: #0a6c37;
  --tmc-m-warn-bg: #fff2d1;
  --tmc-m-warn: #7a4d00;
  --tmc-m-bad-bg: #fde7e7;
  --tmc-m-bad: #9f1d1d;
  --tmc-m-info-bg: #e6f0ff;
  --tmc-m-info: #0b4fb3;
  --tmc-m-card-shadow: 0 1px 2px rgba(7, 20, 38, .05), 0 8px 22px rgba(7, 20, 38, .06);
}


/* ------------------------------------------------------------------ *
 * 1. Shell: frameless, symmetric 12px gutters (<= 900px)
 * ------------------------------------------------------------------ */
@media (max-width: 900px) {
  html body.woocommerce-account.woocommerce-account.logged-in .tmc-account-content-band > .tmc24-container {
    padding-inline: 12px !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .tmc40-content-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .tmc40-content-card > .woocommerce {
    display: block !important;
    width: 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content h2 {
    margin: 4px 0 6px !important;
    font-size: 24px !important;
    line-height: 1.12 !important;
    letter-spacing: 0 !important;
  }
}

/* ------------------------------------------------------------------ *
 * 2. Account navigation: every section as a pill in a two-column grid (<= 900px)
 * ------------------------------------------------------------------ */
@media (max-width: 900px) {
  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation {
    position: relative !important;
    top: auto !important;
    width: auto !important;
    max-width: none !important; /* the evidence page layer sets max-width:100% on the nav */
    height: auto !important;
    overflow: visible !important;
    margin: 0 -12px 8px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* Every section visible at once (owner 2026-10-12: a scrolled row hid most sections off-screen): a two-column grid. */
  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation ul {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 4px 12px 12px !important;
    overflow: visible !important;
    list-style: none !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation li {
    margin: 0 !important;
    min-width: 0 !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation li a {
    display: flex !important;
    width: 100% !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    min-height: 44px !important;
    padding: 6px 12px !important;
    border: 1px solid var(--tmc-m-line) !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: var(--tmc-m-ink) !important;
    box-shadow: 0 1px 2px rgba(7, 20, 38, .05) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    text-transform: none !important;
    white-space: normal !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation li a::before {
    content: none !important;
    display: none !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation li a:hover {
    border-color: var(--tmc-m-accent) !important;
    background: #eef5ff !important;
    color: var(--tmc-m-accent-deep) !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation li.is-active a,
  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation li a[aria-current="page"] {
    border-color: var(--tmc-m-accent) !important;
    background: var(--tmc-m-accent) !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(8, 109, 177, .30) !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation li a:focus-visible {
    outline: 3px solid rgba(8, 109, 177, .55) !important;
    outline-offset: 2px !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout a {
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--tmc-m-muted) !important;
  }
}

/* ------------------------------------------------------------------ *
 * 3. Notices inside the account area (<= 900px)
 * ------------------------------------------------------------------ */
@media (max-width: 900px) {
  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content .woocommerce-info,
  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content .woocommerce-message {
    display: grid !important;
    gap: 12px !important;
    margin: 0 0 16px !important;
    padding: 14px 16px !important;
    border-radius: 14px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.45 !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content .woocommerce-info > a.button,
  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content .woocommerce-message > a.button {
    order: 2;
    float: none !important;
    width: 100% !important;
    min-height: 44px !important;
    margin: 0 !important;
  }
}

/* ------------------------------------------------------------------ *
 * 3b. Buttons in the account area use the site's primary button (owner clean-ui tokens), not dark navy (<= 900px)
 * ------------------------------------------------------------------ */
@media (max-width: 900px) {
  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content :is(a.button, button.button, button.woocommerce-Button, a.tmc-card-cta, button.tmc-card-cta):not(.is-disabled):not(:disabled) {
    border-color: var(--tmc-clean-blue, #086db1) !important;
    border-radius: var(--tmc-clean-radius, 8px) !important;
    background: var(--tmc-clean-blue, #086db1) !important;
    color: #fff !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content :is(a.button, button.button, button.woocommerce-Button, a.tmc-card-cta, button.tmc-card-cta):not(.is-disabled):not(:disabled):hover {
    border-color: var(--tmc-clean-blue-hover, #07558b) !important;
    background: var(--tmc-clean-blue-hover, #07558b) !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content :is(a.button, button.button, button.woocommerce-Button, a.tmc-card-cta, button.tmc-card-cta):focus-visible {
    outline: 3px solid var(--tmc-clean-blue, #086db1);
    outline-offset: 3px;
  }
}

/* ------------------------------------------------------------------ *
 * 4. Orders list -> cards (<= 900px); WooCommerce hides the order number
 *    cell (th) on small screens, so the card brings it back as the headline.
 * ------------------------------------------------------------------ */
@media (max-width: 900px) {
  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: 0 !important;
    background: transparent !important;
    overflow: visible !important;
    white-space: normal !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table thead {
    display: none !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table tbody {
    display: grid !important;
    gap: 12px;
    width: 100% !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table tbody tr {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "num status"
      "date total"
      "act act";
    align-items: center;
    gap: 6px 12px;
    margin: 0 !important;
    padding: 14px !important;
    border: 1px solid var(--tmc-m-line) !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: var(--tmc-m-card-shadow);
    overflow: visible !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table tbody :is(th, td) {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--tmc-m-ink) !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
    text-align: left !important;
    white-space: normal !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table tbody :is(th, td)::before {
    content: none !important;
    display: none !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table .woocommerce-orders-table__cell-order-number {
    grid-area: num;
    font-size: 18px !important;
    font-weight: 800 !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table .woocommerce-orders-table__cell-order-number a {
    display: inline-block;
    margin-block: -10px;
    padding-block: 10px;
    color: var(--tmc-m-ink);
    text-decoration: none;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table .woocommerce-orders-table__cell-order-status {
    grid-area: status;
    padding: 5px 10px !important;
    border-radius: 999px !important;
    background: var(--tmc-m-info-bg) !important;
    color: var(--tmc-m-info) !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
  }

  /* Paid orders (processing, completed) show no status pill; refunded, cancelled, failed, pending and on-hold keep theirs.
     includes/account-order-status.php prints no status text for the paid rows, so the empty pill is removed here. */
  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table :is(tr.woocommerce-orders-table__row--status-processing, tr.woocommerce-orders-table__row--status-completed) .woocommerce-orders-table__cell-order-status {
    display: none !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table :is(tr.woocommerce-orders-table__row--status-failed, tr.woocommerce-orders-table__row--status-cancelled, tr.woocommerce-orders-table__row--status-refunded) .woocommerce-orders-table__cell-order-status {
    background: var(--tmc-m-bad-bg) !important;
    color: var(--tmc-m-bad) !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table tr.woocommerce-orders-table__row--status-on-hold .woocommerce-orders-table__cell-order-status,
  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table tr.woocommerce-orders-table__row--status-pending .woocommerce-orders-table__cell-order-status {
    background: var(--tmc-m-warn-bg) !important;
    color: var(--tmc-m-warn) !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table .woocommerce-orders-table__cell-order-date {
    grid-area: date;
    color: var(--tmc-m-muted) !important;
    font-size: 13px !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table .woocommerce-orders-table__cell-order-total {
    grid-area: total;
    color: var(--tmc-m-muted) !important;
    font-size: 12px !important;
    text-align: right !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table .woocommerce-orders-table__cell-order-total .woocommerce-Price-amount {
    display: block;
    color: var(--tmc-m-ink);
    font-size: 17px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions {
    grid-area: act;
    margin-top: 6px !important;
    padding-top: 12px !important;
    border-top: 1px solid var(--tmc-m-line) !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions a.button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-height: 44px !important;
    margin: 0 !important;
    border-radius: 12px !important;
  }
}

/* Orders table (> 900px): a page that only holds paid orders has nothing to report, so the Status column goes away
   instead of showing a blank one. A page with any other status keeps the column; paid rows are blank in it. */
@media (min-width: 901px) {
  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-orders-table:not(:has(tbody tr:not(.woocommerce-orders-table__row--status-processing):not(.woocommerce-orders-table__row--status-completed))) :is(.woocommerce-orders-table__header-order-status, .woocommerce-orders-table__cell-order-status) {
    display: none !important;
  }
}

/* ------------------------------------------------------------------ *
 * 5. Wallet ledger -> cards (<= 760px of its own box)
 * ------------------------------------------------------------------ */
body.woocommerce-account .tmc-wallet {
  container: tmcwallet / inline-size;
}

@container tmcwallet (max-width: 760px) {
  html body.woocommerce-account.woocommerce-account.logged-in .tmc-wallet-summary {
    align-items: center;
    min-height: 0 !important;
    margin: 0 0 14px;
    padding: 14px 16px;
    border: 1px solid var(--tmc-m-line);
    border-radius: 16px;
    background: var(--tmc-m-soft);
  }

  html body.woocommerce-account.woocommerce-account.logged-in .tmc-wallet-summary h2 {
    margin: 0 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--tmc-m-muted);
  }

  html body.woocommerce-account.woocommerce-account.logged-in .tmc-wallet-balance {
    min-height: 0 !important;
    font-size: 28px !important;
    font-weight: 800 !important;
    font-variant-numeric: tabular-nums;
    line-height: 1.1 !important;
  }
}

@container tmcwallet (max-width: 760px) {
  html body.woocommerce-account.woocommerce-account.logged-in table.tmc-wallet-ledger {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: 0 !important;
    background: transparent !important;
    overflow: visible !important;
    white-space: normal !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in table.tmc-wallet-ledger thead {
    display: none !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in table.tmc-wallet-ledger tbody {
    display: grid !important;
    gap: 10px;
  }

  html body.woocommerce-account.woocommerce-account.logged-in table.tmc-wallet-ledger tbody tr {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "what amount" "when amount";
    align-items: start;
    gap: 4px 12px;
    padding: 12px 14px !important;
    border: 1px solid var(--tmc-m-line) !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 1px 2px rgba(7, 20, 38, .04);
  }

  html body.woocommerce-account.woocommerce-account.logged-in table.tmc-wallet-ledger tbody td {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important; /* Additional CSS gives [class*="wallet"] a 110px min-height */
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--tmc-m-ink) !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere;
    white-space: normal !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in table.tmc-wallet-ledger tbody td:nth-child(1) {
    grid-area: when;
    color: var(--tmc-m-muted) !important;
    font-size: 12px !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in table.tmc-wallet-ledger tbody td:nth-child(2) {
    grid-area: amount;
    font-size: 17px !important;
    font-weight: 800 !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in table.tmc-wallet-ledger tbody td.is-credit {
    color: var(--tmc-m-ok) !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in table.tmc-wallet-ledger tbody td:nth-child(3) {
    grid-area: what;
    font-weight: 600 !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in table.tmc-wallet-ledger tbody td[colspan] {
    grid-column: 1 / -1;
    grid-area: auto;
    font-weight: 600 !important;
  }
}

/* ------------------------------------------------------------------ *
 * 6. Order details (view-order): fit the column, never clip it (<= 900px)
 * ------------------------------------------------------------------ */
@media (max-width: 900px) {
  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-table--order-details,
  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.order_details {
    display: table !important;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto;
    overflow: visible !important;
    white-space: normal !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-table--order-details :is(th, td) {
    padding: 12px !important;
    overflow-wrap: anywhere;
    font-size: 14px !important;
    white-space: normal !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-table--order-details :is(td.woocommerce-table__product-total, tfoot td) {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
  }

  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content table.woocommerce-table--order-details td.woocommerce-table__product-total {
    white-space: nowrap !important;
  }
}

/* ------------------------------------------------------------------ *
 * 7. Account forms (address, details, preferences) on phones
 * ------------------------------------------------------------------ */
@media (max-width: 560px) {
  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content form .form-row,
  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content form .form-row-first,
  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content form .form-row-last,
  html body.woocommerce-account.woocommerce-account.logged-in .woocommerce-MyAccount-content form .form-row-wide {
    float: none !important;
    clear: both;
    width: 100% !important;
    margin-inline: 0 !important;
  }
}

/* ------------------------------------------------------------------ *
 * 8. Desktop sidebar (>= 901px): same clean-ui item style as the pills (<= 900px grid).
 *    Keeps the sticky sidebar card and its 210px column; only the items change:
 *    no empty checkbox squares, sentence case, readable active item (white on
 *    --tmc-clean-blue = 5.5:1, was dark navy on #147cff = 4.1:1), 44px rows.
 * ------------------------------------------------------------------ */
@media (min-width: 901px) {
  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation ul {
    gap: 6px !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation li a {
    box-sizing: border-box;
    min-height: 44px !important;
    padding: 0 14px !important;
    border: 1px solid var(--tmc-m-line) !important;
    border-radius: var(--tmc-clean-radius, 8px) !important;
    background: #fff !important;
    color: var(--tmc-m-ink) !important;
    box-shadow: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
    text-transform: none !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation li a::before {
    content: none !important;
    display: none !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation li a:hover {
    border-color: var(--tmc-m-accent) !important;
    background: #eef5ff !important;
    color: var(--tmc-m-accent-deep) !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation li.is-active a,
  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation li a[aria-current="page"] {
    border-color: var(--tmc-m-accent) !important;
    background: var(--tmc-m-accent) !important;
    color: #fff !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation li a:focus-visible {
    outline: 3px solid rgba(8, 109, 177, .55) !important;
    outline-offset: 2px !important;
  }

  html body.woocommerce-account.woocommerce-account.logged-in nav.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout a:not(:hover) {
    border-color: transparent !important;
    background: transparent !important;
    color: var(--tmc-m-muted) !important;
  }
}
