/*
 * New design — the account window #profile_dialog and the header's account controls (body.nd-menu).
 * Look and motion only: js/menu.js keeps every action, js/new-design-account.js only adds what is
 * shown (title, logout, the address «+», gift cards, the header's menu). See docs/new-design-account.md.
 * Same weight as the menu layer: `:not(#\9)` is one id of weight, it beats the Sites' class rules.
 */
body.nd-menu {
  --nd-acct-mut: #6b6b6b;
  --nd-acct-field: #fafafa;
  --nd-acct-field-line: #c9c9c9;
  --nd-acct-divider: rgba(0, 0, 0, .07);
  --nd-acct-card-line: rgba(13, 13, 13, .08);
  --nd-acct-danger: #b42318;
  --nd-acct-ink: #0d0d0d;
  --nd-acct-hover-fill: #0d0d0d;
  /* the script swaps these on a very light brand: white text on it would not read */
  --nd-acct-on-primary: var(--nd-on-primary, #fff); /* measured once, in new-design-menu.js */
  --nd-acct-accent: var(--primary);
  --nd-acct-fill-line: transparent;
  --nd-acct-tint: color-mix(in srgb, var(--primary) 9%, transparent);
  --nd-acct-primary-hover: color-mix(in srgb, var(--primary) 78%, #000);
  /* the same height on every tab: the prototype jumps 534 / 438 / 810 px between them */
  --nd-acct-height: min(90vh - var(--nd-cookie-h, 0px), 660px);
  --nd-acct-e-soft: cubic-bezier(.16, 1, .3, 1);
  --nd-acct-e-out: cubic-bezier(.32, .72, 0, 1);
  --nd-acct-ico-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
  --nd-acct-ico-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --nd-acct-ico-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --nd-acct-ico-restore: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v5h5'/%3E%3Cpath d='M3.05 13A9 9 0 1 0 6 5.3L3 8'/%3E%3C/svg%3E");
  --nd-acct-ico-user: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
  --nd-acct-ico-plus: url("/images/new-design/icons/menu/plus.svg");
  --nd-acct-ico-trash: url("/images/new-design/icons/menu/trash.svg");
  --nd-acct-ico-logout: url("/images/new-design/icons/entry/logout.svg");
}

/* ───────────── Motion: the backdrop and the window go together ───────────── */
/* Bootstrap reads only the FIRST transition duration and waits for it: 0s there starts the window
   with the backdrop (not after it) and lets a close land at any moment of the opening. */
body.nd-menu.nd-acct-open .modal-backdrop:not(#\9) {
  transition: outline-color 0s, opacity .5s var(--nd-acct-e-soft);
}

/* the window's own backdrop; a bootbox above it keeps a plain one */
body.nd-menu.nd-acct-open .modal-backdrop:not(.modal-backdrop ~ .modal-backdrop):not(#\9) {
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(9px) saturate(115%);
  backdrop-filter: blur(9px) saturate(115%);
}

body.nd-menu.nd-acct-open .modal-backdrop.show:not(.modal-backdrop ~ .modal-backdrop):not(#\9) {
  opacity: 1;
}

body.nd-menu.nd-acct-closing .modal-backdrop.show:not(.modal-backdrop ~ .modal-backdrop):not(#\9) {
  opacity: 0;
  transition: outline-color 0s, opacity .45s var(--nd-acct-e-soft);
}

body.nd-menu #profile_dialog.fade:not(#\9) {
  transition: opacity .45s var(--nd-acct-e-soft);
}

body.nd-menu #profile_dialog.fade .modal-dialog:not(#\9) {
  transform: translateY(24px) scale(.97);
  transition: outline-color 0s, transform .55s var(--nd-acct-e-out);
}

body.nd-menu #profile_dialog.show .modal-dialog:not(#\9) {
  transform: none;
}

/* ───────────── The window ───────────── */
body.nd-menu #profile_dialog .modal-dialog:not(#\9) {
  width: min(860px, calc(100vw - 40px));
  max-width: none;
  margin-inline: auto;
  padding: 0;
}

/* Bootstrap's strut for centring is taller than this window's own margins allow on a phone */
body.nd-menu #profile_dialog .modal-dialog:not(#\9)::before {
  content: none;
}

/* the cookie notice stays over everything (front.css): while it is there the window ends above it */
body.nd-menu #profile_dialog:not(#\9) {
  height: calc(100% - var(--nd-cookie-h, 0px));
}

body.nd-menu #profile_dialog .modal-content:not(#\9) {
  display: flex;
  flex-direction: column;
  height: var(--nd-acct-height);
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: none;
  border-radius: 24px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .5), 0 8px 24px -12px rgba(0, 0, 0, .2);
  color: var(--nd-acct-ink);
  text-align: start;
}

/* the title (script), the close, the tabs and the logout (script) on one grid: no markup moves */
body.nd-menu #profile_dialog .modal-header:not(#\9) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title close" "tabs logout";
  align-items: center;
  flex: none;
  height: auto;
  margin: 0;
  padding: 22px 24px 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--nd-acct-divider);
  border-radius: 0;
}

body.nd-menu #profile_dialog .nd-acct-title:not(#\9) {
  grid-area: title;
  margin: 0;
  color: var(--nd-acct-ink);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.6px;
  line-height: 1.2;
  text-align: start;
}

/* the close: the same round button in every dialog of the account (.m01-close of the design) */
body.nd-menu #profile_dialog .modal-header .close:not(#\9),
body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .bootbox-close-button:not(#\9) {
  grid-area: close;
  justify-self: end;
  position: relative; /* the circle and its cross are placed against the button */
  float: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  background: var(--nd-acct-tint);
  border: none;
  border-radius: 50%;
  color: var(--nd-acct-accent);
  font-size: 0;
  line-height: 1;
  opacity: 1;
  text-shadow: none;
  transition: background .35s var(--nd-acct-e-soft), color .35s var(--nd-acct-e-soft), transform .4s var(--nd-acct-e-out);
}

body.nd-menu #profile_dialog .modal-header .close > span:not(#\9) {
  display: block;
  width: 17px;
  height: 17px;
  background: currentColor;
  font-size: 0;
  -webkit-mask: var(--nd-acct-ico-close) center / contain no-repeat;
  mask: var(--nd-acct-ico-close) center / contain no-repeat;
}

body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .bootbox-close-button:not(#\9)::before {
  content: "";
  display: block;
  width: 17px;
  height: 17px;
  background: currentColor;
  -webkit-mask: var(--nd-acct-ico-close) center / contain no-repeat;
  mask: var(--nd-acct-ico-close) center / contain no-repeat;
}

/* ───────────── The tabs ───────────── */
body.nd-menu #profile_dialog .nav-tabs:not(#\9) {
  grid-area: tabs;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  margin: 18px 0;
  padding: 0;
  background: none;
  border: none;
}

body.nd-menu #profile_dialog .nav-tabs .nav-item:not(#\9) {
  flex: none;
  margin: 0;
}

body.nd-menu #profile_dialog .nav-tabs .nav-link:not(#\9) {
  display: block;
  height: auto;
  margin: 0;
  padding: 10px 20px;
  background: none;
  border: none;
  border-radius: 999px;
  color: var(--nd-acct-mut);
  font-size: 14.88px;
  font-weight: 700;
  letter-spacing: -.1px;
  line-height: 18px;
  white-space: nowrap;
  transition: background .3s var(--nd-acct-e-soft), color .3s var(--nd-acct-e-soft);
}

