/* SWITZ - Update Profile Picture modal.
   Inherits the dashboard's tokens (--a-gold, --a-ink, ...) because the modal is
   mounted inside .switz-acct. Every rule is scoped to .sz-pp so nothing here can
   reach the existing dashboard. */

.sz-pp-lock { overflow: hidden !important; }
.sz-pp [hidden] { display: none !important; } .sz-pp *, .sz-pp *::before, .sz-pp *::after { box-sizing: border-box; } .sz-pp img { max-width: 100%; } .sz-pp h2, .sz-pp h3, .sz-pp p, .sz-pp button, .sz-pp input { font-family: Inter, -apple-system, "Segoe UI", Roboto, sans-serif; text-transform: none; } .sz-pp p { font-weight: 400; }

.sz-pp {
  position: fixed; inset: 0; z-index: 2147483000;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
  font-family: Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--a-ink, #1d1d1f);
}
.sz-pp[data-open] { display: flex; }
.sz-pp__bg {
  position: absolute; inset: 0;
  background: rgba(17, 17, 17, .55);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  animation: sz-pp-fade .16s ease;
}
.sz-pp__box {
  position: relative; width: 100%; max-width: 1240px; max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: #fff; border-radius: var(--a-radius, 22px);
  box-shadow: 0 24px 64px rgba(16, 24, 40, .28);
  animation: sz-pp-rise .18s ease;
  overflow: hidden;
}
@keyframes sz-pp-fade { from { opacity: 0; } }
@keyframes sz-pp-rise { from { opacity: 0; transform: translateY(8px) scale(.99); } }

