/* ==========================================================================
   TAGOOLI UI Phase 4 — My Account
   Loaded only on account pages. Reuses design tokens + .tg-btn / .tg-card / .tg-input / .tg-badge.
   Presentation only — WC hooks, endpoints, field names and order queries unchanged.
   ========================================================================== */

/* ---------- Page shell ---------- */
body.woocommerce-account .tg-page-hero--account {
  background: var(--tg-color-page);
  border-bottom: 0;
  padding: 28px 0 14px;
}
body.woocommerce-account .tg-page-hero--account h1 {
  margin: 0;
  font-size: var(--tg-fs-page-title);
  font-weight: 700;
  line-height: 1.2;
  color: var(--tg-color-brand);
  letter-spacing: -0.01em;
}
body.woocommerce-account .tg-content--account {
  background: var(--tg-color-page);
  padding: 0 0 56px;
}
body.woocommerce-account .tg-container--account {
  width: min(100% - 48px, var(--tg-max));
  max-width: var(--tg-max);
  margin-inline: auto;
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
}
body.woocommerce-account { overflow-x: hidden; }
body.woocommerce-account .tg-content--account *,
body.woocommerce-account .tg-account * { box-sizing: border-box; }

/* Notices */
body.woocommerce-account .woocommerce-notices-wrapper:empty { display: none; }
body.woocommerce-account .woocommerce-message,
body.woocommerce-account .woocommerce-info,
body.woocommerce-account .woocommerce-error {
  margin: 0 0 16px;
  padding: 14px 18px 14px 48px;
  border: 1px solid #D6E6F8;
  border-left: 4px solid var(--tg-color-button);
  border-radius: 12px;
  background: #F5F9FF;
  color: var(--tg-color-brand);
  font-size: 14px;
  line-height: 1.5;
  box-shadow: none;
  list-style: none;
}
body.woocommerce-account .woocommerce-message {
  border-left-color: var(--tg-color-success);
  background: #F2FBF6;
  border-color: #CDEAD5;
}
body.woocommerce-account .woocommerce-error {
  border-left-color: var(--tg-color-sale);
  background: #FFF5F5;
  border-color: #F6C9CC;
}

/* ---------- Layout: nav + content ---------- */
.tg-account {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.tg-account__content,
.woocommerce-MyAccount-content.tg-account__content {
  min-width: 0;
  max-width: 100%;
  float: none !important;
  width: auto !important;
}

/* Hide legacy WC float clear */
body.woocommerce-account .woocommerce::after,
body.woocommerce-account .woocommerce::before { display: none !important; content: none !important; }
body.woocommerce-account .woocommerce { display: block; }

/* ---------- Left nav ---------- */
.tg-account-nav,
.woocommerce-MyAccount-navigation.tg-account-nav {
  float: none !important;
  width: auto !important;
  max-width: 100%;
  min-width: 0;
  position: sticky;
  top: calc(var(--tg-announce-h, 32px) + var(--tg-header-h, 76px) + 12px);
  background: var(--tg-color-card);
  border: 1px solid var(--tg-color-border);
  border-radius: 16px;
  box-shadow: var(--tg-shadow-soft);
  padding: 10px;
}
.tg-account-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.tg-account-nav__list li { margin: 0; padding: 0; border: 0; }
.tg-account-nav__list li::before,
.tg-account-nav__list li::after { display: none !important; content: none !important; }
.tg-account-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px 10px 12px;
  border-radius: 12px;
  color: var(--tg-color-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
  border-left: 3px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tg-account-nav__icon {
  display: inline-flex;
  color: var(--tg-color-muted);
  flex: 0 0 auto;
}
.tg-account-nav__link:hover {
  background: #F3F7FD;
  color: var(--tg-color-button);
}
.tg-account-nav__link:hover .tg-account-nav__icon { color: var(--tg-color-button); }
.is-active .tg-account-nav__link,
li.is-active > .tg-account-nav__link,
.woocommerce-MyAccount-navigation-link.is-active > .tg-account-nav__link {
  background: #EAF2FC;
  color: var(--tg-color-button);
  border-left-color: var(--tg-color-button);
}
.is-active .tg-account-nav__icon,
li.is-active .tg-account-nav__icon { color: var(--tg-color-button); }
.woocommerce-MyAccount-navigation-link--customer-logout .tg-account-nav__link {
  color: var(--tg-color-muted);
  margin-top: 4px;
}

/* ---------- Shared section head ---------- */
.tg-account-section-head { margin: 0 0 18px; }
.tg-account-section-head__title {
  margin: 0 0 4px;
  font-size: var(--tg-fs-module-title);
  font-weight: 700;
  color: var(--tg-color-brand);
  line-height: 1.25;
}
.tg-account-section-head__sub {
  margin: 0;
  color: var(--tg-color-muted);
  font-size: var(--tg-fs-meta);
  line-height: 1.45;
}
.tg-account-back {
  color: var(--tg-color-button);
  text-decoration: none;
  font-weight: 600;
}
.tg-account-back:hover { text-decoration: underline; }

/* ---------- Orders table (legacy helpers retained) ---------- */
.tg-account-orders__table-wrap {
  background: var(--tg-color-card);
  border: 1px solid var(--tg-color-border);
  border-radius: 16px;
  box-shadow: var(--tg-shadow-soft);
  overflow: hidden;
}
.tg-orders-table {
  width: 100%;
  margin: 0 !important;
  border: 0 !important;
  border-collapse: collapse;
  background: transparent;
}
.tg-orders-table thead th {
  padding: 14px 18px;
  background: #F7FAFD;
  border-bottom: 1px solid var(--tg-color-border);
  color: var(--tg-color-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: left;
}
.tg-orders-table tbody td,
.tg-orders-table tbody th {
  padding: 16px 18px;
  border-bottom: 1px solid var(--tg-color-border);
  vertical-align: middle;
  background: transparent;
  font-size: 14px;
  color: var(--tg-color-text);
}
.tg-orders-table tbody tr:last-child td,
.tg-orders-table tbody tr:last-child th { border-bottom: 0; }
.tg-orders-num {
  display: inline-block;
  color: var(--tg-color-button);
  font-weight: 700;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.3;
}
.tg-orders-num:hover { text-decoration: underline; }
.tg-orders-qty {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 500;
  color: var(--tg-color-muted);
}
.tg-orders-date { color: var(--tg-color-muted); font-size: 13px; white-space: nowrap; }
.tg-orders-total {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tg-orders-total__amount {
  font-weight: 700;
  font-size: 15px;
  color: var(--tg-color-brand);
  white-space: nowrap;
}
.tg-orders-total__count {
  font-size: 12px;
  color: var(--tg-color-muted);
}
.tg-account-orders__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}
.tg-account-orders__perpage {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.tg-account-orders__perpage-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--tg-color-muted);
  white-space: nowrap;
}
.tg-account-orders__perpage-select {
  width: auto !important;
  min-width: 72px;
  min-height: 40px !important;
  height: 40px !important;
  padding: 0 32px 0 12px !important;
}
.tg-orders-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tg-btn--sm {
  min-height: 36px;
  padding: 0.45rem 0.9rem;
  font-size: 13px;
}

/* Status badges superseded by Concept C block below */

.tg-account-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.tg-account-pagination__meta {
  font-size: 13px;
  color: var(--tg-color-muted);
  font-weight: 600;
}
.tg-account-pagination__nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tg-account-pagination__pages {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
}
.tg-account-pagination__page {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--tg-color-border);
  background: #fff;
  color: var(--tg-color-text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
a.tg-account-pagination__page:hover {
  border-color: #C9DBF2;
  color: var(--tg-color-button);
  background: #F5F9FF;
}
.tg-account-pagination__page.is-current {
  background: var(--tg-color-button);
  border-color: var(--tg-color-button);
  color: #fff;
}
.tg-account-pagination__ellipsis {
  padding: 0 4px;
  color: var(--tg-color-muted);
}
.tg-btn.is-disabled,
.tg-btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}
.tg-account-orders__empty { padding: 48px 24px; }

/* ---------- Addresses ---------- */
.tg-address-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.tg-address-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tg-address-card { padding: 20px 22px; }
.tg-address-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.tg-address-card__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #EEF4FD;
  color: var(--tg-color-button);
  flex: 0 0 auto;
}
.tg-address-card__titles { flex: 1; min-width: 0; }
.tg-address-card__type {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--tg-color-brand);
}
.tg-address-card__edit { flex: 0 0 auto; }
.tg-address-card__body {
  display: grid;
  gap: 10px;
  font-style: normal;
  margin: 0;
}
.tg-address-card__row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}
.tg-address-card__label {
  color: var(--tg-color-muted);
  font-weight: 600;
  font-size: 13px;
}
.tg-address-card__value {
  color: var(--tg-color-text);
  word-break: break-word;
}
.tg-address-card__empty {
  padding: 28px 16px;
  border-style: dashed;
}