body.nd-menu #profile_dialog .nav-tabs .nav-link.active:not(#\9) {
  background: var(--primary);
  box-shadow: inset 0 0 0 1px var(--nd-acct-fill-line), 0 8px 18px -8px color-mix(in srgb, var(--primary) 50%, transparent);
  color: var(--nd-acct-on-primary);
}

body.nd-menu #profile_dialog .nd-acct-logout:not(#\9) {
  grid-area: logout;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--nd-acct-mut);
  font-size: 13.44px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background .25s var(--nd-acct-e-soft), color .25s var(--nd-acct-e-soft);
}

body.nd-menu #profile_dialog .nd-acct-logout > i:not(#\9) {
  flex: none;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--nd-acct-ico-logout) center / contain no-repeat;
  mask: var(--nd-acct-ico-logout) center / contain no-repeat;
}

/* ───────────── The body: one scroll for every tab ───────────── */
body.nd-menu #profile_dialog .modal-body:not(#\9) {
  flex: 1 1 auto;
  min-height: 0;
  padding: 22px 24px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(13, 13, 13, .2) transparent;
}

body.nd-menu #profile_dialog .tab-content:not(#\9) {
  margin: 0;
  padding: 0;
}

body.nd-menu #profile_dialog .tab-pane:not(#\9) {
  padding: 0;
}

body.nd-menu #profile_dialog .tab-pane.active:not(#\9) {
  animation: nd-acct-fade .4s var(--nd-acct-e-out);
}

/* ───────────── Personal details ───────────── */
body.nd-menu #profile_dialog #tab_profile h4:not(#\9) {
  margin: 0 0 14px;
  color: var(--nd-acct-ink);
  font-size: 16.32px;
  font-weight: 800;
  text-align: start;
}

body.nd-menu #profile_dialog #tab_profile hr:not(#\9) {
  margin: 26px 0 0;
  border: none;
}

/* the platform's Bootstrap columns become the design's two-column grid; the elements stay */
body.nd-menu #profile_dialog #tab_profile > .row:first-of-type:not(#\9),
body.nd-menu #profile_dialog #profile_address > .row:last-child:not(#\9) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

body.nd-menu #profile_dialog #tab_profile > .row:first-of-type > .form-group:not(#\9),
body.nd-menu #profile_dialog #profile_address > .row > .form-group:not(#\9) {
  flex: none;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.nd-menu #profile_dialog #tab_profile label:not(#\9) {
  display: block;
  margin: 0 0 6px;
  color: var(--nd-acct-mut);
  font-size: 12.48px;
  font-weight: 700;
  text-align: start;
}

body.nd-menu #profile_dialog #tab_profile :is(input[type="text"], input[type="tel"], input[type="email"], input[type="date"], select):not(#\9) {
  width: 100%;
  height: 43px;
  padding: 11px 14px;
  background-color: var(--nd-acct-field);
  border: 1.5px solid var(--nd-acct-field-line);
  border-radius: 12px;
  box-shadow: none;
  color: var(--nd-acct-ink);
  font-size: 15.2px;
  transition: border-color .25s var(--nd-acct-e-soft), background-color .25s var(--nd-acct-e-soft);
}

body.nd-menu #profile_dialog #tab_profile :is(input, select):focus:not(#\9) {
  background-color: #fff;
  border-color: var(--nd-acct-ink);
  outline: none;
}

/* register_validate_phone, disable_menu_profile_editing and a saved birthday lock a field */
body.nd-menu #profile_dialog #tab_profile :is(input, select):disabled:not(#\9) {
  background-color: #f1f1f1;
  color: var(--nd-acct-mut);
  -webkit-text-fill-color: var(--nd-acct-mut);
  opacity: 1;
}

/* .form-control: a plain `select` here loses to the field rule above, whose :is() weighs a class more */
body.nd-menu #profile_dialog #tab_profile select.form-control:not(#\9) {
  -webkit-appearance: none;
  appearance: none;
  height: 46px;
  padding-inline-end: 42px;
  background-image: var(--nd-acct-ico-chevron);
  background-repeat: no-repeat;
  background-size: 16px;
  background-position: left 14px center;
  font-weight: 600;
}

body.nd-menu.ltr #profile_dialog #tab_profile select.form-control:not(#\9) {
  background-position: right 14px center;
}

/* jQuery Validate marks a wrong field; qtip draws the message */
body.nd-menu #profile_dialog #tab_profile :is(input, select).error:not(#\9) {
  border-color: var(--nd-acct-danger);
}

/* streets without maps: select2 inside the form (dropdownParent #profile_dialog, menu.js) */
body.nd-menu #profile_dialog #profile_address .select2-container--default .select2-selection--single:not(#\9) {
  height: 43px;
  background: var(--nd-acct-field);
  border: 1.5px solid var(--nd-acct-field-line);
  border-radius: 12px;
}

body.nd-menu #profile_dialog #profile_address .select2-container--default .select2-selection__rendered:not(#\9) {
  padding-inline: 14px 36px;
  color: var(--nd-acct-ink);
  font-size: 15.2px;
  line-height: 40px;
}

body.nd-menu #profile_dialog #profile_address .select2-container--default .select2-selection__arrow:not(#\9) {
  height: 40px;
}

/* «save»: the platform's own button (there is no autosave); the empty label above it goes */
body.nd-menu #profile_dialog #tab_profile .form-group:has(> .save_profile_info):not(#\9) {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

body.nd-menu #profile_dialog #tab_profile .form-group:has(> .save_profile_info) > label:not(#\9),
body.nd-menu #profile_dialog #tab_profile .form-group:has(> #profile_addr_save) > label:not(#\9) {
  display: none;
}

body.nd-menu #profile_dialog #tab_profile .save_profile_info:not(#\9),
body.nd-menu #profile_dialog #tab_profile #profile_addr_save:not(#\9) {
  width: auto;
  height: 41px;
  margin: 0;
  padding: 0 26px;
  background: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--nd-acct-fill-line);
  color: var(--nd-acct-on-primary);
  -webkit-text-fill-color: var(--nd-acct-on-primary);
  font-size: 13.6px;
  font-weight: 700;
  transition: background .3s var(--nd-acct-e-soft), border-color .3s var(--nd-acct-e-soft), transform .18s ease;
}

/* ───────────── The address book ───────────── */
/* the select, the bin and the «+» in a row; their empty labels go */
body.nd-menu #profile_dialog #profile_address > .row:first-child:not(#\9) {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 10px;
  margin: 0;
}

body.nd-menu #profile_dialog #profile_address > .row:first-child > .form-group:first-child:not(#\9) {
  flex: 1 1 auto;
  min-width: 0;
}

body.nd-menu #profile_dialog #profile_address > .row:first-child > .form-group:first-child > label:not(#\9) {
  display: none;
}

body.nd-menu #profile_dialog #profile_address > .row:first-child > .form-group:last-child:not(#\9) {
  display: flex;
  flex: none;
  gap: 10px;
  align-items: center;
}

body.nd-menu #profile_dialog #profile_address > .row:first-child > .form-group:last-child > :is(label, br):not(#\9) {
  display: none;
}

