/**
 * PixelForge account UI — Pixel Sprint Exact Match
 * Account / profile dialogs: light + dark (html.dark).
 * Billing pixel modal keeps warm art in both themes.
 */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

#ps-account-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
}
#ps-account-root[hidden] { display: none !important; }
#ps-profile-edit-root {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: grid;
  place-items: center;
}
#ps-profile-edit-root[hidden] { display: none !important; }
#ps-billing-modal-root {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 16px;
  box-sizing: border-box;
  overflow: auto;
}
#ps-billing-modal-root[hidden] { display: none !important; }
#ps-billing-modal-root .ps-bill-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(36, 33, 30, 0.45);
}
html.dark #ps-billing-modal-root .ps-bill-backdrop { background: rgba(0, 0, 0, 0.6); }
#ps-billing-modal-root .ps-bill-stage {
  position: relative;
  z-index: 1;
  margin: auto;
}

.ps-acct-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 33, 30, 0.35);
}
html.dark .ps-acct-backdrop { background: rgba(0, 0, 0, 0.55); }

.ps-acct-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  width: 860px;
  height: 720px;
  max-width: 94vw;
  max-height: 90vh;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid #e8e8e8;
  background: #fff;
  box-shadow: 0 12px 48px 0 rgba(0, 0, 0, 0.22);
  color: #24211e;
}
html.dark .ps-acct-dialog {
  background: #1e212b;
  border-color: #2a2e3a;
  color: #f7f7f5;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.ps-acct-aside {
  display: flex;
  height: 100%;
  width: 220px;
  flex-shrink: 0;
  flex-direction: column;
  border-right: 1px solid #e8e8e8;
  background: #faf8f5;
  padding: 32px 12px 18px 16px;
  box-sizing: border-box;
}
html.dark .ps-acct-aside {
  background: #171a22;
  border-right-color: #2a2e3a;
}
.ps-acct-aside-title {
  margin: 0;
  padding: 0 12px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.4;
}
html.dark .ps-acct-aside-title { color: #f7f7f5; }

.ps-acct-nav { display: flex; flex-direction: column; gap: 4px; }
.ps-acct-nav-btn {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 10px 12px;
  text-align: left;
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  color: #1a1a1a;
  cursor: pointer;
}
.ps-acct-nav-btn .ps-acct-nav-icon {
  display: inline-flex;
  color: #1a1a1a;
  flex-shrink: 0;
}
.ps-acct-nav-btn:hover { background: rgba(255, 255, 255, 0.7); }
.ps-acct-nav-btn.is-active {
  background: #fff;
  color: #c2612a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.ps-acct-nav-btn.is-active .ps-acct-nav-icon { color: #c2612a; }
html.dark .ps-acct-nav-btn { color: #d5d8e0; }
html.dark .ps-acct-nav-btn .ps-acct-nav-icon { color: #d5d8e0; }
html.dark .ps-acct-nav-btn:hover { background: rgba(255, 255, 255, 0.06); }
html.dark .ps-acct-nav-btn.is-active,
html.dark .ps-acct-nav-btn.is-active:hover {
  background: #252830;
  color: #ff9f43;
  box-shadow: none;
}
html.dark .ps-acct-nav-btn.is-active .ps-acct-nav-icon { color: #ff9f43; }

.ps-acct-main {
  position: relative;
  height: 100%;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  background: #fff;
}
html.dark .ps-acct-main { background: #1e212b; }
.ps-acct-main > [data-ps-account-body] {
  height: 100%;
  min-height: 0;
}

.ps-acct-close {
  position: absolute;
  right: 24px;
  top: 24px;
  z-index: 10;
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: #f2f2f0;
  color: #888;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.ps-acct-close:hover { background: #e8e8e8; color: #24211e; }
html.dark .ps-acct-close { background: #2a2e3a; color: #a7adb8; }
html.dark .ps-acct-close:hover { background: #343845; color: #f7f7f5; }

.ps-acct-panel {
  box-sizing: border-box;
  height: 100%;
  overflow-y: auto;
  padding: 24px;
  scrollbar-gutter: stable;
}
.ps-acct-panel--col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding-right: 16px;
}
.ps-acct-panel--referral {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 24px;
  box-sizing: border-box;
  scrollbar-gutter: stable;
}
.ps-acct-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 20px;
}
.ps-acct-panel-title {
  margin: 0;
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 600;
  color: #24211e;
  line-height: 1.3;
}
html.dark .ps-acct-panel-title { color: #f7f7f5; }
.ps-acct-panel-desc {
  margin: 4px 0 0;
  font-size: 14px;
  color: #766f66;
  line-height: 1.45;
}
html.dark .ps-acct-panel-desc { color: #a7adb8; }
.ps-acct-close-reserve { width: 28px; height: 28px; flex-shrink: 0; }
.ps-acct-muted { color: #888; font-size: 14px; }
html.dark .ps-acct-muted { color: #a7adb8; }
.ps-acct-error { color: #dc2626; font-size: 14px; }
html.dark .ps-acct-error { color: #f87171; }

.ps-acct-section-label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #a39e96;
}
html.dark .ps-acct-section-label { color: #8b909c; }
.ps-acct-section { padding-top: 12px; }
.ps-acct-section.is-first { padding-top: 0; }
.ps-acct-card {
  margin-top: 8px;
  width: 100%;
  border-radius: 12px;
  background: #f5f0e8;
  padding: 17px 16px;
  box-sizing: border-box;
}
html.dark .ps-acct-card { background: #252830; }
.ps-acct-card-signout {
  margin-top: 8px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid #e8e8e8;
  background: #f2f2f0;
  padding: 17px 16px;
  box-sizing: border-box;
}
html.dark .ps-acct-card-signout {
  border-color: #3a3e4a;
  background: #252830;
}
.ps-acct-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ps-acct-row-left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}
.ps-acct-identity { min-width: 0; }
.ps-acct-primary {
  font-size: 16px;
  font-weight: 600;
  color: #24211e;
  line-height: 1.35;
}
html.dark .ps-acct-primary { color: #f7f7f5; }
.ps-acct-secondary {
  margin-top: 2px;
  font-size: 14px;
  color: #766f66;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html.dark .ps-acct-secondary { color: #a7adb8; }
.ps-acct-credits {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-size: 14px;
  color: #c9633f;
  line-height: 1.4;
}
html.dark .ps-acct-credits { color: #ff9f43; }
.ps-acct-credits .ps-token-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: inherit;
}
.ps-acct-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #faf6f0;
  box-shadow: 0 0 0 1px #ded9d1;
}
html.dark .ps-acct-avatar {
  background: #1a1d26;
  box-shadow: 0 0 0 1px #3a3e4a;
}
.ps-acct-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ps-acct-avatar span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-weight: 700;
  color: #766f66;
  font-size: 18px;
}
.ps-acct-action-btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 7rem;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  box-sizing: border-box;
}
.ps-acct-action-btn--secondary {
  border: 1px solid #ded9d1;
  background: #fff;
  color: #766f66;
}
.ps-acct-action-btn--secondary:hover {
  border-color: #cfc8bd;
  color: #24211e;
}
.ps-acct-action-btn--primary {
  border: 0;
  background: #c9633f;
  color: #fff;
}
.ps-acct-action-btn--primary:hover { background: #b55636; }
.ps-acct-action-btn:disabled { opacity: 0.6; cursor: not-allowed; }
html.dark .ps-acct-action-btn--secondary {
  border-color: #3a3e4a;
  background: transparent;
  color: #a7adb8;
}
html.dark .ps-acct-action-btn--secondary:hover {
  border-color: #4a4f5c;
  color: #f7f7f5;
}
html.dark .ps-acct-action-btn--primary {
  background: #ff9f43;
  color: #1a0f05;
}
html.dark .ps-acct-action-btn--primary:hover { background: #fb923c; }
.ps-acct-profile-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}
.ps-acct-profile-top { display: flex; flex-direction: column; }
.ps-acct-profile-system {
  margin-top: auto;
  flex-shrink: 0;
  padding-top: 24px;
}
/* ===== Referral ===== */
.ps-ref-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid #f0ddd0;
  background: linear-gradient(134.68deg, rgb(253, 246, 240) 0%, rgb(245, 236, 229) 100%);
  padding: 21px 25px;
  box-sizing: border-box;
}
html.dark .ps-ref-banner {
  border-color: #3d342c;
  background: linear-gradient(134.68deg, #2a241e 0%, #221e1a 100%);
}
.ps-ref-banner-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
  color: #1a1a1a;
}
html.dark .ps-ref-banner-title { color: #f7f7f5; }
.ps-ref-badge {
  display: inline-block;
  border-radius: 10px;
  background: #c2612a;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  color: #fff;
}
html.dark .ps-ref-badge { background: #ff9f43; color: #1a0f05; }
.ps-ref-banner-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ps-ref-banner-desc {
  margin: 7px 0 0;
  max-width: 360px;
  font-size: 13px;
  line-height: 21px;
  color: #888;
}
html.dark .ps-ref-banner-desc { color: #a7adb8; }
.ps-ref-banner-desc b { font-weight: 600; color: #c2612a; }
html.dark .ps-ref-banner-desc b { color: #ff9f43; }
.ps-ref-hero {
  margin-left: 16px;
  display: none;
  height: 96px;
  width: 120px;
  flex-shrink: 0;
  object-fit: contain;
}
@media (min-width: 640px) {
  .ps-ref-hero { display: block; }
}
.ps-ref-dot {
  pointer-events: none;
  position: absolute;
  border-radius: 999px;
  background: #c2612a;
}
.ps-ref-dot--1 { right: 9rem; top: 12px; width: 6px; height: 6px; opacity: 0.2; }
.ps-ref-dot--2 { bottom: 16px; right: 12rem; width: 8px; height: 8px; opacity: 0.15; }
.ps-ref-dot--3 { right: 13rem; top: 24px; width: 4px; height: 4px; opacity: 0.25; }
.ps-ref-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
}
html.dark .ps-ref-label { color: #8b909c; }
.ps-ref-link-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid #e8e8e8;
  background: #f2f2f0;
  padding: 13px;
  box-sizing: border-box;
}
html.dark .ps-ref-link-row { border-color: #3a3e4a; background: #151821; }
.ps-ref-link-row code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 17px;
  color: #888;
}
html.dark .ps-ref-link-row code { color: #a7adb8; }
.ps-ref-copy {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  background: #c2612a;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 19px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}
.ps-ref-copy:hover { background: #a85424; }
html.dark .ps-ref-copy { background: #ff9f43; color: #1a0f05; }
html.dark .ps-ref-copy:hover { background: #fb923c; }
.ps-ref-scroll {
  margin-top: 24px;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.ps-ref-stack { display: flex; flex-direction: column; gap: 24px; }
.ps-ref-stats {
  border-radius: 10px;
  border: 1px solid #e8e8e8;
  background: #f2f2f0;
  padding: 17px;
  box-sizing: border-box;
}
html.dark .ps-ref-stats { border-color: #3a3e4a; background: #252830; }
.ps-ref-stats-inner { display: flex; align-items: center; gap: 16px; }
.ps-ref-stat {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ps-ref-stat-value {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
  color: #1a1a1a;
}
html.dark .ps-ref-stat-value { color: #f7f7f5; }
.ps-ref-stat-value.is-hi { color: #c2612a; }
html.dark .ps-ref-stat-value.is-hi { color: #ff9f43; }
.ps-ref-stat-label { font-size: 12px; line-height: 16px; color: #888; }
html.dark .ps-ref-stat-label { color: #a7adb8; }
.ps-ref-divider {
  width: 1px;
  height: 54px;
  flex-shrink: 0;
  background: #e8e8e8;
}
html.dark .ps-ref-divider { background: #3a3e4a; }
.ps-ref-how {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .ps-ref-how { grid-template-columns: repeat(3, 1fr); }
}
.ps-ref-step {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid #e8e8e8;
  background: #f2f2f0;
  padding: 13px;
  box-sizing: border-box;
}
html.dark .ps-ref-step { border-color: #3a3e4a; background: #252830; }
.ps-ref-step-head { display: flex; align-items: center; gap: 8px; }
.ps-ref-step-icon {
  display: flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f5ece5;
  color: #c2612a;
  flex-shrink: 0;
}
html.dark .ps-ref-step-icon {
  background: rgba(255, 159, 67, 0.15);
  color: #ff9f43;
}
.ps-ref-step-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 19px;
  color: #1a1a1a;
}
html.dark .ps-ref-step-title { color: #f7f7f5; }
.ps-ref-step-desc {
  margin: 0;
  font-size: 12px;
  line-height: 19.5px;
  color: #888;
}
html.dark .ps-ref-step-desc { color: #a7adb8; }
.ps-ref-empty {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px dashed #e8e8e8;
  background: #f2f2f0;
  padding: 25px 4px;
  color: #888;
  font-size: 13px;
  line-height: 19px;
}
html.dark .ps-ref-empty {
  border-color: #3a3e4a;
  background: #252830;
  color: #a7adb8;
}
.ps-ref-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ps-ref-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid #e8e8e8;
  background: #f2f2f0;
  padding: 12px 16px;
  font-size: 14px;
}
html.dark .ps-ref-item { border-color: #3a3e4a; background: #252830; }
.ps-ref-item-email { color: #1a1a1a; }
html.dark .ps-ref-item-email { color: #f7f7f5; }
.ps-ref-item-meta { color: #888; }
html.dark .ps-ref-item-meta { color: #a7adb8; }

/* ===== Ledger ===== */
.ps-acct-ledger-wrap {
  margin-top: 24px;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  margin-right: -10px;
  padding-right: 6px;
  scrollbar-gutter: auto;
  scrollbar-width: none;
}
.ps-acct-ledger-wrap:hover {
  scrollbar-width: thin;
  scrollbar-color: rgba(36, 33, 30, 0.22) transparent;
}
.ps-acct-ledger-wrap::-webkit-scrollbar {
  width: 3px;
}
.ps-acct-ledger-wrap::-webkit-scrollbar-track {
  background: transparent;
}
.ps-acct-ledger-wrap::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}
.ps-acct-ledger-wrap:hover::-webkit-scrollbar-thumb {
  background: rgba(36, 33, 30, 0.22);
}
html.dark .ps-acct-ledger-wrap:hover {
  scrollbar-color: rgba(247, 247, 245, 0.24) transparent;
}
html.dark .ps-acct-ledger-wrap:hover::-webkit-scrollbar-thumb {
  background: rgba(247, 247, 245, 0.24);
}
.ps-acct-ledger {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
.ps-acct-ledger th {
  padding: 12px 16px 12px 0;
  font-weight: 500;
  color: #766f66;
  border-bottom: 1px solid #e8e2d9;
}
.ps-acct-ledger th.is-right,
.ps-acct-ledger th:last-child { text-align: right; padding-right: 0; }
.ps-acct-ledger td {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid #f0ebe3;
  color: #766f66;
  vertical-align: top;
}
.ps-acct-ledger td.desc { color: #24211e; }
.ps-acct-ledger td.tokens {
  text-align: right;
  font-weight: 500;
  padding-right: 0;
}
.ps-acct-ledger td.amount {
  text-align: right;
  color: #24211e;
  padding-left: 16px;
  padding-right: 0;
}
.ps-acct-ledger .tok-pos { color: #15803d; }
.ps-acct-ledger .tok-neg { color: #c9633f; }
html.dark .ps-acct-ledger th { color: #a7adb8; border-bottom-color: #2a2e3a; }
html.dark .ps-acct-ledger td { border-bottom-color: #2a2e3a; color: #a7adb8; }
html.dark .ps-acct-ledger td.desc,
html.dark .ps-acct-ledger td.amount { color: #f7f7f5; }
html.dark .ps-acct-ledger .tok-pos { color: #4ade80; }
html.dark .ps-acct-ledger .tok-neg { color: #ff9f43; }
.ps-acct-trunc-hint { margin: 0 0 12px; font-size: 12px; color: #c9633f; }
html.dark .ps-acct-trunc-hint { color: #ff9f43; }

/* ===== Profile edit ===== */
.ps-profile-edit-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  border-radius: 1rem;
  border: 1px solid #ded9d1;
  background: #fff;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}
html.dark .ps-profile-edit-dialog {
  border-color: #3a3e4a;
  background: #1e212b;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
}
.ps-profile-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ps-profile-edit-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #24211e;
}
html.dark .ps-profile-edit-title { color: #f7f7f5; }
.ps-profile-edit-x {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: #f5f0e8;
  color: #766f66;
  cursor: pointer;
  padding: 0;
}
.ps-profile-edit-x:hover { background: #ece4d8; }
html.dark .ps-profile-edit-x { background: #252830; color: #a7adb8; }
html.dark .ps-profile-edit-x:hover { background: #2f3340; color: #f7f7f5; }
.ps-profile-edit-avatar-wrap {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ps-profile-edit-avatar-box { position: relative; }
.ps-profile-edit-avatar {
  position: relative;
  display: block;
  width: 112px;
  height: 112px;
  overflow: hidden;
  border-radius: 12px;
  background: #faf6f0;
  box-shadow: 0 0 0 1px #ded9d1;
  border: 0;
  padding: 0;
  cursor: pointer;
}
html.dark .ps-profile-edit-avatar {
  background: #151821;
  box-shadow: 0 0 0 1px #3a3e4a;
}
.ps-profile-edit-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ps-profile-edit-avatar:disabled { opacity: 0.6; cursor: not-allowed; }
.ps-profile-edit-dice {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: #c9633f;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  padding: 0;
}
.ps-profile-edit-dice:hover { background: #b55636; }
.ps-profile-edit-dice:disabled { opacity: 0.6; cursor: not-allowed; }
html.dark .ps-profile-edit-dice { background: #ff9f43; color: #1a0f05; }
html.dark .ps-profile-edit-dice:hover { background: #fb923c; }
.ps-profile-edit-label {
  display: block;
  margin-top: 32px;
  font-size: 16px;
  color: #766f66;
}
html.dark .ps-profile-edit-label { color: #a7adb8; }
.ps-profile-edit-input {
  display: block;
  width: 100%;
  margin-top: 8px;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid #ded9d1;
  background: #fff;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: #24211e;
  outline: none;
}
.ps-profile-edit-input:focus {
  border-color: rgba(201, 99, 63, 0.45);
  box-shadow: 0 0 0 3px rgba(201, 99, 63, 0.12);
}
html.dark .ps-profile-edit-input {
  border-color: #3a3e4a;
  background: #151821;
  color: #f7f7f5;
}
.ps-profile-edit-save-wrap {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}
.ps-profile-edit-save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: #c9633f;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}
.ps-profile-edit-save:hover { background: #b55636; }
.ps-profile-edit-save:disabled { opacity: 0.6; cursor: not-allowed; }
html.dark .ps-profile-edit-save { background: #ff9f43; color: #1a0f05; }
html.dark .ps-profile-edit-save:hover { background: #fb923c; }
/* ===== Billing pixel modal (warm art — same in light/dark) ===== */
.ps-bill-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 33, 30, 0.45);
}
html.dark .ps-bill-backdrop { background: rgba(0, 0, 0, 0.55); }
.ps-bill-stage {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  overflow: visible;
}
.ps-bill-canvas {
  position: relative;
  transform-origin: top left;
  overflow: visible;
  background: transparent;
  user-select: none;
}
.ps-bill-shell {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}
.ps-bill-decor {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ps-bill-decor img {
  width: 65%;
  height: 65%;
  object-fit: contain;
}
.ps-bill-header-inner {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding-left: 60px;
  transform: translateY(40px) scale(1.1);
  transform-origin: top left;
}
.ps-bill-header-inner img { flex-shrink: 0; object-fit: contain; }
.ps-bill-title { margin: 0; line-height: 1.2; color: #1a0e00; }
.ps-bill-title-brand,
.ps-bill-title-suffix {
  font-family: "Press Start 2P", monospace;
  letter-spacing: 0.02em;
}
.ps-bill-desc {
  margin: 4px 0 0;
  color: #7a5c3a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ps-bill-footnote {
  position: absolute;
  z-index: 1;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 4px;
  scrollbar-width: thin;
  color: #7a5c3a;
}
.ps-bill-footnote p { margin: 0; text-align: left; }
.ps-bill-col {
  position: absolute;
  z-index: 5;
  overflow: visible;
}
.ps-bill-card {
  position: absolute;
  left: 19%;
  right: 1%;
  top: 2%;
  bottom: 4%;
  display: flex;
  flex-direction: column;
  padding-left: 10px;
  box-sizing: border-box;
  color: #3a2810;
}
.ps-bill-card-upper {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  height: 36%;
  padding-top: 6.76rem;
  box-sizing: border-box;
}
.ps-bill-card-title {
  margin: 0;
  flex-shrink: 0;
  font-weight: 800;
  color: #1a0e00;
}
.ps-bill-card-sub {
  margin: 2px 0 0;
  flex-shrink: 0;
  color: #1a0e00;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ps-bill-card-lower {
  margin-top: -8px;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}
.ps-bill-price-row {
  display: flex;
  flex-shrink: 0;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 8px;
}
.ps-bill-price {
  margin: 0;
  flex-shrink: 0;
  font-weight: 900;
  color: #1a0e00;
  line-height: 1;
}
.ps-bill-ribbon {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.5rem;
  max-width: 100%;
  border-radius: 999px;
  background: #c2612a;
  padding: 6px 12px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(60, 20, 0, 0.45);
  white-space: nowrap;
}
.ps-bill-highlight {
  margin: 0;
  flex-shrink: 0;
  color: #1a0e00;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ps-bill-features {
  margin: 0;
  padding: 0;
  list-style: none;
  min-height: 0;
  flex: 1;
  width: 100%;
}
.ps-bill-features li {
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  gap: 8px;
  margin-top: 5px;
  width: 100%;
}
.ps-bill-feat-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  object-fit: contain;
  image-rendering: pixelated;
}
.ps-bill-feat-text {
  min-width: 0;
  flex: 1 1 auto;
  color: #3a2810;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ps-bill-btn-row { position: absolute; z-index: 10; }
.ps-bill-btn-slot { position: absolute; top: 0; height: 100%; }
.ps-bill-pixel-btn {
  position: relative;
  display: flex;
  height: 100%;
  width: 100%;
  align-items: center;
  justify-content: center;
  overflow: visible;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.ps-bill-pixel-btn:disabled { cursor: wait; opacity: 0.6; }
.ps-bill-pixel-btn-art {
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.ps-bill-pixel-btn-art > span {
  position: relative;
  display: block;
  height: 100%;
  width: 100%;
  transform: scale(3);
  transform-origin: center;
}
.ps-bill-pixel-btn-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}
.ps-bill-pixel-btn-label {
  pointer-events: none;
  position: relative;
  z-index: 10;
  transform: translate(-4px, -6px);
  text-align: center;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}
.ps-bill-pixel-btn.is-hot .ps-bill-pixel-btn-label {
  transform: translate(-4px, -8px) scale(1.02);
}
.ps-bill-close {
  position: absolute;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.ps-bill-close:hover { opacity: 0.8; }
.ps-bill-close img {
  width: 70%;
  height: 70%;
  object-fit: contain;
}
.ps-bill-popular {
  pointer-events: none;
  position: absolute;
  z-index: 20;
  width: 98%;
  left: calc(50% + 36px);
  top: 0;
  aspect-ratio: 869 / 123;
  transform: translate(-50%, calc(-56% + 95px));
}
.ps-bill-popular img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ps-bill-popular span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  color: #fff;
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 rgba(60, 20, 0, 0.55);
}
.ps-bill-msg {
  position: absolute;
  left: 50%;
  bottom: -36px;
  transform: translateX(-50%);
  z-index: 30;
  max-width: 90%;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.95);
  border: 1px solid #e8d5c4;
  color: #5c3016;
  font-size: 13px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.ps-bill-msg[hidden] { display: none !important; }
.ps-bill-msg a { color: #c2612a; font-weight: 600; }

@media (max-width: 720px) {
  .ps-acct-dialog {
    flex-direction: column;
    width: min(860px, 94vw);
    height: auto;
    max-height: 90vh;
  }
  .ps-acct-aside {
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #e8e8e8;
    padding: 16px 12px;
  }
  html.dark .ps-acct-aside { border-bottom-color: #2a2e3a; }
  .ps-acct-nav { flex-direction: row; overflow-x: auto; }
  .ps-acct-nav-btn { white-space: nowrap; }
  .ps-acct-main { min-height: 420px; }
}

/* Payment QR — match Pixel Sprint TopUp (always light panel) */
#ps-billing-modal-root .ps-pay-qr-root {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 16px;
  box-sizing: border-box;
}
#ps-billing-modal-root .ps-pay-qr-root[hidden] { display: none !important; }
.ps-pay-qr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 33, 30, 0.35);
}
.ps-pay-qr-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 28rem);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid #ded9d1;
  background: #faf6f0;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.22);
  color: #24211e;
}
.ps-pay-qr-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: #24211e;
}
.ps-pay-qr-amount {
  margin: 4px 0 0;
  font-size: 14px;
  color: #766f66;
}
.ps-pay-qr-channel {
  margin: 16px 0 0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}
.ps-pay-qr-channel--wechat { color: #07c160; }
.ps-pay-qr-channel--alipay { color: #1677ff; }
.ps-pay-qr-hint {
  margin: 8px 0 0;
  text-align: center;
  font-size: 14px;
  color: #766f66;
}
.ps-pay-qr-box {
  margin: 16px auto 0;
  width: 248px;
  height: 248px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid #ded9d1;
  background: #fff;
  overflow: hidden;
}
.ps-pay-qr-box img {
  display: block;
  width: 240px;
  height: 240px;
  object-fit: contain;
}
.ps-pay-qr-loading,
.ps-pay-qr-fail {
  padding: 0 16px;
  font-size: 13px;
  color: #766f66;
  text-align: center;
  line-height: 1.5;
}
.ps-pay-qr-fail { color: #dc2626; }
.ps-pay-qr-poll {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  color: #766f66;
}
.ps-pay-qr-cancel {
  margin-top: 16px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #ded9d1;
  background: #fff;
  color: #766f66;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.ps-pay-qr-cancel:hover { background: #f5f2ec; }
