/* ─────────────────────────────────────────────────────────────────────────
   Pro My Account — premium UI layer

   Everything added on top of the original dashboard: top-bar tools, skeletons,
   command palette, modals, returns, reviews, preferences, map and the small
   motion touches. Written against the existing design tokens only, so the dark
   theme is a token swap rather than a second stylesheet.
   ───────────────────────────────────────────────────────────────────────── */

.pma-scope,
.pma-dashboard {
  --pma-elev:        var(--pma-surface, #fff);
  --pma-muted:       var(--pma-bg, #f8f8f8);
  --pma-ring:        var(--pma-brand-ring, rgba(124,22,149,.18));
  --pma-veil:        rgba(255,255,255,.72);
}

/* ── Top bar tools ───────────────────────────────────────────────────────── */

.pma-topbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}

.pma-topbar-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--pma-muted);
  border: 1px solid var(--pma-border);
  color: var(--pma-text-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--pma-radius-sm, 2px);
  transition: border-color var(--pma-transition), color var(--pma-transition);
}
.pma-topbar-search:hover { border-color: var(--pma-brand); color: var(--pma-text); }
.pma-topbar-search svg { width: 16px; height: 16px; flex-shrink: 0; }

.pma-topbar-kbd {
  font-size: 10.5px;
  padding: 2px 6px;
  border: 1px solid var(--pma-border);
  background: var(--pma-surface);
  color: var(--pma-text-3);
  letter-spacing: .04em;
}

.pma-topbar-bell,
.pma-theme-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--pma-muted);
  border: 1px solid var(--pma-border);
  color: var(--pma-text-2);
  cursor: pointer;
  border-radius: var(--pma-radius-sm, 2px);
  transition: color var(--pma-transition), border-color var(--pma-transition);
}
.pma-topbar-bell:hover,
.pma-theme-btn:hover { color: var(--pma-brand); border-color: var(--pma-brand); }
.pma-topbar-bell svg,
.pma-theme-btn svg { width: 18px; height: 18px; }

.pma-bell-count {
  position: absolute;
  top: -6px;
  inset-inline-end: -6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  background: var(--pma-brand);
  color: var(--pma-on-brand, #fff);
  font-size: 10px;
  border-radius: 9px;
}
.pma-bell-count.is-hidden { display: none; }

.pma-topbar-bell.is-ringing svg {
  animation: pma-ring .9s cubic-bezier(.36,.07,.19,.97);
  transform-origin: top center;
}

@keyframes pma-ring {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-12deg); }
  45% { transform: rotate(9deg); }
  60% { transform: rotate(-6deg); }
  75% { transform: rotate(3deg); }
}

/* ── Theme switch ────────────────────────────────────────────────────────── */

.pma-theme-switch { position: relative; }

.pma-theme-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 190px;
  padding: 5px;
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  box-shadow: var(--pma-shadow-md);
  z-index: 260;
  display: none;
}
.pma-theme-switch.is-open .pma-theme-menu { display: block; }

.pma-theme-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  background: none;
  border: 0;
  color: var(--pma-text-2);
  font: inherit;
  font-size: 13px;
  text-align: start;
  cursor: pointer;
}
.pma-theme-option:hover { background: var(--pma-muted); color: var(--pma-text); }
.pma-theme-option.is-active { color: var(--pma-brand); font-weight: 700; }
.pma-theme-option-icon { display: inline-grid; place-items: center; width: 18px; }
.pma-theme-option svg { width: 16px; height: 16px; }

/* ── Sidebar profile extras ──────────────────────────────────────────────── */

/* Both chips follow the preset's corners – round under "مدرن", square
   under the sharp "شیک" – and sit on the outside corners of the avatar so
   they never cover the face. */
.pma-avatar-edit,
.pma-avatar-remove {
  opacity: 1;
  position: absolute;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  border-radius: var(--pma-radius-pill, 0px);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  cursor: pointer;
  transition: transform var(--pma-transition), border-color var(--pma-transition);
}

.pma-avatar-edit {
  bottom: -5px;
  inset-inline-start: -5px;
  width: 22px;
  height: 22px;
  color: var(--pma-brand);
}
.pma-avatar-edit:hover { transform: scale(1.1); border-color: var(--pma-brand); }
.pma-avatar-edit svg { width: 12px; height: 12px; }