body.nd-menu #profile_dialog #profile_addr_delete:not(#\9),
body.nd-menu #profile_dialog .nd-acct-addr-add:not(#\9) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  transition: background .25s var(--nd-acct-e-soft), border-color .25s var(--nd-acct-e-soft), color .25s var(--nd-acct-e-soft), opacity .25s var(--nd-acct-e-soft), transform .18s ease;
}

body.nd-menu #profile_dialog #profile_addr_delete:not(#\9) {
  background: var(--nd-acct-field);
  border: 1.5px solid var(--nd-acct-field-line);
  color: var(--nd-acct-mut);
}

body.nd-menu #profile_dialog #profile_addr_delete.disabled:not(#\9) {
  cursor: default;
  opacity: .45;
}

body.nd-menu #profile_dialog #profile_addr_delete > i:not(#\9),
body.nd-menu #profile_dialog .nd-acct-addr-add > i:not(#\9) {
  display: block;
  width: 19px;
  height: 19px;
  background: currentColor;
}

body.nd-menu #profile_dialog #profile_addr_delete > i:not(#\9) {
  -webkit-mask: var(--nd-acct-ico-trash) center / contain no-repeat;
  mask: var(--nd-acct-ico-trash) center / contain no-repeat;
}

body.nd-menu #profile_dialog #profile_addr_delete > i:not(#\9)::before {
  content: none;
}

body.nd-menu #profile_dialog .nd-acct-addr-add:not(#\9) {
  background: var(--primary);
  border: 1.5px solid var(--primary);
  box-shadow: inset 0 0 0 1px var(--nd-acct-fill-line);
  color: var(--nd-acct-on-primary);
}

body.nd-menu #profile_dialog .nd-acct-addr-add > i:not(#\9) {
  -webkit-mask: var(--nd-acct-ico-plus) center / contain no-repeat;
  mask: var(--nd-acct-ico-plus) center / contain no-repeat;
}

/* the form behind the «+»: a card in the flow, at its full height at once; it fades in as in the prototype */
body.nd-menu #profile_dialog #profile_address > .row:last-child:not(#\9) {
  margin-top: 16px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--nd-acct-card-line);
  border-radius: 16px;
  animation: nd-acct-fade .4s var(--nd-acct-e-out);
}

body.nd-menu #profile_dialog #profile_address:not(.nd-acct-addr-open):not(#\9) > .row:last-child {
  display: none;
}

body.nd-menu #profile_dialog #profile_address > .row > .form-group:has(#profile_addr_name):not(#\9) {
  grid-column: 1 / -1;
}

body.nd-menu #profile_dialog #profile_address > .row > .form-group:has(> #profile_addr_save):not(#\9) {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

body.nd-menu #profile_dialog .nd-acct-addr-cancel:not(#\9) {
  height: 41px;
  padding: 0 24px;
  background: #fff;
  border: 1.5px solid #bdbdbd;
  border-radius: 999px;
  color: var(--nd-acct-ink);
  font-size: 13.6px;
  font-weight: 700;
  transition: background .25s var(--nd-acct-e-soft), border-color .25s var(--nd-acct-e-soft), transform .18s ease;
}

/* ───────────── Password and delete ───────────── */
body.nd-menu #profile_dialog #tab_profile > .row:has(> .form-group > .change_password, > .delete_user_wrap):not(#\9) {
  display: flex;
  flex-wrap: wrap;
  /* the row carries Bootstrap's .justify-content-between, which is !important */
  justify-content: flex-start !important;
  gap: 12px;
  margin: 0;
}

body.nd-menu #profile_dialog #tab_profile > .row:has(> .form-group > .change_password, > .delete_user_wrap) > .form-group:not(#\9) {
  flex: none;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* two selectors, not :is(): an id inside :is() would outweigh .change_password:hover */
body.nd-menu #profile_dialog #tab_profile .change_password:not(#\9),
body.nd-menu #profile_dialog #tab_profile #delete_user_account:not(#\9) {
  width: auto;
  height: 39px;
  padding: 0 18px;
  background: none;
  border: 1.5px solid var(--nd-acct-accent);
  border-radius: 999px;
  color: var(--nd-acct-accent);
  font-size: 13.6px;
  font-weight: 700;
  line-height: 1;
  transition: background .25s var(--nd-acct-e-soft), color .25s var(--nd-acct-e-soft), border-color .25s var(--nd-acct-e-soft), transform .18s ease;
}

body.nd-menu #profile_dialog #tab_profile #delete_user_account:not(#\9) {
  border-color: var(--nd-acct-danger);
  color: var(--nd-acct-danger);
}

/* the design's button has no icon */
body.nd-menu #profile_dialog #delete_user_account > i:not(#\9) {
  display: none;
}

/* ───────────── Gifts and points: the benefit cards ───────────── */
body.nd-menu #profile_dialog :is(#tab_gifts, #tab_points, #tab_clubs) .wrapper:not(#\9) {
  padding: 0;
  text-align: start;
}

body.nd-menu #profile_dialog :is(#tab_gifts, #tab_points) .wrapper > p:not(#\9) {
  margin: 0 0 16px;
  color: var(--nd-acct-mut);
  font-size: 14px;
}

body.nd-menu #profile_dialog #tab_points .wrapper > h3:not(#\9) {
  margin: 0 0 16px !important;
  color: var(--nd-acct-ink);
  font-size: 16.32px;
  font-weight: 800;
  text-align: start;
}

body.nd-menu #profile_dialog :is(#tab_gifts, #tab_points) .wrapper > .row:not(#\9) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}

body.nd-menu #profile_dialog :is(#tab_gifts, #tab_points) .wrapper > .row > div:not(#\9) {
  flex: none;
  width: auto;
  max-width: none;
  margin: 0 !important;
  padding: 0;
}

body.nd-menu #profile_dialog a.gift:not(#\9) {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--nd-acct-card-line);
  border-radius: 16px;
  box-shadow: none;
  color: var(--nd-acct-ink);
  text-align: start;
  text-decoration: none;
  transition: border-color .25s var(--nd-acct-e-soft);
}

body.nd-menu #profile_dialog a.gift .img_cont:not(#\9) {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #efe8dd;
}

body.nd-menu #profile_dialog a.gift .img_cont img:not(#\9) {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
}

/* the platform's price chip on the photo: the script shows the price in the card's foot */
body.nd-menu #profile_dialog a.gift .img_cont > .price:not(#\9) {
  display: none;
}

body.nd-menu #profile_dialog a.gift :is(.img_cont > .points, .nd-acct-gift-off):not(#\9) {
  position: absolute;
  top: 10px;
  inset-inline: auto 10px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 5px 11px;
  background: var(--primary);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--nd-acct-fill-line);
  color: var(--nd-acct-on-primary);
  font-size: 13.12px;
  font-weight: 800;
  line-height: 1.2;
}

body.nd-menu #profile_dialog a.gift .img_cont > .not_in_stock:not(#\9) {
  position: absolute;
  inset-block-end: 10px;
  inset-inline-start: 10px;
  padding: 4px 10px;
  background: rgba(13, 13, 13, .8);
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

