#store-wallet {
  --nw-ink: #252821;
  --nw-muted: #656b64;
  --nw-line: #e1dfd4;
  --nw-accent: #80530c;
  --nw-wash: #faf4e4;
  --nw-pad: clamp(18px, 2.2vw, 28px);
  width: min(1200px, calc(100% - 80px));
  margin: clamp(28px, 3vw, 40px) auto 0;
  padding: 0;
  color: var(--nw-ink);
  font-family: 'DM Sans', Arial, sans-serif;
}

#store-wallet [hidden] { display: none !important; }
.nw-head {
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 28px;
  height: auto;
  margin-bottom: 24px;
  padding: 0;
  background: none;
  box-shadow: none;
  border: 0;
}

#store-wallet :is(h1, h2, h3) { margin: 0; font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif; }
#store-wallet h1 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.18; letter-spacing: -.048em; }
#store-wallet h2 { font-size: clamp(20px, 2vw, 26px); line-height: 1.23; letter-spacing: -.04em; }
#store-wallet h3 { font-size: 16px; line-height: 1.35; letter-spacing: -.018em; }
.nw-head p { max-width: 660px; margin: 8px 0 0; line-height: 1.55; color: var(--nw-muted); }
#store-wallet .eyebrow, .nw-eyebrow {
  display: block;
  color: var(--nw-accent);
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .1em;
}

.nw-dashboard {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  grid-template-areas: "overview topup" "activity history";
  gap: clamp(16px, 2vw, 24px);
  align-items: stretch;
}

.nw-dashboard > * { min-width: 0; }
.nw-left { display: grid; grid-area: overview; grid-template-rows: auto 1fr; align-content: start; gap: 20px; }
.nw-topup { grid-area: topup; }
.nw-activity { grid-area: activity; }
.nw-history { grid-area: history; }
.nw-panel, .nw-balance, .nw-guest {
  padding: var(--nw-pad);
  border-radius: 16px;
  border: 1px solid var(--nw-line);
  background: #fff;
}

