:root {
  --profile-line: #e8d9c7;
  --profile-paper: #fffdf9;
  --profile-muted: #746e67;
}

/* Phase 22-12: cancelled-order receipt state */
.receipt-status.voided {
  color: #756d67;
}

.profile-page-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 18%, rgba(201, 163, 78, 0.1), transparent 22%),
    radial-gradient(circle at 92% 42%, rgba(63, 167, 163, 0.09), transparent 25%),
    var(--cream);
}

.profile-header-store {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 13px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  color: #fff;
  font-size: 0.8125rem;
}

.profile-header-search {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.5rem;
}

.profile-auth-gate {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
  padding: 45px 20px;
}

.profile-auth-gate[hidden],
.profile-main[hidden] {
  display: none;
}

.profile-auth-gate section {
  width: min(520px, 100%);
  padding: 45px 32px;
  border: 1px solid var(--profile-line);
  border-radius: 20px;
  background: var(--profile-paper);
  box-shadow: var(--shadow);
  text-align: center;
}

.profile-auth-gate section > span {
  color: var(--gold);
  font-size: 1.9375rem;
}

.profile-auth-gate h1 {
  margin: 5px 0;
  color: var(--teal-dark);
  font-size: 1.5625rem;
}

.profile-auth-gate p {
  margin: 0 0 18px;
  color: var(--profile-muted);
  font-size: 0.9375rem;
}

.profile-main {
  width: min(1180px, calc(100% - 40px));
  margin: 38px auto 75px;
}

.profile-hero {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  min-height: 205px;
  padding: 34px 40px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at 8% 25%, rgba(255, 255, 255, 0.18) 0 2px, transparent 3px),
    linear-gradient(125deg, var(--teal-dark), var(--teal));
  color: #fff;
  box-shadow: 0 20px 55px rgba(45, 127, 124, 0.22);
}

.profile-hero::after {
  content: "✥";
  position: absolute;
  left: 6%;
  bottom: -74px;
  color: rgba(255, 255, 255, 0.08);
  font-size: 11.875rem;
  line-height: 1;
}

.profile-avatar {
  position: relative;
  z-index: 1;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 2.25rem;
  font-weight: 700;
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.06);
}

.profile-hero > div:nth-child(2) {
  position: relative;
  z-index: 1;
}

.profile-hero span {
  color: #f2d690;
  font-size: 0.875rem;
  font-weight: 700;
}

.profile-hero h1 {
  margin: 4px 0;
  font-size: 2.125rem;
  line-height: 1.3;
}

.profile-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.9375rem;
}

.profile-hero-summary-item {
  display: inline;
}

.profile-hero-summary-item + .profile-hero-summary-item::before {
  content: " · ";
}

@media (min-width: 541px) {
  #profileHeroSummary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  .profile-hero-summary-name { order: 1; }
  .profile-hero-summary-mobile { order: 2; }

  .profile-hero-summary-email {
    order: 3;
    flex-basis: 100%;
    margin-top: 1px;
  }

  .profile-hero-summary-item + .profile-hero-summary-item::before {
    content: none;
  }

  .profile-hero-summary-mobile::before {
    content: " · ";
  }
}

.profile-hero > a {
  position: relative;
  z-index: 1;
  min-width: 125px;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.875rem;
}

.profile-section-nav {
  position: sticky;
  top: 112px;
  z-index: 12;
  display: flex;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  margin: -21px auto 28px;
  padding: 7px;
  border: 1px solid rgba(63, 167, 163, 0.2);
  border-radius: 13px;
  background: rgba(255, 253, 249, 0.95);
  box-shadow: 0 12px 35px rgba(45, 80, 74, 0.12);
  backdrop-filter: blur(12px);
}

.profile-section-nav a,
.profile-section-nav button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 15px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--teal-dark);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.profile-section-nav a:hover,
.profile-section-nav button:hover {
  background: rgba(63, 167, 163, 0.1);
}

.profile-section-nav .active,
.profile-section-nav [aria-selected="true"] {
  color: #fff;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  box-shadow: 0 7px 18px rgba(45, 127, 124, 0.22);
}

.profile-view[hidden] { display: none !important; }

.profile-card {
  scroll-margin-top: 170px;
  margin-bottom: 24px;
  padding: 28px 30px;
  border: 1px solid var(--profile-line);
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 14px 44px rgba(72, 64, 53, 0.07);
}

.profile-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--profile-line);
}

.profile-card-heading span {
  color: var(--gold);
  font-size: 0.8125rem;
  font-weight: 700;
}

.profile-card-heading h2 {
  margin: 2px 0;
  color: var(--teal-dark);
  font-size: 1.75rem;
}

.profile-card-heading p {
  margin: 0;
  color: var(--profile-muted);
  font-size: 0.875rem;
}

.profile-card-heading > i {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border: 1px solid rgba(201, 163, 78, 0.35);
  border-radius: 50%;
  color: var(--gold);
  font-size: 1.4375rem;
  font-style: normal;
}

.profile-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.profile-form label {
  display: grid;
  gap: 6px;
  color: #504c47;
  font-size: 0.875rem;
  font-weight: 700;
}

.profile-form input,
.profile-form textarea {
  width: 100%;
  min-height: 47px;
  padding: 9px 12px;
  border: 1px solid #d9cbbc;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 0.875rem;
}

.profile-form textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.9;
}

.profile-form-address {
  grid-column: 1 / -1;
}

.profile-form-address-details {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  align-items: end;
}

.profile-form-address-details > .btn {
  grid-column: 1 / -1;
  justify-self: end;
  width: min(220px, 100%);
  min-height: 46px;
  margin: 4px auto 0 0;
  text-align: center;
  font-size: 0.875rem;
}

@media (min-width: 901px) {
  .profile-form-address-details {
    display: flex;
    align-items: flex-end;
  }

  .profile-form-address-details > label {
    flex: 0 0 140px;
  }

  .profile-form-address-details > .btn {
    flex: 0 0 220px;
    width: 220px;
    margin: 0;
    margin-inline-start: auto;
  }
}

.profile-form input:focus,
.profile-form textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(63, 167, 163, 0.12);
}

.profile-form input[name="email"]:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  caret-color: var(--ink);
}

.profile-form input[name="email"]:-webkit-autofill:focus {
  -webkit-box-shadow:
    0 0 0 1000px #fff inset,
    0 0 0 3px rgba(63, 167, 163, 0.12);
}

.profile-form input[name="email"]:autofill {
  color: var(--ink);
  box-shadow: 0 0 0 1000px #fff inset;
}

.profile-form input[name="email"]:autofill:focus {
  border-color: var(--teal);
  box-shadow:
    0 0 0 1000px #fff inset,
    0 0 0 3px rgba(63, 167, 163, 0.12);
}

.profile-form > .btn {
  grid-column: 1 / -1;
  justify-self: end;
  width: min(220px, 100%);
  min-height: 46px;
  margin: 4px auto 0 0;
  text-align: center;
  font-size: 0.875rem;
}

.profile-form button:disabled,
.profile-refresh:disabled,
.profile-account-action:disabled,
.profile-password-dialog-actions button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.profile-message {
  margin: 0 0 15px;
  padding: 10px 12px;
  border: 1px solid #edc9c3;
  border-radius: 8px;
  background: #fff1ee;
  color: #8d463d;
  font-size: 0.8125rem;
}

.profile-message.success {
  border-color: #bfe0d3;
  background: #edf8f3;
  color: #246d59;
}

.profile-message[hidden],
.profile-pagination[hidden] {
  display: none;
}

.profile-refresh {
  min-height: 39px;
  padding: 7px 13px;
  border: 1px solid rgba(63, 167, 163, 0.36);
  border-radius: 8px;
  background: #fff;
  color: var(--teal-dark);
  font-size: 0.75rem;
  font-weight: 700;
}

.profile-order-view-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 22px;
  padding: 7px;
  border: 1px solid rgba(63, 167, 163, 0.2);
  border-radius: 15px;
  background: rgba(63, 167, 163, 0.06);
}

.profile-order-view-tabs button {
  min-height: 58px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--teal-dark);
  background: transparent;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.profile-order-view-tabs button:hover {
  border-color: rgba(63, 167, 163, 0.2);
  background: rgba(255, 255, 255, 0.68);
}

.profile-order-view-tabs button.active,
.profile-order-view-tabs button[aria-selected="true"] {
  border-color: rgba(63, 167, 163, 0.3);
  background: #fff;
  box-shadow: 0 8px 22px rgba(45, 127, 124, 0.13);
}

.profile-order-view-tabs small {
  margin-inline-start: 4px;
  color: var(--profile-muted);
  font-family: Arial, sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
}