.pma-avatar-remove {
  top: -5px;
  inset-inline-end: -5px;
  width: 20px;
  height: 20px;
  color: #dc2626;
}
.pma-avatar-remove:hover { transform: scale(1.1); border-color: #dc2626; }
.pma-avatar-remove svg { width: 10px; height: 10px; }

/* Two permanent chips on a 48px avatar is more furniture than face. Where
   there is a real pointer they wait for it; on touch, where nothing hovers,
   they stay put. */
@media (hover: hover) and (pointer: fine) {
  .pma-avatar-edit,
  .pma-avatar-remove {
    opacity: 0;
    transform: scale(.85);
  }

  .pma-profile-card:hover .pma-avatar-edit,
  .pma-profile-card:hover .pma-avatar-remove,
  .pma-avatar-edit:focus-visible,
  .pma-avatar-remove:focus-visible {
    opacity: 1;
    transform: none;
  }
}
.pma-avatar.is-uploading { opacity: .55; filter: blur(1px); }

/* The level pill and its rail sit under the identity row inside the brand
   block; both take their fill from currentColor so a light brand colour –
   which flips --pma-on-brand to dark – does not paint white on white. */
.pma-level {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 13px 0 0;
  padding: 4px 10px;
  border-radius: var(--pma-radius-pill, 0px);
  font-size: 11px;
  font-weight: 700;
  color: inherit;
}
.pma-level::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: currentColor;
  opacity: .18;
}
.pma-level svg { width: 12px; height: 12px; }

.pma-level-progress { margin-top: 10px; }
.pma-level-progress .pma-progress-track {
  height: 3px;
  border-radius: var(--pma-radius-pill, 0px);
  background: rgba(255,255,255,.24);
  overflow: hidden;
}
.pma-level-progress .pma-progress-track span {
  display: block;
  height: 100%;
  background: currentColor;
  transition: width .8s cubic-bezier(.4,0,.2,1);
}
.pma-level-progress small { display: block; margin-top: 6px; font-size: 10.5px; opacity: .8; }
.pma-level-progress .woocommerce-Price-amount { color: inherit; }

.pma-badge.is-hidden { display: none; }

/* ── Skeletons ───────────────────────────────────────────────────────────── */

.pma-skeleton { padding: 4px 0 20px; }
.pma-sk-head { margin-bottom: 22px; }

.pma-sk {
  display: block;
  background: linear-gradient(90deg,
    var(--pma-border-soft, #f0f0f0) 25%,
    var(--pma-border, #e8e8e8) 37%,
    var(--pma-border-soft, #f0f0f0) 63%);
  background-size: 400% 100%;
  animation: pma-sk-shimmer 1.35s ease-in-out infinite;
  border-radius: var(--pma-radius-sm, 2px);
}

.pma-sk-title { width: 210px; height: 20px; margin-bottom: 10px; }
.pma-sk-sub   { width: 320px; max-width: 80%; height: 12px; }

.pma-sk-cards { display: grid; gap: 12px; }
.pma-sk-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
}
.pma-sk-thumb { width: 54px; height: 54px; flex-shrink: 0; }
.pma-sk-lines { flex: 1; display: grid; gap: 9px; }
.pma-sk-line { height: 11px; width: 100%; }
.pma-sk-line.is-short { width: 45%; }

@keyframes pma-sk-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ── Reveal on scroll ────────────────────────────────────────────────────── */

.pma-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .45s ease, transform .45s cubic-bezier(.2,.7,.3,1);
}
.pma-reveal.pma-in { opacity: 1; transform: none; }

/* ── Command palette ─────────────────────────────────────────────────────── */

.pma-palette {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: start center;
  padding: 12vh 16px 16px;
}
.pma-palette[hidden] { display: none; }

.pma-palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,12,18,.5);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .18s ease;
}
.pma-palette.is-open .pma-palette-backdrop { opacity: 1; }

.pma-palette-panel {
  position: relative;
  width: min(620px, 100%);
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  box-shadow: var(--pma-shadow-lg);
  opacity: 0;
  transform: translateY(-10px) scale(.985);
  transition: opacity .18s ease, transform .18s cubic-bezier(.2,.7,.3,1);
}
.pma-palette.is-open .pma-palette-panel { opacity: 1; transform: none; }