body.nd-menu #profile_dialog a.gift .title:not(#\9) {
  display: block;
  margin: 0;
  padding: 12px 14px 0;
  background: none;
  color: var(--nd-acct-ink);
  font-size: 14.72px;
  font-weight: 700;
  line-height: 1.3;
  text-align: start;
}

body.nd-menu #profile_dialog a.gift .nd-acct-gift-foot:not(#\9) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding: 8px 14px 14px;
}

body.nd-menu #profile_dialog a.gift .nd-acct-gift-prices:not(#\9) {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  min-width: 0;
}

body.nd-menu #profile_dialog a.gift .nd-acct-gift-price:not(#\9) {
  color: var(--nd-acct-ink);
  font-size: 18.4px;
  font-weight: 800;
}

body.nd-menu #profile_dialog a.gift .nd-acct-gift-was:not(#\9) {
  color: var(--nd-acct-mut);
  font-size: 13.6px;
  text-decoration: line-through;
}

body.nd-menu #profile_dialog a.gift .nd-acct-gift-add:not(#\9) {
  flex: none;
  padding: 8px 14px;
  background: var(--primary);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--nd-acct-fill-line);
  color: var(--nd-acct-on-primary);
  font-size: 13.6px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  transition: background .3s var(--nd-acct-e-soft), transform .18s ease;
}

body.nd-menu #profile_dialog .user_club_note:not(#\9) {
  margin: 16px 0 0;
  color: var(--nd-acct-mut);
  font-size: 13px;
}

/* ───────────── The order cards ───────────── */
body.nd-menu #profile_dialog .tab_orders .wrapper:not(#\9) {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  background: none;
}

body.nd-menu #profile_dialog .tab_orders .wrapper > p:only-child:not(#\9),
body.nd-menu #profile_dialog #tab_gifts .wrapper > p:has(+ .row:not(:has(a.gift))):not(#\9) {
  margin: 48px 0;
  color: var(--nd-acct-mut);
  font-size: 15px;
  text-align: center;
}

/* as in the prototype: the faintest hairline and the benefit card's soft double shadow */
body.nd-menu #profile_dialog .tab_orders .user_order:not(#\9) {
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr) 168px;
  gap: 14px;
  width: auto;
  margin: 0;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .04);
  border-radius: 18px;
  box-shadow: 0 10px 26px -16px rgba(0, 0, 0, .28), 0 2px 6px rgba(0, 0, 0, .05);
}

body.nd-menu #profile_dialog .tab_orders .user_order > div:not(#\9) {
  width: auto;
  max-width: none;
  padding: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
}

body.nd-menu #profile_dialog .user_order .order_user_status_wrapper:not(#\9) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  text-align: start;
}

body.nd-menu #profile_dialog .user_order .order_status_user:not(#\9) {
  width: auto;
  margin: 0 0 2px;
  padding: 4px 11px;
  background: rgba(34, 150, 83, .12);
  border-radius: 999px;
  color: #1c7d45;
  font-size: 11.52px;
  font-weight: 800;
  line-height: 1.3;
}

body.nd-menu #profile_dialog .user_order .order_status_user[data-status="5"]:not(#\9) {
  background: rgba(212, 160, 23, .18);
  color: #9a6a00;
}

body.nd-menu #profile_dialog .user_order .order_status_user[data-status="6"]:not(#\9) {
  background: rgba(180, 35, 24, .1);
  color: var(--nd-acct-danger);
}

body.nd-menu #profile_dialog .user_order .order_user_number:not(#\9) {
  color: var(--nd-acct-ink);
  font-size: 14.72px;
  font-weight: 800;
  line-height: 1.3;
}

body.nd-menu #profile_dialog .user_order .order_user_number > span:not(#\9) {
  font-weight: 800;
}

body.nd-menu #profile_dialog .user_order .order_user_branch:not(#\9) {
  color: var(--nd-acct-mut);
  font-size: 12.8px;
}

/* .text-primary on this element is Bootstrap's !important */
body.nd-menu #profile_dialog .user_order .order_user_date:not(#\9) {
  display: block;
  margin: 0;
  color: var(--nd-acct-mut) !important;
  font-size: 12.8px;
  font-weight: 400;
  text-align: start;
}

body.nd-menu #profile_dialog .user_order .order_user_date > span:not(#\9) {
  display: none;
}

body.nd-menu #profile_dialog .user_order .products_user_list_wrapper:not(#\9) {
  display: flex;
  align-items: center;
  min-width: 0;
  padding-inline: 14px;
  border-inline: 1px solid var(--nd-acct-divider);
}

/* flex-wrap comes from Bootstrap utilities with !important under 768px */
body.nd-menu #profile_dialog .user_order .products_user_list:not(#\9) {
  flex-wrap: nowrap !important;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

body.nd-menu #profile_dialog .user_order .products_user_list::-webkit-scrollbar {
  display: none;
}

body.nd-menu #profile_dialog .user_order .products_user_list .and:not(#\9) {
  display: none;
}

/* the platform's phone rule sets 28% !important */
body.nd-menu #profile_dialog .user_order .products_user_list .product:not(#\9) {
  flex: none;
  width: 60px !important;
  margin: 0;
  padding: 0;
  overflow: visible;
  color: var(--nd-acct-ink);
  font-size: 11.52px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

body.nd-menu #profile_dialog .user_order .products_user_list .product img:not(#\9) {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 5px;
  background: #efe8dd;
  border-radius: 11px;
  object-fit: cover;
}

body.nd-menu #profile_dialog .user_order .products_user_list .product > span:not(#\9) {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* every line of the order in one strip; the arrows (script) step through it, as in the prototype */
body.nd-menu #profile_dialog .user_order .nd-acct-oarrow:not(#\9) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 26px;
  height: 26px;
  margin-inline: 0 6px;
  padding: 0;
  background: rgba(0, 0, 0, .05);
  border: none;
  border-radius: 50%;
  color: var(--nd-acct-ink);
  cursor: pointer;
  transition: background .25s var(--nd-acct-e-soft), opacity .25s;
}

body.nd-menu #profile_dialog .user_order .nd-acct-oarrow.next:not(#\9) {
  margin-inline: 6px 0;
}

body.nd-menu #profile_dialog .user_order .nd-acct-oarrow[hidden]:not(#\9) {
  display: none;
}

body.nd-menu #profile_dialog .user_order .nd-acct-oarrow[aria-disabled="true"]:not(#\9) {
  cursor: default;
  opacity: .3;
}

/* each chevron points outward, away from the strip: «prev» toward the start, «next» toward the end */
body.nd-menu #profile_dialog .user_order .nd-acct-oarrow > i:not(#\9) {
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: var(--nd-acct-ico-chev) center / contain no-repeat;
  mask: var(--nd-acct-ico-chev) center / contain no-repeat;
  transform: rotate(-90deg);
}

body.nd-menu #profile_dialog .user_order .nd-acct-oarrow.next > i:not(#\9),
body.nd-menu.ltr #profile_dialog .user_order .nd-acct-oarrow.prev > i:not(#\9) {
  transform: rotate(90deg);
}

body.nd-menu.ltr #profile_dialog .user_order .nd-acct-oarrow.next > i:not(#\9) {
  transform: rotate(-90deg);
}

body.nd-menu #profile_dialog .user_order .price_btns_wrapper:not(#\9) {
  display: block;
  margin: 0;
}