.profile-order-view-tabs span {
  display: inline-grid;
  min-width: 27px;
  height: 27px;
  margin-inline-start: 8px;
  padding: 0 7px;
  place-items: center;
  border-radius: 999px;
  color: var(--teal-dark);
  background: rgba(63, 167, 163, 0.13);
  font-size: 0.75rem;
}

.profile-order-view-tabs button[aria-selected="true"] span {
  color: #fff;
  background: var(--teal);
}

.profile-orders-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 13px;
}

.profile-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px;
  border: 1px dashed #d8c8b7;
  border-radius: 11px;
  color: var(--profile-muted);
  text-align: center;
  font-size: 0.8125rem;
}

.profile-order {
  min-width: 0;
  scroll-margin-top: 96px;
  padding: 14px;
  border: 1px solid #e5d8c9;
  border-radius: 12px;
  background: #fff;
}

.profile-order-heading,
.profile-order-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profile-order-heading strong,
.profile-order-heading small {
  display: block;
}

.profile-order-heading strong {
  color: var(--teal-dark);
  font-size: 0.875rem;
}

.profile-order-heading small {
  color: var(--profile-muted);
  font-size: 0.6875rem;
}

.profile-order-status {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #edf5f3;
  color: var(--teal-dark);
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}

.profile-order-status.awaiting_payment { background: #fff0df; color: #9a5b09; }
.profile-order-status.payment_review { background: #fff5dc; color: #8a6819; }
.profile-order-status.payment_confirmed { background: #e5f7f3; color: #176b5c; }
.profile-order-status.payment_expired { background: #fdeceb; color: #a4453d; }
.profile-order-status.receipt-rejected {
  border: 1px solid rgba(173, 81, 72, 0.34);
  background: #ffe8e5;
  color: #983f36;
}

.profile-order.has-rejected-receipt {
  border-color: rgba(173, 81, 72, 0.38);
  box-shadow: 0 14px 34px rgba(135, 54, 46, 0.11);
}
.profile-order-status.processing { background: #e9f4fb; color: #286786; }
.profile-order-status.shipped { background: #eeeffd; color: #4f569b; }
.profile-order-status.completed { background: #e8f7ef; color: #267356; }
.profile-order-status.cancelled { background: #fff0ee; color: #9c4d43; }

.profile-order-progress {
  margin: 12px 0;
  padding: 13px;
  border: 1px solid rgba(63, 167, 163, 0.2);
  border-radius: 12px;
  background: #f8fcfb;
}

.profile-order-progress h4,
.profile-order-contact h4 {
  margin: 0 0 10px;
  color: var(--teal-dark);
  font-size: 0.875rem;
}

.profile-order-progress ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-order-progress li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #9a9f9c;
  font-size: 0.6875rem;
  text-align: center;
}

.profile-order-progress li:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 12px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: #dfe8e5;
}

.profile-order-progress li i {
  position: relative;
  z-index: 1;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 2px solid #dfe8e5;
  border-radius: 50%;
  background: #fff;
  color: inherit;
  font-style: normal;
  font-weight: 800;
}

.profile-order-progress li.done,
.profile-order-progress li.current {
  color: var(--teal-dark);
  font-weight: 700;
}

.profile-order-progress li.done i,
.profile-order-progress li.current i {
  border-color: var(--teal);
}

.profile-order-progress li.done i {
  background: var(--teal);
  color: #fff;
}

.profile-order-progress li.current i {
  background: var(--teal);
  color: #fff;
}

.profile-order-progress li.done:not(:last-child)::after {
  background: var(--teal);
}

.profile-order-progress li.current i {
  box-shadow: 0 0 0 4px rgba(63, 167, 163, 0.12);
}

.profile-order-progress-waiting {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed rgba(63, 167, 163, 0.28);
  color: var(--teal-dark);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.8;
  text-align: center;
}

.profile-order-progress.cancelled {
  border-color: rgba(156, 77, 67, 0.22);
  background: #fff7f5;
}

.profile-order-progress.cancelled p {
  margin: 0;
  color: #9c4d43;
  font-weight: 700;
}

.profile-order-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(201, 163, 78, 0.35);
  border-radius: 12px;
  background: #fffaf0;
}

.profile-order-contact h4 {
  margin-bottom: 4px;
}

.profile-order-contact p {
  margin: 0;
  color: #625b54;
  font-size: 0.6875rem;
  line-height: 1.8;
}

.profile-order-contact > div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.profile-order-contact a,
.profile-order-contact button {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid rgba(63, 167, 163, 0.35);
  border-radius: 9px;
  background: #fff;
  color: var(--teal-dark);
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.profile-order-contact a.whatsapp {
  border-color: #25d366;
  color: #128c4f;
}

@media (max-width: 760px) {
  .profile-order-progress {
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .profile-order-progress ol {
    grid-template-columns: 1fr;
    min-width: 0;
    gap: 0;
  }

  .profile-order-progress li {
    grid-template-columns: 28px minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    gap: 9px;
    min-height: 39px;
    padding-bottom: 5px;
    text-align: right;
  }

  .profile-order-progress li:not(:last-child)::after {
    top: 25px;
    right: 12px;
    width: 2px;
    height: calc(100% - 14px);
  }

  .profile-order-contact {
    width: 100%;
    max-width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .profile-order-contact > div:last-child {
    justify-content: stretch;
  }

  .profile-order-contact a,
  .profile-order-contact button {
    flex: 1 1 auto;
    text-align: center;
  }
}

.profile-order-summary {
  margin: 11px 0;
  padding: 9px 11px;
  border-radius: 8px;
  background: #fbf7f0;
  color: var(--profile-muted);
  font-size: 0.75rem;
}

.profile-order-summary strong {
  color: var(--gold);
  font-size: 0.8125rem;
}

.profile-order details {
  min-width: 0;
  padding-top: 9px;
  border-top: 1px solid #eee4d8;
}

.profile-order summary {
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 700;
}

.profile-order-items {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.profile-order-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border-radius: 8px;
  background: #fbf8f3;
}

.profile-order-item img {
  width: 46px;
  height: 46px;
  border-radius: 7px;
  object-fit: cover;
}

.profile-order-item span strong,
.profile-order-item span small {
  display: block;
}

.profile-order-item span strong {
  overflow: hidden;
  color: var(--teal-dark);
  font-size: 0.8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-order-item span small,
.profile-order-item > b {
  color: var(--profile-muted);
  font-size: 0.6875rem;
}

.profile-order-item > b {
  color: var(--gold);
  white-space: nowrap;
}

.profile-order-delivery {
  margin-top: 9px;
  padding: 9px;
  border-radius: 8px;
  background: #f1f7f5;
}

.profile-order-delivery p {
  margin: 0;
  color: #5f6965;
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.profile-order-management {
  margin-top: 1rem;
  padding: 1.1rem;
  border: 1px solid rgba(201, 163, 78, 0.42);
  border-radius: 18px;
  background: rgba(63, 167, 163, 0.06);
}

.profile-order-management h4 {
  margin: 0 0 0.35rem;
  color: var(--teal-dark, #277f7c);
  font-size: 1.12rem;
}

.profile-order-management > p {
  margin: 0 0 1rem;
  color: #625b54;
  line-height: 1.9;
}

.profile-order-edit-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.profile-order-edit-address,
.profile-order-edit-address-fields,
.profile-order-edit-note {
  grid-column: 1 / -1;
}

.profile-order-edit-address-fields {
  display: grid;
  grid-template-columns: minmax(160px, 1.5fr) repeat(2, minmax(90px, 0.75fr));
  gap: 0.8rem;
}

.profile-order-edit-address-fields > label {
  min-width: 0;
}

.profile-order-edit-address-fields.courier {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-order-edit-form label {
  display: grid;
  gap: 0.45rem;
  color: #277f7c;
  font-weight: 700;
}

.profile-order-edit-form input,
.profile-order-edit-form textarea {
  width: 100%;
  border: 1px solid #dbcdbd;
  border-radius: 12px;
  background: #fffdf9;
  color: #39332e;
  font: inherit;
  padding: 0.75rem 0.85rem;
}

.profile-order-edit-form textarea {
  min-height: 100px;
  resize: vertical;
}

.profile-order-edit-form input[dir="ltr"] {
  text-align: center;
}

.profile-order-edit-form input[readonly] {
  border-color: rgba(63, 167, 163, 0.28);
  background: #f2f8f6;
  color: #277f7c;
  cursor: default;
}

.profile-order-edit-actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.profile-order-edit-actions button {
  min-height: 44px;
  border-radius: 12px;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.profile-order-cancel {
  border: 1px solid #b55b50;
  background: #fff8f7;
  color: #98483f;
}

.profile-order-edit-form > small {
  display: block;
  margin-top: 0.75rem;
  color: #776d63;
}

@media (max-width: 720px) {
  .profile-order-edit-fields {
    grid-template-columns: 1fr;
  }

  .profile-order-edit-address-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-order-edit-address-fields > label:first-child:nth-last-child(3) {
    grid-column: 1 / -1;
  }

  .profile-order-edit-actions {
    flex-direction: column;
  }

  .profile-order-edit-actions button {
    width: 100%;
  }
}

.profile-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-top: 16px;
}

.profile-pagination button {
  min-height: 35px;
  padding: 6px 12px;
  border: 1px solid rgba(63, 167, 163, 0.36);
  border-radius: 8px;
  background: #fff;
  color: var(--teal-dark);
  font-size: 0.75rem;
}

.profile-pagination button:disabled { opacity: 0.4; }
.profile-pagination strong { color: var(--profile-muted); font-size: 0.75rem; }

.profile-account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  align-items: start;
  gap: 24px;
  margin-bottom: 24px;
}

.profile-account-layout .profile-card {
  min-width: 0;
  margin: 0;
}

.profile-account-section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--profile-line);
}

.profile-account-section-heading.compact {
  align-items: flex-start;
}

.profile-account-section-heading small,
.profile-account-section-heading h3,
.profile-account-section-heading p {
  display: block;
  margin: 0;
}

.profile-account-section-heading small {
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 800;
}

.profile-account-section-heading h3 {
  margin-top: 1px;
  color: var(--teal-dark);
  font-size: 1.4375rem;
}

.profile-account-section-heading p {
  margin-top: 3px;
  color: var(--profile-muted);
  font-size: 0.78125rem;
  line-height: 1.8;
}

.profile-account-section-icon {
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  place-items: center;
  border: 1px solid rgba(63, 167, 163, 0.34);
  border-radius: 15px;
  color: var(--teal-dark);
  background: rgba(63, 167, 163, 0.08);
  font-size: 1.4375rem;
}

.profile-account-section-icon.security {
  border-color: rgba(201, 163, 78, 0.42);
  color: #9a7425;
  background: rgba(255, 250, 239, 0.92);
}

.profile-account-action-list {
  display: grid;
  gap: 10px;
}

.profile-account-action {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  min-height: 67px;
  padding: 10px 12px;
  border: 1px solid rgba(63, 167, 163, 0.25);
  border-radius: 12px;
  color: var(--teal-dark);
  background: #fff;
  font-family: inherit;
  text-align: right;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.profile-account-action:hover {
  border-color: rgba(63, 167, 163, 0.52);
  background: rgba(63, 167, 163, 0.06);
  transform: translateY(-1px);
}

.profile-account-action > span {
  grid-row: 1 / 3;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  align-self: center;
  border-radius: 10px;
  background: rgba(63, 167, 163, 0.11);
  font-size: 1.125rem;
}

.profile-account-action strong {
  align-self: end;
  font-size: 0.8125rem;
}

.profile-account-action small {
  align-self: start;
  color: var(--profile-muted);
  font-size: 0.6875rem;
}

.profile-account-action.change-password,
.profile-account-action.change-mobile {
  border-color: rgba(63, 167, 163, 0.44);
  background: rgba(239, 250, 248, 0.72);
}

.profile-account-action.change-mobile > span {
  color: #256f6d;
  background: #e4f5f3;
}

.profile-account-action.danger {
  border-color: rgba(173, 81, 70, 0.3);
  color: #984d42;
}

.profile-account-action.danger > span {
  background: #fff1ee;
}

.profile-account-action:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.profile-password-dialog {
  width: min(520px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(63, 167, 163, 0.28);
  border-radius: 20px;
  color: var(--ink);
  background: #fffdf9;
  box-shadow: 0 28px 85px rgba(16, 48, 45, 0.28);
}

.profile-password-dialog::backdrop {
  background: rgba(18, 49, 47, 0.58);
  backdrop-filter: blur(5px);
}

.profile-password-dialog-shell {
  max-height: calc(100dvh - 30px);
  padding: 25px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.profile-password-dialog-header {
  position: static;
  top: auto;
  z-index: auto;
  display: flex;
  width: auto;
  height: auto;
  min-height: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 0 0 17px;
  border-bottom: 1px solid var(--profile-line);
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.profile-password-dialog-header span,
.profile-password-dialog-header h2,
.profile-password-dialog-header p { margin: 0; }

.profile-password-dialog-header span {
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 800;
}

.profile-password-dialog-header h2 {
  position: static;
  margin-top: 1px;
  color: var(--teal-dark);
  font-size: 1.5625rem;
  line-height: 1.55;
}

.profile-password-dialog-header p {
  position: static;
  margin-top: 4px;
  color: var(--profile-muted);
  font-size: 0.75rem;
  line-height: 1.8;
  opacity: 1;
}

.profile-password-dialog-header > button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(63, 167, 163, 0.22);
  border-radius: 11px;
  color: var(--teal-dark);
  background: #fff;
  font-size: 1.5rem;
  line-height: 1;
  text-align: center;
}

.profile-password-dialog-form {
  display: grid;
  gap: 14px;
}

.profile-password-dialog-form label {
  display: grid;
  gap: 6px;
  color: #504c47;
  font-size: 0.8125rem;
  font-weight: 700;
}

.profile-password-dialog-form input {
  width: 100%;
  min-height: 48px;
  padding: 9px 12px;
  border: 1px solid #d9cbbc;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  direction: ltr;
  font-size: 0.875rem;
  text-align: left;
  unicode-bidi: plaintext;
}

.profile-password-dialog-form input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(63, 167, 163, 0.12);
}

.profile-password-dialog-form .password-field input {
  padding-left: 48px;
}

.profile-password-dialog-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.65fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 6px;
  padding-top: 17px;
  border-top: 1px solid var(--profile-line);
}

.profile-password-dialog-actions button {
  display: grid;
  min-height: 45px;
  place-items: center;
  padding: 8px 14px;
  border: 1px solid rgba(63, 167, 163, 0.3);
  border-radius: 10px;
  color: var(--teal-dark);
  background: #fff;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
}

.profile-password-dialog-actions .primary {
  color: #fff;
  background: var(--teal);
}

.profile-password-dialog-actions button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.profile-mobile-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(63, 167, 163, 0.22);
  border-radius: 10px;
  color: var(--profile-muted);
  background: rgba(239, 250, 248, 0.72);
  font-size: 0.75rem;
}

.profile-mobile-current strong {
  color: var(--teal-dark);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
}

.profile-mobile-verification-note {
  margin: 0;
  padding: 11px 13px;
  border-radius: 10px;
  color: #53605e;
  background: #f1f8f7;
  font-size: 0.75rem;
  line-height: 1.9;
}

.profile-mobile-verification-note strong {
  display: inline-block;
  color: var(--teal-dark);
  font-size: 0.8125rem;
}

.profile-mobile-code {
  text-align: center !important;
  letter-spacing: 0.42em;
  font-size: 1.125rem !important;
  font-weight: 700;
}

.profile-mobile-verification-tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.profile-mobile-verification-tools button {
  min-height: 38px;
  padding: 7px 10px;
  border: 0;
  color: var(--teal-dark);
  background: transparent;
  font-size: 0.71875rem;
  font-weight: 800;
}

.profile-mobile-verification-tools button:disabled {
  cursor: wait;
  color: #9a9792;
}

@media (max-width: 850px) {
  .profile-account-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}

@media (max-width: 540px) {
  .profile-account-section-heading {
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 17px;
    padding-bottom: 14px;
  }

  .profile-account-section-icon {
    width: 43px;
    height: 43px;
    flex-basis: 43px;
    border-radius: 12px;
    font-size: 1.25rem;
  }

  .profile-account-section-heading h3 { font-size: 1.25rem; }
  .profile-account-section-heading p { font-size: 0.71875rem; }
  .profile-account-action { min-height: 64px; }

  .profile-password-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    margin: auto;
    border-radius: 17px;
  }

  .profile-password-dialog-shell {
    max-height: calc(100dvh - 18px);
    padding: 18px 15px;
  }

  .profile-password-dialog-header {
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
  }

  .profile-password-dialog-header h2 { font-size: 1.375rem; }
  .profile-password-dialog-header p { font-size: 0.6875rem; }
  .profile-password-dialog-form { gap: 11px; }
  .profile-password-dialog-form input { min-height: 46px; }
  .profile-password-dialog-actions { position: sticky; bottom: -18px; padding: 12px 0 18px; background: #fffdf9; }
}

.profile-footer {
  margin-top: 0;
  direction: rtl;
}

.profile-footer > div {
  direction: rtl;
}

.profile-footer .footer-logo {
  grid-column: auto;
  justify-self: stretch;
  align-items: flex-start;
  direction: rtl;
  text-align: right;
}

.profile-footer .footer-logo p {
  direction: rtl;
  text-align: right;
}

.profile-store-footer-mobile {
  display: none;
}

.profile-mobile-nav a.active {
  color: var(--gold);
}

.profile-form .password-field {
  position: relative;
  display: block;
}

.profile-form .password-field input {
  padding-left: 48px;
}

@media (max-width: 900px) {
  .profile-main {
    width: min(100% - 24px, 1180px);
    margin-top: 20px;
  }

  .profile-section-nav {
    top: 82px;
    width: 100%;
    justify-content: stretch;
    overflow-x: auto;
  }

  .profile-section-nav a,
  .profile-section-nav button {
    flex: 1 0 auto;
    justify-content: center;
  }

  .profile-header-store {
    font-size: 0.75rem;
  }

  .profile-header-search {
    position: absolute;
    right: 58px;
  }

  .profile-hero {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 28px;
  }

  .profile-hero > a {
    grid-column: 1 / -1;
  }

  .profile-orders-list {
    grid-template-columns: 1fr;
  }

  .profile-form {
    grid-template-columns: 1fr;
  }

  .profile-form > .btn {
    grid-column: 1;
  }

  .profile-form-address {
    grid-column: 1;
  }

  .profile-form-address-details {
    grid-column: 1;
    width: 100%;
  }
}

@media (max-width: 540px) {
  .profile-mobile-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .profile-main {
    width: calc(100% - 18px);
    margin-bottom: 95px;
  }

  .profile-section-nav {
    top: 68px;
    margin-bottom: 18px;
    padding: 5px;
  }

  .profile-section-nav button {
    min-height: 44px;
    padding-inline: 10px;
    font-size: 0.75rem;
  }

  .profile-order-view-tabs {
    gap: 6px;
    margin-bottom: 16px;
    padding: 5px;
  }

  .profile-order-view-tabs button {
    min-height: 54px;
    padding: 8px 5px;
    font-size: 0.75rem;
  }

  .profile-order-view-tabs small {
    display: block;
    margin: 1px 0 0;
    font-size: 0.6875rem;
  }

  .profile-order-view-tabs span {
    min-width: 23px;
    height: 23px;
    margin-inline-start: 4px;
    padding-inline: 5px;
    font-size: 0.6875rem;
  }

  .profile-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 13px;
    min-height: 245px;
    padding: 25px 18px 34px;
    text-align: center;
  }

  .profile-avatar {
    width: 76px;
    height: 76px;
    font-size: 1.8125rem;
  }

  .profile-hero h1 {
    font-size: 1.6875rem;
  }

  .profile-card {
    padding: 20px 15px;
    border-radius: 14px;
  }

  .profile-card-heading {
    align-items: flex-start;
  }

  .profile-card-heading h2 {
    font-size: 1.4375rem;
  }

  .profile-card-heading > i {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .profile-refresh {
    max-width: 160px;
  }

  .profile-order-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .profile-order-item img {
    width: 42px;
    height: 42px;
  }

  .profile-order-item > b {
    grid-column: 2;
  }

  .profile-footer {
    padding-bottom: 105px;
  }
}

.profile-order-delivery p + p {
  margin-top: 5px;
}

.profile-payment-panel {
  margin-top: 1.25rem;
  padding: 1.25rem;
  border: 1px solid rgba(201, 163, 78, 0.42);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(201, 163, 78, 0.08), rgba(63, 167, 163, 0.08));
}

.profile-payment-panel > div:first-child,
.profile-payment-info p,
.profile-receipt-history article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.profile-payment-panel h4,
.profile-payment-panel h5 {
  margin: 0;
  color: #247f7d;
}

.profile-payment-panel > div:first-child > span {
  color: #776f67;
  font-size: 0.82rem;
}

.profile-payment-info {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.profile-payment-info p { margin: 0.45rem 0; }
.profile-payment-info strong[dir="ltr"] { letter-spacing: 0.08em; }

.profile-card-number {
  white-space: nowrap;
  word-spacing: 0.3em;
}

.profile-payment-info .profile-payment-holder {
  justify-content: flex-start;
  gap: 0.55rem;
}

.profile-payment-info button {
  border: 1px solid rgba(63, 167, 163, 0.5);
  border-radius: 10px;
  padding: 0.35rem 0.7rem;
  color: #247f7d;
  background: #fff;
  cursor: pointer;
}

.profile-payment-instructions {
  display: block !important;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(201, 163, 78, 0.25);
  color: #56504a;
  line-height: 1.9;
}

.profile-payment-deadline {
  display: block !important;
  margin: 0.7rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(201, 163, 78, 0.14);
  color: #7d5f17;
  font-weight: 800;
  text-align: center;
}

.profile-payment-deadline.expired {
  background: #fdeceb;
  color: #a4453d;
}

.profile-expired-receipt-rejection {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(173, 81, 72, 0.42);
  border-radius: 14px;
  background: #fff3f1;
  box-shadow: inset 4px 0 0 rgba(173, 81, 72, 0.58);
}

.profile-expired-receipt-rejection h4,
.profile-expired-receipt-rejection p {
  margin: 0;
}

.profile-expired-receipt-rejection h4 {
  color: #963f37;
  font-size: 1rem;
  font-weight: 900;
}

.profile-expired-receipt-rejection p {
  color: #563f3b;
  font-size: 0.9rem;
  line-height: 1.9;
}

.profile-payment-unavailable { color: #a0443a !important; }
.profile-payment-panel.has-rejected-receipt {
  border-color: rgba(173, 81, 72, 0.48);
  box-shadow: 0 16px 38px rgba(133, 55, 47, 0.12);
}

.profile-receipt-history {
  margin-top: 1rem;
  padding: 0.9rem;
  border: 1px solid rgba(41, 127, 125, 0.14);
  border-radius: 16px;
  background: rgba(63, 167, 163, 0.055);
}
.profile-receipt-history h5 { margin: 0 0 0.7rem; color: #267f7d; }

.profile-receipt-history.has-rejected {
  border-color: rgba(173, 81, 72, 0.42);
  background: #fff1ef;
  box-shadow: inset 4px 0 0 rgba(173, 81, 72, 0.58);
}

.profile-receipt-history.has-rejected h5 { color: #963f37; }
.profile-receipt-history.has-rejected h5 { font-size: 1.12rem; }

.profile-receipt-history article {
  margin-top: 0.55rem;
  padding: 0.85rem;
  border: 1px solid rgba(41, 127, 125, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
}

.profile-receipt-history article.is-rejected {
  border-color: rgba(173, 81, 72, 0.38);
  background: #fff8f7;
}

.profile-receipt-history article.is-rejected .profile-rejected-admin-message {
  display: grid;
  gap: 0.18rem;
  margin: 0;
  color: #563f3b;
  font-weight: 400;
  line-height: 2;
}

.profile-rejected-admin-message strong {
  display: block;
  color: #8f3d35;
  font-size: 1rem;
  font-weight: 900;
}

.profile-rejected-admin-message span {
  display: block;
  font-size: 0.9rem;
  font-weight: 400;
}

.profile-receipt-history article.is-rejected a {
  padding: 0.48rem 0.72rem;
  font-size: 0.9rem;
}

.profile-receipt-history article > div,
.profile-receipt-history article strong,
.profile-receipt-history article small { display: block; }

.profile-receipt-history article p {
  margin: 0.35rem 0 0;
  color: #625a52;
}

.profile-receipt-history a {
  flex: 0 0 auto;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  color: #fff;
  background: #3fa7a3;
  text-decoration: none;
}

.receipt-status.pending { color: #a77b1d; }
.receipt-status.accepted { color: #208169; }
.receipt-status.rejected { color: #a0443a; }

.profile-receipt-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.7rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(201, 163, 78, 0.3);
}

.profile-receipt-form label {
  display: grid;
  gap: 0.45rem;
  color: #247f7d;
  font-weight: 700;
}

.profile-receipt-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(201, 163, 78, 0.42);
  border-radius: 12px;
  padding: 0.65rem;
  background: #fff;
  font: inherit;
}

.profile-receipt-form button { grid-column: auto; }

.profile-receipt-form .profile-receipt-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  min-height: 48px;
  gap: 0.7rem;
  padding: 0.35rem 0.45rem 0.35rem 0.35rem;
  border: 1px solid rgba(201, 163, 78, 0.42);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.profile-receipt-file-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 0.6rem;
}

.profile-receipt-file-name {
  min-width: 0;
  overflow: hidden;
  color: #77716a;
  font-size: 0.75rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-receipt-file-action {
  flex: 0 0 auto;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.profile-receipt-file.has-file {
  border-color: rgba(63, 167, 163, 0.65);
  box-shadow: 0 0 0 3px rgba(63, 167, 163, 0.08);
}

.profile-receipt-file:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(63, 167, 163, 0.13);
}

.profile-receipt-form .profile-receipt-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.profile-receipt-upload-status {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0.15rem 0 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(63, 167, 163, 0.28);
  border-radius: 11px;
  color: #247f7d;
  background: rgba(63, 167, 163, 0.08);
  font-size: 0.875rem;
  font-weight: 800;
  text-align: center;
}

.profile-receipt-upload-status::before {
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid rgba(63, 167, 163, 0.25);
  border-top-color: var(--teal);
  border-radius: 50%;
  content: '';
  animation: receipt-upload-spin 0.75s linear infinite;
}

.profile-receipt-upload-status[hidden] {
  display: none;
}

.profile-receipt-form[aria-busy="true"] .profile-receipt-file {
  cursor: wait;
  opacity: 0.72;
}

@keyframes receipt-upload-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .profile-receipt-upload-status::before { animation: none; }
}

@media (max-width: 900px) {
  .profile-footer {
    padding-bottom: 88px;
  }
}

@media (max-width: 700px) {
  .profile-payment-panel { padding: 1rem; }

  .profile-payment-panel > div:first-child,
  .profile-payment-info p,
  .profile-receipt-history article {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-payment-info .profile-payment-holder {
    gap: 0.3rem;
  }

  .profile-receipt-form { grid-template-columns: 1fr; }

  .profile-receipt-history a {
    width: 100%;
    text-align: center;
  }
}

/* Phase 19-5: clear, full-width order history and a prominent payment action. */
.profile-orders-list {
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.profile-order {
  padding: 22px;
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(45, 91, 86, 0.07);
}

.profile-order.is-latest {
  border-color: rgba(63, 167, 163, 0.72);
  box-shadow: 0 16px 38px rgba(45, 126, 121, 0.13);
}

.profile-order.is-archived:not(.is-latest) {
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
}

.profile-order-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(230px, 0.65fr);
  gap: 18px;
  align-items: stretch;
}

.profile-order-heading,
.profile-order-summary {
  min-width: 0;
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
}

.profile-order-heading {
  border: 1px solid rgba(63, 167, 163, 0.18);
  background: rgba(63, 167, 163, 0.06);
}

.profile-order-summary {
  background: #fbf5e9;
}

.profile-order-summary strong {
  font-size: 1rem;
}

.profile-order-progress {
  margin: 18px 0;
}

.profile-order details {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #eee1d2;
  border-radius: 16px;
  background: rgba(255, 253, 249, 0.72);
}

.profile-order details[open] > summary {
  margin-bottom: 14px;
}

.profile-order-items {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.profile-order-item {
  min-height: 76px;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  padding: 10px;
  border: 1px solid rgba(63, 167, 163, 0.12);
  border-radius: 12px;
}

.profile-order-item img {
  width: 58px;
  height: 58px;
  border-radius: 10px;
}

.profile-payment-panel {
  margin-top: 18px;
  padding: 22px;
}

.profile-payment-panel.requires-action {
  border: 2px solid rgba(201, 163, 78, 0.78);
  background: linear-gradient(145deg, #fffaf0, rgba(63, 167, 163, 0.1));
  box-shadow: 0 15px 34px rgba(147, 107, 25, 0.12);
}

.profile-payment-panel.requires-action h4 {
  color: #8b6515;
  font-size: clamp(0.9375rem, 2.2vw, 1.125rem);
  white-space: nowrap;
}

.profile-payment-info .profile-payment-card-row {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
}

.profile-payment-card-row .profile-card-number {
  justify-self: center;
}

.profile-payment-info .profile-payment-holder {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) 62px;
  align-items: center;
  justify-content: initial;
  gap: 1rem;
}

.profile-payment-holder strong {
  justify-self: center;
}

.profile-payment-holder-spacer {
  width: 62px;
}

.profile-payment-info .profile-payment-total {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0.85rem 0;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(201, 163, 78, 0.38);
  border-radius: 12px;
  background: rgba(255, 248, 230, 0.82);
  color: #765510;
  text-align: center;
}

.profile-payment-total span {
  font-weight: 700;
}

.profile-payment-total strong {
  color: #247f7d;
  font-size: clamp(0.9375rem, 1.8vw, 1.125rem);
  white-space: nowrap;
}

.profile-order-financial-summary {
  display: grid;
  margin-top: 0.9rem;
  padding: 0.45rem 0;
  border-top: 1px solid rgba(201, 163, 78, 0.3);
  border-bottom: 1px solid rgba(201, 163, 78, 0.3);
}

.profile-order-financial-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.7rem;
}

.profile-order-financial-row + .profile-order-financial-row {
  border-top: 1px dashed rgba(63, 167, 163, 0.2);
}

.profile-order-financial-row > span {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.profile-order-financial-row b {
  color: var(--teal-dark);
  font-size: var(--profile-font-xs);
}

.profile-order-financial-row small {
  color: var(--profile-muted);
  font-size: var(--profile-font-2xs);
  font-weight: 500;
}

.profile-order-financial-row strong {
  flex: 0 0 auto;
  color: #a77821;
  font-size: var(--profile-font-sm);
  white-space: nowrap;
}

.profile-order-financial-row.final {
  margin-top: 0.2rem;
  border-top-style: solid;
  border-radius: 10px;
  background: rgba(63, 167, 163, 0.08);
}

.profile-order-financial-row.final b {
  font-weight: 900;
}

.profile-order-financial-row.final strong {
  color: var(--teal-dark);
  font-size: var(--profile-font-md);
}

.profile-receipt-form {
  padding: 18px;
  border: 1px solid rgba(63, 167, 163, 0.22);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.7);
}

.profile-receipt-form .btn.primary {
  width: auto;
  min-width: 132px;
  min-height: 48px;
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  white-space: nowrap;
}

.profile-receipt-form.is-cooling-down .btn.primary {
  background: #8eaaa8;
  color: #fff;
  cursor: not-allowed;
  opacity: 1;
}

.profile-receipt-form.is-cooling-down .profile-receipt-file {
  cursor: not-allowed;
  opacity: 0.62;
}

@media (max-width: 900px) {
  .profile-order-overview {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .profile-order {
    padding: 14px;
    border-radius: 16px;
  }

  .profile-order-heading,
  .profile-order-summary {
    padding: 12px;
  }

  .profile-order-heading {
    align-items: flex-start;
  }

  .profile-order-items {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-payment-panel {
    padding: 14px;
  }

  .profile-payment-panel > div:first-child {
    gap: 7px;
  }

  .profile-payment-info .profile-payment-card-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .profile-payment-card-row > span:first-child {
    grid-column: 1 / -1;
  }

  .profile-payment-card-row .profile-card-number {
    justify-self: start;
  }

  .profile-payment-info .profile-payment-holder {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 48px;
    align-items: center;
    gap: 0.55rem;
  }

  .profile-payment-holder-spacer {
    width: 48px;
  }

  .profile-payment-info .profile-payment-total {
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    padding: 0.7rem 0.65rem;
  }

  .profile-order-financial-row {
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0.45rem;
  }

  .profile-receipt-form {
    padding: 12px;
  }

  .profile-receipt-form .btn.primary {
    width: 100%;
    min-height: 44px;
  }
}

/* Phase 19-5-1: visually separated order groups and a compact order accordion. */
.profile-order-group {
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(63, 167, 163, 0.2);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 42px rgba(35, 92, 88, 0.08);
}

.profile-order-group.requires-action {
  border-color: rgba(201, 163, 78, 0.55);
  background: linear-gradient(145deg, rgba(255, 250, 239, 0.98), rgba(255, 255, 255, 0.92));
  box-shadow: 0 18px 46px rgba(139, 101, 21, 0.11);
}

.profile-order-group.current-orders {
  border-color: rgba(63, 167, 163, 0.38);
  background: linear-gradient(145deg, rgba(239, 250, 248, 0.96), rgba(255, 255, 255, 0.94));
}

.profile-order-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(63, 167, 163, 0.16);
}

.profile-order-group.requires-action .profile-order-group-heading {
  border-bottom-color: rgba(201, 163, 78, 0.28);
}

.profile-order-group-heading h3,
.profile-order-group-heading p {
  margin: 0;
}

.profile-order-group-heading h3 {
  color: var(--teal-dark);
  font-size: 1.375rem;
}

.profile-order-group.requires-action .profile-order-group-heading h3 {
  color: #8b6515;
}

.profile-order-group-heading p {
  margin-top: 5px;
  color: var(--profile-muted);
  line-height: 1.8;
}

.profile-order-group-heading > span {
  flex: 0 0 auto;
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: rgba(63, 167, 163, 0.1);
  font-size: 0.75rem;
  font-weight: 800;
}

.profile-order-group.requires-action .profile-order-group-heading > span {
  color: #8b6515;
  background: rgba(201, 163, 78, 0.14);
}

.profile-order-stack {
  display: grid;
  gap: 24px;
}

.profile-order {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 2px solid rgba(63, 167, 163, 0.22);
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 11px 28px rgba(39, 86, 82, 0.09);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.profile-order::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  bottom: 0;
  width: 7px;
  background: var(--teal);
}

.profile-order.status-awaiting_payment::before { background: #d3a23a; }
.profile-order.status-payment_review::before { background: #c99628; }
.profile-order.status-payment_confirmed::before { background: #41a98d; }
.profile-order.status-payment_expired::before,
.profile-order.status-cancelled::before { background: #b75c52; }
.profile-order.status-processing::before { background: #4d94b6; }
.profile-order.status-shipped::before { background: #6b70b8; }
.profile-order.status-completed::before { background: #4c9b70; }

.profile-order.is-latest {
  border-color: rgba(63, 167, 163, 0.72);
  box-shadow: 0 15px 36px rgba(45, 126, 121, 0.14);
}

.profile-order.is-archived:not(.is-latest) {
  background: rgba(250, 250, 248, 0.86);
  border-color: rgba(108, 126, 121, 0.16);
  box-shadow: 0 7px 20px rgba(55, 74, 70, 0.05);
}

.profile-order details.profile-order-disclosure,
.profile-order details.profile-order-disclosure[open] {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
}

.profile-order-disclosure > .profile-order-toggle {
  display: grid;
  grid-template-columns: 76px minmax(170px, 1fr) 140px auto;
  align-items: center;
  gap: 18px;
  min-height: 108px;
  margin: 0;
  padding: 16px 24px 16px 20px;
  list-style: none;
  border: 0;
  background: linear-gradient(100deg, rgba(63, 167, 163, 0.075), rgba(255, 255, 255, 0.95));
  cursor: pointer;
}

.profile-order-disclosure > .profile-order-toggle::-webkit-details-marker {
  display: none;
}

.profile-order-disclosure[open] > .profile-order-toggle {
  margin-bottom: 0;
  border-bottom: 1px solid rgba(63, 167, 163, 0.16);
  background: linear-gradient(100deg, rgba(63, 167, 163, 0.12), rgba(255, 255, 255, 0.97));
}

.profile-order.status-awaiting_payment .profile-order-toggle {
  background: linear-gradient(100deg, rgba(201, 163, 78, 0.14), rgba(255, 255, 255, 0.97));
}

.profile-order-thumbnail {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border: 1px solid rgba(201, 163, 78, 0.3);
  border-radius: 14px;
  background: #f5eee5;
}

.profile-order-heading,
.profile-order-summary {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.profile-order-heading > div {
  display: grid;
  gap: 3px;
}

.profile-order-heading strong { font-size: 0.9375rem; }
.profile-order-heading small { font-size: 0.6875rem; }

.profile-order-summary {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.profile-order-summary span {
  color: var(--profile-muted);
  font-size: 0.75rem;
}

.profile-order-summary strong {
  color: var(--teal-dark);
  font-size: 1.0625rem;
}

.profile-order-total {
  width: 140px;
  min-width: 0;
  justify-items: center;
  justify-self: center;
  padding: 7px 9px;
  border: 1px solid rgba(201, 163, 78, 0.32);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(255, 249, 236, 0.96), rgba(255, 255, 255, 0.9));
  box-shadow: 0 7px 18px rgba(125, 91, 26, 0.07);
  text-align: center;
}

.profile-order-total span {
  color: #8a6a2c;
  font-size: 0.6875rem;
  font-weight: 800;
  text-align: center;
}

.profile-order-total strong {
  color: var(--teal-dark);
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}

.profile-order-open-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal-dark);
  white-space: nowrap;
}

.profile-order-open-label b { font-size: 0.75rem; }

.profile-order-open-label i {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(63, 167, 163, 0.32);
  border-radius: 50%;
  background: #fff;
  font-size: 1.25rem;
  font-style: normal;
  transition: transform 180ms ease;
}

.profile-order-disclosure[open] .profile-order-open-label i {
  transform: rotate(180deg);
}

.profile-order-body { padding: 20px; }

.profile-order-body > .profile-order-progress {
  margin: 0 0 18px;
  padding: 11px 13px;
}

.profile-order-body > .profile-order-progress h4 {
  margin-bottom: 8px;
  font-size: 0.75rem;
}

.profile-order-body > .profile-order-progress li {
  gap: 3px;
  font-size: 0.6875rem;
}

.profile-order-body > .profile-order-progress li i {
  width: 23px;
  height: 23px;
}

.profile-order-primary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.profile-order-primary.without-payment {
  grid-template-columns: minmax(0, 1fr);
}

.profile-order-info-column {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.profile-order-products-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(63, 167, 163, 0.2);
  border-radius: 17px;
  background: rgba(248, 252, 251, 0.78);
}

.profile-order-products-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.profile-order-products-heading h4 {
  margin: 0;
  color: var(--teal-dark);
  font-size: 1rem;
}

.profile-order-products-heading span {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: rgba(63, 167, 163, 0.11);
  font-size: 0.6875rem;
  font-weight: 800;
}

.profile-order-products-panel .profile-order-items {
  grid-template-columns: minmax(0, 1fr);
}

.profile-order-info-column > .profile-payment-panel {
  min-width: 0;
  margin: 0;
  padding: 18px;
}

.profile-order-body > .profile-order-delivery {
  width: 100%;
  margin: 18px 0 0;
  padding: 13px 15px;
  border: 1px solid rgba(63, 167, 163, 0.2);
  border-radius: 14px;
  background: #f1f7f5;
}

.profile-order details.profile-order-more,
.profile-order details.profile-order-more[open] {
  margin: 18px 0 0;
  padding: 13px 15px;
  border: 1px solid #e9dccd;
  border-radius: 15px;
  background: rgba(255, 252, 247, 0.8);
}

.profile-order-more > summary {
  margin: 0;
  color: var(--teal-dark);
  font-size: 0.8125rem;
  font-weight: 800;
}

.profile-order-more[open] > summary { margin-bottom: 14px; }

@media (max-width: 1100px) {
  .profile-order-disclosure > .profile-order-toggle {
    grid-template-columns: 68px minmax(150px, 1fr) 140px auto;
  }

  .profile-order-thumbnail {
    width: 68px;
    height: 68px;
  }

  .profile-order-open-label {
    grid-column: 2 / -1;
    justify-self: end;
  }
}

@media (max-width: 850px) {
  .profile-order-group {
    padding: 16px;
    border-radius: 19px;
  }

  .profile-order-primary { grid-template-columns: minmax(0, 1fr); }
  .profile-order-body > .profile-order-admin-note {
    padding: 11px 13px;
  }

  .profile-order-disclosure > .profile-order-toggle {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 13px;
    padding: 14px 19px 14px 14px;
  }

  .profile-order-thumbnail {
    width: 64px;
    height: 64px;
  }

  .profile-order-summary { grid-column: 2 / 3; }

  .profile-order-open-label {
    grid-column: 3;
    grid-row: 2;
  }
}

@media (max-width: 600px) {
  .profile-order-group {
    padding: 12px;
  }

  .profile-order-group-heading {
    align-items: flex-start;
    margin-bottom: 14px;
  }

  .profile-order-group-heading h3 { font-size: 1.125rem; }
  .profile-order-group-heading p { font-size: 0.75rem; }
  .profile-order-stack { gap: 16px; }

  .profile-order-disclosure > .profile-order-toggle {
    grid-template-columns: 58px minmax(0, 1fr);
    min-height: 0;
    gap: 11px;
    padding: 13px 17px 13px 11px;
  }

  .profile-order-thumbnail {
    width: 58px;
    height: 58px;
    border-radius: 11px;
  }

  .profile-order-status {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .profile-order-summary {
    grid-column: 1 / -1;
    width: 100%;
    align-items: center;
  }

  .profile-order-total {
    grid-template-columns: minmax(0, 1fr);
    width: 140px;
    max-width: 100%;
    justify-self: center;
  }

  .profile-order-open-label {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: stretch;
    justify-content: space-between;
    padding-top: 9px;
    border-top: 1px solid rgba(63, 167, 163, 0.13);
  }

  .profile-order-body { padding: 13px; }

  .profile-order-body > .profile-order-progress {
    overflow-x: auto;
  }

  .profile-order-body > .profile-order-progress.receipt-upload-stage {
    display: none;
  }

  .profile-order-body > .profile-order-progress ol { min-width: 560px; }

  .profile-order-products-panel,
  .profile-order-info-column > .profile-payment-panel {
    padding: 13px;
  }
}

/* Phase 22-21-4-11: one compact three-way profile switcher on mobile. */
.profile-mobile-view-switcher {
  display: none;
}

@media (max-width: 600px) {
  .profile-section-nav {
    display: none;
  }

  .profile-mobile-view-switcher {
    position: sticky;
    top: 74px;
    z-index: 12;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    margin: 0 0 12px;
    padding: 4px;
    border: 1px solid rgba(63, 167, 163, 0.2);
    border-radius: 13px;
    background: rgba(255, 253, 249, 0.96);
    box-shadow: 0 9px 24px rgba(45, 80, 74, 0.11);
    backdrop-filter: blur(12px);
  }

  .profile-mobile-view-switcher button {
    min-width: 0;
    min-height: 44px;
    padding: 6px 3px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--teal-dark);
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 800;
    line-height: 1.55;
    text-align: center;
    white-space: nowrap;
  }

  .profile-mobile-view-switcher button.active,
  .profile-mobile-view-switcher button[aria-selected="true"] {
    color: #fff;
    background: linear-gradient(135deg, var(--teal-dark), var(--teal));
    box-shadow: 0 6px 16px rgba(45, 127, 124, 0.2);
  }

  .profile-orders-card {
    display: block;
  }

  .profile-orders-card .profile-order-view-tabs,
  .profile-orders-card .profile-refresh {
    display: none;
  }
}

/* Phase 22-21-2: mobile-only simplification of the profile hero. */
@media (max-width: 540px) {
  .profile-hero {
    min-height: 0;
  }

  .profile-avatar,
  .profile-hero > a,
  .profile-hero-summary-email {
    display: none;
  }
}

/* Phase 22-21-4-5: desktop-only full-width grid track for true text centering. */
@media (min-width: 601px) {
  .profile-order-total {
    position: static;
    grid-template-columns: minmax(0, 1fr);
    width: 140px;
    margin: 0 auto;
    justify-content: stretch;
    justify-items: stretch;
    transform: none;
  }

  .profile-order-total span,
  .profile-order-total strong {
    display: block;
    width: 100%;
    text-align: center;
  }
}

/* Phase 22-21-4-7: compact orders view, mobile only. */
@media (max-width: 600px) {
  .profile-footer {
    display: none;
  }

  .profile-store-footer-mobile {
    display: grid;
  }

  .profile-orders-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 10px 8px;
    margin-bottom: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .profile-orders-card > .profile-card-heading {
    display: contents;
  }

  .profile-orders-card > .profile-card-heading > div {
    display: none;
  }

  .profile-orders-card .profile-order-view-tabs {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    gap: 4px;
    margin: 0;
    padding: 4px;
    border-radius: 13px;
  }

  .profile-orders-card .profile-order-view-tabs button {
    min-height: 42px;
    padding: 6px 4px;
    border-radius: 9px;
    font-size: 0.6875rem;
  }

  .profile-orders-card .profile-order-view-tabs span {
    min-width: 21px;
    height: 21px;
    margin-inline-start: 3px;
    padding-inline: 4px;
    font-size: 0.6875rem;
  }

  .profile-orders-card .profile-refresh {
    grid-column: 2;
    grid-row: 1;
    align-self: stretch;
    width: 42px;
    min-width: 42px;
    max-width: none;
    min-height: 42px;
    margin: 0;
    padding: 0;
    border-radius: 12px;
    font-size: 0;
  }

  .profile-orders-card .profile-refresh::before {
    content: "↻";
    display: block;
    font-size: 1.3125rem;
    line-height: 1;
    text-align: center;
  }

  .profile-orders-card > .profile-message,
  .profile-orders-card > .profile-orders-list,
  .profile-orders-card > .profile-pagination {
    grid-column: 1 / -1;
  }
}

/* Phase 22-21-4-10: mobile-only inline order total below the order date. */
.profile-order-mobile-total {
  display: none;
}

@media (max-width: 600px) {
  .profile-order-total {
    display: none;
  }

  .profile-order-mobile-total {
    display: block;
    margin-top: 2px;
    color: #a77821;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.55;
    text-align: right;
    white-space: nowrap;
  }
}

/* Phase 22-21-4-12: one profile navigation level on desktop and mobile. */
.profile-unified-view-switcher {
  position: sticky;
  top: 112px;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: min(720px, 100%);
  margin: -22px auto 28px;
  padding: 6px;
  border: 1px solid rgba(63, 167, 163, 0.22);
  border-radius: 15px;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 12px 35px rgba(45, 80, 74, 0.12);
  backdrop-filter: blur(12px);
}

.profile-unified-view-switcher button {
  min-width: 0;
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--teal-dark);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.55;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.profile-unified-view-switcher button:hover {
  background: rgba(63, 167, 163, 0.1);
}

.profile-unified-view-switcher button.active,
.profile-unified-view-switcher button[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  box-shadow: 0 7px 18px rgba(45, 127, 124, 0.22);
}

.profile-unified-view-switcher button:focus-visible {
  outline: 3px solid rgba(201, 163, 78, 0.34);
  outline-offset: 2px;
}

.profile-orders-card {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 900px) {
  .profile-unified-view-switcher {
    top: 82px;
  }
}

@media (max-width: 600px) {
  .profile-unified-view-switcher {
    top: 74px;
    gap: 4px;
    width: 100%;
    margin: 0 0 12px;
    padding: 4px;
    border-radius: 13px;
    box-shadow: 0 9px 24px rgba(45, 80, 74, 0.11);
  }

  .profile-unified-view-switcher button {
    min-height: 44px;
    padding: 6px 3px;
    border-radius: 9px;
    font-size: 0.6875rem;
  }
}

/* Phase 22-21-4-13: two compact order cards per desktop row. */
@media (min-width: 901px) {
  .profile-order-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 20px;
  }

  .profile-order.is-open {
    grid-column: 1 / -1;
  }

  .profile-order .profile-order-toggle {
    grid-template-columns: 76px minmax(0, 1fr) auto;
  }

  .profile-order:not(.is-open) .profile-order-toggle {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    grid-template-rows: auto;
    gap: 12px;
    min-height: 108px;
    padding: 14px 18px 14px 15px;
  }

  .profile-order:not(.is-open) .profile-order-thumbnail {
    grid-column: 1;
    grid-row: 1;
    width: 64px;
    height: 64px;
    border-radius: 12px;
  }

  .profile-order:not(.is-open) .profile-order-heading {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }

  .profile-order:not(.is-open) .profile-order-heading strong {
    overflow-wrap: anywhere;
    font-size: 0.875rem;
  }

  .profile-order:not(.is-open) .profile-order-open-label {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    justify-self: end;
  }
}

/* Phase 22-21-4-14: show the order total below its date at every width. */
.profile-order-inline-total {
  display: block;
  margin-top: 2px;
  color: #a77821;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.55;
  text-align: right;
  white-space: nowrap;
}

/* Phase 22-21-4-16: mobile-only top-left order disclosure control. */
@media (max-width: 600px) {
  .profile-order-disclosure > .profile-order-toggle {
    position: relative;
    padding-left: 52px;
  }

  .profile-order-open-label {
    position: absolute;
    z-index: 2;
    top: 12px;
    left: 12px;
    grid-column: auto;
    grid-row: auto;
    justify-self: auto;
    justify-content: initial;
    display: block;
    width: 33px;
    height: 33px;
    padding: 0;
    border: 0;
  }

  .profile-order-open-label b {
    display: none;
  }

  .profile-order-open-label i {
    width: 33px;
    height: 33px;
  }
}

/* Phase 22-21-4-22: compact account-management actions on mobile only. */
@media (max-width: 600px) {
  .profile-account-actions .profile-account-section-heading small,
  .profile-account-actions .profile-account-section-heading p {
    display: none;
  }

  .profile-account-actions .profile-account-section-heading {
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .profile-account-action-list {
    grid-template-columns: repeat(2, minmax(120px, 170px));
    justify-content: center;
    gap: 8px;
  }

  .profile-account-action {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-height: 46px;
    padding: 9px 10px;
    place-items: center;
    text-align: center;
  }

  .profile-account-action > span,
  .profile-account-action > small {
    display: none;
  }

  .profile-account-action strong {
    display: block;
    align-self: center;
    width: 100%;
    font-size: 0;
    line-height: 0;
    text-align: center;
    white-space: nowrap;
  }

  .profile-account-action strong::after {
    content: attr(data-mobile-label);
    font-size: 0.78125rem;
    line-height: 1.6;
  }
}

@media (max-width: 340px) {
  .profile-account-action-list {
    grid-template-columns: minmax(120px, 170px);
  }
}

/* PHASE 22-21-4-45: PROFILE AND PROFILE DIALOG TYPOGRAPHY */
.profile-page-body {
  --profile-font-2xs: 0.6875rem;
  --profile-font-xs: 0.75rem;
  --profile-font-sm: 0.8125rem;
  --profile-font-md: 0.875rem;
  --profile-font-base: 1rem;
  --profile-font-lg: 1.125rem;
  font-size: var(--profile-font-base);
}

.profile-page-body .profile-header nav a {
  font-size: 0.9375rem;
}

.profile-page-body .profile-header .logo strong {
  font-size: clamp(1.625rem, 2.4vw, 2.125rem);
}

.profile-page-body .profile-header-store {
  font-size: var(--profile-font-md);
}

.profile-page-body .hamburger {
  font-size: 1.5rem;
}

.profile-page-body .profile-auth-gate section > span {
  font-size: clamp(1.75rem, 3vw, 1.9375rem);
}

.profile-page-body .profile-auth-gate h1 {
  font-size: clamp(1.375rem, 2.4vw, 1.625rem);
}

.profile-page-body .profile-auth-gate p,
.profile-page-body .profile-empty,
.profile-page-body .profile-message {
  font-size: var(--profile-font-md);
}

.profile-page-body .profile-avatar {
  font-size: clamp(1.8125rem, 3vw, 2.25rem);
}

.profile-page-body .profile-hero > div > span {
  font-size: var(--profile-font-md);
}

.profile-page-body .profile-hero h1 {
  font-size: clamp(1.6875rem, 3vw, 2.125rem);
}

.profile-page-body .profile-hero p,
.profile-page-body .profile-hero-summary-item {
  font-size: 0.9375rem;
}

.profile-page-body .profile-unified-view-switcher button,
.profile-page-body .profile-mobile-nav button {
  font-size: var(--profile-font-md);
}

.profile-page-body .profile-card-number,
.profile-page-body .profile-order-group-heading > span,
.profile-page-body .profile-card-heading > span {
  font-size: var(--profile-font-sm);
}

.profile-page-body .profile-card-heading h2 {
  font-size: clamp(1.4375rem, 2.5vw, 1.75rem);
}

.profile-page-body .profile-card-heading p,
.profile-page-body .profile-order-group-heading p,
.profile-page-body .profile-account-section-heading p {
  font-size: var(--profile-font-md);
}

.profile-page-body .profile-card-heading i,
.profile-page-body .profile-account-section-icon {
  font-size: clamp(1.25rem, 2vw, 1.4375rem);
}

.profile-page-body .profile-form label,
.profile-page-body .profile-password-dialog-form label,
.profile-page-body .profile-mobile-dialog label,
.profile-page-body .profile-order-edit-form label,
.profile-page-body .profile-receipt-form label {
  font-size: var(--profile-font-md);
}

.profile-page-body .profile-form input,
.profile-page-body .profile-form textarea,
.profile-page-body .profile-form select,
.profile-page-body .profile-password-dialog-form input,
.profile-page-body .profile-mobile-dialog input,
.profile-page-body .profile-order-edit-form input,
.profile-page-body .profile-order-edit-form textarea,
.profile-page-body .profile-receipt-form input {
  font-size: 0.9375rem;
}

.profile-page-body .profile-form button,
.profile-page-body .profile-password-dialog-actions button,
.profile-page-body .profile-mobile-dialog button,
.profile-page-body .profile-order-edit-actions button,
.profile-page-body .profile-receipt-form button,
.profile-page-body .profile-pagination button {
  font-size: var(--profile-font-md);
}

.profile-page-body .profile-message,
.profile-page-body .profile-form small,
.profile-page-body .profile-pagination strong,
.profile-page-body .profile-order-contact,
.profile-page-body .profile-order-delivery,
.profile-page-body .profile-order-management p {
  font-size: var(--profile-font-sm);
}

.profile-page-body .profile-account-section-heading small,
.profile-page-body .profile-password-dialog-header span {
  font-size: var(--profile-font-sm);
}

.profile-page-body .profile-account-section-heading h3 {
  font-size: clamp(1.25rem, 2.2vw, 1.4375rem);
}

.profile-page-body .profile-account-action > i {
  font-size: 1.125rem;
}

.profile-page-body .profile-account-action strong {
  font-size: var(--profile-font-md);
}

.profile-page-body .profile-account-action small {
  font-size: var(--profile-font-xs);
}

.profile-page-body .profile-password-dialog-header h2 {
  font-size: clamp(1.375rem, 2.5vw, 1.625rem);
}

.profile-page-body .profile-password-dialog-header p,
.profile-page-body .profile-mobile-verification-note,
.profile-page-body .profile-mobile-verification-tools button {
  font-size: var(--profile-font-sm);
}

.profile-page-body .profile-password-dialog-shell > button {
  font-size: 1.5rem;
}

.profile-page-body .profile-mobile-current {
  font-size: var(--profile-font-sm);
}

.profile-page-body .profile-mobile-current strong {
  font-size: 0.9375rem;
}

.profile-page-body .profile-mobile-code {
  font-size: 1.125rem !important;
}

.profile-page-body .profile-order-group-heading h3 {
  font-size: clamp(1.25rem, 2.3vw, 1.5rem);
}

.profile-page-body .profile-order-heading strong {
  font-size: 0.9375rem;
}

.profile-page-body .profile-order-heading small,
.profile-page-body .profile-order-summary span,
.profile-page-body .profile-order-products-heading span,
.profile-page-body .profile-order-more,
.profile-page-body .profile-order-disclosure {
  font-size: var(--profile-font-xs);
}

.profile-page-body .profile-order-total span {
  font-size: var(--profile-font-2xs);
}

.profile-page-body .profile-order-total strong,
.profile-page-body .profile-order-inline-total {
  font-size: var(--profile-font-md);
}

.profile-page-body .profile-order-open-label b,
.profile-page-body .profile-order-progress h4,
.profile-page-body .profile-order-products-heading h4 {
  font-size: var(--profile-font-sm);
}

.profile-page-body .profile-order-toggle::after {
  font-size: 1.3125rem;
}

.profile-page-body .profile-order-progress li {
  font-size: var(--profile-font-2xs);
}

.profile-page-body .profile-order-item strong,
.profile-page-body .profile-order-item > span {
  font-size: var(--profile-font-md);
}

.profile-page-body .profile-order-item small,
.profile-page-body .profile-order-item > b {
  font-size: var(--profile-font-xs);
}

.profile-page-body .profile-payment-panel h4,
.profile-page-body .profile-receipt-history h5 {
  font-size: var(--profile-font-sm);
}

.profile-page-body .profile-payment-panel p,
.profile-page-body .profile-payment-panel > div:first-child > span,
.profile-page-body .profile-receipt-history article,
.profile-page-body .profile-payment-info,
.profile-page-body .profile-payment-deadline {
  font-size: var(--profile-font-xs);
}

.profile-page-body .profile-payment-instructions {
  color: #a86f0b;
  font-size: var(--profile-font-sm);
  font-weight: 800;
}

.profile-page-body .profile-payment-panel.requires-action h4 {
  font-size: clamp(0.9375rem, 2.2vw, 1.125rem);
}

.profile-page-body .profile-rejected-admin-message strong {
  font-size: var(--profile-font-base);
}

.profile-page-body .profile-rejected-admin-message span,
.profile-page-body .profile-receipt-history article.is-rejected a {
  font-size: var(--profile-font-md);
}

.profile-page-body .profile-footer,
.profile-page-body .profile-footer a {
  font-size: var(--profile-font-sm);
}

.profile-page-body .profile-mobile-nav small {
  font-size: var(--profile-font-2xs);
}

@media (max-width: 720px) {
  .profile-page-body .profile-header .logo strong {
    font-size: clamp(1.5rem, 7vw, 1.75rem);
  }

  .profile-page-body .profile-header-store,
  .profile-page-body .profile-unified-view-switcher button,
  .profile-page-body .profile-mobile-nav button {
    font-size: var(--profile-font-sm);
  }

  .profile-page-body .profile-hero h1 {
    font-size: clamp(1.6875rem, 8vw, 2rem);
  }

  .profile-page-body .profile-card-heading h2,
  .profile-page-body .profile-order-group-heading h3 {
    font-size: clamp(1.25rem, 6vw, 1.5rem);
  }

  .profile-page-body .profile-order-heading strong {
    font-size: var(--profile-font-md);
  }

  .profile-page-body .profile-order-progress li,
  .profile-page-body .profile-order-total span {
    font-size: var(--profile-font-2xs);
  }
}

@media (max-width: 600px) {
  .profile-page-body .profile-account-action strong {
    font-size: 0;
  }

  .profile-page-body .profile-account-action strong::after {
    font-size: var(--profile-font-sm);
  }
}

/* Phase 22-21-4-110: separate Hogoon message box (no title, includes shipping code) above the delivery summary. */
.profile-order-body > .profile-order-admin-note {
  width: 100%;
  margin: 18px 0 0;
  padding: 13px 15px;
  border: 1px solid rgba(201, 163, 78, 0.55);
  border-radius: 14px;
  background: #fff3d1;
}

.profile-order-admin-note p {
  margin: 0;
  color: #5c5240;
  font-size: 0.8125rem;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