/* ---------- Account details / forms ---------- */
.tg-account-details__form {
  display: grid;
  gap: 18px;
  margin: 0;
}
.tg-account-details__card { padding: 22px 24px; }
.tg-account-details__card-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--tg-color-brand);
}
.tg-account-details__card-sub {
  margin: 0 0 16px;
  color: var(--tg-color-muted);
  font-size: 13px;
}
.tg-account-details__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.tg-account-details__row .form-row-first,
.tg-account-details__row .form-row-last {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
}
.tg-account-form,
.tg-account-address-edit .tg-account-form {
  padding: 22px 24px;
  max-width: 720px;
}
.tg-account-form__fields .form-row,
body.woocommerce-account .woocommerce-address-fields .form-row,
body.woocommerce-account .woocommerce-EditAccountForm .form-row {
  margin: 0 0 14px !important;
  padding: 0 !important;
  float: none !important;
  width: 100% !important;
}
body.woocommerce-account .woocommerce-address-fields .form-row-first,
body.woocommerce-account .woocommerce-address-fields .form-row-last {
  width: calc(50% - 7px) !important;
  display: inline-block;
  vertical-align: top;
}
body.woocommerce-account .woocommerce-address-fields .form-row-first { margin-right: 14px !important; }

body.woocommerce-account .woocommerce form-row label,
body.woocommerce-account .tg-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: var(--tg-fs-meta);
  font-weight: 600;
  color: var(--tg-color-text);
}
body.woocommerce-account .woocommerce form-row .required,
body.woocommerce-account .req { color: var(--tg-color-sale); }

