/* Кнопка профиля в шапке (аватар). Единственный владелец внешнего вида.
   Цвета только из токенов --ava-* (brand-tokens.css). Место в сетке шапки — в топбаре, не здесь. */
#profileTopBtn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: Unbounded, "Golos Text", system-ui, sans-serif;
  font-size: calc(var(--topbar-h, 56px) * 0.28);
  font-weight: 700;
  line-height: 1;
  background: var(--ava-bg, linear-gradient(135deg, #3e8fd0, #123a6b));
  color: var(--ava-color, #FFFFFF);
  border: var(--ava-border, 1.5px solid #FFFFFF);
  box-shadow: var(--ava-shadow, none);
  transition: transform 0.25s;
}
#profileTopBtn:hover { transform: scale(1.08); }
@media (min-width: 821px) {
  #profileTopBtn { width: 48px; height: 48px; min-width: 48px; font-size: 18px; }
}

/* Profile identity: first row contains name and actions; second row contains avatar and account details. */
#profileBox .phead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
#profileBox .phead > .profile-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  grid-template-rows: 44px;
  align-items: center;
  gap: 8px;
  flex: 1 1 calc(100% - 54px);
  width: calc(100% - 54px);
  min-width: 0;
  grid-column: auto;
  grid-row: auto;
}
#profileBox .phead > #profileSettingsBtn {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  grid-column: auto;
  grid-row: auto;
  align-self: center;
}
#profileBox .profile-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
}
#profileBox .profile-meta-row .ava {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  min-width: 52px;
  align-self: center;
}
#profileBox .profile-meta-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}
#profileBox .profile-meta-copy > .ph,
#profileBox .profile-meta-copy > .profile-role {
  min-width: 0;
  margin: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
#profileBox .profile-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  grid-template-rows: 44px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
#profileBox input#nameInput {
  grid-column: 1;
  grid-row: 1;
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  height: 44px;
  line-height: 1.2;
  text-overflow: ellipsis;
}
#profileBox .profile-name-edit-icon {
  grid-column: 2;
  grid-row: 1;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: var(--profile-btn-secondary-border, 1.5px solid var(--line));
  border-radius: var(--profile-btn-radius, 12px);
  background: var(--profile-btn-secondary-bg, #fff);
  box-shadow: var(--profile-btn-secondary-shadow, 0 2px 6px rgba(0,0,0,.12));
  color: var(--profile-btn-secondary-color, var(--ink));
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#profileBox .profile-name-actions {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
#profileBox .profile-name-actions[hidden],
#profileBox .profile-name-edit-icon[hidden] {
  display: none;
}
#profileBox .profile-identity-copy > .ph,
#profileBox .profile-identity-copy > .profile-role {
  grid-column: 1;
  min-width: 0;
  margin: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
#profileBox .profile-name-row > #nameEditBtn.profile-name-edit-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  max-width: none;
  max-height: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#profileBox #profileSettingsBtn {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  line-height: 1;
  flex: 0 0 44px;
}

@media (max-width: 380px) {
  #profileBox .phead { gap: 8px; }
  #profileBox .profile-meta-row { gap: 10px; }
  #profileBox .profile-meta-row .ava {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
  #profileBox #profileSettingsBtn,
  #profileBox .profile-name-edit-icon {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }
}

/* Вкладки профиля имеют одинаковый вес и размер зоны нажатия. */
.tabs .btn-back {
  flex: 1 1 0;
  min-width: 0;
  padding: 9px 4px;
  border-radius: 12px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  transition: 0.2s;
}
.tabs .btn-back:hover {
  background: #edf2f6;
}

/* Профиль кофейни: один прогресс вместо повторяющейся статистики. */
#profileCoffeeSection [hidden].stats {
  display: none !important;
}
.profile-stamps-summary {
  display: grid;
  gap: 7px;
  margin-top: 2px;
}
.profile-stamps-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(62, 143, 208, 0.16);
}
.profile-stamps-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--flame, #123A6B);
  transition: width 180ms ease;
}
#profileStampsRemaining {
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.profile-qr-access {
  display: block;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}
