/* ==========================================================================
   Module: profile (Profil & Pengaturan) + onboarding overlay
   Every selector is scoped to .m-profile (the #view while the route renders, the module's
   sheets via their class option, and the onboarding .overlay-screen). Tokens only.
   ========================================================================== */

/* ---------- Profile card ---------- */
.m-profile .pf-card { overflow: hidden; padding: var(--space-5); }
.m-profile .pf-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 120px; pointer-events: none;
  background: radial-gradient(110% 120px at 0% 0%, var(--accent-soft), transparent 72%);
}
.m-profile .pf-card-grid { position: relative; display: grid; gap: var(--space-5); }
.m-profile .pf-id { display: flex; align-items: flex-start; gap: var(--space-4); min-width: 0; }
.m-profile .pf-avatar { position: relative; flex: none; }
.m-profile .pf-avatar .avatar { box-shadow: 0 0 0 3px var(--surface-solid), 0 0 0 5px var(--accent-glow), 0 16px 32px -14px var(--accent-glow); }
.m-profile .pf-avatar-lv {
  position: absolute; right: -4px; bottom: -2px; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 3px solid var(--surface-solid);
}
.m-profile .pf-id-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.m-profile .pf-name { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.m-profile .pf-nick { font-size: var(--fs-sm); color: var(--muted); }
.m-profile .pf-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-width: 0; }
.m-profile .pf-meta-item, .m-profile .pf-join {
  display: inline-flex; align-items: flex-start; gap: 6px; min-width: 0;
  font-size: var(--fs-sm); color: var(--muted); font-weight: 600; line-height: 1.4;
}
.m-profile .pf-meta-item .ico, .m-profile .pf-join .ico { color: var(--accent-ink); margin-top: 2px; }
.m-profile .pf-edit-btn { margin-top: 6px; }

.m-profile .pf-card-side { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.m-profile .pf-level {
  padding: var(--space-4); border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), transparent 75%), var(--surface-2);
  border: 1px solid var(--stroke);
}
.m-profile .pf-level-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; min-width: 0; }
.m-profile .pf-level-kicker { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); }
.m-profile .pf-level-name { font-size: var(--fs-md); font-weight: 800; letter-spacing: -.01em; line-height: 1.25; }
.m-profile .pf-level-xp { flex: none; font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.02em; }
.m-profile .pf-level-xp span { font-size: var(--fs-xs); color: var(--muted); font-weight: 750; }
.m-profile .pf-level-next { margin-top: 8px; font-size: var(--fs-sm); color: var(--muted); }
.m-profile .pf-level-next strong { color: var(--accent-ink); }

.m-profile .pf-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.m-profile .pf-stat {
  min-width: 0; display: flex; flex-direction: column; align-items: flex-start;
  padding: 12px 10px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--stroke);
}
.m-profile .pf-stat .tile { width: 28px; height: 28px; border-radius: 9px; margin-bottom: 10px; }
.m-profile .pf-stat-value { max-width: 100%; font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-profile .pf-stat-value small { font-size: var(--fs-xs); font-weight: 750; color: var(--muted); letter-spacing: 0; }
.m-profile .pf-stat-label { max-width: 100%; margin-top: 4px; font-size: var(--fs-xs); font-weight: 750; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-profile .pf-stat-sub { margin-top: 1px; font-size: 11px; line-height: 1.3; color: var(--dim); font-weight: 600; }
.m-profile .pf-card > .callout { position: relative; margin-top: var(--space-4); }

@media (min-width: 720px) {
  .m-profile .pf-card { padding: var(--space-6); }
  .m-profile .pf-card-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); align-items: center; }
  .m-profile .pf-card-side { padding-left: var(--space-6); border-left: 1px solid var(--stroke); }
  .m-profile .pf-stat { padding: 12px; }
}

/* ---------- Tabs (sticky, glass) ---------- */
.m-profile .pf-tabs-wrap { position: sticky; top: calc(var(--topbar-h) + var(--safe-top) + 6px); z-index: 5; }
.m-profile .pf-tabs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--glass); box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
}
.m-profile .pf-tabs .tab { min-width: 0; padding: 0 10px; }
.m-profile .pf-tabs .tab > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 519.98px) {
  .m-profile .pf-tabs .tab { flex-direction: column; gap: 3px; min-height: 54px; padding: 6px 2px; font-size: 11.5px; letter-spacing: 0; }
  .m-profile .pf-tabs .tab > span { max-width: 100%; }
}

