/* The refined preview keeps account tasks in one edge-attached workspace. */
body.interface-refined {
  --drawer-surface: #141a23;
  --drawer-field: #1b2330;
  --drawer-line: #2c3543;
  --drawer-ink: #edf1f7;
  --drawer-muted: #98a7ba;
  --drawer-action: #a9c8f1;
  --drawer-width: 520px;
}

body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet, #loginSheet, #onboard) {
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
  background: rgb(3 7 13 / 28%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet, #loginSheet, #onboard) > :is(.wc-card, .login-card, .ob-card) {
  position: relative;
  flex: 0 1 var(--drawer-width);
  width: var(--drawer-width);
  max-width: 100%;
  height: var(--visible-height, 100dvh);
  max-height: var(--visible-height, 100dvh);
  margin: 0;
  padding: 36px 32px max(28px, env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-left: 1px solid var(--drawer-line);
  border-radius: 0;
  background: var(--drawer-surface);
  color: var(--drawer-ink);
  box-shadow: -18px 0 64px rgb(0 0 0 / 16%);
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: #3b4656 transparent;
}

body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet, #loginSheet, #onboard) :is(.wc-head, .login-h, .ob-brand) {
  margin: 0 0 28px;
  padding-right: 44px;
  font: 600 25px/1.2 var(--ui);
  letter-spacing: -.035em;
  text-transform: none;
  color: var(--drawer-ink);
}

body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet, #loginSheet, #onboard) :is(.wc-x, .login-x) {
  position: fixed;
  top: 28px;
  right: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--drawer-surface);
  color: var(--drawer-muted);
  font: 400 24px/1 var(--ui);
  cursor: pointer;
  z-index: 3;
}

body.interface-refined .interface-back {
  position: sticky;
  top: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 7px;
  width: fit-content;
  min-height: 32px;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--drawer-surface);
  color: var(--drawer-muted);
  font: 400 13px/1.4 var(--ui);
  cursor: pointer;
}
body.interface-refined .interface-back:hover { color: var(--drawer-ink); }

body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet, #loginSheet, #onboard) :is(.wc-x, .login-x):hover {
  color: var(--drawer-ink);
  background: #232d3b;
}

body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet, #loginSheet, #onboard) :is(button, input, a, summary):focus-visible {
  outline: 2px solid var(--drawer-action);
  outline-offset: 3px;
}

body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet, #loginSheet, #onboard) :is(.wc-note, .wc-fp-copy, .login-foot, .login-code-note, .wc-emb-warn, .wc-export-copy) {
  color: var(--drawer-muted);
  font: 400 13px/1.6 var(--ui);
}

body.interface-refined #walletCenter .wc-id {
  gap: 6px;
  margin-bottom: 28px;
}

body.interface-refined #walletCenter .wc-type {
  padding: 0;
  border: 0;
  background: none;
  color: var(--drawer-muted);
  font: 400 13px/1.5 var(--ui);
}

body.interface-refined #walletCenter .wc-profile {
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--drawer-muted);
}

body.interface-refined #walletCenter .wc-signer {
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--drawer-line);
}

body.interface-refined #walletCenter .wc-addr {
  max-width: 68%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.interface-refined #walletCenter .wc-addr-v {
  font-size: 12px;
  color: #c6d0de;
}

body.interface-refined #walletCenter .wc-copy {
  color: var(--drawer-action);
  font-size: 12px;
}

body.interface-refined #walletCenter .wc-buckets {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin: 0 0 22px;
}

body.interface-refined #walletCenter .wc-b {
  min-width: 0;
  gap: 7px;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--drawer-line);
  border-radius: 0;
  background: none;
}

body.interface-refined #walletCenter .wc-b-k {
  color: var(--drawer-muted);
  font: 400 12px/1.4 var(--ui);
  text-transform: none;
  letter-spacing: 0;
}

body.interface-refined #walletCenter .wc-b-v {
  font: 500 21px/1.2 var(--mono);
  letter-spacing: -.04em;
  color: var(--drawer-ink);
}