.pma-palette-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--pma-border);
}
.pma-palette-field svg { width: 18px; height: 18px; color: var(--pma-text-3); flex-shrink: 0; }

.pma-palette-input {
  flex: 1;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  color: var(--pma-text);
  outline: none;
  padding: 0;
}
.pma-palette-input::placeholder { color: var(--pma-text-3); }

.pma-palette-esc {
  border: 1px solid var(--pma-border);
  background: var(--pma-muted);
  color: var(--pma-text-3);
  font: inherit;
  font-size: 11px;
  padding: 4px 9px;
  cursor: pointer;
}

.pma-palette-results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.pma-palette-group + .pma-palette-group { margin-top: 6px; }

.pma-palette-group-label {
  display: block;
  padding: 8px 10px 4px;
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--pma-text-3);
}

.pma-palette-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 9px 11px;
  background: none;
  border: 0;
  border-inline-start: 2px solid transparent;
  text-align: start;
  font: inherit;
  cursor: pointer;
  color: var(--pma-text);
}
.pma-palette-item:hover,
.pma-palette-item.is-active {
  background: var(--pma-brand-dim);
  border-inline-start-color: var(--pma-brand);
}
.pma-palette-item-title { font-size: 13.5px; font-weight: 700; }
.pma-palette-item-meta  { font-size: 11.5px; color: var(--pma-text-3); }

.pma-palette-empty { padding: 26px 14px; text-align: center; color: var(--pma-text-3); font-size: 13px; }

.pma-palette-foot {
  display: flex;
  gap: 16px;
  padding: 9px 16px;
  border-top: 1px solid var(--pma-border);
  font-size: 11px;
  color: var(--pma-text-3);
}
.pma-palette-foot kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--pma-border);
  background: var(--pma-muted);
  font-size: 10px;
  margin-inline-end: 2px;
}

/* ── Generic modal (returns, map) ────────────────────────────────────────── */

.pma-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 16px;
}
.pma-modal[hidden] { display: none; }

.pma-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,12,18,.52);
  opacity: 0;
  transition: opacity .18s ease;
}
.pma-modal.is-open .pma-modal-backdrop { opacity: 1; }

.pma-modal-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  box-shadow: var(--pma-shadow-lg);
  opacity: 0;
  transform: translateY(12px) scale(.99);
  transition: opacity .18s ease, transform .18s cubic-bezier(.2,.7,.3,1);
}
.pma-modal.is-open .pma-modal-panel { opacity: 1; transform: none; }

.pma-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--pma-border);
}
.pma-modal-head h3 { margin: 0; font-size: 15px; color: var(--pma-text); }

.pma-modal-body { padding: 18px; }

.pma-modal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 18px;
  border-top: 1px solid var(--pma-border);
}

/* ── Return request ──────────────────────────────────────────────────────── */

.pma-return-items { display: grid; gap: 6px; }

.pma-return-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--pma-border);
  background: var(--pma-muted);
  font-size: 13px;
  cursor: pointer;
}
.pma-return-item:hover { border-color: var(--pma-brand); }
.pma-return-item-name { flex: 1; }
.pma-return-item-qty input {
  width: 62px;
  padding: 4px 6px;
  border: 1px solid var(--pma-border);
  background: var(--pma-surface);
  color: var(--pma-text);
  font: inherit;
  font-size: 12px;
  text-align: center;
}

.pma-field-error { display: block; margin-top: 5px; font-size: 11.5px; color: #dc2626; }
.pma-field-hint  { display: block; margin-top: 5px; font-size: 11.5px; color: var(--pma-text-3); }
.has-error { border-color: #dc2626 !important; }

.pma-rma-list { display: grid; gap: 12px; }

.pma-rma {
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
}
.pma-rma-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--pma-border-soft, var(--pma-border));
  flex-wrap: wrap;
}
.pma-rma-id { color: var(--pma-text-3); font-size: 12px; margin-inline-end: 6px; }
.pma-rma-order { color: var(--pma-text-3); font-size: 12px; margin-inline-start: 8px; }

.pma-rma-body { padding: 14px 16px; display: grid; gap: 12px; }
.pma-rma-items { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; }
.pma-rma-items span { color: var(--pma-text-3); margin-inline-start: 6px; }