body.woocommerce-account .woocommerce input.input-text,
body.woocommerce-account .woocommerce textarea,
body.woocommerce-account .woocommerce select,
body.woocommerce-account .tg-input {
  display: block;
  width: 100%;
  min-height: var(--tg-input-h);
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--tg-color-border);
  border-radius: var(--tg-radius-sm);
  background: var(--tg-color-card);
  color: var(--tg-color-text);
  font: inherit;
  box-shadow: none;
}
body.woocommerce-account .woocommerce input.input-text:focus,
body.woocommerce-account .woocommerce textarea:focus,
body.woocommerce-account .woocommerce select:focus {
  outline: none;
  border-color: var(--tg-color-button);
  box-shadow: 0 0 0 3px rgba(23, 105, 210, 0.14);
}
body.woocommerce-account fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}
body.woocommerce-account fieldset legend { display: none; }
.tg-field-hint {
  display: block;
  margin-top: 6px;
  color: var(--tg-color-muted);
  font-size: 12px;
}
.tg-account-form__actions {
  margin: 8px 0 0 !important;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Password toggle + strength — eye icon ONLY (hide WC core duplicate) */
.tg-password {
  position: relative;
  display: block;
}
.tg-password .password-input {
  display: block;
  position: relative;
  width: 100%;
}
.tg-password .tg-input,
.tg-password input.input-text,
.tg-password .password-input input.input-text {
  width: 100%;
  padding-right: 48px !important;
  box-sizing: border-box;
}
.tg-password .show-password-input {
  display: none !important;
}
.tg-password__toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--tg-color-muted);
  cursor: pointer;
  padding: 0;
  border-radius: 8px;
  line-height: 0;
}
.tg-password__toggle:hover {
  background: #EEF4FD;
  color: var(--tg-color-button);
}
.tg-password__toggle.is-showing { color: var(--tg-color-button); }
.tg-password__ico { display: block; }
.tg-password__ico[hidden] { display: none !important; }
.tg-password-strength {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.tg-password-strength__bar {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--tg-color-border);
  overflow: hidden;
}
.tg-password-strength__bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--tg-color-muted);
  transition: width .2s ease, background .2s ease;
}
.tg-password-strength[data-level="1"] .tg-password-strength__bar > i { width: 25%; background: var(--tg-color-sale); }
.tg-password-strength[data-level="2"] .tg-password-strength__bar > i { width: 50%; background: var(--tg-color-warning); }
.tg-password-strength[data-level="3"] .tg-password-strength__bar > i { width: 75%; background: #2F9E5D; }
.tg-password-strength[data-level="4"] .tg-password-strength__bar > i { width: 100%; background: var(--tg-color-success); }
.tg-password-strength__label {
  font-size: 12px;
  color: var(--tg-color-muted);
}

/* Login / lost password (logged-out account page) */
body.woocommerce-account:not(.logged-in) .tg-account,
body.woocommerce-account .u-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
body.woocommerce-account:not(.logged-in) .woocommerce,
body.woocommerce-account .woocommerce-form-login,
body.woocommerce-account .woocommerce-form-register {
  background: var(--tg-color-card);
  border: 1px solid var(--tg-color-border);
  border-radius: 16px;
  box-shadow: var(--tg-shadow-soft);
  padding: 24px;
  max-width: 480px;
  margin-inline: auto;
}
body.woocommerce-account .woocommerce-form-login .button,
body.woocommerce-account .woocommerce-form-register .button,
body.woocommerce-account .woocommerce-Button.button {
  /* keep WC submit looking like tg primary when not already classed */
}

/* Toast host */
.tg-toast.is-visible { opacity: 1; pointer-events: auto; }
.tg-toast { opacity: 0; pointer-events: none; transition: opacity .2s ease; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {

}
@media (max-width: 900px) {
  .tg-account {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  /* t198: Mobile account nav fixed to bottom of viewport (desktop sticky sidebar unchanged ≥901px). */
  .tg-account-nav,
  .woocommerce-MyAccount-navigation.tg-account-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 90;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    width: 100% !important;
    max-width: 100%;
    overflow: hidden;
    margin: 0;
    border-radius: 16px 16px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    background: var(--tg-color-card, #fff);
    box-shadow: 0 -8px 24px rgba(15, 40, 80, 0.12);
  }
  .tg-account,
  .tg-account__content,
  .woocommerce-MyAccount-content.tg-account__content {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .tg-account-nav__list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    max-width: 100%;
    min-width: 0;
  }
  .tg-account-nav__list li { flex: 0 0 auto; }
  .tg-account-nav__link {
    border-left: 0;
    border-bottom: 3px solid transparent;
    border-radius: 10px;
    padding: 10px 12px;
    white-space: nowrap;
  }
  .is-active .tg-account-nav__link,
  li.is-active > .tg-account-nav__link {
    border-left-color: transparent;
    border-bottom-color: var(--tg-color-button);
  }
  .tg-account__content,
  .woocommerce-MyAccount-content.tg-account__content {
    position: relative;
    z-index: 1;
  }
  .tg-account-orders__toolbar {
    position: relative;
    z-index: 1;
  }
  .tg-account-orders__search {
    position: relative;
    z-index: 1;
  }
  .tg-account-orders__search .tg-input {
    position: relative;
    z-index: 0;
  }
  .tg-address-grid--2 { grid-template-columns: 1fr; }
  .tg-account-details__row { grid-template-columns: 1fr; }
  body.woocommerce-account .woocommerce-address-fields .form-row-first,
  body.woocommerce-account .woocommerce-address-fields .form-row-last {
    width: 100% !important;
    display: block;
    margin-right: 0 !important;
  }
}
@media (max-width: 720px) {
  body.woocommerce-account .tg-container--account {
    width: min(100% - 24px, var(--tg-max));
  }
  /* Orders → stacked cards */
  .tg-account-orders__table-wrap {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }
  .tg-orders-table thead { display: none; }
  .tg-orders-table,
  .tg-orders-table tbody,
  .tg-orders-table tr,
  .tg-orders-table td,
  .tg-orders-table th {
    display: block;
    width: 100%;
  }
  .tg-orders-table tbody tr.tg-orders-row {
    background: var(--tg-color-card);
    border: 1px solid var(--tg-color-border);
    border-radius: 14px;
    box-shadow: var(--tg-shadow-soft);
    padding: 14px 16px;
    margin-bottom: 12px;
  }
  .tg-orders-table tbody td,
  .tg-orders-table tbody th {
    border: 0;
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
  .tg-orders-table tbody td::before,
  .tg-orders-table tbody th::before {
    content: attr(data-title);
    color: var(--tg-color-muted);
    font-size: 12px;
    font-weight: 600;
    flex: 0 0 auto;
  }
  .tg-orders-actions { justify-content: flex-end; }
  .tg-address-card__row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .tg-account-pagination__nav { width: 100%; justify-content: space-between; }
}

/* ---------- Password: eye anchored to input row; meter below (v2 fix) ---------- */
.tg-password .password-input { position: relative; display: block; }
.tg-password__toggle {
  top: calc(var(--tg-input-h, 48px) / 2) !important;
  transform: translateY(-50%) !important;
}
.tg-password .password-input .tg-password__toggle { top: 50% !important; }
body.woocommerce-account .woocommerce-password-strength {
  display: block;
  margin: 8px 0 0;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  border: 1px solid transparent;
}
body.woocommerce-account .woocommerce-password-strength.short { background: #FDE8EA; color: var(--tg-color-sale); border-color: #F6C9CC; }
body.woocommerce-account .woocommerce-password-strength.bad { background: #FFF4E5; color: var(--tg-color-warning); border-color: #F8DDB5; }
body.woocommerce-account .woocommerce-password-strength.good { background: #E8F1FC; color: var(--tg-color-button); border-color: #CFE0F6; }
body.woocommerce-account .woocommerce-password-strength.strong { background: #E7F7EE; color: var(--tg-color-success); border-color: #CDEAD5; }
body.woocommerce-account .woocommerce-password-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--tg-color-muted);
}

/* ---------- VN shipping badge (account address edit) ---------- */
body.woocommerce-account .woocommerce-address-fields .tg-field-hidden,
body.woocommerce-account .tg-account-address-edit .tg-field-hidden,
body.woocommerce-account #billing_country_field.tg-country-locked,
body.woocommerce-account #shipping_country_field.tg-country-locked {
  display: none !important;
}
.tg-vn-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  clear: both;
  float: none;
  margin: 0 0 20px;
  padding: 12px 18px;
  min-height: 48px;
  border-radius: 999px;
  background: #EEF4FD;
  border: 1px solid #D6E6F8;
  color: var(--tg-color-brand);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  box-shadow: var(--tg-shadow-soft);
}
body.woocommerce-account .woocommerce-address-fields__field-wrapper > .tg-vn-badge {
  display: flex;
  width: 100% !important;
  clear: both;
}
.tg-vn-badge__flag {
  font-size: 22px;
  line-height: 1;
}
.tg-vn-badge__text { letter-spacing: 0.01em; }

/* ---------- Dashboard (Phase 4 v3 Concept C) ---------- */
.tg-account-dash {
  display: grid;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.tg-account-dash__banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding: 22px 24px;
  border-radius: 16px;
  /* Same navy tone as the dashboard welcome strip; each page adds its own themed art below. */
  --tg-hero-glow: rgba(90, 169, 255, 0.28);
  background-color: #18375F;
  background-image:
    none,
    radial-gradient(circle at 82% 50%, var(--tg-hero-glow) 0, transparent 46%),
    linear-gradient(135deg, #18375F 0%, #1E4A7A 55%, #1769D2 130%);
  background-repeat: no-repeat;
  background-position: right 8px center, center, center;
  background-size: auto 112%, auto, auto;
  color: #fff;
  overflow: hidden;
  box-shadow: var(--tg-shadow);
}
.tg-account-dash__banner-main { position: relative; z-index: 1; min-width: 0; flex: 1 1 280px; }
.tg-account-dash__banner-hello {
  margin: 0 0 14px;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.tg-account-dash__banner-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.tg-account-dash__avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.22);
}
.tg-account-dash__hello { min-width: 0; }
.tg-account-dash__name {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}
.tg-account-dash__email {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.78);
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}
.tg-account-dash__banner-actions {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tg-btn--light {
  background: #fff;
  color: var(--tg-color-brand);
  border: 1px solid #fff;
}
.tg-btn--light:hover { background: #F3F7FD; color: var(--tg-color-button); }
.tg-btn--ghost-light {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.45);
}
.tg-btn--ghost-light:hover { background: rgba(255,255,255,0.1); border-color: #fff; }
.tg-account-dash__banner-deco {
  position: absolute;
  right: -20px;
  bottom: -30px;
  width: 160px;
  height: 160px;
  border-radius: 28px;
  background: rgba(255,255,255,0.08);
  transform: rotate(18deg);
  pointer-events: none;
}
.tg-account-dash__banner-deco::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 20px;
  border: 2px dashed rgba(255,255,255,0.22);
}

/* Overview + Quick share the same content-column alignment (not under sidebar). */
.tg-account-dash__overview,
.tg-account-dash__trust,
.tg-account-dash__quick {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.tg-account-dash__section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}
.tg-account-dash__section-title {
  margin: 0;
  font-size: var(--tg-fs-module-title);
  font-weight: 700;
  color: var(--tg-color-brand);
  line-height: 1.25;
}
.tg-account-dash__section-bolt { color: var(--tg-color-logo-red); display: inline-flex; }

.tg-account-dash__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  background: var(--tg-color-card);
  border: 1px solid var(--tg-color-border);
  border-radius: 16px;
  box-shadow: var(--tg-shadow-soft);
}
.tg-account-dash__stat {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
}
.tg-account-dash__stat-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #FDECEC;
  color: var(--tg-color-logo-red);
  flex: 0 0 auto;
}
.tg-account-dash__stat--completed .tg-account-dash__stat-icon {
  background: #FFF6E5;
  color: var(--tg-color-star);
}
.tg-account-dash__stat-body { display: grid; gap: 2px; min-width: 0; }
.tg-account-dash__stat-value {
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  font-weight: 800;
  color: var(--tg-color-brand);
  line-height: 1.2;
  word-break: break-word;
}
.tg-account-dash__stat-value .woocommerce-Price-amount { font-weight: 800; }
.tg-account-dash__stat-label {
  font-size: 12px;
  color: var(--tg-color-muted);
  font-weight: 600;
}

.tg-account-dash__trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.tg-account-dash__trust-chip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px;
  background: var(--tg-color-card);
  border: 1px solid var(--tg-color-border);
  border-radius: 14px;
  box-shadow: var(--tg-shadow-soft);
  min-width: 0;
}
.tg-account-dash__trust-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #EEF4FD;
  color: var(--tg-color-button);
  flex: 0 0 auto;
}
.tg-account-dash__trust-text { display: grid; gap: 2px; min-width: 0; }
.tg-account-dash__trust-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--tg-color-brand);
  line-height: 1.3;
}
.tg-account-dash__trust-desc {
  font-size: 12px;
  color: var(--tg-color-muted);
  line-height: 1.4;
}