button.nw-card {
  --nw-radius: clamp(13px, 1.7vw, 22px);
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  aspect-ratio: 5312 / 3344;
  margin: 0;
  padding: 0;
  isolation: isolate;
  container-type: inline-size;
  perspective: 1100px;
  border: 0;
  border-radius: var(--nw-radius);
  background: transparent;
  box-shadow: 0 6px 18px -10px #38210670;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button.nw-card:focus-visible { outline: 3px solid #a96d0c; outline-offset: 4px; }
.nw-flipper {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
  transition: transform 850ms cubic-bezier(.4,0,.2,1);
}

.nw-card[aria-pressed="true"] .nw-flipper { transform: rotateY(180deg); }
.nw-front, .nw-back {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border-radius: var(--nw-radius);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  text-align: left;
}

.nw-front {
  transform: translateZ(.5px);
  background: #25150b url('/wallet-card.webp') center / cover no-repeat;
}
.nw-front img { display: block; height: 100%; width: 100%; object-fit: cover; }
.nw-name {
  position: absolute;
  top: 15%;
  right: 8.9%;
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: white;
  font-size: clamp(11px, 3.6cqw, 24px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.035em;
  text-transform: uppercase;
  text-shadow: .06em .07em 0 #251004;
}
.nw-back {
  transform: rotateY(180deg) translateZ(.5px);
  color: #fff;
  background: linear-gradient(125deg,#15100d 2%,#331c0d 38%,#93500f 77%,#442809 100%);
}
.nw-stripe {
  position: absolute;
  inset: 10% 0 auto;
  height: 16%;
  background: linear-gradient(#151415, #111 55%, #22201e);
}
.nw-sign {
  position: absolute;
  inset: 34% 8% auto;
  min-height: 22%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 1.4% 2.5%;
  overflow: hidden;
  border-radius: 5px;
  color: #382811;
  background: #fff6e3;
}
.nw-sign small { color: #7b6c53; font-size: clamp(7px, 1.6cqw, 11px); text-transform: uppercase; letter-spacing: .07em; }
.nw-sign :is(strong,b) { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: clamp(12px, 3.5cqw, 22px); }
.nw-back-note, .nw-back-foot { position: absolute; left: 8%; right: 8%; text-align: left; }
.nw-back-note { top: 61%; color: #f6e5cc; font-size: max(8px, 2cqw); }
.nw-back-foot { bottom: 9%; display: flex; align-items: center; justify-content: space-between; font-size: max(9px, 2.25cqw); }

.nw-balance {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  color: #fff;
  border-color: #514233;
  background: linear-gradient(120deg, #242820, #44341d 70%, #61451d);
}
.nw-balance :is(h2,h3,p,small) { margin: 0; color: inherit; }
.nw-balance :is(h2, .nw-value) { font-weight: 750; font-size: clamp(27px, 3.1vw, 38px) !important; letter-spacing: -.055em; }
.nw-balance p, .nw-balance small { color: #f2e8d4; line-height: 1.5; }
.nw-balance .nw-unit-note { color: #ede5d5; font-size: 13px; line-height: 1.45; }
.nw-times { display: grid; gap: 5px; width: 100%; margin: 3px 0 0; font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.nw-times > div { display: grid; grid-template-columns: 9em minmax(0,1fr); align-items: baseline; column-gap: 8px; }
.nw-times dt { color: #e6d8c4; }
.nw-times dd { margin: 0; color: #fff8ec; }
.nw-times time { display: inline-block; }
.nw-balance :is(.button, a) { margin: 6px 0 0; border: 0; background: #fffaf0; color: #4a381c; }
.nw-balance :is(.button, a):hover { background: #fff; color: #2c2417; }

@media (prefers-reduced-motion: reduce) {
  .nw-flipper { transition: none; }
}

.nw-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}
.nw-form label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--nw-ink);
}
#store-wallet .nw-form :is(input:not([type=file]), select:not(.nx-plan-native), .nx-plan-trigger) {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--nw-line);
  border-radius: 7px;
  background: #fff;
  color: var(--nw-ink);
  font: 400 14px/1.45 'DM Sans', Arial, sans-serif;
}
#store-wallet .nw-form .nx-plan-trigger { display: flex; align-items: center; justify-content: space-between; }
#store-wallet .nw-form :is(input, select, .nx-plan-trigger):focus-visible {
  border-color: #bd8c32;
  outline: 2px solid #f4d58e;
  outline-offset: 2px;
}
.nw-topup .nw-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--nw-wash);
  font-size: 13px;
  line-height: 1.55;
  color: #5e5136;
}
.nw-topup > :is(small,p), .nw-activity > p, .nw-history > p {
  margin: 7px 0 0;
  font-size: 13px;
  color: var(--nw-muted);
  line-height: 1.55;
}
.nw-form button[type=submit] { width: 100%; }
.nw-form [role=status]:empty, #store-wallet [role=alert]:empty { display: none; }
.nw-form [role=status], #store-wallet [role=alert] { margin: 0; font-size: 13px; line-height: 1.5; }
#store-wallet [role=alert] { color: #953720; }

.nw-activity, .nw-history {
  height: clamp(328px, 48svh, 460px);
  overflow: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}
.nw-activity::-webkit-scrollbar, .nw-history::-webkit-scrollbar { display: none; }
.nw-history h3 { margin: 18px 0 5px !important; }
.nw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 55px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--nw-line);
  border-radius: 0;
  background: transparent;
  text-align: left;
  color: var(--nw-ink);
  font: inherit;
}
.nw-row:last-child { border-bottom-color: transparent; }
.nw-row > :first-child { min-width: 0; overflow-wrap: anywhere; }
.nw-row > :last-child { margin-left: auto; flex-shrink: 0; max-width: 55%; text-align: right; overflow-wrap: anywhere; }
.nw-row :is(strong,b,small) { display: block; }
.nw-row :is(strong,b) { font-size: 14px; line-height: 1.4; }
.nw-row small { margin-top: 3px; font-size: 12px; color: var(--nw-muted); }
button.nw-row { cursor: pointer; }
button.nw-row:hover { color: var(--nw-accent); }
button.nw-row:focus-visible { outline: 2px solid #ab791e; outline-offset: -2px; border-radius: 5px; }

.nw-guest {
  width: min(100%, 520px);
  margin: clamp(32px, 4vw, 56px) auto 0;
  text-align: center;
}
.nw-guest p { margin: 10px auto 18px; max-width: 42ch; color: var(--nw-muted); }

#store-wallet dialog {
  width: min(480px, calc(100vw - 32px));
  max-height: min(86svh, 760px);
  margin: auto;
  padding: clamp(20px, 3vw, 30px);
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--nw-ink);
  border: 1px solid var(--nw-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 75px -20px #191b1880;
}
.nw-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nw-dialog-head [data-close] { position: static; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--nw-line); border-radius: 8px; color: inherit; background: white; cursor: pointer; }
#store-wallet dialog dl { display: grid; gap: 3px; }
#store-wallet dialog dt { margin-top: 8px; font-size: 12px; color: var(--nw-muted); }
#store-wallet dialog dd { margin: 0; }
.nw-topup > small { display: block; }
#store-wallet dialog::backdrop { background: #141c1aa1; }
#store-wallet dialog :is(dd,code) { overflow-wrap: anywhere; }
#store-wallet dialog img { display: block; width: min(100%, 220px); height: auto; margin: 14px auto; }
#store-wallet dialog input[type=file] { display: block; width: 100%; font: inherit; }
#store-wallet dialog input[type=file]::file-selector-button {
  cursor: pointer;
  margin-inline-end: 8px;
  padding: 7px 10px;
  border: 1px solid var(--nw-line);
  border-radius: 5px;
  background: #fffaf1;
  color: var(--nw-accent);
  font: inherit;
}

@media (max-width: 720px) {
  #store-wallet { width: calc(100% - 36px); margin-top: 26px; --nw-pad: 18px; }
  .nw-head { gap: 12px; margin-bottom: 18px; }
  .nw-head p { font-size: 14px; }
  .nw-dashboard { grid-template-columns: minmax(0,1fr); grid-template-areas: "overview" "topup" "activity" "history"; gap: 16px; }
  .nw-left { gap: 14px; }
  .nw-activity, .nw-history { height: auto; max-height: 360px; }
  .nw-panel, .nw-balance { border-radius: 13px; }
}

@media (max-width: 380px) {
  #store-wallet { width: calc(100% - 24px); --nw-pad: 15px; }
  .nw-head h1 { font-size: 25px; }
}