/* ---------- Tab panel ---------- */
.m-profile .pf-panel { min-width: 0; }
.m-profile .pf-panel.is-in > * { animation: pfFadeUp var(--dur-slow) var(--ease-out) both; }
@keyframes pfFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Pencapaian ---------- */
.m-profile .pf-ach { display: flex; flex-direction: column; gap: var(--space-6); }
.m-profile .pf-ach-grid { display: grid; gap: var(--space-4); }
.m-profile .pf-ach-col { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
@media (min-width: 720px) {
  .m-profile .pf-ach-grid { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); align-items: start; }
}

.m-profile .section-body > .pf-bgroup { margin-top: var(--space-5); }
.m-profile .pf-bgroup-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; padding: 0 2px; }
.m-profile .pf-bgroup-title { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.m-profile .pf-bgroup-count { flex: none; padding: 2px 9px; border-radius: var(--radius-pill); background: var(--surface-3); color: var(--dim); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.m-profile .pf-bgroup-count.is-full { background: var(--green-soft); color: var(--green-ink); }
.m-profile .pf-badges { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr)); }
@media (min-width: 1024px) { .m-profile .pf-badges { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); } }
.m-profile .pf-badge {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  min-width: 0; min-height: 100%; padding: 14px; border-radius: var(--radius);
  color: var(--text); text-align: left;
  background: var(--surface); border: 1px solid var(--stroke); box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.m-profile .pf-badge:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--stroke-strong); }
.m-profile .pf-badge:active { transform: scale(.98); }
.m-profile .pf-badge.is-unlocked {
  border-color: var(--accent-glow);
  background: radial-gradient(120% 90% at 0% 0%, var(--accent-soft), transparent 62%), var(--surface);
}
.m-profile .pf-badge.is-unlocked::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background: linear-gradient(110deg, transparent 32%, var(--shimmer) 50%, transparent 68%);
  transform: translateX(-120%); transition: transform .9s var(--ease-out);
}
.m-profile .pf-badge.is-unlocked:hover::after { transform: translateX(120%); }
.m-profile .pf-badge-art { position: relative; }
.m-profile .pf-badge.is-locked .tile { background: var(--surface-3); color: var(--dim); }
.m-profile .pf-badge-lock, .m-profile .pf-bdetail-lock {
  position: absolute; right: -5px; bottom: -5px; display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-solid); color: var(--muted); border: 1px solid var(--stroke-strong);
}
.m-profile .pf-badge-title { font-size: var(--fs-sm); font-weight: 750; line-height: 1.3; }
.m-profile .pf-badge.is-locked .pf-badge-title { color: var(--muted); }
.m-profile .pf-badge-sub {
  font-size: var(--fs-xs); color: var(--dim); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.m-profile .pf-badge.is-unlocked .pf-badge-sub { color: var(--accent-ink); font-weight: 700; }

/* badge detail sheet */
.m-profile .pf-bdetail { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 10px 0 4px; text-align: center; }
.m-profile .pf-bdetail-medal { position: relative; margin: 10px 0 6px; }
.m-profile .pf-bdetail-medal::before { content: ""; position: absolute; inset: -26px; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 70%); }
.m-profile .pf-bdetail .tile-xl { position: relative; width: 88px; height: 88px; border-radius: 28px; }
.m-profile .pf-bdetail.is-unlocked .tile-xl { animation: pfMedal .65s var(--ease-spring) both; }
.m-profile .pf-bdetail.is-locked .tile-xl { background: var(--surface-3); color: var(--dim); }
.m-profile .pf-bdetail-lock { width: 28px; height: 28px; right: -6px; bottom: -6px; }
.m-profile .pf-bdetail-desc { max-width: 36ch; color: var(--text); }
.m-profile .pf-bdetail-hint { font-size: var(--fs-sm); color: var(--muted); }
@keyframes pfMedal { from { transform: scale(.4) rotate(-18deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* level roadmap */
.m-profile .pf-roadmap { display: flex; flex-direction: column; }
.m-profile .pf-lv { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.m-profile .pf-lv:last-child { padding-bottom: 0; }
.m-profile .pf-lv::before { content: ""; position: absolute; left: 17px; top: 38px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--stroke); }
.m-profile .pf-lv:last-child::before { display: none; }
.m-profile .pf-lv.is-done::before { background: linear-gradient(var(--accent), var(--accent-2)); }
.m-profile .pf-lv-node {
  position: relative; z-index: 1; flex: none; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--surface-3); color: var(--dim); border: 1px solid var(--stroke);
}
.m-profile .pf-lv.is-done .pf-lv-node { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.m-profile .pf-lv.is-current .pf-lv-node {
  color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent;
  box-shadow: 0 0 0 4px var(--accent-soft), 0 10px 22px -10px var(--accent-glow);
  animation: pfPulse 2.6s ease-in-out infinite;
}
.m-profile .pf-lv-main { flex: 1; min-width: 0; padding-top: 6px; }
.m-profile .pf-lv-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 750; line-height: 1.3; }
.m-profile .pf-lv.is-locked .pf-lv-name { color: var(--muted); font-weight: 650; }
.m-profile .pf-lv-sub { margin-top: 2px; font-size: var(--fs-xs); color: var(--dim); font-weight: 650; }
.m-profile .pf-lv .progress { margin-top: 10px; }
@keyframes pfPulse { 0%, 100% { box-shadow: 0 0 0 4px var(--accent-soft), 0 10px 22px -10px var(--accent-glow); } 50% { box-shadow: 0 0 0 8px var(--accent-soft), 0 10px 22px -10px var(--accent-glow); } }

/* activity */
.m-profile .pf-heat-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.m-profile .pf-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent-ink); font-size: var(--fs-xs); font-weight: 750; line-height: 1.3;
}
.m-profile .pf-xp-chip { font-size: var(--fs-sm); font-weight: 800; color: var(--amber-ink); white-space: nowrap; }
.m-profile .pf-recent-card .list-plain > .li { min-height: 56px; }