.profile-qr-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: var(--profile-btn-border, none);
  border-radius: var(--profile-btn-radius, 12px);
  background: var(--profile-btn-bg, var(--flame, #123A6B));
  color: var(--profile-btn-color, #fff);
  box-shadow: var(--profile-btn-shadow, none);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  text-underline-offset: 0;
}

/* Соцсети кофейни: иконки в один ряд, подписи доступны скринридерам. */
.coffee-place-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 9px;
}
.coffee-place-link,
.friday-info-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.coffee-place-link svg,
.friday-info-link svg {
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}
.coffee-place-link span,
.friday-info-link span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Отзыв — одна строка без описательного абзаца. */
#profileBox .coffee-review-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
}
.coffee-review-prompt {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
#profileBox .coffee-review-button {
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--profile-btn-radius, 12px);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  border: 0;
  background: var(--profile-review-btn-bg, var(--profile-btn-bg));
  color: var(--profile-review-btn-color, var(--profile-btn-color));
  box-shadow: var(--profile-btn-shadow, none);
}

/* «Пятница»: компактное раскрытие адреса и графика, ссылки-иконки. */
#profileBox > #fridayInfo {
  padding: 0;
  border-color: var(--line);
  background: #fff;
}
.friday-info-details {
  margin: 0;
}
.friday-info-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.friday-info-details > summary::-webkit-details-marker {
  display: none;
}
.friday-info-chevron {
  color: var(--soft);
  font-size: 18px;
  line-height: 1;
  transition: transform 160ms ease;
}
.friday-info-details[open] .friday-info-chevron {
  transform: rotate(180deg);
}
.friday-info-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}
.friday-info-address {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
}
.friday-info-hours {
  display: grid;
  gap: 6px;
  color: var(--soft);
  font-size: 11.5px;
  line-height: 1.4;
}
.friday-info-hours-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 8px;
}
.friday-info-hours-row b {
  color: var(--ink);
}
.friday-info-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
}
.friday-info-review {
  justify-self: start;
  font-size: 12px;
  font-weight: 700;
}

/* Единый визуальный паттерн раскрывающихся блоков в профиле кофейни. */
#verifyNote .profile-loyalty-help,
#profileCoffeeSection .profile-promo-details {
  margin: 0 0 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(18, 58, 107, 0.055);
}
#profileCoffeeSection .profile-promo-details {
  margin: 8px 0 0;
}
#verifyNote .profile-loyalty-help > summary,
#profileCoffeeSection .profile-promo-details > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 13px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 160ms ease;
}
#verifyNote .profile-loyalty-help > summary::-webkit-details-marker,
#profileCoffeeSection .profile-promo-details > summary::-webkit-details-marker {
  display: none;
}
#verifyNote .profile-loyalty-help > summary:focus-visible,
#profileCoffeeSection .profile-promo-details > summary:focus-visible {
  outline: 2px solid var(--loyalty-accent, var(--flame));
  outline-offset: -3px;
  border-radius: 13px;
}
#verifyNote .profile-loyalty-help > summary > span:first-child {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  gap: 10px;
}
#verifyNote .profile-loyalty-help > summary > span:first-child::before,
#profileCoffeeSection .profile-promo-details > summary::before {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(18, 58, 107, 0.09);
  border-radius: 10px;
  background: var(--loyalty-help-bg, #EDF2F6);
  color: var(--loyalty-accent, var(--flame));
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}
#verifyNote .profile-loyalty-help > summary > span:first-child::before {
  content: "?";
}
#profileCoffeeSection .profile-promo-details > summary::before {
  content: "%";
  font-size: 15px;
}
.profile-loyalty-help-chevron,
#profileCoffeeSection .profile-promo-details > summary::after {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(18, 58, 107, 0.09);
  border-radius: 10px;
  background: var(--loyalty-help-bg, #EDF2F6);
  color: var(--soft);
  font-size: 17px;
  line-height: 1;
  transition: transform 180ms ease, background-color 160ms ease;
}
#profileCoffeeSection .profile-promo-details > summary::after {
  content: "⌄";
}
.profile-loyalty-help[open] .profile-loyalty-help-chevron,
#profileCoffeeSection .profile-promo-details[open] > summary::after {
  transform: rotate(180deg);
}
#verifyNote .profile-loyalty-help[open] > summary,
#profileCoffeeSection .profile-promo-details[open] > summary {
  background: var(--loyalty-help-bg, #EDF2F6);
}
#verifyNote .profile-loyalty-help-content {
  display: grid;
  gap: 8px;
  padding: 10px 11px 12px;
  border-top: 1px solid var(--line);
  background: #F8FAFC;
  color: var(--soft);
  font-size: 11.75px;
  line-height: 1.5;
}
.profile-loyalty-help-content p {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid rgba(18, 58, 107, 0.09);
  border-radius: 12px;
  background: #fff;
}
.profile-loyalty-help-content b {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.profile-loyalty-help-content a {
  color: var(--loyalty-accent, var(--flame));
  font-weight: 800;
  text-decoration: none;
  text-underline-offset: 2px;
  border-bottom: 1px solid currentColor;
}
#profileCoffeeSection .profile-promo-details[open] > .qrbox {
  margin-top: 0;
  padding: 12px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: #F8FAFC;
  box-shadow: none;
}
@media (hover: hover) {
  #verifyNote .profile-loyalty-help > summary:hover,
  #profileCoffeeSection .profile-promo-details > summary:hover {
    background: var(--loyalty-help-bg, #EDF2F6);
  }
}
@media (prefers-reduced-motion: reduce) {
  .profile-loyalty-help-chevron,
  #profileCoffeeSection .profile-promo-details > summary::after,
  #verifyNote .profile-loyalty-help > summary,
  #profileCoffeeSection .profile-promo-details > summary {
    transition: none;
  }
}
.profile-activation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}
.profile-activation-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.profile-activation-row input {
  min-width: 0;
  width: 100%;
}
.profile-activation-row button {
  min-height: 40px;
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .profile-loyalty-help-chevron { transition: none; }
}