body.interface-refined #walletCenter .wc-b:nth-child(n + 3) .wc-b-v {
  font: 500 14px/1.5 var(--ui);
  letter-spacing: 0;
}

body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet) :is(.wc-act, .wc-switch, .wc-max) {
  min-height: 42px;
  height: auto;
  padding: 10px 14px;
  border: 1px solid #394556;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: #dce4ef;
  font: 500 13px/1.4 var(--ui);
  text-transform: none;
  letter-spacing: 0;
}

body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet) :is(.wc-act, .wc-switch, .wc-max):hover:not(:disabled) {
  border-color: #61758e;
  background: #202b39;
  color: #fff;
}

body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet) .wc-act-primary {
  border-color: var(--drawer-action);
  background: var(--drawer-action);
  color: #13243b;
}

body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet) .wc-act-primary:hover:not(:disabled) {
  border-color: #c6dcf7;
  background: #c6dcf7;
  color: #13243b;
}

body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet) .wc-act-gold {
  color: #dac28c;
  border-color: #675b3c;
  background: transparent;
}

body.interface-refined #walletCenter .wc-actions-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}

body.interface-refined #walletCenter .wc-details {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--drawer-line);
  background: none;
  border-radius: 0;
}

body.interface-refined #walletCenter .wc-details > summary {
  min-height: 54px;
  padding: 14px 0;
  font: 500 13px/1.5 var(--ui);
  color: #d0dbe9;
}

body.interface-refined #walletCenter .wc-details .wc-b-v {
  font-size: 16px;
}

body.interface-refined #walletCenter .wc-details .wc-emb-row {
  align-items: flex-start;
  margin: 0;
  padding: 10px 0;
  font-size: 13px;
}

body.interface-refined #walletCenter :is(.wc-receive, .wc-embedded) {
  padding: 20px 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--drawer-line);
  border-radius: 0;
  background: none;
}

body.interface-refined #walletCenter .wc-receive-addr {
  padding: 14px;
  border: 1px solid #394556;
  border-radius: 6px;
  background: var(--drawer-field);
}

body.interface-refined #walletCenter .wc-foot-row {
  gap: 4px 20px;
  padding-top: 18px;
  margin-top: 14px;
  border-top: 1px solid var(--drawer-line);
}

body.interface-refined #walletCenter .wc-foot-row .wc-act {
  justify-content: flex-start;
  padding: 10px 0;
  border-color: transparent;
  text-align: left;
  color: var(--drawer-muted);
}

body.interface-refined #walletCenter .wc-foot-row .wc-act:hover {
  color: var(--drawer-ink);
  background: none;
}

body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet) :is(.wc-k, .wc-field, .wc-fp-lim) {
  gap: 9px;
  color: var(--drawer-muted);
  font: 400 13px/1.5 var(--ui);
  text-transform: none;
  letter-spacing: 0;
}

body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet) :is(.wc-input, .wc-fp-input) {
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #394556;
  border-radius: 6px;
  background: var(--drawer-field);
  box-shadow: none;
  color: var(--drawer-ink);
  font: 400 15px/1.4 var(--ui);
}

body.interface-refined #walletCenter .wc-fp-input { width: 100%; }
body.interface-refined #walletCenter .wc-fp-row { width: 100%; }

body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet) .wc-warn {
  padding: 13px 15px;
  border: 0;
  border-left: 2px solid #b79456;
  border-radius: 0;
  background: #221f19;
  color: #d4bd91;
  font: 400 12px/1.6 var(--ui);
}

body.interface-refined #withdrawSheet .wc-asset {
  width: 100%;
  gap: 0;
  margin: 0 0 26px;
  border: 0;
  border-bottom: 1px solid var(--drawer-line);
  border-radius: 0;
  background: none;
  overflow: visible;
}

body.interface-refined #withdrawSheet .wc-asset-b {
  min-height: 44px;
  padding: 12px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--drawer-muted);
  font: 500 14px/1.4 var(--ui);
}