/* ---------- Target ---------- */
.m-profile .pf-target { display: flex; flex-direction: column; gap: var(--space-4); }
.m-profile .pf-tform { display: flex; flex-direction: column; gap: var(--space-4); }
.m-profile .pf-tgrid { display: grid; gap: var(--space-4); }
@media (min-width: 720px) { .m-profile .pf-tgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.m-profile .pf-tgroup { min-width: 0; padding: var(--space-4); border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--stroke); }
.m-profile .pf-tgroup.is-flash { animation: pfFlash .9s var(--ease-out); }
@keyframes pfFlash { 0% { box-shadow: 0 0 0 0 var(--accent-glow); } 35% { box-shadow: 0 0 0 6px var(--accent-soft); } 100% { box-shadow: 0 0 0 0 transparent; } }
/* stepper fields on one row: label left, stepper right; hint / error below */
.m-profile .pf-steprow { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 12px; row-gap: 6px; }
.m-profile .pf-steprow > .field-label { flex: 1 1 80px; min-width: 0; line-height: 1.35; }
.m-profile .pf-steprow > .stepper { align-self: center; flex: none; }
.m-profile .pf-steprow > .field-hint, .m-profile .pf-steprow > .field-error { flex-basis: 100%; }
.m-profile .pf-ghead { display: flex; align-items: center; gap: 10px; margin-bottom: var(--space-4); }
.m-profile .pf-ghead-title { font-weight: 800; line-height: 1.25; }
.m-profile .pf-ghead-sub { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.m-profile .pf-auto { display: flex; flex-direction: column; gap: 8px; margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px dashed var(--stroke-strong); }
.m-profile .pf-workdays { display: inline-flex; align-items: flex-start; gap: 6px; font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; }
.m-profile .pf-workdays .ico { flex: none; margin-top: 2px; color: var(--accent-ink); }
.m-profile .pf-auto-hint { font-size: var(--fs-xs); color: var(--dim); }
.m-profile .pf-auto-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.m-profile .pf-auto-note { font-size: var(--fs-xs); font-weight: 750; color: var(--accent-ink); }
.m-profile .pf-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: var(--space-5); }
@media (max-width: 719.98px) { .m-profile .pf-form-actions > .btn { flex: 1 1 100%; } }