.pma-rma-meta { display: flex; flex-wrap: wrap; gap: 18px; margin: 0; font-size: 12.5px; }
.pma-rma-meta dt { color: var(--pma-text-3); font-size: 11px; }
.pma-rma-meta dd { margin: 0; font-weight: 700; }

.pma-rma-note {
  margin: 0;
  padding: 9px 12px;
  background: var(--pma-brand-dim);
  border-inline-start: 2px solid var(--pma-brand);
  font-size: 12.5px;
}

.pma-rma-foot { padding: 12px 16px; border-top: 1px solid var(--pma-border-soft, var(--pma-border)); }

/* ── Reviews ─────────────────────────────────────────────────────────────── */

.pma-subhead { margin: 26px 0 12px; font-size: 14px; color: var(--pma-text); }

.pma-review-queue { display: grid; gap: 12px; }

.pma-review-card {
  padding: 16px;
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  display: grid;
  gap: 12px;
  transition: opacity .35s ease, transform .35s ease;
}
.pma-review-card.is-done { opacity: 0; transform: scale(.98); }

.pma-review-product { display: flex; align-items: center; gap: 12px; }
.pma-review-product img { width: 52px; height: 52px; object-fit: cover; flex-shrink: 0; }
.pma-review-product a { font-weight: 700; color: var(--pma-text); text-decoration: none; font-size: 13.5px; }
.pma-review-product span { display: block; font-size: 11.5px; color: var(--pma-text-3); }

/* Star input: rendered in reverse so `~` can light the earlier stars. */
.pma-rating { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.pma-rating input { position: absolute; opacity: 0; width: 0; height: 0; }
.pma-rating label { cursor: pointer; color: var(--pma-border); transition: color .15s ease, transform .15s ease; }
.pma-rating label svg { width: 26px; height: 26px; fill: currentColor; display: block; }
.pma-rating label:hover,
.pma-rating label:hover ~ label,
.pma-rating input:checked ~ label { color: #f59e0b; }
.pma-rating label:hover { transform: scale(1.12); }
.pma-rating input:focus-visible + label { outline: 2px solid var(--pma-brand); outline-offset: 2px; }

.pma-review-actions { display: flex; justify-content: flex-end; }

.pma-review-list { display: grid; gap: 10px; }
.pma-review-item { padding: 14px 16px; background: var(--pma-surface); border: 1px solid var(--pma-border); }
.pma-review-item header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.pma-review-item header a { color: var(--pma-text); text-decoration: none; font-weight: 700; font-size: 13.5px; }
.pma-review-item p { margin: 0 0 8px; font-size: 13px; color: var(--pma-text-2); line-height: 2; }
.pma-review-item footer { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--pma-text-3); }
.pma-review-stars { color: #f59e0b; letter-spacing: 2px; font-size: 14px; }

/* ── Preferences grid ────────────────────────────────────────────────────── */

.pma-prefs-table { width: 100%; border-collapse: collapse; }
.pma-prefs-table th,
.pma-prefs-table td { padding: 11px 10px; border-bottom: 1px solid var(--pma-border-soft, var(--pma-border)); text-align: center; }
.pma-prefs-table thead th { font-size: 11.5px; color: var(--pma-text-3); font-weight: 400; white-space: nowrap; }
.pma-prefs-table tbody th { text-align: start; }
.pma-prefs-table tbody th strong { display: block; font-size: 13.5px; color: var(--pma-text); }
.pma-prefs-table tbody th span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--pma-text-3); font-weight: 400; }
.pma-prefs-table tr.is-locked { opacity: .62; }
.pma-prefs .pma-btn-primary { margin-top: 18px; }

.pma-switch { display: inline-block; cursor: pointer; }
.pma-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.pma-switch-track {
  display: block;
  width: 38px;
  height: 21px;
  padding: 2px;
  background: var(--pma-border);
  border-radius: 11px;
  transition: background var(--pma-transition);
}
.pma-switch-thumb {
  display: block;
  width: 17px;
  height: 17px;
  background: var(--pma-surface);
  border-radius: 50%;
  box-shadow: var(--pma-shadow-xs);
  transition: transform var(--pma-transition);
}
.pma-switch input:checked + .pma-switch-track { background: var(--pma-brand); }
.pma-switch input:checked + .pma-switch-track .pma-switch-thumb { transform: translateX(-17px); }
.pma-ltr .pma-switch input:checked + .pma-switch-track .pma-switch-thumb { transform: translateX(17px); }
.pma-switch input:disabled + .pma-switch-track { opacity: .5; cursor: not-allowed; }
.pma-switch input:focus-visible + .pma-switch-track { outline: 2px solid var(--pma-brand); outline-offset: 2px; }