.tg-account-dash__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.tg-account-dash__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 20px 18px 56px;
  min-height: 168px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.tg-account-dash__card:hover {
  transform: translateY(-2px);
  box-shadow: var(--tg-shadow);
  border-color: #C9DBF2;
  background: #FBFCFE;
}
.tg-account-dash__card.is-accent .tg-account-dash__card-icon { color: var(--tg-color-logo-red); background: #FDECEC; }
.tg-account-dash__card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #EEF4FD;
  color: var(--tg-color-button);
  flex: 0 0 auto;
}
.tg-account-dash__card-body { display: grid; gap: 4px; min-width: 0; width: 100%; }
.tg-account-dash__card-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--tg-color-brand);
}
.tg-account-dash__card-desc {
  font-size: 13px;
  color: var(--tg-color-muted);
  line-height: 1.4;
}
.tg-account-dash__card-cta {
  position: absolute;
  left: 18px;
  bottom: 18px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--tg-color-logo-red);
  color: #fff;
  z-index: 1;
}
.tg-account-dash__card-deco {
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 72px;
  height: 64px;
  opacity: 0.9;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
}
.tg-account-dash__card-deco--box {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='64' viewBox='0 0 72 64' fill='none'%3E%3Cpath d='M10 22 36 8l26 14v24L36 60 10 46V22Z' fill='%23D2B48C'/%3E%3Cpath d='M36 8v52' stroke='%23fff' stroke-width='3'/%3E%3Cpath d='M10 22h52' stroke='%23B8956A' stroke-width='2'/%3E%3Cpath d='M28 8h16v8H28z' fill='%23F5F5F5'/%3E%3C/svg%3E");
}
.tg-account-dash__card-deco--pin {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='64' viewBox='0 0 72 64' fill='none'%3E%3Cpath d='M8 46c8-10 18-16 28-16s20 6 28 16' fill='%23EEF2F7'/%3E%3Cpath d='M36 8c-8 0-14 6.2-14 14 0 10 14 26 14 26s14-16 14-26c0-7.8-6-14-14-14Z' fill='%23E30613'/%3E%3Ccircle cx='36' cy='22' r='5' fill='%23fff'/%3E%3C/svg%3E");
}
.tg-account-dash__card-deco--id {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='64' viewBox='0 0 72 64' fill='none'%3E%3Crect x='12' y='14' width='48' height='34' rx='6' fill='%23D7E7FA'/%3E%3Ccircle cx='28' cy='30' r='7' fill='%239DC4F5'/%3E%3Cpath d='M40 24h14M40 30h12M40 36h10' stroke='%237AA7E0' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ---------- Orders Concept C ---------- */
.tg-account-orders__hero {
  /* Soft-card styles applied when .tg-account-hero-card is present */
  margin: 0 0 16px;
}
.tg-account-orders__title {
  margin: 0 0 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--tg-fs-module-title);
  font-weight: 700;
  color: var(--tg-color-brand);
  line-height: 1.25;
}
.tg-account-orders__title .tg-ico { color: var(--tg-color-button); }
.tg-account-orders__count {
  margin: 0;
  color: var(--tg-color-muted);
  font-size: var(--tg-fs-meta);
  font-weight: 600;
}
.tg-account-orders { min-width: 0; }
/* t204 — dynamic status chips (36px, icon 14px + label + count badge). */
.tg-account-orders__tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  max-width: 100%;
}
.tg-account-orders__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  height: 36px;
  padding: 0 12px 0 13px;
  border-radius: 999px;
  background: #EEF3F9;
  color: #1E3A66;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  box-sizing: border-box;
  transition: background-color .15s ease, color .15s ease;
}
.tg-account-orders__tab .tg-osi {
  width: 14px; height: 14px; flex: 0 0 14px;
  color: #6B88B0;
}
.tg-account-orders__tab .tg-osi,
.tg-account-orders__tab .tg-osi * { animation: none; }
.tg-account-orders__tab-label { white-space: nowrap; line-height: 1; }
.tg-account-orders__tab:hover { background: #E2EBF6; color: #1E3A66; }
.tg-account-orders__tab:focus-visible { outline: 2px solid var(--tg-color-button); outline-offset: 2px; }
.tg-account-orders__tab.is-active,
.tg-account-orders__tab.is-active:hover {
  background: var(--tg-color-button);
  color: #fff;
}
.tg-account-orders__tab.is-active .tg-osi { color: #fff; }
.tg-account-orders__tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 2px;
  border-radius: 999px;
  background: rgba(23,104,209,0.12);
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;
}
.tg-account-orders__tab.is-active .tg-account-orders__tab-count { background: rgba(255,255,255,0.24); }
.tg-account-orders__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
}
.tg-account-orders__search {
  position: relative;
  flex: 1 1 180px;
  min-width: 0;
}
.tg-account-orders__toolbar > .tg-account-orders__perpage {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin: 0;
}
.tg-account-orders__search .tg-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tg-color-muted, #7A8798);
  pointer-events: none;
  z-index: 2;
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 1;
  visibility: visible;
}
body.woocommerce-account .tg-account-orders__search .tg-input,
.tg-account-orders__search .tg-input {
  width: 100%;
  padding: 0 14px 0 42px !important;
  min-height: 40px;
  height: 40px;
  box-sizing: border-box;
}
.tg-account-orders__search .tg-ico {
  left: 14px;
  z-index: 2;
}
body.woocommerce-account .tg-account-orders__apply.tg-btn--primary {
  background: #1769D2 !important;
  background-color: #1769D2 !important;
  border-color: #1769D2 !important;
  color: #fff !important;
  min-height: 40px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--tg-radius-pill, 999px);
  font-weight: 600;
  box-shadow: none;
}
body.woocommerce-account .tg-account-orders__apply.tg-btn--primary:hover {
  background: var(--tg-color-brand, #0F4FA8) !important;
  border-color: var(--tg-color-brand, #0F4FA8) !important;
  color: #fff !important;
}
.tg-account-orders__perpage-label {
  font-size: 13px;
  color: var(--tg-color-muted);
  font-weight: 600;
}
.tg-account-orders__perpage-select {
  width: auto;
  min-width: 72px;
  min-height: 40px;
  height: 40px;
  padding: 0 28px 0 10px;
}

.tg-orders-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.tg-orders-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1.4fr) auto auto auto;
  align-items: center;
  gap: 14px 16px;
  padding: 14px 16px;
  background: var(--tg-color-card);
  border: 1px solid var(--tg-color-border);
  border-radius: 14px;
  box-shadow: var(--tg-shadow-soft);
}
.tg-orders-card__thumb {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  background: #F3F6FA;
  flex: 0 0 auto;
}
.tg-orders-card__thumb img,
.tg-orders-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tg-orders-card__thumb-ph {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #E8F1FC, #F3F6FA);
}
.tg-orders-card__main { min-width: 0; }
.tg-orders-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 4px;
}
.tg-orders-card__num {
  font-weight: 800;
  font-size: 15px;
  color: var(--tg-color-brand);
  text-decoration: none;
}
.tg-orders-card__num:hover { color: var(--tg-color-button); }
.tg-orders-card__date {
  font-size: 12px;
  color: var(--tg-color-muted);
  font-weight: 600;
}
.tg-orders-card__product {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  min-width: 0;
}
.tg-orders-card__product-name {
  font-size: 13px;
  color: var(--tg-color-text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.tg-orders-card__product-qty {
  font-size: 12px;
  color: var(--tg-color-muted);
  font-weight: 600;
  white-space: nowrap;
}
.tg-orders-card__total { text-align: right; }
.tg-orders-card__amount {
  font-size: 15px;
  font-weight: 800;
  color: var(--tg-color-brand);
  white-space: nowrap;
}
.tg-orders-card__amount .woocommerce-Price-amount { font-weight: 800; }
.tg-orders-card__view {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--tg-color-logo-red);
  color: var(--tg-color-logo-red);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  background: #fff;
  transition: background .15s ease, color .15s ease;
}
.tg-orders-card__view:hover {
  background: #FDECEC;
  color: var(--tg-color-logo-red);
}

/* Status badges: unified .order-status-badge lives in main.css (t204). */
.tg-orders-card__status { min-width: 0; }

@media (max-width: 1100px) {
  .tg-account-dash__stats,
  .tg-account-dash__trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tg-orders-card {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb main status"
      "thumb main total"
      "thumb main actions";
  }
  .tg-orders-card__thumb { grid-area: thumb; width: 56px; height: 56px; }
  .tg-orders-card__main { grid-area: main; }
  .tg-orders-card__status { grid-area: status; justify-self: end; }
  .tg-orders-card__total { grid-area: total; justify-self: end; }
  .tg-orders-card__actions { grid-area: actions; justify-self: end; }
}
@media (max-width: 1024px) {
  .tg-account-dash__grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .tg-account-dash__banner { padding: 18px; }
  .tg-account-dash__banner-actions { width: 100%; }
  .tg-account-dash__banner-actions .tg-btn { flex: 1 1 auto; justify-content: center; }
  .tg-account-dash__stats,
  .tg-account-dash__trust,
  .tg-account-dash__grid { grid-template-columns: 1fr; }
  .tg-orders-card {
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-areas:
      "thumb main"
      "thumb status"
      "total total"
      "actions actions";
  }
  .tg-orders-card__status,
  .tg-orders-card__total,
  .tg-orders-card__actions { justify-self: start; }
  .tg-orders-card__actions { width: 100%; }
  .tg-orders-card__view { width: 100%; justify-content: center; }
  /* t198/t200: search + per-page on one row; Apply full width below */
  .tg-account-orders__toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }
  .tg-account-orders__search {
    grid-column: 1;
    flex: none;
    width: auto;
    min-width: 0;
    max-width: none;
  }
  .tg-account-orders__toolbar > .tg-account-orders__perpage {
    grid-column: 2;
    flex: none;
    justify-self: end;
  }
  .tg-account-orders__apply,
  body.woocommerce-account .tg-account-orders__apply.tg-btn--primary {
    grid-column: 1 / -1;
    width: 100%;
  }
}
@media (min-width: 721px) and (max-width: 1024px) {
  .tg-account-dash__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}