body.nd-menu #profile_dialog .user_order .price_btns_wrapper > .row:not(#\9) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  margin: 0;
}

body.nd-menu #profile_dialog .user_order .col.price_wrapper:not(#\9),
body.nd-menu #profile_dialog .user_order .col.btns_wrapper:not(#\9) {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-start;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  text-align: start;
}

body.nd-menu #profile_dialog .user_order .col.price_wrapper .price:not(#\9) {
  display: block;
  margin: 0;
  color: var(--nd-acct-ink);
  font-size: 18.4px;
  font-weight: 800;
  line-height: 1.25;
  text-align: start;
}

body.nd-menu #profile_dialog .user_order .col.price_wrapper .price > span:not(#\9) {
  display: block;
  margin: 0;
  color: var(--nd-acct-mut);
  font-size: 12.48px;
  font-weight: 400;
}

body.nd-menu #profile_dialog .user_order .col.price_wrapper br:not(#\9),
body.nd-menu #profile_dialog .user_order .col.btns_wrapper br:not(#\9) {
  display: none;
}

body.nd-menu #profile_dialog .user_order .col.price_wrapper .points:not(#\9) {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  color: var(--nd-acct-mut);
  font-size: 12px;
  font-weight: 400;
}

/* front.css gives this mark `color: #fff !important`: on a light brand the «?» would not read */
body.nd-menu #profile_dialog .user_order .col.price_wrapper .tooltip_points:not(#\9) {
  background: var(--primary);
  box-shadow: inset 0 0 0 1px var(--nd-acct-fill-line);
  color: var(--nd-acct-on-primary) !important;
}

body.nd-menu #profile_dialog .user_order .col.price_wrapper .points .points_number:not(#\9) {
  color: var(--nd-acct-ink);
  font-weight: 700;
}

body.nd-menu #profile_dialog .user_order :is(a.repeat_order, a.edit_order):not(#\9) {
  display: inline-block;
  width: auto;
  margin: 0;
  padding: 9px 18px;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--nd-acct-fill-line);
  color: var(--nd-acct-on-primary);
  font-size: 13.44px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  transition: background .3s var(--nd-acct-e-soft), border-color .3s var(--nd-acct-e-soft), transform .18s ease;
}

/* the platform's arrow (arr.webp) is not mirrored in LTR and is not in the design */
body.nd-menu #profile_dialog .user_order a.repeat_order:not(#\9)::after {
  content: none;
}

body.nd-menu #profile_dialog .user_order a.cancel_order:not(#\9) {
  margin: 0;
  padding: 4px 0 0;
  color: var(--nd-acct-danger);
  font-size: 12.8px;
  font-weight: 600;
}

/* the green frame the platform gives a cancellable order */
body.nd-menu #profile_dialog .tab_orders .user_order:has(.cancel_order):not(#\9) {
  border: 1px solid rgba(0, 0, 0, .04);
}

/* ───────────── Bootbox over the window (password, delete, «saved») ───────────── */
/* only while the account is open: the cart's confirmations are another decision */
body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .modal-content:not(#\9) {
  padding: 8px;
  background: #fff;
  border: none;
  border-radius: 24px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .5);
  color: var(--nd-acct-ink);
}

body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .modal-header:not(#\9),
body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .modal-footer:not(#\9) {
  border: none;
  background: none;
}

body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .modal-header:not(#\9) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: auto;
  color: var(--nd-acct-ink);
}

body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .bootbox-close-button:not(#\9) {
  order: 2;
  margin-inline-start: auto;
}

body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .modal-title:not(#\9) {
  color: var(--nd-acct-ink);
  font-size: 20px;
  font-weight: 800;
}

body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .modal-body:not(#\9) {
  color: var(--nd-acct-ink);
  font-size: 15px;
}

body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox :is(.bootbox-input, .nd-acct-pw-again):not(#\9) {
  width: 100%;
  height: 45px;
  padding: 12px 14px;
  background: var(--nd-acct-field);
  border: 1.5px solid var(--nd-acct-field-line);
  border-radius: 12px;
  box-shadow: none;
  font-size: 15.68px;
}

body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox :is(.bootbox-input, .nd-acct-pw-again):focus:not(#\9) {
  background: #fff;
  border-color: var(--nd-acct-ink);
  outline: none;
}

/* change password: the second field (script) and its hint; the window stands in place, only fading in,
   as the prototype's mini window */
body.nd-menu .bootbox.nd-acct-pw .nd-acct-pw-again:not(#\9) {
  margin-top: 12px;
}

body.nd-menu .bootbox.nd-acct-pw .nd-acct-pw-again.error:not(#\9) {
  border-color: var(--nd-acct-danger);
}

body.nd-menu .bootbox.nd-acct-pw .nd-acct-pw-hint:not(#\9) {
  margin: 8px 0 0;
  color: var(--nd-acct-danger);
  font-size: 12.8px;
  font-weight: 600;
}

body.nd-menu .bootbox.nd-acct-pw.fade .modal-dialog:not(#\9) {
  transform: none;
  transition: none;
}

/* in the middle of the free height, as the prototype's card (Bootstrap's .modal-dialog-centered, which bootbox does not set) */
body.nd-menu .bootbox.nd-acct-pw .modal-dialog:not(#\9) {
  display: flex;
  align-items: center;
  min-height: calc(100% - 1rem);
}

@media (min-width: 576px) {
  body.nd-menu .bootbox.nd-acct-pw .modal-dialog:not(#\9) {
    min-height: calc(100% - 3.5rem);
  }
}

/* the cookie notice stays over everything (front.css): the small windows end above it too, as the account's own */
body.nd-menu.nd-acct-open .bootbox:not(#\9) {
  height: calc(100% - var(--nd-cookie-h, 0px));
}

body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .modal-footer .btn:not(#\9) {
  width: auto;
  height: auto;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14.72px;
  font-weight: 700;
  line-height: 1.3;
  transition: background .25s var(--nd-acct-e-soft), border-color .25s var(--nd-acct-e-soft), transform .18s ease;
}

body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .modal-footer .btn-primary:not(#\9) {
  background: var(--primary);
  border: 1.5px solid var(--primary);
  box-shadow: inset 0 0 0 1px var(--nd-acct-fill-line);
  color: var(--nd-acct-on-primary);
}

body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .modal-footer .btn-default:not(#\9),
body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .modal-footer .btn-secondary:not(#\9) {
  background: #fff;
  border: 1.5px solid #bdbdbd;
  color: var(--nd-acct-ink);
}

/* ───────────── Hover (mouse only) ───────────── */
@media (hover: hover) {
  body.nd-menu #profile_dialog .modal-header .close:hover:not(#\9),
  body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .bootbox-close-button:hover:not(#\9) {
    background: var(--nd-acct-hover-fill);
    color: #fff;
    transform: rotate(90deg);
  }

  body.nd-menu #profile_dialog .nav-tabs .nav-link:not(.active):hover:not(#\9),
  body.nd-menu #profile_dialog .nd-acct-logout:hover:not(#\9) {
    background: rgba(0, 0, 0, .05);
    color: var(--nd-acct-ink);
  }

  body.nd-menu #profile_dialog #profile_addr_delete:not(.disabled):hover:not(#\9) {
    background: rgba(180, 35, 24, .06);
    border-color: rgba(180, 35, 24, .4);
    color: var(--nd-acct-danger);
    transform: translateY(-1px);
  }

  body.nd-menu #profile_dialog .nd-acct-addr-add:hover:not(#\9),
  body.nd-menu #profile_dialog #tab_profile .save_profile_info:hover:not(#\9),
  body.nd-menu #profile_dialog #tab_profile #profile_addr_save:hover:not(#\9),
  body.nd-menu #profile_dialog .user_order :is(a.repeat_order, a.edit_order):hover:not(#\9) {
    background: var(--nd-acct-primary-hover);
    border-color: var(--nd-acct-primary-hover);
    transform: translateY(-1px);
  }

  body.nd-menu #profile_dialog .nd-acct-addr-cancel:hover:not(#\9),
  body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .modal-footer :is(.btn-default, .btn-secondary):hover:not(#\9) {
    background: #f0f0f0;
    border-color: #9c9c9c;
  }

  body.nd-menu #profile_dialog #tab_profile .change_password:hover:not(#\9) {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--nd-acct-on-primary);
    transform: translateY(-1px);
  }

  body.nd-menu #profile_dialog #tab_profile #delete_user_account:hover:not(#\9) {
    background: var(--nd-acct-danger);
    border-color: var(--nd-acct-danger);
    color: #fff;
    transform: translateY(-1px);
  }

  body.nd-menu #profile_dialog a.gift:hover:not(#\9) {
    border-color: rgba(13, 13, 13, .22);
  }

  body.nd-menu #profile_dialog a.gift:hover .nd-acct-gift-add:not(#\9) {
    background: var(--nd-acct-primary-hover);
    transform: translateY(-1px);
  }

  body.nd-menu #profile_dialog .user_order a.cancel_order:hover:not(#\9) {
    color: #8f1c13;
  }

  /* the base rules above outweigh Bootstrap's own :hover on these */
  body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .modal-footer .btn-primary:hover:not(#\9) {
    background: var(--nd-acct-primary-hover);
    border-color: var(--nd-acct-primary-hover);
  }
}