/* Кнопка промокода не должна переносить «ОК» даже на узких экранах. */
#profileCoffeeSection .findrow #promoBtn {
  flex: 0 0 auto;
  min-width: 54px;
  white-space: nowrap;
}

/* Бонусы: подарок, основной QR и промокод без скрытого холста. */
#profileCoffeeSection .stamp-gift {
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  border-style: dashed;
}
#profileCoffeeSection .stamp-gift.f {
  border-style: solid;
}
#profileCoffeeSection .freeCard {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(18, 58, 107, 0.22);
  background: #F3F8FC;
}
#profileCoffeeSection .free-card-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
#profileCoffeeSection .free-card-action {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 0;
  border-radius: 11px;
  background: var(--loyalty-accent, var(--flame));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
#profileCoffeeSection .bonus-qr-row {
  display: grid;
  gap: 8px;
  padding: 12px;
}
#profileCoffeeSection .bonus-qr-copy b {
  font-size: 13px;
}
#profileCoffeeSection .bonus-qr-copy small {
  font-size: 11px;
}
#profileCoffeeSection .bonus-qr-row .demoBtn {
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  border: 0;
  border-radius: 11px;
  background: var(--loyalty-accent, var(--flame));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
#profileCoffeeSection .bonus-qr-canvas {
  position: static;
  display: block;
  width: min(196px, 100%);
  height: auto;
  aspect-ratio: 1;
  margin: 12px auto 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  opacity: 1;
  pointer-events: auto;
}
@media (max-width: 420px) {
  #profileCoffeeSection .bonus-qr-row {
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }
  #profileCoffeeSection .bonus-qr-row .demoBtn {
    min-height: 50px;
    padding-inline: 12px;
  }
}

/* Mobile drawer footer: equal, full-width actions with a proper touch target. */
@media (max-width: 820px) {
  #panel.open .tabs {
    gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  #panel.open .tabs button {
    box-sizing: border-box;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.2;
  }
  #panel.open .tabs .btn-back {
    color: var(--soft);
    font-weight: 700;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: none;
  }
  #panel.open .tabs button.on {
    transform: none;
  }
}