body.interface-refined #withdrawSheet .wc-asset-b.is-on {
  border-bottom-color: var(--drawer-action);
  background: none;
  color: var(--drawer-ink);
}

body.interface-refined #withdrawSheet .wc-field { margin-bottom: 22px; }
body.interface-refined #withdrawSheet #wdAmount { font-family: var(--mono); font-size: 22px; }
body.interface-refined #withdrawSheet #wdTo { font-family: var(--mono); font-size: 13px; }
body.interface-refined #withdrawSheet #wdReview { margin-top: 24px; }

body.interface-refined :is(#withdrawSheet, #rewardReview, #exportSheet) .wc-rev {
  align-items: baseline;
  gap: 24px;
  padding: 18px 0;
  border-color: var(--drawer-line);
  color: var(--drawer-muted);
  font: 400 13px/1.5 var(--ui);
}

body.interface-refined :is(#withdrawSheet, #rewardReview, #exportSheet) .wc-rev > :last-child {
  color: var(--drawer-ink);
  text-align: right;
  overflow-wrap: anywhere;
}

body.interface-refined #rewardReview .wc-rev:first-of-type > :last-child {
  font: 500 22px/1.3 var(--mono);
  letter-spacing: -.04em;
}

body.interface-refined :is(#rewardReviewConfirm, #wdReview, #wdReviewBox .wc-rev-actions, #exportSheet #exGo) {
  width: 100%;
  min-height: 46px;
  margin-top: 28px;
}

body.interface-refined :is(#withdrawSheet, #rewardReview) > .wc-card {
  display: flex;
  flex-direction: column;
}

body.interface-refined :is(#withdrawSheet, #rewardReview) > .wc-card > * { flex-shrink: 0; }
body.interface-refined #withdrawSheet :is(#wdForm, #wdReviewBox) {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
}
body.interface-refined #withdrawSheet :is(#wdReview, .wc-rev-actions),
body.interface-refined #rewardReview #rewardReviewConfirm { margin-top: auto; }
body.interface-refined #rewardReview #rewardReviewNote { margin-bottom: 28px; }

.login-brand, .login-intro, .login-divider, .login-title-code, .login-wallet-note, .login-email-label { display: none; }

/* Account entry is a short, focused dialog; the account tools remain drawers. */
body.interface-refined #loginSheet {
  height: var(--visible-height, 100dvh);
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgb(3 7 13 / 64%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body.interface-refined #loginSheet > .login-card {
  flex: 0 1 420px;
  width: 420px;
  height: auto;
  max-height: calc(var(--visible-height, 100dvh) - 40px);
  padding: 34px 32px 27px;
  border: 1px solid #35404e;
  border-radius: 20px;
  background: #141b24;
  box-shadow: 0 24px 100px rgb(0 0 0 / 38%);
}
body.interface-refined #loginSheet .login-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: transparent;
}
body.interface-refined #loginSheet .login-brand {
  display: flex;
  justify-content: center;
  margin: 0 auto 18px;
  color: #c4d9f4;
}
body.interface-refined #loginSheet .login-brand svg { width: 48px; height: 48px; }
body.interface-refined #loginSheet .login-h {
  margin: 0;
  padding: 0 12px;
  text-align: center;
  font: 550 27px/1.2 var(--ui);
  letter-spacing: -.04em;
}
body.interface-refined #loginSheet .login-intro {
  display: block;
  margin: 9px 0 28px;
  color: #a2b0c0;
  text-align: center;
  font: 400 13px/1.5 var(--ui);
}
body.interface-refined #loginSheet .login-social { grid-template-columns: minmax(0, 1fr); }
body.interface-refined #loginSheet :is(.login-opt, .login-input) {
  height: 50px;
  border: 1px solid #394556;
  border-radius: 10px;
  background: #1b2532;
  color: var(--drawer-ink);
  font: 500 14px/1.4 var(--ui);
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
}