/* ---------- Phase 4 v3-fix: address controls + view-order ---------- */
body.woocommerce-account .tg-account-address-edit .woocommerce-address-fields .form-row input.input-text,
body.woocommerce-account .tg-account-address-edit .woocommerce-address-fields .form-row select,
body.woocommerce-account .tg-account-address-edit .woocommerce-address-fields .form-row .select2-container .select2-selection--single {
  width: 100%;
  min-height: 46px !important;
  height: 46px !important;
  margin: 0;
  padding: 0 14px !important;
  border: 1px solid var(--tg-color-border) !important;
  border-radius: var(--tg-radius-sm, 10px) !important;
  background: var(--tg-color-card, #fff) !important;
  color: var(--tg-color-text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.3;
  box-shadow: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
body.woocommerce-account .tg-account-address-edit .woocommerce-address-fields .form-row textarea {
  height: auto !important;
  min-height: 96px !important;
  padding: 12px 14px !important;
  resize: vertical;
}
body.woocommerce-account .tg-account-address-edit .woocommerce-address-fields .form-row select {
  padding-right: 36px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7C93' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  cursor: pointer;
}
body.woocommerce-account .tg-account-address-edit .woocommerce-address-fields .form-row input.input-text:focus,
body.woocommerce-account .tg-account-address-edit .woocommerce-address-fields .form-row select:focus,
body.woocommerce-account .tg-account-address-edit .woocommerce-address-fields .form-row .select2-container--open .select2-selection--single,
body.woocommerce-account .tg-account-address-edit .woocommerce-address-fields .form-row .select2-container--focus .select2-selection--single {
  outline: none;
  border-color: var(--tg-color-button) !important;
  box-shadow: 0 0 0 3px rgba(23, 105, 210, 0.14);
}
body.woocommerce-account .tg-account-address-edit .select2-container {
  width: 100% !important;
}
body.woocommerce-account .tg-account-address-edit .select2-container .select2-selection--single {
  display: flex !important;
  align-items: center;
  padding: 0 36px 0 14px !important;
}
body.woocommerce-account .tg-account-address-edit .select2-container .select2-selection__rendered {
  padding: 0 !important;
  line-height: 44px !important;
  color: var(--tg-color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.woocommerce-account .tg-account-address-edit .select2-container .select2-selection__placeholder {
  color: #A3AFBF;
}
body.woocommerce-account .tg-account-address-edit .select2-container .select2-selection__arrow {
  height: 46px !important;
  right: 10px !important;
  top: 0 !important;
}
body.woocommerce-account .tg-account-address-edit .select2-dropdown {
  border-color: var(--tg-color-border);
  border-radius: var(--tg-radius-sm, 10px);
  box-shadow: var(--tg-shadow-soft, 0 8px 24px rgba(15, 40, 80, 0.08));
  overflow: hidden;
}
body.woocommerce-account .tg-account-address-edit .select2-results__option {
  padding: 9px 12px;
  font-size: 14px;
}
body.woocommerce-account .tg-account-address-edit .select2-container--default .select2-results__option--highlighted[aria-selected],
body.woocommerce-account .tg-account-address-edit .select2-container--default .select2-results__option--highlighted[data-selected] {
  background: #EEF4FD;
  color: var(--tg-color-button);
}

.tg-account-view-order {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.tg-account-view-order__hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 18px;
  background: var(--tg-color-card, #fff);
  border: 1px solid var(--tg-color-border, #E3E8EF);
  border-radius: 14px;
  box-shadow: var(--tg-shadow-soft, 0 8px 24px rgba(15, 40, 80, 0.06));
  height: auto !important;
}
.tg-account-view-order__hero-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  min-width: 0;
}
.tg-account-view-order__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  color: var(--tg-color-text);
  font-weight: 600;
}
.tg-account-view-order__meta-label {
  color: var(--tg-color-muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.tg-account-view-order__notes {
  padding: 16px 18px;
  height: auto !important;
}
.tg-account-view-order__notes h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

/* Account sidebar narrows content — tighten order-details pack */
body.woocommerce-view-order .tg-account-view-order .tg-od-page,
body.woocommerce-view-order .woocommerce-MyAccount-content .tg-od-page {
  max-width: 100%;
  margin: 0;
  padding: 0;
}
body.woocommerce-view-order .tg-od-summary-card__grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
body.woocommerce-view-order .tg-od-summary-card,
body.woocommerce-view-order .tg-od-items-card,
body.woocommerce-view-order .tg-od-totals-card,
body.woocommerce-view-order .tg-od-addr,
body.woocommerce-view-order .tg-od-note-card {
  height: auto !important;
}
body.woocommerce-view-order .tg-od-head__title {
  font-size: 1.05rem;
}

@media (max-width: 720px) {
  .tg-vn-badge {
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14px;
  }
  body.woocommerce-account .tg-account-orders__apply.tg-btn--primary {
    width: 100%;
  }
}

@media (max-width: 720px) {
  body.woocommerce-view-order .tg-od-summary-card__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tg-account-view-order__hero {
    padding: 12px 14px;
  }
}
@media (max-width: 430px) {
  body.woocommerce-view-order .tg-od-summary-card__grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Phase 4 v3-fix2: view-order shipping address only ---------- */
body.woocommerce-view-order .tg-od-customer,
body.woocommerce-view-order .tg-od-addrs,
body.woocommerce-order-received .tg-od-customer,
body.woocommerce-order-received .tg-od-addrs {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  float: none !important;
  clear: both;
  box-sizing: border-box;
}
body.woocommerce-view-order .tg-od-customer {
  margin-top: 8px;
  padding: 0 0 8px;
}
body.woocommerce-view-order .tg-od-addrs,
body.woocommerce-order-received .tg-od-addrs,
.tg-od-addrs--single {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin: 0 0 1rem;
}
body.woocommerce-view-order .tg-od-addr,
body.woocommerce-order-received .tg-od-addr,
.tg-od-addrs--single .tg-od-addr {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  float: none !important;
  padding: 1.15rem 1.25rem;
}
body.woocommerce-view-order .tg-od-addr__empty,
.tg-od-addr__empty {
  display: grid;
  gap: 12px;
  padding: 8px 0 4px;
}
body.woocommerce-view-order .tg-od-addr__empty-action {
  margin: 0;
}
body.woocommerce-view-order .tg-rv-order-cta {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 0 1rem;
}
/* Hide any residual billing card if a plugin re-injects WC columns */
body.woocommerce-view-order .tg-od-addr--billing,
body.woocommerce-view-order .woocommerce-column--billing-address,
body.woocommerce-view-order .woocommerce-customer-details .woocommerce-columns--addresses {
  display: none !important;
}
body.woocommerce-view-order .woocommerce-customer-details .tg-od-addrs--single {
  display: grid !important;
}

/* Addresses page: shipping-only card */
body.woocommerce-edit-address .tg-account-addresses--ship-only .tg-address-grid,
body.woocommerce-account .tg-account-addresses--ship-only .tg-address-grid {
  grid-template-columns: minmax(0, 1fr);
  max-width: 640px;
}
body.woocommerce-account .tg-account-addresses--ship-only .woocommerce-Address--billing {
  display: none !important;
}

/* ---------- Address book (multiple shipping addresses) — 1.14.9 ---------- */
.tg-ab-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.tg-ab-toolbar__count { margin: 0; font-size: 14px; color: var(--tg-color-muted); }
.tg-ab-toolbar__add { display: inline-flex; align-items: center; gap: 6px; }
.tg-ab-toolbar__limit { font-size: 13px; color: var(--tg-color-muted); }
.tg-ab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.tg-ab-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--tg-color-border);
  border-radius: 14px;
  background: var(--tg-color-card);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tg-ab-card:hover { border-color: #BFD5F2; box-shadow: var(--tg-shadow-soft); }
.tg-ab-card.is-default { border-color: var(--tg-color-button); background: linear-gradient(180deg, #F5F9FF 0, #fff 70%); }
.tg-ab-card__head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tg-ab-card__icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #EAF2FD;
  color: var(--tg-color-button);
}
.tg-ab-card.is-default .tg-ab-card__icon { background: var(--tg-color-button); color: #fff; }
.tg-ab-card__who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.tg-ab-card__name { font-size: 15px; font-weight: 700; color: var(--tg-color-brand); overflow-wrap: anywhere; }
.tg-ab-card__phone { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--tg-color-muted); }
.tg-ab-badge {
  flex: 0 0 auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--tg-color-button);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
.tg-ab-card__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  font-style: normal;
  font-size: 14px;
  line-height: 1.55;
  color: var(--tg-color-text, #334155);
  overflow-wrap: anywhere;
}
.tg-ab-card__loc { color: var(--tg-color-muted); }
.tg-ab-card__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--tg-color-border);
}
.tg-ab-card__delete {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--tg-color-sale);
  text-decoration: none;
}
.tg-ab-card__delete:hover { text-decoration: underline; }
.tg-ab-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 20px; text-align: center; }
.tg-ab-empty__icon { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: #EAF2FD; color: var(--tg-color-button); }
.tg-ab-empty p { margin: 0; color: var(--tg-color-muted); }

/* Add / edit form: use the whole content column, dense grid */
.tg-account-address-edit .tg-account-form.tg-account-form--address { max-width: none; padding: 24px 28px; }
.tg-account-form--address .tg-account-form__fields {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: 16px;
  align-items: start;
}
.tg-account-form--address .tg-account-form__fields > * { grid-column: 1 / -1; min-width: 0; }
body.woocommerce-account .tg-account-form--address .tg-account-form__fields > .form-row {
  grid-column: span 3;
  width: 100% !important;
  margin-right: 0 !important;
  display: block;
}
body.woocommerce-account .tg-account-form--address .tg-account-form__fields > #shipping_first_name_field,
body.woocommerce-account .tg-account-form--address .tg-account-form__fields > #shipping_last_name_field,
body.woocommerce-account .tg-account-form--address .tg-account-form__fields > #shipping_phone_field { grid-column: span 2; }
body.woocommerce-account .tg-account-form--address .tg-account-form__fields > #shipping_address_1_field,
body.woocommerce-account .tg-account-form--address .tg-account-form__fields > #shipping_address_2_field,
body.woocommerce-account .tg-account-form--address .tg-account-form__fields > #shipping_company_field { grid-column: 1 / -1; }
body.woocommerce-account .tg-account-form--address .tg-account-form__fields > .tg-field-hidden { display: none !important; }
.tg-ab-default-row { margin: 2px 0 16px !important; }
.tg-ab-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--tg-color-brand); }
.tg-ab-switch input { width: 18px; height: 18px; accent-color: var(--tg-color-button); margin: 0; }
.tg-ab-default-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; font-size: 13px; color: var(--tg-color-muted); }
@media (max-width: 1024px) {
  body.woocommerce-account .tg-account-form--address .tg-account-form__fields > #shipping_first_name_field,
  body.woocommerce-account .tg-account-form--address .tg-account-form__fields > #shipping_last_name_field { grid-column: span 3; }
  body.woocommerce-account .tg-account-form--address .tg-account-form__fields > #shipping_phone_field { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .tg-ab-grid { grid-template-columns: minmax(0, 1fr); }
  .tg-ab-toolbar__add { width: 100%; justify-content: center; }
  .tg-account-address-edit .tg-account-form.tg-account-form--address { padding: 18px 16px; }
  .tg-account-form--address .tg-account-form__fields { grid-template-columns: minmax(0, 1fr); }
  body.woocommerce-account .tg-account-form--address .tg-account-form__fields > .form-row { grid-column: 1 / -1 !important; }
}

/* ---------- Account section heroes: match Dashboard navy welcome strip ---------- */
.tg-account-hero-card.tg-account-section-head--with-art,
.tg-account-hero-card.tg-account-orders__hero {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 136px;
  margin: 0 0 18px;
  padding: 24px 28px;
  padding-right: min(46%, 420px);
  overflow: hidden;
  border-radius: 16px;
  border: 0;
  background:
    radial-gradient(circle at 78% 30%, rgba(255,255,255,0.10) 0 42px, transparent 43px),
    radial-gradient(circle at 88% 70%, rgba(255,255,255,0.07) 0 28px, transparent 29px),
    linear-gradient(135deg, #18375F 0%, #1E4A7A 55%, #1769D2 130%);
  color: #fff;
  box-shadow: var(--tg-shadow, 0 10px 28px rgba(15, 40, 80, 0.12));
}
.tg-account-hero-card .tg-account-section-head__main,
.tg-account-hero-card .tg-account-orders__hero-text {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
}
.tg-account-hero-card .tg-account-section-head__title,
.tg-account-hero-card .tg-account-orders__title {
  margin: 0 0 6px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.tg-account-hero-card .tg-account-orders__title .tg-ico,
.tg-account-hero-card .tg-account-section-head__title .tg-ico {
  color: rgba(255, 255, 255, 0.95);
}
.tg-account-hero-card .tg-account-section-head__sub,
.tg-account-hero-card .tg-account-orders__count {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}
/* Per-page themed illustration (language-neutral SVG, no text) */
.tg-account-hero-card[class*="tg-account-hero-card--"] {
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: right 12px center, center, center;
  background-size: auto 112%, 100% 100%, 100% 100%;
}
.tg-account-hero-card.tg-account-hero-card--orders {
  background-image:
    url("../img/tg-hero-pattern-orders.svg"),
    radial-gradient(circle at 82% 50%, rgba(245, 181, 68, 0.22) 0, transparent 46%),
    linear-gradient(135deg, #18375F 0%, #1E4A7A 55%, #1769D2 130%);
}
.tg-account-hero-card.tg-account-hero-card--address {
  background-image:
    url("../img/tg-hero-pattern-address.svg"),
    radial-gradient(circle at 82% 50%, rgba(229, 72, 77, 0.22) 0, transparent 46%),
    linear-gradient(135deg, #18375F 0%, #1E4A7A 55%, #1769D2 130%);
}
.tg-account-hero-card.tg-account-hero-card--account {
  background-image:
    url("../img/tg-hero-pattern-account.svg"),
    radial-gradient(circle at 82% 50%, rgba(61, 217, 193, 0.22) 0, transparent 46%),
    linear-gradient(135deg, #18375F 0%, #1E4A7A 55%, #1769D2 130%);
}
/* Drop tiny right-only PNG/SVG art — pattern is the decoration now */
.tg-account-hero-card .tg-account-hero-art,
.tg-account-hero-art,
.tg-account-hero-art__img,
.tg-account-hero-art__svg {
  display: none !important;
}

/* Logged-in account pages hide the page title (heroes / welcome card repeat it) — keep the content off the header. */
body.woocommerce-account.logged-in .tg-content--account {
  padding-top: 32px;
}
@media (max-width: 720px) {
  body.woocommerce-account.logged-in .tg-content--account {
    padding-top: 20px;
  }
}

body.woocommerce-account.logged-in .tg-page-hero--account {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 720px) {
  .tg-account-hero-card.tg-account-section-head--with-art,
  .tg-account-hero-card.tg-account-orders__hero {
    min-height: 112px;
    padding: 18px 20px;
    padding-right: 20px;
  }
  .tg-account-hero-card[class*="tg-account-hero-card--"] {
    /* Art sits in the right half only, below the text layer — never under the title */
    background-size: auto 70%, 100% 100%, 100% 100%;
    background-position: right -6px bottom 6px, center, center;
  }
  .tg-account-hero-card .tg-account-section-head__main,
  .tg-account-hero-card .tg-account-orders__hero-text { max-width: 58%; }
}

/* t204 — mobile: chips scroll horizontally (touch), no visible scrollbar, no page overflow. */
@media (max-width: 720px) {
  .tg-account-orders__tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding: 1px 1px 3px;
  }
  .tg-account-orders__tabs::-webkit-scrollbar { display: none; }
  .tg-account-orders__tab { scroll-snap-align: start; }
  .tg-orders-card__total .tg-order-amount { align-items: flex-start; }
}