/* Profile restyle: clean canvas, one identity surface, clear action hierarchy. */
#panel #pvProfile {
  background-color: var(--profile-canvas, var(--panel));
  background-image: var(--profile-canvas-image, none);
  background-size: auto;
}
#profileBox > .profile-identity {
  padding: 14px;
  border: var(--profile-section-border, 1px solid var(--line));
  border-radius: var(--profile-section-radius, 16px);
  background: var(--profile-section-bg, #fff);
  box-shadow: var(--profile-section-shadow, none);
}
#profileBox .phead .ava {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 16px;
}
#profileBox input#nameInput {
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: var(--profile-surface-muted, var(--panel));
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}
#profileBox .profile-name-edit-icon,
#profileBox #profileSettingsBtn {
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}
#profileBox .profile-name-action,
#profileBox .profile-all-orders,
#profileBox .profile-history-toggle,
#profileBox #pushBtn,
#profileBox .profile-qr-link,
#profileBox .profile-activation-row button,
#profileBox .free-card-action,
#profileBox .coffee-review-button,
#profileBox .friday-info-review,
#profileBox .friday-info-link {
  min-height: 44px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
  -webkit-tap-highlight-color: transparent;
}
#profileBox .profile-name-action:not(.is-primary),
#profileBox .profile-name-edit-icon,
#profileBox #profileSettingsBtn,
#profileBox .profile-all-orders,
#profileBox .profile-history-toggle,
#profileBox .friday-info-link {
  border: var(--profile-btn-secondary-border, 1.5px solid var(--line));
  border-radius: var(--profile-btn-radius, 12px);
  background: var(--profile-btn-secondary-bg, #fff);
  color: var(--profile-btn-secondary-color, var(--ink));
  box-shadow: var(--profile-btn-secondary-shadow, 0 2px 6px rgba(0,0,0,.12));
}
#profileBox .profile-name-action.is-primary,
#profileBox #pushBtn,
#profileBox .profile-qr-link,
#profileBox .profile-activation-row button,
#profileBox .free-card-action {
  border: var(--profile-btn-border, 1.5px solid transparent);
  border-radius: var(--profile-btn-radius, 12px);
  background: var(--profile-btn-bg, var(--flame));
  color: var(--profile-btn-color, #fff);
  box-shadow: var(--profile-btn-shadow, none);
  font-weight: 800;
}
#profileBox .profile-name-action,
#profileBox .profile-all-orders,
#profileBox .profile-history-toggle,
#profileBox .friday-info-review {
  padding: 9px 13px;
}
#profileBox .profile-name-action:not(.is-primary) {
  background: var(--profile-btn-secondary-bg, #fff);
  border: var(--profile-btn-secondary-border, 1.5px solid var(--line));
  box-shadow: var(--profile-btn-secondary-shadow, none);
}
#profileBox > #profileCoffeeSection,
#profileBox > #profileOrdersSection,
#profileBox > #fridayInfo,
#profileBox > .profile-history-section,
#profileBox > .placebox {
  border: var(--profile-section-border, 1px solid var(--line));
  border-radius: var(--profile-section-radius, 16px);
  background: var(--profile-section-bg, #fff);
  box-shadow: var(--profile-section-shadow, none);
}
#profileBox > #profileCoffeeSection,
#profileBox > #profileOrdersSection,
#profileBox > .placebox,
#profileBox > .profile-history-section {
  padding: 14px;
}
#profileBox > #profileCoffeeSection,
#profileBox > #profileOrdersSection,
#profileBox > #fridayInfo,
#profileBox > .profile-history-section {
  overflow: hidden;
}
#profileBox > #fridayInfo { background-image: none; }
#profileBox .profile-section-heading,
#profileBox .profile-history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
#profileBox .profile-section-heading h4,
#profileBox .profile-history-heading h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}
#profileBox .profile-history-section { display: grid; gap: 10px; }
#profileBox #histList .hmini {
  padding: 10px 0;
  border-top: 1px solid var(--profile-divider, var(--line));
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#profileBox .myOrderCard {
  padding: 13px;
  border: var(--profile-section-border, 1px solid var(--line));
  border-radius: 12px;
  background: var(--profile-surface, #fff);
  box-shadow: none;
}
#profileBox .myOrderCard .moTrack,
#ordersModal .myOrderCard .moTrack {
  min-height: 44px;
  padding: 10px 14px;
  border: var(--profile-btn-border, 1.5px solid transparent);
  border-radius: var(--profile-btn-radius, 12px);
  background: var(--profile-btn-bg, var(--flame));
  color: var(--profile-btn-color, #fff);
  box-shadow: var(--profile-btn-shadow, none);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
#profileBox :is(button, a):focus-visible,
#ordersModal :is(button, a):focus-visible {
  outline: 2px solid var(--profile-focus-ring, currentColor);
  outline-offset: 3px;
}
@media (hover: hover) {
  #profileBox .profile-name-edit-icon:hover,
  #profileBox #profileSettingsBtn:hover,
  #profileBox .profile-name-action:hover,
  #profileBox .profile-all-orders:hover,
  #profileBox .profile-history-toggle:hover,
  #profileBox #pushBtn:hover,
  #profileBox .profile-qr-link:hover,
  #profileBox .profile-activation-row button:hover,
  #profileBox .free-card-action:hover,
  #profileBox .coffee-review-button:hover,
  #profileBox .friday-info-review:hover,
  #profileBox .friday-info-link:hover {
    transform: var(--profile-btn-hover-transform, none);
    box-shadow: var(--profile-btn-shadow-hover, var(--profile-btn-shadow, none));
  }
  #profileBox .profile-name-action:not(.is-primary):hover,
  #profileBox .profile-all-orders:hover,
  #profileBox .profile-history-toggle:hover,
  #profileBox #profileSettingsBtn:hover,
  #profileBox .profile-name-edit-icon:hover,
  #profileBox .friday-info-link:hover {
    box-shadow: var(--profile-btn-secondary-shadow-hover, var(--profile-btn-secondary-shadow, none));
  }
}
#profileBox .profile-name-edit-icon:active,
#profileBox #profileSettingsBtn:active,
#profileBox .profile-name-action:active,
#profileBox .profile-all-orders:active,
#profileBox .profile-history-toggle:active,
#profileBox #pushBtn:active,
#profileBox .profile-qr-link:active,
#profileBox .profile-activation-row button:active,
#profileBox .free-card-action:active,
#profileBox .coffee-review-button:active,
#profileBox .friday-info-review:active,
#profileBox .friday-info-link:active,
#profileBox .myOrderCard .moTrack:active {
  transform: var(--profile-btn-active-transform, none);
  box-shadow: var(--profile-btn-shadow-active, none);
}
#profileBox .profile-name-action:not(.is-primary):active,
#profileBox .profile-name-edit-icon:active,
#profileBox #profileSettingsBtn:active,
#profileBox .profile-all-orders:active,
#profileBox .profile-history-toggle:active {
  box-shadow: var(--profile-btn-secondary-shadow-active, var(--profile-btn-secondary-shadow, none));
}
#profileBox .coffee-review-button {
  border: var(--profile-review-btn-border, var(--profile-btn-border, none));
  background: var(--profile-review-btn-bg, var(--profile-btn-bg));
  color: var(--profile-review-btn-color, var(--profile-btn-color));
  box-shadow: var(--profile-review-btn-shadow, var(--profile-btn-shadow, none));
}
#profileBox #pushBtn[hidden],
#profileBox .profile-name-actions[hidden],
#profileBox .profile-name-edit-icon[hidden],
#profileBox .profile-all-orders[hidden],
#profileBox .profile-history-toggle[hidden] { display: none; }
#settingsModal .settings-card,
#ordersModal .omCard,
#orderTrackModal .ot-card {
  background-image: var(--profile-modal-image, none);
  background-size: var(--profile-modal-size, auto);
}
#settingsModal .settings-account-action:not(.is-danger),
#settingsModal #setPinGo2 {
  min-height: 44px;
  border: var(--profile-btn-secondary-border, 1px solid var(--line));
  border-radius: var(--profile-btn-radius, 12px);
  background: var(--profile-btn-secondary-bg, #fff);
  color: var(--profile-btn-secondary-color, var(--ink));
  box-shadow: var(--profile-btn-secondary-shadow, none);
  cursor: pointer;
}