body.interface-refined #loginSheet .login-opt:hover:not(:disabled) {
  border-color: #6d829f;
  background: #273447;
}
body.interface-refined #loginSheet .login-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: #8999ad;
  font: 400 12px/1.5 var(--ui);
}
body.interface-refined #loginSheet .login-divider::before,
body.interface-refined #loginSheet .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #2c3644;
}
body.interface-refined #loginSheet .login-emailform {
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}
body.interface-refined #loginSheet .login-email-label {
  display: block;
  color: #b7c3d2;
  font: 400 12px/1.4 var(--ui);
}
body.interface-refined #loginSheet .login-input { font-weight: 400; background: #101720; }
body.interface-refined #loginSheet .login-input::placeholder { color: #7e8da2; }
body.interface-refined #loginSheet .login-input:focus { border-color: var(--drawer-action); }
body.interface-refined #loginSheet .login-go {
  border-color: var(--drawer-action);
  background: var(--drawer-action);
  color: #13243b;
}
body.interface-refined #loginSheet .login-go:hover:not(:disabled) {
  border-color: #c6dcf7;
  background: #c6dcf7;
  color: #13243b;
}
body.interface-refined #loginSheet .login-codeform { gap: 16px; margin-top: 16px; }
body.interface-refined #loginSheet .login-code-note { text-align: center; overflow-wrap: anywhere; }
body.interface-refined #loginSheet #loginCodeInput {
  height: 62px;
  padding-left: 24px;
  font: 450 24px/1 var(--mono);
  letter-spacing: .4em;
}
body.interface-refined #loginSheet .login-codeform .login-social {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
body.interface-refined #loginSheet :is(#loginResendCode, #loginChangeEmail) {
  height: 44px;
  padding: 0;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #afc7e6;
  font-size: 12px;
}
body.interface-refined #loginSheet :is(#loginResendCode, #loginChangeEmail):hover:not(:disabled) { background: #202b39; }
body.interface-refined #loginSheet .login-foot {
  margin: 16px 0 0;
  padding: 11px 13px;
  border: 1px solid #324155;
  border-radius: 8px;
  background: #1a2635;
  color: #c1cfdf;
  font: 400 12px/1.5 var(--ui);
}
body.interface-refined #loginSheet .login-wallet-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 21px 0 0;
  color: #8999ad;
  font: 400 11px/1.5 var(--ui);
}
body.interface-refined #loginSheet .login-wallet-note svg { width: 15px; height: 15px; flex-shrink: 0; }
body.interface-refined #loginSheet:has(#loginCodeForm:not([hidden])) :is(.login-title-start, .login-intro, .login-entry-social, .login-divider, .login-wallet-note) { display: none; }
body.interface-refined #loginSheet:has(#loginCodeForm:not([hidden])) .login-title-code { display: inline; }

body.interface-refined #onboard .ob-brand { margin-bottom: 10px; }
body.interface-refined #onboard .ob-tag {
  margin: 0 0 32px;
  color: var(--drawer-muted);
  font: 400 15px/1.5 var(--ui);
}
body.interface-refined #onboard .ob-steps { gap: 0; margin: 0; }
body.interface-refined #onboard .ob-steps li {
  gap: 16px;
  padding: 22px 0;
  border-top: 1px solid var(--drawer-line);
}
body.interface-refined #onboard .ob-n {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--drawer-action);
  font: 500 13px/1.4 var(--mono);
}
body.interface-refined #onboard .ob-steps b {
  color: var(--drawer-ink);
  font: 500 15px/1.5 var(--ui);
}
body.interface-refined #onboard .ob-steps div span {
  margin-top: 7px;
  color: var(--drawer-muted);
  font: 400 13px/1.6 var(--ui);
}
body.interface-refined #onboard .ob-risk {
  margin: 0;
  padding: 20px 0;
  border: 0;
  border-top: 1px solid var(--drawer-line);
  background: none;
  color: #c1cbd9;
  font: 400 12px/1.6 var(--ui);
}
body.interface-refined #onboard .ob-details {
  margin: 0;
  border-top: 1px solid var(--drawer-line);
  border-bottom: 1px solid var(--drawer-line);
}
body.interface-refined #onboard .ob-details > summary {
  min-height: 52px;
  padding: 14px 0;
  color: #d0dbe9;
  font: 500 13px/1.5 var(--ui);
}
body.interface-refined #onboard .ob-details p {
  margin: 0 0 18px;
  color: var(--drawer-muted);
  font: 400 13px/1.6 var(--ui);
}
body.interface-refined #onboard .ob-go {
  width: 100%;
  min-height: 46px;
  margin-top: 26px;
  border: 0;
  border-radius: 6px;
  background: var(--drawer-action);
  box-shadow: none;
  color: #13243b;
  font: 500 14px/1.5 var(--ui);
}
body.interface-refined #onboard .ob-fair { margin-top: 18px; color: var(--drawer-muted); font-size: 12px; }