/* ───────────── Press: after the hover block, at its weight, or a mouse press never shows ───────────── */
body.nd-menu #profile_dialog #tab_profile .save_profile_info:active:not(#\9),
body.nd-menu #profile_dialog #tab_profile #profile_addr_save:active:not(#\9),
body.nd-menu #profile_dialog #tab_profile .change_password:active:not(#\9),
body.nd-menu #profile_dialog #tab_profile #delete_user_account:active:not(#\9),
body.nd-menu #profile_dialog .nd-acct-addr-add:active:not(#\9),
body.nd-menu #profile_dialog .nd-acct-addr-cancel:active:not(#\9),
body.nd-menu #profile_dialog #profile_addr_delete:not(.disabled):active:not(#\9),
body.nd-menu #profile_dialog .user_order :is(a.repeat_order, a.edit_order):active:not(#\9),
body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .modal-footer .btn:active:not(#\9) {
  transform: scale(.98);
}

/* a Site's .btn-primary:active (rest-css, delicates) paints the press white with !important, and the
   label's text-fill above stays white: the fill is held at the brand's */
body.nd-menu #profile_dialog #tab_profile :is(.save_profile_info, #profile_addr_save):active:not(#\9) {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}

@media (hover: hover) {
  body.nd-menu #profile_dialog #tab_profile :is(.save_profile_info, #profile_addr_save):active:not(#\9) {
    background: var(--nd-acct-primary-hover) !important;
    border-color: var(--nd-acct-primary-hover) !important;
  }
}

/* on touch: the press, no rotation */
body.nd-menu #profile_dialog .modal-header .close:active:not(#\9),
body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .bootbox-close-button:active:not(#\9) {
  transform: scale(.92);
}

@media (hover: hover) {
  body.nd-menu #profile_dialog .modal-header .close:hover:active:not(#\9),
  body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .bootbox-close-button:hover:active:not(#\9) {
    transform: rotate(90deg) scale(.92);
  }
}

/* a mouse press leaves no ring (the platform's :focus outline) */
body.nd-menu #profile_dialog :is(a, button):focus:not(:focus-visible):not(#\9) {
  outline: none;
}

/* the prototype has no focus style at all: keyboard users get the theme's ring */
body.nd-menu #profile_dialog :is(a, button, input[type="button"]):focus-visible:not(#\9),
body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox :is(a, button):focus-visible:not(#\9),
body.nd-menu #profile_dialog #tab_profile .save_profile_info:focus-visible:not(#\9),
body.nd-menu #profile_dialog #tab_profile #profile_addr_save:focus-visible:not(#\9) {
  outline: 2px solid var(--nd-acct-accent);
  outline-offset: 2px;
}

/* the platform's button sits over the window from 768px up: under the backdrop while it is open,
   as on the entry screens */
body.nd-menu.nd-acct-open:not(#\9) .a11y_floating_button {
  z-index: 1039;
}

/* ───────────── Phone ───────────── */
@media (max-width: 767px) {
  body.nd-menu {
    --nd-acct-height: calc(100vh - 32px - var(--nd-cookie-h, 0px));
  }

  /* svh, not dvh: the iOS toolbar comes and goes, the window's height must not follow it */
  @supports (height: 100svh) {
    body.nd-menu {
      --nd-acct-height: calc(100svh - 32px - var(--nd-cookie-h, 0px));
    }
  }

  body.nd-menu #profile_dialog .modal-dialog:not(#\9) {
    width: calc(100vw - 32px);
    min-height: var(--nd-acct-height);
    margin: 16px auto;
  }

  /* the logout moves up beside the close: in the prototype it runs off the tab strip's edge */
  body.nd-menu #profile_dialog .modal-header:not(#\9) {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "title logout close" "tabs tabs tabs";
    column-gap: 4px;
    padding: 16px 16px 0;
  }

  body.nd-menu #profile_dialog .nd-acct-title:not(#\9) {
    font-size: 22px;
  }

  body.nd-menu #profile_dialog .nd-acct-logout:not(#\9) {
    padding: 8px;
  }

  /* the strip scrolls alone, under the header's own edges */
  body.nd-menu #profile_dialog .nav-tabs:not(#\9) {
    flex-wrap: nowrap;
    margin: 12px -16px;
    padding-inline: 16px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    scroll-padding-inline: 16px;
  }

  body.nd-menu #profile_dialog .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  body.nd-menu #profile_dialog .nav-tabs .nav-link:not(#\9) {
    padding: 11px 16px;
  }

  body.nd-menu #profile_dialog .modal-body:not(#\9) {
    padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  }

  /* the address list beside its two buttons: «Добавить новый адрес» at 16px must not lose its end */
  body.nd-menu #profile_dialog #profile_address > .row:first-child:not(#\9),
  body.nd-menu #profile_dialog #profile_address > .row:first-child > .form-group:last-child:not(#\9) {
    gap: 8px;
  }

  body.nd-menu #profile_dialog #tab_profile select#profile_addr_select.form-control:not(#\9) {
    padding-inline: 12px 34px;
    background-position: left 12px center;
  }

  body.nd-menu.ltr #profile_dialog #tab_profile select#profile_addr_select.form-control:not(#\9) {
    background-position: right 12px center;
  }

  /* below 16px iOS zooms the page on focus; the prototype's 15.2px would trigger it */
  body.nd-menu #profile_dialog #tab_profile :is(input[type="text"], input[type="tel"], input[type="email"], input[type="date"], select):not(#\9),
  body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox :is(.bootbox-input, .nd-acct-pw-again):not(#\9) {
    font-size: 16px;
  }

  body.nd-menu #profile_dialog #tab_profile > .row:first-of-type:not(#\9) {
    grid-template-columns: minmax(0, 1fr);
  }

  /* the new address in one column, as in the prototype (.acct-fields 1fr); the card's padding shrinks */
  body.nd-menu #profile_dialog #profile_address > .row:last-child:not(#\9) {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
  }

  /* the platform's phone rule stretches these with width:100% */
  body.nd-menu #profile_dialog #tab_profile :is(.save_profile_info, #profile_addr_save, .change_password, #delete_user_account):not(#\9) {
    width: auto;
    margin: 0;
  }
}