/* ---------- Pengaturan ---------- */
.m-profile .pf-settings, .m-profile .pf-data { display: flex; flex-direction: column; gap: var(--space-4); }
.m-profile .pf-two { display: grid; gap: var(--space-4); }
@media (min-width: 1024px) { .m-profile .pf-two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.m-profile .pf-theme .seg { min-width: 0; padding: 0 8px; gap: 5px; }
.m-profile .pf-toggles { display: flex; flex-direction: column; gap: 4px; margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--stroke); }
.m-profile .pf-toggles .toggle { min-height: 56px; }
.m-profile .pf-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.m-profile .pf-days .chip { justify-content: center; min-width: 0; min-height: 44px; padding: 0 2px; font-weight: 750; }
.m-profile .pf-days .chip .chip-check { display: none; }
.m-profile .pf-days .chip.active {
  color: var(--on-accent); border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 14px -8px var(--accent-glow);
}
.m-profile .pf-days-hint { display: flex; align-items: flex-start; gap: 8px; margin-top: var(--space-4); font-size: var(--fs-sm); color: var(--muted); }
.m-profile .pf-days-hint .ico { flex: none; margin-top: 2px; color: var(--accent-ink); }
.m-profile .pf-saved { font-size: var(--fs-xs); font-weight: 800; color: var(--green-ink); opacity: 0; transform: translateY(4px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.m-profile .pf-saved.is-on { opacity: 1; transform: none; }

.m-profile .pf-install-grid { display: grid; gap: var(--space-3); }
@media (min-width: 720px) { .m-profile .pf-install-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.m-profile .pf-install-os { min-width: 0; padding: var(--space-4); border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--stroke); }
.m-profile .pf-install-os-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.m-profile .pf-steps { display: flex; flex-direction: column; gap: 10px; }
.m-profile .pf-steps li { display: flex; align-items: flex-start; gap: 10px; font-size: var(--fs-sm); color: var(--muted); line-height: 1.45; }
.m-profile .pf-step-n {
  flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 800;
}

/* ---------- Data ---------- */
.m-profile .pf-bstatus { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--stroke); }
.m-profile .pf-bstatus-title { font-weight: 750; line-height: 1.3; }
.m-profile .pf-bstatus-sub { font-size: var(--fs-sm); color: var(--muted); }
.m-profile .pf-remind {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); font-size: var(--fs-sm); color: var(--muted); line-height: 1.45;
}
.m-profile .pf-remind .ico { flex: none; margin-top: 2px; color: var(--blue-ink); }
.m-profile .pf-remind.is-warn { background: var(--amber-soft); }
.m-profile .pf-remind.is-warn .ico { color: var(--amber-ink); }
.m-profile .pf-data-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--space-4); }
.m-profile .pf-data-actions .btn { flex: 1 1 200px; }
.m-profile .pf-usage { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: var(--fs-xs); color: var(--dim); }
.m-profile .pf-danger { border-color: var(--accent-glow); background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface); }
@media (max-width: 719.98px) { .m-profile .pf-danger .btn { width: 100%; } }

.m-profile .pf-about-head { display: flex; align-items: center; gap: 14px; }
.m-profile .pf-about-mark { width: 52px; height: 52px; border-radius: 16px; flex: none; }
.m-profile .pf-about-name { font-size: var(--fs-md); font-weight: 800; }
.m-profile .pf-about-ver { font-size: var(--fs-sm); color: var(--muted); }
.m-profile .pf-about-tag { margin-top: var(--space-4); font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.02em; }
.m-profile .pf-quote { margin: var(--space-3) 0 0; padding: 12px 16px; border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; background: var(--surface-2); }
.m-profile .pf-quote blockquote { font-weight: 650; line-height: 1.5; }
.m-profile .pf-quote figcaption { margin-top: 6px; font-size: var(--fs-xs); color: var(--dim); font-weight: 700; }
.m-profile .pf-credits { display: flex; flex-direction: column; gap: 8px; margin-top: var(--space-4); font-size: var(--fs-sm); color: var(--muted); }
.m-profile .pf-credits li { display: flex; align-items: flex-start; gap: 8px; }
.m-profile .pf-credits .ico { flex: none; margin-top: 3px; color: var(--accent-ink); }