/* ── Support desk extras ─────────────────────────────────────────────────── */

.pma-sla-chip {
  display: inline-block;
  padding: 2px 9px;
  font-size: 11px;
  border: 1px solid currentColor;
  border-radius: 10px;
}
.pma-sla-chip.is-open      { color: var(--c-open, #2563eb); }
.pma-sla-chip.is-pending   { color: var(--c-pending, #d97706); }
.pma-sla-chip.is-completed { color: var(--c-completed, #16a34a); }
.pma-sla-chip.is-failed    { color: var(--c-failed, #dc2626); }

.pma-kb-suggest {
  margin: -4px 0 16px;
  padding: 12px 14px;
  background: var(--pma-brand-dim);
  border-inline-start: 2px solid var(--pma-brand);
}
.pma-kb-suggest-title { display: block; margin-bottom: 8px; font-size: 12.5px; color: var(--pma-text); }
.pma-kb-suggest-list { display: grid; gap: 6px; }

.pma-kb-item {
  display: block;
  padding: 8px 10px;
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  text-decoration: none;
  color: var(--pma-text);
}
.pma-kb-item:hover { border-color: var(--pma-brand); }
.pma-kb-item strong { display: block; font-size: 13px; }
.pma-kb-item span { display: block; font-size: 11.5px; color: var(--pma-text-3); }

.pma-kb-feedback {
  margin: 28px 0;
  padding: 16px 18px;
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  text-align: center;
}
.pma-kb-feedback strong { display: block; margin-bottom: 10px; font-size: 14px; color: var(--pma-text); }
.pma-kb-feedback-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pma-kb-feedback-count { display: block; margin-top: 10px; font-size: 11.5px; color: var(--pma-text-3); }

.pma-csat {
  margin: 18px 0;
  padding: 18px;
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  text-align: center;
}
.pma-csat strong { display: block; font-size: 14px; color: var(--pma-text); }
.pma-csat p { margin: 4px 0 12px; font-size: 12.5px; color: var(--pma-text-3); }
.pma-csat .pma-textarea { margin: 12px 0; }
.pma-csat.is-done { display: flex; align-items: center; justify-content: center; gap: 10px; }
.pma-rated { margin: 0; font-size: 13px; color: var(--pma-text-2); }

.pma-csat-comment { margin: 6px 0 0; font-size: 12.5px; color: var(--pma-text-2); }
.pma-canned { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }

/* ── Push opt-in ─────────────────────────────────────────────────────────── */

.pma-push-optin {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--pma-surface);
  border: 1px dashed var(--pma-border);
}
.pma-push-optin strong { display: block; font-size: 13.5px; color: var(--pma-text); }
.pma-push-optin p { margin: 3px 0 0; font-size: 12px; color: var(--pma-text-3); }

/* ── Callouts and notes ──────────────────────────────────────────────────── */

.pma-callout {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 15px 17px;
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  border-inline-start: 3px solid var(--pma-brand);
}
.pma-callout-icon { color: var(--pma-brand); flex-shrink: 0; }
.pma-callout-icon svg { width: 24px; height: 24px; }
.pma-callout-body { flex: 1; }
.pma-callout-body strong { display: block; font-size: 13.5px; color: var(--pma-text); }
.pma-callout-body p { margin: 2px 0 0; font-size: 12.5px; color: var(--pma-text-3); }

.pma-inline-note {
  margin-bottom: 14px;
  padding: 10px 13px;
  background: var(--pma-brand-dim);
  font-size: 12.5px;
  color: var(--pma-text-2);
}

.pma-section-actions { display: flex; gap: 8px; align-items: center; }

/* ── Profile completion card ─────────────────────────────────────────────── */

.pma-complete-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
}
.pma-complete-card strong { display: block; font-size: 13.5px; margin-bottom: 6px; color: var(--pma-text); }

.pma-complete-ring {
  position: relative;
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--pma-brand) calc(var(--pma-ring, 0) * 1%), var(--pma-border) 0);
}
.pma-complete-ring::after {
  content: '';
  position: absolute;
  inset: 6px;
  background: var(--pma-surface);
  border-radius: 50%;
}
.pma-complete-ring span { position: relative; z-index: 1; font-size: 13px; font-weight: 700; color: var(--pma-brand); }

.pma-complete-list { margin: 0; padding-inline-start: 18px; font-size: 12.5px; color: var(--pma-text-3); }
.pma-complete-list li { margin-bottom: 2px; }

/* ── Password strength ───────────────────────────────────────────────────── */

.pma-strength { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.pma-strength-bar { flex: 1; height: 3px; background: var(--pma-border); overflow: hidden; }
.pma-strength-bar i { display: block; height: 100%; width: 0; background: #dc2626; transition: width .3s ease, background .3s ease; }
.pma-strength-label { font-size: 11px; color: var(--pma-text-3); min-width: 44px; }
.pma-strength[data-score="2"] .pma-strength-bar i { background: #d97706; }
.pma-strength[data-score="3"] .pma-strength-bar i { background: #16a34a; }
.pma-strength[data-score="4"] .pma-strength-bar i { background: #15803d; }

/* ── Orders: pager and extra actions ─────────────────────────────────────── */

.pma-ord-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.pma-ord-pager-info { font-size: 12px; color: var(--pma-text-3); }

.pma-reorder { display: inline-flex; align-items: center; gap: 5px; }
.pma-reorder svg { width: 14px; height: 14px; }

/* ── Map picker ──────────────────────────────────────────────────────────── */

.pma-map-modal .pma-modal-panel { width: min(680px, 100%); }
.pma-map-hint { margin: 0; padding: 12px 18px 0; font-size: 12.5px; color: var(--pma-text-3); }

.pma-map {
  position: relative;
  height: min(58vh, 420px);
  margin: 12px 18px;
  overflow: hidden;
  background: var(--pma-muted);
  border: 1px solid var(--pma-border);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.pma-map.is-dragging { cursor: grabbing; }

.pma-map-layer { position: absolute; inset: 0; }
.pma-map-tile {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 256px;
  height: 256px;
  will-change: transform;
  pointer-events: none;
}
/* Tiles are positioned from the left edge in both directions. */
.pma-rtl .pma-map-tile { left: 0; right: auto; }

.pma-map-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%);
  color: var(--pma-brand);
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.35));
  z-index: 2;
}
.pma-map-pin svg { width: 36px; height: 36px; }

.pma-map-zoom {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  display: grid;
  gap: 4px;
  z-index: 3;
}
.pma-map-zoom button {
  width: 30px;
  height: 30px;
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  color: var(--pma-text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.pma-map-locate {
  position: absolute;
  bottom: 10px;
  inset-inline-end: 10px;
  padding: 6px 12px;
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  color: var(--pma-text);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  z-index: 3;
}

.pma-map-credit {
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  padding: 2px 7px;
  background: rgba(255,255,255,.78);
  color: #333;
  font-size: 10px;
  z-index: 3;
}

.pma-map-coords { margin-inline-end: auto; font-size: 12px; color: var(--pma-text-3); font-variant-numeric: tabular-nums; }

.pma-geo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pma-geo-value { font-size: 12px; color: var(--pma-text-3); font-variant-numeric: tabular-nums; }
.pma-geo.has-location [data-pma-geo-open] { border-color: var(--pma-brand); color: var(--pma-brand); }
.pma-geo [data-pma-geo-open] { display: inline-flex; align-items: center; gap: 6px; }
.pma-geo svg { width: 15px; height: 15px; }

/* ── Install banner ──────────────────────────────────────────────────────── */

.pma-install {
  position: fixed;
  inset-inline: 16px;
  bottom: 16px;
  z-index: 99990;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 460px;
  margin: 0 auto;
  padding: 13px 16px;
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  box-shadow: var(--pma-shadow-lg);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .25s ease, transform .25s cubic-bezier(.2,.7,.3,1);
}
.pma-install.is-in { opacity: 1; transform: none; }
.pma-install-text { flex: 1; }
.pma-install-text strong { display: block; font-size: 13.5px; color: var(--pma-text); }
.pma-install-text span { font-size: 11.5px; color: var(--pma-text-3); }
.pma-install-close {
  background: none;
  border: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--pma-text-3);
  cursor: pointer;
  padding: 0 4px;
}

@media (max-width: 900px) {
  .pma-install { bottom: 74px; }
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .pma-topbar-search-label,
  .pma-topbar-kbd { display: none; }

  .pma-topbar-search { padding: 8px 10px; }

  .pma-palette { padding: 8vh 10px 10px; }
  .pma-palette-results { max-height: 60vh; }

  .pma-prefs-table thead th { font-size: 10px; padding: 8px 4px; }
  .pma-prefs-table td { padding: 10px 4px; }
  .pma-prefs-table tbody th span { display: none; }

  .pma-complete-card { flex-direction: column; text-align: center; }
  .pma-rma-meta { gap: 12px; }
  .pma-push-optin { flex-direction: column; align-items: stretch; text-align: center; }
}

.pma-mobile-nav .pma-badge {
  position: absolute;
  top: 3px;
  inset-inline-end: 22%;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  font-size: 9.5px;
  background: var(--pma-brand);
  color: var(--pma-on-brand, #fff);
  border-radius: 8px;
}
.pma-mobile-nav .pma-mob-item { position: relative; }

/* ── Navigation feedback ─────────────────────────────────────────────────── */
/* Two layers, deliberately: a hairline at the top of the window that says the
   panel heard the click, and — only if the answer is slow enough to notice — a
   veil over the section being replaced. Both are suppressed for fast responses
   by the delay in pma-premium.js, so quick navigation stays perfectly still. */

.pma-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: 2px;
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.pma-progress.is-active { opacity: 1; }
.pma-progress.is-done   { opacity: 0; transition: opacity .3s ease .08s; }

.pma-progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--pma-brand-light, #f3e8f8), var(--pma-brand) 45%, var(--pma-brand-dark, #5e1070));
  box-shadow: 0 0 12px var(--pma-brand-ring, rgba(124,22,149,.5));
  transition: width .2s cubic-bezier(.25,.8,.35,1);
}

.pma-section { position: relative; }
.pma-section.is-loading { min-height: 260px; }

.pma-loading {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 20px;
  background: var(--pma-veil, rgba(255,255,255,.72));
  -webkit-backdrop-filter: blur(3px) saturate(1.05);
  backdrop-filter: blur(3px) saturate(1.05);
  opacity: 0;
  transition: opacity .2s ease;
}
.pma-loading.is-in { opacity: 1; }

/* The section can be taller than the window; keep the spinner where the eye is. */
.pma-loading-ring,
.pma-loading-text {
  position: sticky;
  inset-block-start: 40vh;
}

.pma-loading-ring {
  position: relative;
  display: block;
  width: 46px;
  height: 46px;
}
.pma-loading-ring i {
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-top-color: var(--pma-brand);
  border-radius: 50%;
  animation: pma-ring 1.05s linear infinite;
}
.pma-loading-ring i:nth-child(2) {
  inset: 7px;
  opacity: .55;
  animation-duration: 1.6s;
  animation-direction: reverse;
}
.pma-loading-ring i:nth-child(3) {
  inset: 14px;
  border-top-color: var(--pma-text-3);
  opacity: .5;
  animation-duration: .8s;
}

@keyframes pma-ring {
  to { transform: rotate(360deg); }
}

.pma-loading-text {
  font-size: 12.5px;
  color: var(--pma-text-3);
  letter-spacing: .01em;
}

.pma-load-error svg {
  width: 42px;
  height: 42px;
  color: var(--c-failed, #dc2626);
  opacity: .8;
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .pma-sk { animation: none; }
  .pma-reveal { opacity: 1; transform: none; transition: none; }
  .pma-topbar-bell.is-ringing svg { animation: none; }
  .pma-palette-panel,
  .pma-modal-panel { transition: none; }
  .pma-progress > span { transition: none; }
  .pma-loading { transition: none; }
  /* One slow, honest rotation beats three racing rings. */
  .pma-loading-ring i { animation-duration: 2.4s; }
  .pma-loading-ring i:nth-child(2),
  .pma-loading-ring i:nth-child(3) { animation: none; opacity: .3; }
}

.pma-no-anim .pma-sk { animation: none; }
.pma-no-anim .pma-reveal { opacity: 1; transform: none; }