@media (prefers-reduced-motion: no-preference) {
  body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet, #loginSheet, #onboard) > :is(.wc-card, .login-card, .ob-card) {
    animation: refined-panel-reveal 140ms ease-out;
  }
  @keyframes refined-panel-reveal {
    from { opacity: .4; }
    to { opacity: 1; }
  }
}

@media (max-width: 760px) {
  body.interface-refined { --drawer-width: 100%; }
  body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet, #loginSheet, #onboard) {
    align-items: flex-end;
    background: rgb(3 7 13 / 34%);
  }
  body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet, #loginSheet, #onboard) > :is(.wc-card, .login-card, .ob-card) {
    height: var(--visible-height, 100dvh);
    max-height: var(--visible-height, 100dvh);
    padding: max(28px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom));
    border-left: 0;
    border-top: 1px solid var(--drawer-line);
    border-radius: 0;
  }
  body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet, #loginSheet, #onboard) :is(.wc-x, .login-x) {
    top: max(16px, env(safe-area-inset-top));
    right: 13px;
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
  body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet, #loginSheet, #onboard) :is(.wc-head, .login-h, .ob-brand) {
    font-size: 24px;
    margin-bottom: 26px;
  }
  body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet) :is(.wc-act, .wc-switch, .wc-max),
  body.interface-refined #loginSheet .login-opt { min-height: 46px; }
  body.interface-refined .interface-back { min-height: 44px; }
  body.interface-refined :is(#walletCenter, #withdrawSheet, #rewardReview, #exportSheet, #loginSheet) :is(.wc-input, .wc-fp-input, .login-input) { font-size: 16px; }
  body.interface-refined #walletCenter .wc-buckets { column-gap: 18px; }
  body.interface-refined #walletCenter .wc-b-v { font-size: 19px; }
  body.interface-refined #walletCenter .wc-addr { max-width: 66%; }
  body.interface-refined #walletCenter .wc-signer { align-items: baseline; }
  body.interface-refined #onboard .ob-tag { margin-bottom: 26px; font-size: 14px; }
  body.interface-refined #onboard .ob-steps li { padding: 20px 0; }
  body.interface-refined #onboard .ob-steps div span { font-size: 13px; }

  body.interface-refined #loginSheet {
    align-items: flex-end;
    padding: 12px 0 0;
    background: rgb(3 7 13 / 64%);
  }
  body.interface-refined #loginSheet > .login-card {
    flex: 0 1 440px;
    width: 100%;
    height: auto;
    max-height: calc(var(--visible-height, 100dvh) - 12px);
    padding: 27px 24px max(24px, env(safe-area-inset-bottom));
    border: 1px solid #35404e;
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
  }
  body.interface-refined #loginSheet .login-x {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
  body.interface-refined #loginSheet .login-h { margin: 0; padding: 0 12px; font-size: 26px; }
  body.interface-refined #loginSheet .login-brand { margin-bottom: 14px; }
  body.interface-refined #loginSheet .login-intro { margin-bottom: 24px; }
  body.interface-refined #loginSheet .login-input { font-size: 16px; }
}