/* restore sheet */
.m-profile .pf-rlist { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--stroke); }
.m-profile .pf-rrow { display: flex; align-items: center; gap: 12px; min-width: 0; }
.m-profile .pf-rrow-label { font-size: var(--fs-xs); color: var(--dim); font-weight: 700; }
.m-profile .pf-rrow-value { font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.m-profile .pf-rslices { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Edit profile sheet & shared controls ---------- */
.m-profile .pf-edit-preview {
  display: flex; align-items: center; gap: 14px; margin-bottom: var(--space-4); padding: 14px;
  border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--stroke);
}
.m-profile .pf-edit-name { font-size: var(--fs-md); font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.m-profile .pf-edit-sub { font-size: var(--fs-sm); color: var(--muted); }
.m-profile .pf-date-quick { display: flex; flex-wrap: wrap; gap: 8px; }

/* 4 x 2 on phones (a 6 + 2 wrap looks accidental), one row of 8 from 460px (8 x 40 + gaps = 390px fits sheets and the overlay) */
.m-profile .pf-swatches { display: flex; flex-wrap: wrap; gap: 12px 14px; max-width: 212px; }
@media (min-width: 460px) { .m-profile .pf-swatches { max-width: none; gap: 10px; } }
.m-profile .pf-swatch {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 2px var(--surface-solid);
  transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
}
.m-profile .pf-swatch::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; }
.m-profile .pf-swatch:hover { transform: scale(1.08); }
.m-profile .pf-swatch:active { transform: scale(.94); }
.m-profile .pf-swatch.active { color: var(--on-accent); transform: scale(1.06); box-shadow: 0 0 0 3px var(--surface-solid), 0 0 0 5px var(--accent); }
.m-profile.pf-onb .pf-swatch { box-shadow: 0 0 0 2px var(--bg); }
.m-profile.pf-onb .pf-swatch.active { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }

/* ==========================================================================
   Onboarding overlay (.overlay-screen.m-profile.pf-onb)
   ========================================================================== */
.m-profile.pf-onb { padding: 0; overflow-x: hidden; isolation: isolate; animation: pfOnbIn .5s var(--ease-out) both; }
.m-profile.pf-onb.is-leaving { pointer-events: none; animation: pfOnbOut .38s var(--ease) both; }
@keyframes pfOnbIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pfOnbOut { to { opacity: 0; transform: scale(1.02); } }

.m-profile .pf-onb-aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.m-profile .pf-onb-aurora i {
  position: absolute; width: 80vmax; height: 80vmax; border-radius: 50%;
  background: radial-gradient(circle at center, currentColor 0%, transparent 62%);
  opacity: calc(var(--aurora-opacity) * 1.4);
  transition: color 1.2s ease;
  animation: pfDrift 26s ease-in-out infinite alternate;
}
.m-profile .pf-onb-aurora i:nth-child(1) { color: var(--accent); left: -32vmax; top: -36vmax; }
.m-profile .pf-onb-aurora i:nth-child(2) { color: var(--accent-2); right: -38vmax; top: 12vh; animation-duration: 32s; animation-delay: -8s; }
.m-profile .pf-onb-aurora i:nth-child(3) { color: var(--violet); left: 6vw; bottom: -52vmax; animation-duration: 38s; animation-delay: -15s; opacity: calc(var(--aurora-opacity) * .8); }
@keyframes pfDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6vw, 4vh, 0) scale(1.1); }
  100% { transform: translate3d(-4vw, 2vh, 0) scale(.95); }
}