/* a phone on its side: the window's head gives its height back to the content */
@media (max-height: 480px) {
  body.nd-menu #profile_dialog .modal-header:not(#\9) {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "tabs logout close";
    column-gap: 4px;
    padding-block: 8px;
  }

  body.nd-menu #profile_dialog .nd-acct-title:not(#\9) {
    display: none;
  }

  body.nd-menu #profile_dialog .nav-tabs:not(#\9) {
    margin-block: 0;
    margin-inline-end: 0;
  }

  body.nd-menu #profile_dialog .nav-tabs .nav-link:not(#\9) {
    padding-block: 8px;
  }

  body.nd-menu #profile_dialog .modal-body:not(#\9) {
    padding-block-start: 12px;
  }
}

/* ───────────── Where the window is narrower than the card ───────────── */
/* three columns need the window at 836px: 5 items 366, side columns 354, paddings 116. Below that the
   strip would clip with a hidden scrollbar and no way to reach the rest with a mouse. */
@media (max-width: 899px) {
  body.nd-menu #profile_dialog .tab_orders .user_order:not(#\9) {
    grid-template-columns: minmax(0, 1fr);
  }

  body.nd-menu #profile_dialog .user_order .products_user_list_wrapper:not(#\9) {
    padding: 12px 0;
    border-inline: none;
    border-block: 1px solid var(--nd-acct-divider);
  }

  /* as in the prototype: the total at the start, «order again» under it at the end */
  body.nd-menu #profile_dialog .user_order .col.btns_wrapper:not(#\9) {
    align-self: flex-end;
  }
}

@media (max-width: 720px) {
  body.nd-menu #profile_dialog :is(#tab_gifts, #tab_points) .wrapper > .row:not(#\9) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  body.nd-menu #profile_dialog :is(#tab_gifts, #tab_points) .wrapper > .row:not(#\9) {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ───────────── The header: name, its menu, the round buttons ───────────── */
/* desktop (header from 768px): the coloured box becomes the design's quiet row */
body.nd-menu header .welcome_wrap:not(#\9) {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: auto;
  /* the prototype's frame: its last control stands 28px from the header's edge (15 are the column's) */
  padding: 0 !important;
  padding-inline-end: 13px !important;
  /* the room the script measured beside the column, toward its text */
  margin-inline-start: calc(-1 * var(--nd-acct-extra, 0px));
  background: none !important;
  color: var(--nd-acct-ink) !important;
}

/* the column keeps its share of the header row: a wider row narrows «restore» (script) and the name.
   It stands in the header's top row, as the prototype's actions (Bootstrap's .align-self-end is !important) */
body.nd-menu header :has(> .welcome_wrap):not(#\9) {
  align-self: flex-start !important;
  min-width: 0;
}

body.nd-menu header .welcome_wrap > .row:not(#\9),
body.nd-menu header .welcome_wrap > .row > div:not(#\9) {
  display: contents;
}

body.nd-menu header .welcome_wrap a.reorder:not(#\9) {
  order: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 36px;
  margin: 0;
  padding: 0 17px;
  background: var(--primary);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--nd-acct-fill-line);
  color: var(--nd-acct-on-primary);
  font-size: 12.8px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background .3s var(--nd-acct-e-soft), transform .3s var(--nd-acct-e-soft);
}

body.nd-menu header .welcome_wrap a.reorder > i:not(#\9) {
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: var(--nd-acct-ico-restore) center / contain no-repeat;
  mask: var(--nd-acct-ico-restore) center / contain no-repeat;
}

body.nd-menu header .welcome_wrap a.reorder > i:not(#\9)::before {
  content: none;
}

/* the name opens the window (script); the logout link lives in the menu and in the window */
body.nd-menu header .welcome_wrap .welcome:not(#\9) {
  order: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 40px;
  margin: 0;
  padding: 0 8px;
  border: none;
  border-radius: 999px;
  color: var(--nd-acct-accent);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: background .25s var(--nd-acct-e-soft);
}

body.nd-menu header .welcome_wrap .welcome > i:not(#\9) {
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--nd-acct-ico-user) center / contain no-repeat;
  mask: var(--nd-acct-ico-user) center / contain no-repeat;
}

body.nd-menu header .welcome_wrap .welcome > i:not(#\9)::before {
  content: none;
}

body.nd-menu header .welcome_wrap .welcome > a:not(#\9) {
  display: none;
}

/* a long name stays on its line: the script wraps the greeting in this span */
body.nd-menu header .nd-acct-hello:not(#\9) {
  overflow: hidden;
  min-width: 0;
  max-width: 190px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* a guest: the platform's link is the way in; a Client has the name instead */
body.nd-menu header .welcome_wrap a.open_profile:not(#\9) {
  order: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 40px;
  margin: 0;
  padding: 0 8px;
  background: none;
  border: none;
  border-radius: 999px;
  box-shadow: none;
  color: var(--nd-acct-accent);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background .25s var(--nd-acct-e-soft);
}

body.nd-menu.logged_in header .welcome_wrap a.open_profile:not(#\9) {
  display: none;
}

body.nd-menu header .welcome_wrap a.open_profile:not(#\9)::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--nd-acct-ico-user) center / contain no-repeat;
  mask: var(--nd-acct-ico-user) center / contain no-repeat;
}

body.nd-menu .nd-acct-chev:not(#\9) {
  order: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--nd-acct-accent);
  transition: background .25s var(--nd-acct-e-soft), transform .3s var(--nd-acct-e-out);
}

body.nd-menu .nd-acct-chev > i:not(#\9) {
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: var(--nd-acct-ico-chev) center / contain no-repeat;
  mask: var(--nd-acct-ico-chev) center / contain no-repeat;
}

body.nd-menu .nd-acct-chev[aria-expanded="true"]:not(#\9) {
  transform: rotate(180deg);
}

body.nd-menu .nd-acct-menu:not(#\9) {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 13px; /* under the chevron: the row's end padding */
  z-index: 1030;
  min-width: 168px;
  padding: 5px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 44px -18px rgba(0, 0, 0, .32), 0 3px 10px rgba(0, 0, 0, .06);
  visibility: hidden;
}

/* as in the prototype it appears and goes at once; the chevron keeps its turn */
body.nd-menu .nd-acct-menu.is-open:not(#\9) {
  visibility: visible;
}