@media (max-width: 380px) {
  #profileBox .phead { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  #profileTopBtn,
  #profileTopBtn:hover,
  .tabs .btn-back,
  .profile-stamps-track > span,
  .friday-info-chevron,
  #profileBox .profile-name-edit-icon,
  #profileBox #profileSettingsBtn,
  #profileBox .profile-name-action,
  #profileBox .profile-all-orders,
  #profileBox .profile-history-toggle,
  #profileBox #pushBtn,
  #profileBox .profile-qr-link,
  #profileBox .profile-activation-row button,
  #profileBox .free-card-action,
  #profileBox .coffee-review-button,
  #profileBox .friday-info-review,
  #profileBox .friday-info-link,
  #profileBox .myOrderCard .moTrack { transition: none; }

  #profileTopBtn:hover {
    transform: none;
  }
}


/* Blur only the page behind settings; the dialog stays crisp and interactive. */
body:has(#settingsModal.show) #overlay {
  background: rgba(16, 20, 24, 0.48);
  -webkit-backdrop-filter: blur(8px) saturate(0.82);
  backdrop-filter: blur(8px) saturate(0.82);
}


/* Keep the edit glyph optically and geometrically centered.
   The generic .profile-name-action padding is for text actions and must not
   shrink/offset the grid used by this icon-only control. */
#profileBox #nameEditBtn.profile-name-edit-icon {
  display: grid;
  grid-template: 22px / 22px;
  place-content: center;
  place-items: center;
  margin: 0;
  padding: 0;
}
#profileBox #nameEditBtn.profile-name-edit-icon > svg {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0;
}

/* Name editing reuses the identity row's existing action slots. */
#profileBox #profileSettingsBtn {
  color: var(--profile-btn-secondary-color, var(--ink));
}
#profileBox #profileSettingsBtn > svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#profileBox .profile-name-edit-icon[hidden] { display: none; }