.m-profile .pf-onb-shell {
  position: relative; z-index: 1; display: flex; flex-direction: column;
  width: 100%; max-width: 580px; min-height: 100%; margin: 0 auto;
  padding: calc(var(--safe-top) + 12px) calc(var(--safe-right) + 18px) 0 calc(var(--safe-left) + 18px);
}
.m-profile .pf-onb-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; min-height: 48px; }
.m-profile .pf-onb-brand { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--fs-sm); font-weight: 800; letter-spacing: -.01em; }
.m-profile .pf-onb-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-profile .pf-onb-mini { width: 28px; height: 28px; border-radius: 9px; box-shadow: none; }
.m-profile .pf-onb-prog { display: flex; align-items: center; gap: 10px; }
.m-profile .pf-dots { display: flex; align-items: center; gap: 6px; }
.m-profile .pf-dot { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--stroke-strong); transition: width var(--dur-slow) var(--ease-out), background-color var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.m-profile .pf-dot.is-done { background: var(--accent); opacity: .55; }
.m-profile .pf-dot.is-current { width: 26px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.m-profile .pf-onb-count { font-size: var(--fs-xs); font-weight: 800; color: var(--muted); }
.m-profile .pf-onb-skip { display: flex; justify-content: flex-end; }
@media (max-width: 420px) { .m-profile .pf-onb-brand span { display: none; } }

.m-profile .pf-onb-stage { flex: 1 0 auto; display: grid; align-content: center; padding: var(--space-5) 0 var(--space-4); }
.m-profile .pf-onb-step { grid-area: 1 / 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-5); }
.m-profile .pf-onb-step.is-center { align-items: center; text-align: center; }
.m-profile .pf-onb-head { display: flex; flex-direction: column; gap: 8px; }
.m-profile .pf-onb-step.is-center .pf-onb-head { align-items: center; }
.m-profile .pf-onb-title { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
.m-profile .pf-onb-title.is-xl { font-size: var(--fs-3xl); max-width: 16ch; }
.m-profile .pf-onb-title:focus, .m-profile .pf-pledge:focus { outline: none; }
.m-profile .pf-onb-sub { max-width: 46ch; color: var(--muted); }

/* step transitions */
.m-profile .pf-onb-step.is-out { pointer-events: none; }
.m-profile .pf-onb-step.is-in-fwd { animation: pfInFwd .46s var(--ease-out) both; }
.m-profile .pf-onb-step.is-in-back { animation: pfInBack .46s var(--ease-out) both; }
.m-profile .pf-onb-step.is-out-fwd { animation: pfOutFwd .3s var(--ease) both; }
.m-profile .pf-onb-step.is-out-back { animation: pfOutBack .3s var(--ease) both; }
.m-profile .pf-onb-step.is-in-first > *,
.m-profile .pf-onb-step.is-in-fwd > *,
.m-profile .pf-onb-step.is-in-back > * { animation: pfRise .55s var(--ease-out) both; }
.m-profile .pf-onb-step[class*="is-in-"] > *:nth-child(2) { animation-delay: 70ms; }
.m-profile .pf-onb-step[class*="is-in-"] > *:nth-child(3) { animation-delay: 140ms; }
.m-profile .pf-onb-step[class*="is-in-"] > *:nth-child(4) { animation-delay: 210ms; }
.m-profile .pf-onb-step[class*="is-in-"] > *:nth-child(5) { animation-delay: 280ms; }
.m-profile .pf-onb-step[class*="is-in-"] > *:nth-child(n+6) { animation-delay: 340ms; }
.m-profile .pf-onb-step[class*="is-in-"] .pf-hl-item { animation: pfRise .5s var(--ease-out) both; }
.m-profile .pf-onb-step[class*="is-in-"] .pf-hl-item:nth-child(1) { animation-delay: 200ms; }
.m-profile .pf-onb-step[class*="is-in-"] .pf-hl-item:nth-child(2) { animation-delay: 280ms; }
.m-profile .pf-onb-step[class*="is-in-"] .pf-hl-item:nth-child(3) { animation-delay: 360ms; }
@keyframes pfInFwd { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes pfInBack { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes pfOutFwd { to { opacity: 0; transform: translateX(-40px); } }
@keyframes pfOutBack { to { opacity: 0; transform: translateX(40px); } }
@keyframes pfRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* welcome */
.m-profile .pf-onb-hero { position: relative; display: grid; place-items: center; margin: 4px 0 2px; }
.m-profile .pf-onb-hero::before {
  content: ""; position: absolute; width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 66%);
  animation: pfGlow 3.6s ease-in-out infinite alternate;
}
.m-profile .pf-onb-mark { position: relative; width: 92px; height: 92px; border-radius: 28px; box-shadow: 0 24px 60px -18px var(--brand-glow); animation: pfFloat 5s ease-in-out infinite; }
@keyframes pfFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pfGlow { from { transform: scale(.9); opacity: .5; } to { transform: scale(1.08); opacity: .9; } }
.m-profile .pf-onb-step.is-center .pf-quote {
  max-width: 460px; margin: 0; padding: 16px 18px; text-align: center;
  border: 1px solid var(--stroke); border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.m-profile .pf-onb-step.is-center .pf-quote blockquote { font-size: var(--fs-md); }
.m-profile .pf-quote.is-soft { margin: 0; }
.m-profile .pf-onb-feats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 460px; }
.m-profile .pf-feat {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--stroke); color: var(--muted); font-size: var(--fs-xs); font-weight: 700;
}
.m-profile .pf-feat .ico { color: var(--accent-ink); }
.m-profile .pf-onb-tagline { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.m-profile .pf-onb-tagline.is-sm { font-size: var(--fs-lg); }

/* name step */
.m-profile .pf-onb-preview {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--stroke); box-shadow: var(--shadow-sm);
}
.m-profile .pf-onb-avatar { flex: none; }
.m-profile .pf-onb-hello { min-width: 0; font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.015em; line-height: 1.25; overflow-wrap: anywhere; }
.m-profile .pf-onb-form { display: flex; flex-direction: column; }
.m-profile .pf-onb-form > * + * { margin-top: var(--space-4); }
.m-profile .pf-onb-skipline { display: flex; justify-content: center; }

/* pledge */
.m-profile .pf-pledge {
  max-width: 22ch; font-size: clamp(1.5rem, 1.1rem + 2.2vw, 2.25rem); font-weight: 800; line-height: 1.25; letter-spacing: -.02em;
  background: linear-gradient(120deg, var(--text) 35%, var(--accent-ink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.m-profile .pf-hl { display: flex; flex-direction: column; gap: 10px; width: 100%; text-align: left; }
.m-profile .pf-hl-item {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--stroke); box-shadow: var(--shadow-sm);
}
.m-profile .pf-hl-title { font-weight: 800; line-height: 1.3; }
.m-profile .pf-hl-text { font-size: var(--fs-sm); color: var(--muted); line-height: 1.45; }

/* footer */
.m-profile .pf-onb-foot {
  position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 12px; margin-top: auto;
  padding: var(--space-4) 0 calc(var(--safe-bottom) + 18px);
  background: linear-gradient(to top, var(--bg) 62%, transparent);
}
.m-profile .pf-onb-next { flex: 1 1 auto; }
.m-profile .pf-onb-back { flex: none; }
.m-profile.pf-onb[data-step="pledge"] .pf-onb-next { animation: pfReady 2.2s ease-in-out 1s infinite; }
@keyframes pfReady {
  0%, 100% { box-shadow: 0 10px 24px -10px var(--accent-glow), inset 0 1px 0 var(--inset-hi); }
  50% { box-shadow: 0 14px 34px -8px var(--accent-glow), 0 0 0 6px var(--accent-soft), inset 0 1px 0 var(--inset-hi); }
}
@media (min-width: 720px) {
  .m-profile .pf-onb-shell { padding-left: 24px; padding-right: 24px; }
  .m-profile .pf-onb-foot { padding-bottom: 28px; }
}

/* soft keyboard (Android APK: the WebView shrinks, the sticky footer rides up on the keyboard). The focused field is
   never covered: --kb-cover = the footer's height (measured by profile.js, 104px until measured); native focus
   scrolling keeps that distance, and while the keyboard is up (.is-kb, from app.js's 'keyboard' event) the stage
   starts at the top and scrolls with a bottom padding of at least the footer's height, so app.js can centre any
   field (scrollIntoView block:'center') above Kembali / Lanjut. */
.m-profile.pf-onb { --kb-cover: 104px; scroll-padding-top: calc(var(--safe-top) + 12px); scroll-padding-bottom: calc(var(--kb-cover) + 16px); }
.m-profile.pf-onb.is-kb .pf-onb-stage { align-content: start; padding-top: var(--space-3); padding-bottom: calc(var(--kb-cover) + 24px); }
.m-profile.pf-onb.is-kb .pf-onb-foot { padding-top: 10px; padding-bottom: calc(var(--safe-bottom) + 10px); }
.m-profile.pf-onb.is-kb .pf-onb-step[class*="is-in-"] > * { animation: none; }

/* ==========================================================================
   Online mode (SPEC-ONLINE §9): Akun card, sync status, Ganti PIN, read-only targets, Data tab
   ========================================================================== */
.m-profile .pf-card-slot { display: flex; flex-direction: column; gap: var(--space-4); }

/* identity chips (role / branch / username from the server account) */
.m-profile .pf-ident { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.m-profile .pf-ident .chip { max-width: 100%; }
.m-profile .pf-ident-role { font-weight: 800; color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent-glow); }

/* Akun card */
.m-profile .pf-account { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4) var(--space-5); }
.m-profile .pf-account::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 90px; pointer-events: none;
  background: radial-gradient(90% 90px at 0% 0%, var(--accent-soft), transparent 72%);
}
.m-profile .pf-account > * { position: relative; }
.m-profile .pf-account-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.m-profile .pf-account-kicker { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); }
.m-profile .pf-account-user { font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.m-profile .pf-account-name { font-weight: 600; color: var(--muted); }
.m-profile .pf-account-sync {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--stroke);
}
.m-profile .pf-account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 459.98px) {
  .m-profile .pf-account-sync .pf-sync-btn { width: 100%; }
  .m-profile .pf-account-actions .btn { flex: 1 1 0; }
}