.sz-pp__head { position: relative; padding: 30px 84px 18px 32px; }
.sz-pp__title { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; color: var(--a-ink, #1d1d1f); }
.sz-pp__sub { margin: 8px 0 0; font-size: 16px; line-height: 1.5; color: var(--a-muted-deep, #6b7280); }
.sz-pp__x {
  position: absolute; top: 22px; right: 22px;
  width: 44px; height: 44px; border: 0; border-radius: 999px; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--a-ink, #1d1d1f);
}
.sz-pp__x:hover { background: var(--a-hover, #f4f5f7); }
.sz-pp__x svg { width: 24px; height: 24px; }

.sz-pp__body {
  display: grid; grid-template-columns: minmax(0, 390px) minmax(0, 1fr) minmax(0, 280px);
  gap: 26px; padding: 0 32px 26px; overflow: auto; min-height: 0;
}

/* left column */
.sz-pp__left { border-top: 1px solid var(--a-line-mid, rgba(0,0,0,.09)); padding-top: 8px; min-width: 0; }
.sz-pp__opt {
  width: 100%; display: flex; align-items: center; gap: 18px;
  padding: 14px 20px; margin: 0; border: 0; border-radius: 12px;
  background: transparent; font: inherit; font-size: 17px; font-weight: 500; color: inherit;
  text-align: left;
}
.sz-pp__opt svg { width: 28px; height: 28px; flex: none; }
.sz-pp__opt--upload { background: var(--a-gold-pale, #fdf3d4); cursor: pointer; margin-top: 2px; }
.sz-pp__opt--upload svg { color: var(--a-gold-deep, #e8b933); }
.sz-pp__opt--upload:hover { background: #fbecc0; }
.sz-pp__opt--hist { margin-top: 10px; cursor: default; }

.sz-pp__grid {
  list-style: none; margin: 10px 0 0; padding: 4px 12px 4px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
}
.sz-pp__thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0;
  border: 2px solid transparent; border-radius: 12px; overflow: hidden;
  background: var(--a-fill, #f4f5f7); cursor: pointer;
  transition: border-color var(--a-ease, 150ms ease), transform var(--a-ease, 150ms ease);
}
.sz-pp__thumb:hover { transform: translateY(-1px); }
.sz-pp__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sz-pp__thumb[aria-pressed="true"] { border: 3px solid var(--a-gold, #f5c84c); box-shadow: 0 0 0 1px var(--a-gold-deep, #e8b933); }
.sz-pp__tick {
  position: absolute; right: 6px; bottom: 6px; width: 22px; height: 22px; border-radius: 999px;
  background: var(--a-gold, #f5c84c); color: var(--a-ink, #1d1d1f);
  display: none; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.sz-pp__tick svg { width: 14px; height: 14px; }
.sz-pp__thumb[aria-pressed="true"] .sz-pp__tick { display: grid; }
.sz-pp__badge {
  position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 999px;
  background: rgba(17,17,17,.78); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.sz-pp__empty { margin: 14px 20px 0; font-size: 14px; color: var(--a-muted-deep, #6b7280); }
.sz-pp__more {
  display: block; margin: 14px auto 0; padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--a-line-mid, rgba(0,0,0,.09)); background: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.sz-pp__more:hover { background: var(--a-hover, #f4f5f7); }

/* centre column */
.sz-pp__centre {
  min-width: 0; background: var(--a-page, #f6f7f9); border-radius: 16px;
  padding: 20px 26px 24px; display: flex; flex-direction: column; align-items: center; gap: 22px;
}
.sz-pp__stage {
  position: relative; width: 100%; max-width: 470px; aspect-ratio: 1;
  border-radius: 10px; overflow: hidden; background: #8a8a8a;
  touch-action: none; cursor: grab; outline: none; user-select: none; -webkit-user-select: none;
}
.sz-pp__stage[data-dragging] { cursor: grabbing; }
.sz-pp__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sz-pp__stage-msg {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px;
  color: #fff; font-size: 15px; font-weight: 500; background: #9a9ca2;
}
.sz-pp__zoom {
  width: 100%; max-width: 470px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px;
}
.sz-pp__zbar {
  flex: 1 1 230px; display: flex; align-items: center; gap: 12px; min-width: 0;
  background: #fff; border-radius: 999px; padding: 6px 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.sz-pp__zbtn {
  width: 40px; height: 40px; flex: none; border: 0; border-radius: 999px; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--a-ink, #1d1d1f);
}
.sz-pp__zbtn:hover { background: var(--a-hover, #f4f5f7); }
.sz-pp__zbtn svg { width: 26px; height: 26px; }
.sz-pp__range {
  -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 28px; margin: 0;
  background: transparent; cursor: pointer;
  --fill: 30%;
}
.sz-pp__range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(to right, var(--a-gold, #f5c84c) 0 var(--fill), #d5d7dc var(--fill) 100%);
}
.sz-pp__range::-moz-range-track { height: 6px; border-radius: 999px; background: #d5d7dc; }
.sz-pp__range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--a-gold, #f5c84c); }
.sz-pp__range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 999px;
  background: #fff; border: 1px solid rgba(0,0,0,.08); box-shadow: 0 2px 6px rgba(0,0,0,.22);
}
.sz-pp__range::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 999px; background: #fff;
  border: 1px solid rgba(0,0,0,.08); box-shadow: 0 2px 6px rgba(0,0,0,.22);
}
.sz-pp__fit {
  flex: none; display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px;
  border: 0; border-radius: 12px; background: #fff; font: inherit; font-size: 16px; font-weight: 500;
  cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.04); color: var(--a-ink, #1d1d1f);
}
.sz-pp__fit:hover { background: var(--a-hover, #f4f5f7); }
.sz-pp__fit svg { width: 22px; height: 22px; }

/* right column */
.sz-pp__right { min-width: 0; }
.sz-pp__prev {
  border: 1px solid var(--a-line-mid, rgba(0,0,0,.09)); border-radius: 14px; padding: 22px 20px 28px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.sz-pp__prev h3 { margin: 0; font-size: 17px; font-weight: 600; }
.sz-pp__prev p { margin: 8px 0 22px; font-size: 14px; line-height: 1.5; color: var(--a-muted-deep, #6b7280); }
.sz-pp__pcirc {
  display: block; width: 100%; max-width: 220px; aspect-ratio: 1; margin: 0 auto;
  border-radius: 999px; overflow: hidden; background: var(--a-fill, #f4f5f7);
}
.sz-pp__pcirc canvas { width: 100%; height: 100%; display: block; }

/* footer */
.sz-pp__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 32px 22px; border-top: 1px solid var(--a-line-mid, rgba(0,0,0,.09));
}
.sz-pp__btn {
  height: 52px; padding: 0 28px; border-radius: 12px; font: inherit; font-size: 17px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; transition: background var(--a-ease, 150ms ease);
}
.sz-pp__btn--ghost { background: var(--a-fill, #f4f5f7); color: var(--a-ink, #1d1d1f); }
.sz-pp__btn--ghost:hover { background: #eceef1; }
.sz-pp__btn--gold { background: var(--a-gold, #f5c84c); color: var(--a-ink, #1d1d1f); min-width: 240px; }
.sz-pp__btn--gold:hover { background: var(--a-gold-deep, #e8b933); }
.sz-pp__btn[disabled] { opacity: .6; cursor: not-allowed; }
.sz-pp__err { flex: 1; margin: 0; font-size: 14px; color: var(--a-red, #ef4444); text-align: center; }
.sz-pp__err:empty { display: none; }

/* discard-changes confirmation */
.sz-pp__confirm {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(255,255,255,.82); z-index: 2; padding: 20px;
}
.sz-pp__confirm[data-open] { display: flex; }
.sz-pp__confirm-box {
  max-width: 380px; background: #fff; border-radius: 16px; padding: 24px;
  box-shadow: 0 12px 40px rgba(16,24,40,.2); text-align: center;
}
.sz-pp__confirm-box h3 { margin: 0 0 6px; font-size: 18px; }
.sz-pp__confirm-box p { margin: 0 0 18px; font-size: 14px; color: var(--a-muted-deep, #6b7280); }
.sz-pp__confirm-box .sz-pp__btn { height: 44px; padding: 0 18px; font-size: 15px; margin: 0 4px; }

/* toast */
.sz-pp-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 2147483001; transform: translateX(-50%);
  background: var(--a-ink, #1d1d1f); color: #fff; padding: 12px 18px; border-radius: 999px;
  font: 500 14px/1.3 Inter, -apple-system, sans-serif; box-shadow: 0 10px 28px rgba(16,24,40,.25);
  display: flex; align-items: center; gap: 10px; animation: sz-pp-rise .18s ease;
}
.sz-pp-toast svg { width: 18px; height: 18px; color: var(--a-gold, #f5c84c); }

/* focus + small helpers */
.sz-pp :focus-visible,
.switz-avatar__img[data-pp-open]:focus-visible {
  outline: 3px solid var(--a-gold-deep, #e8b933); outline-offset: 2px;
}
.sz-pp__stage:focus-visible { outline-offset: -3px; }
.sz-pp__vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.switz-avatar__img[data-pp-open] { cursor: pointer; }
.switz-avatar__cam[data-avatar-btn] { cursor: pointer; transition: transform var(--a-ease, 150ms ease), box-shadow var(--a-ease, 150ms ease); }
.switz-avatar__cam[data-avatar-btn]:hover { transform: scale(1.08); box-shadow: 0 4px 12px rgba(0,0,0,.18); }

/* tablet */
@media (max-width: 1100px) {
  .sz-pp__body { grid-template-columns: minmax(0, 250px) minmax(0, 1fr) minmax(0, 210px); gap: 18px; padding: 0 24px 22px; }
  .sz-pp__head { padding: 26px 76px 16px 24px; }
  .sz-pp__foot { padding: 16px 24px 20px; }
  .sz-pp__grid { gap: 10px; padding: 4px 4px; }
  .sz-pp__opt { padding: 12px 14px; font-size: 16px; gap: 12px; }
  .sz-pp__centre { padding: 16px; }
  .sz-pp__btn--gold { min-width: 0; }
}

/* mobile: stack previous images, cropper, preview, buttons */
@media (max-width: 760px) {
  .sz-pp { padding: 10px; }
  .sz-pp__box { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); border-radius: 18px; }
  .sz-pp__head { padding: 20px 64px 12px 18px; }
  .sz-pp__title { font-size: 21px; }
  .sz-pp__sub { font-size: 14px; }
  .sz-pp__x { top: 12px; right: 12px; }
  .sz-pp__body { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 0 16px 16px; }
  .sz-pp__left { border-top: 0; padding-top: 0; }
  .sz-pp__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .sz-pp__opt { padding: 12px; font-size: 15px; }
  .sz-pp__opt--hist { margin-top: 2px; }
  .sz-pp__grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 92px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; }
  .sz-pp__thumb { scroll-snap-align: start; }
  .sz-pp__more { margin: 0; align-self: center; white-space: nowrap; }
  .sz-pp__centre { padding: 12px; gap: 14px; }
  .sz-pp__stage { max-width: min(100%, 52vh); }
  .sz-pp__zoom { gap: 8px; }
  .sz-pp__zbtn { width: 34px; height: 34px; }
  .sz-pp__fit { height: 46px; padding: 0 12px; font-size: 15px; }
  .sz-pp__prev { display: flex; align-items: center; gap: 14px; padding: 16px; }
  .sz-pp__prev > div { flex: 1; }
  .sz-pp__prev p { margin-bottom: 0; }
  .sz-pp__pcirc { width: 108px; flex: none; margin: 0; }
  .sz-pp__foot { padding: 12px 16px 16px; flex-wrap: wrap; }
  .sz-pp__err { order: -1; flex-basis: 100%; }
  .sz-pp__btn { flex: 1; height: 50px; padding: 0 12px; font-size: 16px; }
  .sz-pp__btn--gold { flex: 1.6; }
}

@media (prefers-reduced-motion: reduce) {
  .sz-pp__bg, .sz-pp__box, .sz-pp-toast { animation: none; }
}