body.nd-menu .nd-acct-menu > a:not(#\9) {
  display: block;
  padding: 8px 11px;
  border-radius: 10px;
  color: var(--nd-acct-accent);
  font-size: 13.28px;
  font-weight: 600;
  line-height: 1.3;
  text-align: start;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s var(--nd-acct-e-soft);
}

body.nd-menu .nd-acct-menu > a.nd-acct-menu-logout:not(#\9) {
  margin-top: 3px;
  border-radius: 0 0 10px 10px;
  border-top: 1px solid var(--nd-acct-divider);
  color: var(--nd-acct-mut);
}

@media (hover: hover) {
  body.nd-menu header .welcome_wrap a.reorder:hover:not(#\9) {
    background: var(--nd-acct-primary-hover);
    transform: translateY(-1px);
  }

  body.nd-menu header .welcome_wrap .welcome:hover:not(#\9),
  body.nd-menu header .welcome_wrap a.open_profile:hover:not(#\9),
  body.nd-menu .nd-acct-chev:hover:not(#\9) {
    background: rgba(0, 0, 0, .05);
  }

  body.nd-menu .nd-acct-menu > a:hover:not(#\9) {
    background: var(--nd-acct-tint);
  }

  body.nd-menu #profile_dialog .user_order .nd-acct-oarrow:not([aria-disabled="true"]):hover:not(#\9) {
    background: rgba(0, 0, 0, .1);
  }
}

body.nd-menu header .welcome_wrap a.reorder:active:not(#\9) {
  transform: scale(.98);
}

body.nd-menu header :is(.welcome, a.open_profile, a.reorder):focus-visible:not(#\9),
body.nd-menu .nd-acct-chev:focus-visible:not(#\9),
body.nd-menu .nd-acct-menu > a:focus-visible:not(#\9) {
  outline: 2px solid var(--nd-acct-accent);
  outline-offset: 2px;
}

/* a narrow desktop column: «restore» keeps its icon, its name stays for assistive tech (aria-label);
   a name still too long for the row ends in «…» */
body.nd-menu header .welcome_wrap.nd-acct-tight a.reorder:not(#\9) {
  justify-content: center;
  width: 36px;
  padding: 0;
  font-size: 0;
}

body.nd-menu header .welcome_wrap.nd-acct-tight .welcome:not(#\9) {
  flex: 0 1 auto;
  min-width: 0;
}

/* the phone's header: two round buttons, the greeting under the logo. To Bootstrap's own edge of
   d-md-none (min-width 768px): a zoomed window of 767.5px still shows this header */
@media (max-width: 767.98px) {
  body.nd-menu .nd-acct-phone-head .open_profile:not(#\9),
  body.nd-menu .nd-acct-phone-head .icons a.reorder:not(#\9) {
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    background: var(--nd-acct-tint);
    border: none;
    /* the account button carries Bootstrap's .rounded, which is !important */
    border-radius: 50% !important;
    box-shadow: none;
    color: var(--nd-acct-accent);
    font-size: 0;
    line-height: 1;
    transition: background .25s var(--nd-acct-e-soft), color .25s var(--nd-acct-e-soft), transform .18s ease;
  }

  body.nd-menu .nd-acct-phone-head .open_profile:not(#\9)::before,
  body.nd-menu .nd-acct-phone-head .icons a.reorder:not(#\9)::before {
    content: "";
    width: 19px;
    height: 19px;
    background: currentColor;
    -webkit-mask: var(--nd-acct-ico-user) center / contain no-repeat;
    mask: var(--nd-acct-ico-user) center / contain no-repeat;
  }

  body.nd-menu .nd-acct-phone-head .icons a.reorder:not(#\9)::before {
    -webkit-mask-image: var(--nd-acct-ico-restore);
    mask-image: var(--nd-acct-ico-restore);
  }

  body.nd-menu .nd-acct-phone-head .icons a.reorder > i:not(#\9) {
    display: none;
  }

  /* as in the prototype: «restore» at the row's end, the account button beside it (42 + 8 px gap);
     the logo's row stands as it was */
  body.nd-menu .nd-acct-phone-head .icons a.reorder:not(#\9) {
    display: inline-flex;
    position: absolute;
    top: var(--nd-acct-phone-round-top, 8px);
    inset-inline-end: 15px;
    z-index: 1;
  }

  body.nd-menu .nd-acct-phone-head .icons:not(#\9) {
    position: static;
  }

  /* beside «restore», from the header's edge as it is: in its own column (320/3 px less the gutters) the
     two would overlap on a narrow phone */
  body.nd-menu .nd-acct-phone-head .row > :has(> a.open_profile):not(#\9) {
    position: static;
  }

  body.nd-menu .nd-acct-phone-head a.open_profile:not(#\9) {
    display: flex;
    position: absolute;
    top: var(--nd-acct-phone-round-top, 8px);
    inset-inline-end: 65px;
    z-index: 1;
  }

  body.nd-menu .nd-acct-phone-head .open_profile:active:not(#\9),
  body.nd-menu .nd-acct-phone-head .icons a.reorder:active:not(#\9) {
    background: var(--primary);
    color: var(--nd-acct-on-primary);
    transform: scale(.92);
  }

  body.nd-menu .nd-acct-phone-head .welcome:not(#\9) {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: var(--nd-acct-ink);
    font-size: 14.72px;
    font-weight: 800;
    line-height: 1.3;
  }

  body.nd-menu .nd-acct-phone-head .welcome > i:not(#\9) {
    display: none;
  }

  body.nd-menu .nd-acct-phone-head .nd-acct-hello:not(#\9) {
    flex: 0 1 auto;
  }

  body.nd-menu .nd-acct-phone-head .welcome > a:not(#\9) {
    flex: none;
    color: var(--nd-acct-mut);
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
}

/* ───────────── Keyframes and less motion ───────────── */
@keyframes nd-acct-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.nd-menu #profile_dialog,
  body.nd-menu #profile_dialog *,
  body.nd-menu.nd-acct-open .modal-backdrop,
  body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox *,
  body.nd-menu .nd-acct-chev,
  body.nd-menu header .welcome_wrap a.reorder,
  body.nd-menu .nd-acct-phone-head :is(.open_profile, .icons a.reorder) {
    animation-duration: .01ms !important;
    transition-duration: 0s !important;
  }

  /* the header's buttons keep their colour feedback, without the lift or the press */
  body.nd-menu header .welcome_wrap a.reorder:is(:hover, :active):not(#\9),
  body.nd-menu .nd-acct-phone-head :is(.open_profile, .icons a.reorder):active:not(#\9) {
    transform: none;
  }

  /* no movement at all: the close only changes its fill */
  body.nd-menu #profile_dialog.fade .modal-dialog:not(#\9),
  body.nd-menu #profile_dialog .modal-header .close:not(#\9),
  body.nd-menu #profile_dialog .modal-header .close:hover:not(#\9),
  body.nd-menu #profile_dialog .modal-header .close:active:not(#\9),
  body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .bootbox-close-button:not(#\9),
  body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .bootbox-close-button:hover:not(#\9),
  body.nd-menu.nd-acct-open:not(.nd-acct-closing) .bootbox .bootbox-close-button:active:not(#\9) {
    transform: none;
  }
}