/* sync status line: tone classes set from App.sync.status() */
.m-profile .pf-sync { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--fs-sm); font-weight: 700; line-height: 1.35; color: var(--muted); }
.m-profile .pf-sync-dot {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-3); color: var(--dim);
}
.m-profile .pf-sync-text { min-width: 0; overflow-wrap: anywhere; }
.m-profile .pf-sync.is-ok { color: var(--green-ink); }
.m-profile .pf-sync.is-ok .pf-sync-dot { background: var(--green-soft); color: var(--green-ink); }
.m-profile .pf-sync.is-busy { color: var(--blue-ink); }
.m-profile .pf-sync.is-busy .pf-sync-dot { background: var(--blue-soft); color: var(--blue-ink); }
.m-profile .pf-sync.is-busy .pf-sync-dot .ico { animation: spin 1.1s linear infinite; }
.m-profile .pf-sync.is-wait { color: var(--amber-ink); }
.m-profile .pf-sync.is-wait .pf-sync-dot { background: var(--amber-soft); color: var(--amber-ink); }
.m-profile .pf-sync.is-error { color: var(--red-ink); }
.m-profile .pf-sync.is-error .pf-sync-dot { background: var(--red-soft); color: var(--red-ink); }
.m-profile .pf-sync.is-lg { font-size: var(--fs-md); }
.m-profile .pf-sync.is-lg .pf-sync-dot { width: 32px; height: 32px; }
.m-profile .pf-sync-detail { margin-top: 8px; font-size: var(--fs-sm); color: var(--muted); line-height: 1.45; }
.m-profile .pf-sync-btn.is-syncing .ico { animation: spin 1.1s linear infinite; }

/* Ganti PIN sheet */
.m-profile .pf-pin-form { display: flex; flex-direction: column; gap: var(--space-4); }
.m-profile .pf-pin-form .input { letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.m-profile .pf-pin-err {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 12px;
  background: var(--red-soft); color: var(--red-ink); font-size: var(--fs-sm); font-weight: 650; line-height: 1.4;
}
.m-profile .pf-pin-err[hidden] { display: none; }
.m-profile .pf-pin-err .ico { flex: none; margin-top: 2px; }
.m-profile .pf-pin-tip { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-xs); color: var(--dim); line-height: 1.45; }
.m-profile .pf-pin-tip .ico { flex: none; margin-top: 1px; color: var(--green-ink); }

/* read-only targets */
.m-profile .pf-locked { margin-bottom: var(--space-4); }
.m-profile .pf-tsheet .pf-locked { margin-bottom: 0; }
.m-profile .pf-tval {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 2px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--stroke);
}
.m-profile .pf-ghead + .pf-tval { border-top: 0; padding-top: 0; }
.m-profile .pf-tval > .ico { grid-row: span 2; color: var(--accent-ink); }
.m-profile .pf-tval-label { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.m-profile .pf-tval-value { font-size: var(--fs-md); font-weight: 800; letter-spacing: -.01em; overflow-wrap: anywhere; }
.m-profile .pf-tval.is-empty .pf-tval-value { font-size: var(--fs-sm); font-weight: 650; color: var(--dim); }
.m-profile .pf-tval-note { margin: -2px 0 6px 26px; font-size: var(--fs-xs); font-weight: 650; color: var(--accent-ink); line-height: 1.4; }

/* Data tab: reload from server */
.m-profile .pf-reload { border-color: var(--accent-glow); background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface); }
@media (max-width: 719.98px) { .m-profile .pf-reload .btn { width: 100%; } }

/* onboarding: read-only identity on the name step */
.m-profile .pf-onb-ident { display: flex; flex-direction: column; gap: 8px; }
.m-profile .pf-onb-ident-note { display: flex; align-items: flex-start; gap: 6px; font-size: var(--fs-xs); color: var(--muted); line-height: 1.45; }
.m-profile .pf-onb-ident-note .ico { flex: none; margin-top: 1px; color: var(--accent-ink); }
