/* Presentation only. Original platform markup, actions and data remain intact.
   ID scope wins over the legacy styles injected after DOMContentLoaded. */
body.bh-surface #platformModal {
  --dialog-text: #eee8dc;
  --dialog-muted: #bcb6a9;
  --dialog-gold: #e5c88e;
  --dialog-line: #87724d70;
  --dialog-field: #222529;
  color-scheme: dark;
  color: var(--dialog-text);
  background: #090b10b8;
  backdrop-filter: blur(5px);
  padding: 24px;
}
body.bh-surface #platformModal .platform-box {
  box-sizing: border-box;
  min-width: 0;
  width: min(940px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  border: 1px solid #aa8c5c80;
  border-radius: 20px;
  color: var(--dialog-text);
  background: radial-gradient(ellipse at 0 0, #9c7a3421, transparent 55%), #292c30;
  box-shadow: 0 30px 90px #0009, inset 0 1px 0 #f8dfa41a;
  scrollbar-width: thin;
  scrollbar-color: #8c7856 #24262a;
}
body.bh-surface #platformModal .platform-box {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.bh-surface #platformModal .platform-head {
  flex: 0 0 auto;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--dialog-line);
  color: var(--dialog-gold);
  background: #303135;
}
body.bh-surface #platformModal .platform-head > strong {
  min-width: 0;
  font-size: 18px;
  letter-spacing: .03em;
  color: var(--dialog-gold);
}
body.bh-surface #platformModal .platform-close {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--dialog-line);
  border-radius: 10px;
  background: #24272b;
  color: var(--dialog-gold);
  font-size: 24px;
  line-height: 1;
}
body.bh-surface #platformModal .platform-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
  padding: 16px 24px;
  overflow: visible;
  border-bottom: 1px solid var(--dialog-line);
  background: #25282c;
}
body.bh-surface #platformModal .platform-tab {
  min-width: 0;
  min-height: 44px;
  padding: 8px 4px;
  border: 1px solid #71624780;
  border-radius: 8px;
  background: #303236;
  color: #d2cabb;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
body.bh-surface #platformModal .platform-tab.active {
  color: #282217;
  border-color: #ebd1a0;
  background: linear-gradient(120deg, #eddbb0, #c8a368);
  box-shadow: inset 0 1px 0 #fff3d54d;
  font-weight: 700;
}
body.bh-surface #platformModal .platform-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 24px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #8c7856 #24262a;
}
body.bh-surface #platformModal .platform-panel {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--dialog-text);
}
body.bh-surface #platformModal :is(h4, .platform-row strong, .platform-message b) {
  color: var(--dialog-text);
}
body.bh-surface #platformModal h4 { margin: 0 0 14px; font-size: 16px; }
body.bh-surface #platformModal .platform-summary {
  gap: 12px;
  margin: 0 0 16px;
}
body.bh-surface #platformModal .platform-card {
  min-width: 0;
  padding: 20px 18px;
  border-color: var(--dialog-line);
  border-radius: 12px;
  color: #d1c8b8;
  background: linear-gradient(135deg, #373733, #2b2e32);
  font-size: 13px;
}
body.bh-surface #platformModal .platform-card b {
  margin-top: 9px;
  font-size: clamp(20px, 2.4vw, 28px);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  color: var(--dialog-gold);
  overflow-wrap: anywhere;
}
body.bh-surface #platformModal #walletSummary .platform-card:first-child {
  border-color: #c6a56e;
  background: radial-gradient(ellipse at 0 0, #bb965133, transparent 90%), #323231;
}
body.bh-surface #platformModal .platform-row {
  min-width: 0;
  flex-wrap: wrap;
  align-items: flex-start;
  border-color: var(--dialog-line);
  background: #24272b80;
  padding: 16px;
  color: var(--dialog-text);
}
body.bh-surface #platformModal .platform-row > :last-child {
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
  white-space: normal;
  overflow-wrap: anywhere;
}
body.bh-surface #platformModal .platform-hint,
body.bh-surface #platformModal :is(.platform-card small, .platform-row small, .platform-method small, .platform-message-content) {
  color: var(--dialog-muted);
  line-height: 1.75;
}
body.bh-surface #platformModal .platform-form label { color: #d6cdbb; }
body.bh-surface #platformModal .platform-form :is(input, select) {
  min-width: 0;
  min-height: 44px;
  border: 1px solid #8c795880;
  background: var(--dialog-field);
  color: var(--dialog-text);
  font: inherit;
  box-shadow: inset 0 1px 3px #0002;
}
body.bh-surface #platformModal .platform-form option { background: #222529; color: #eee8dc; }
body.bh-surface #platformModal .platform-form input::placeholder { color: #aaa598; opacity: 1; }
body.bh-surface #platformModal .platform-form :is(input, select):disabled { opacity: .55; cursor: not-allowed; }
body.bh-surface #platformModal a { color: var(--dialog-gold); }
body.bh-surface #platformModal .platform-submit {
  min-height: 44px;
  border: 1px solid #e2c58a;
  color: #292217;
  background: linear-gradient(120deg, #e8d2a2, #c6a266);
  font-weight: 700;
  box-shadow: inset 0 1px 0 #fff2d63d;
}
body.bh-surface #platformModal :is(.platform-correction-button, .platform-order-check, .platform-message-read, .platform-recipient-mode) {
  border: 1px solid #ad915c80;
  border-radius: 8px;
  color: var(--dialog-gold);
  background: #443a2980;
  min-height: 36px;
}
body.bh-surface #platformModal .platform-correction-button { margin-top: 22px; padding: 10px 20px; font-size: 13px; }
body.bh-surface #platformModal :is(button:disabled, .platform-method.unavailable) { opacity: .48; cursor: not-allowed; }
body.bh-surface #platformModal .platform-method {
  min-width: 0;
  overflow-wrap: anywhere;
  background: #272a2f;
  border-color: #71624780;
  color: var(--dialog-text);
}
body.bh-surface #platformModal :is(.platform-method.active, .platform-recipient-mode.active) {
  border-color: #e2c58a;
  color: var(--dialog-gold);
  background: #b5934b24;
  box-shadow: 0 0 0 1px #e2c58a33;
}
body.bh-surface #platformModal .platform-message { background: #272a2f; border-color: var(--dialog-line); }
body.bh-surface #platformModal .platform-message.unread { background: #ad874015; border-color: #c4a36a; }
body.bh-surface #platformModal .platform-message-head { flex-wrap: wrap; }
body.bh-surface #platformModal .platform-vip { background: linear-gradient(135deg, #4a402d, #303033); border-color: #b99a65; color: #f1dfb8; }
body.bh-surface #platformModal .platform-rebate-note { background: #a9802526; color: #ecd39d; border: 1px solid #a1875366; }
body.bh-surface #platformModal .platform-vip small[style*="background:#fff7dd"] { background: #282923 !important; color: #f1d495 !important; }
body.bh-surface #platformModal .platform-progress { background: #191d2280; }
body.bh-surface #platformModal .platform-progress > span { background: linear-gradient(90deg, #b89559, #f0d7a0); }
body.bh-surface #platformModal .platform-positive,
body.bh-surface #platformModal .platform-card b.platform-positive { color: #8bd5af; }
body.bh-surface #platformModal .platform-negative,
body.bh-surface #platformModal .platform-card b.platform-negative { color: #ffa8a0; }
body.bh-surface #platformModal #withdrawEligibility b[style*="color:#16a34a"] { color: #8bd5af !important; }
body.bh-surface #platformModal #withdrawEligibility b[style*="color:#dc2626"] { color: #ffa8a0 !important; }
body.bh-surface #platformModal :is(button, a, input, select):focus-visible {
  outline: 2px solid #efcf8c;
  outline-offset: 3px;
}
@media (hover: hover) {
  body.bh-surface #platformModal .platform-tab:not(.active):hover { border-color: #d6b57a; background: #403b32; color: #f0d8a6; }
  body.bh-surface #platformModal .platform-close:hover { background: #514330; }
  body.bh-surface #platformModal :is(.platform-correction-button, .platform-order-check, .platform-message-read):not(:disabled):hover { border-color: #ddc087; background: #64503370; }
}
@media (max-width: 760px) {
  body.bh-surface #platformModal .platform-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  body.bh-surface #platformModal .platform-tab { min-height: 36px; font-size: 13px; }
}
@media (max-width: 520px) {
  body.bh-surface #platformModal { align-items: flex-end; padding: 0; }
  body.bh-surface #platformModal .platform-box {
    width: 100%;
    max-height: calc(100vh - max(12px, env(safe-area-inset-top)));
    max-height: calc(100dvh - max(12px, env(safe-area-inset-top)));
    border-radius: 18px 18px 0 0;
  }
  body.bh-surface #platformModal .platform-head { padding: 14px 16px; }
  body.bh-surface #platformModal .platform-tabs { padding: 12px; }
  body.bh-surface #platformModal .platform-body { padding: 16px 14px calc(20px + env(safe-area-inset-bottom)); }
  body.bh-surface #platformModal .platform-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.bh-surface #platformModal #walletSummary .platform-card:first-child { grid-column: 1 / -1; }
  body.bh-surface #platformModal #walletSummary .platform-card:first-child b { font-size: 32px; }
  body.bh-surface #platformModal .platform-card { padding: 15px; }
  body.bh-surface #platformModal .platform-row { padding: 14px; }
  body.bh-surface #platformModal .platform-form :is(input, select) { font-size: 16px; }
}

/* The original account panels can also live directly inside the member page. */
.bh-account-content { padding: 24px; min-width: 0; }
.bh-account-section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid #9b83594d; }
.bh-account-section-heading h2 { margin: 0; color: #ecd3a0; font-size: 23px; }
.bh-inline-wallet-actions { display: flex; gap: 10px; }
.bh-inline-wallet-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 18px; }
.bh-inline-wallet-actions svg { width: 18px; height: 18px; }
#bh-account-panel { min-width: 0; }
body.bh-surface #platformModal.bh-account-inline {
  position: static;
  inset: auto;
  z-index: auto;
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  backdrop-filter: none;
}
body.bh-surface #platformModal.bh-account-inline > .platform-box {
  display: block;
  width: 100%;
  max-height: none;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
body.bh-surface #platformModal.bh-account-inline > .platform-box > :is(.platform-head, .platform-tabs) { display: none; }
body.bh-surface #platformModal.bh-account-inline .platform-body { overflow: visible; padding: 0; }
body.bh-surface #platformModal.bh-account-inline .platform-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.bh-surface #platformModal.bh-account-inline #walletSummary .platform-card:first-child { grid-column: 1 / -1; }
body.bh-surface #platformModal.bh-account-inline .platform-panel > h4 { margin-top: 20px; }
body.bh-surface #platformModal.bh-account-inline .platform-panel > h4:first-child { margin-top: 0; }
@media (max-width: 600px) {
  .bh-account-content { padding: 18px 14px; }
  .bh-account-section-heading { gap: 12px; margin-bottom: 18px; padding-bottom: 16px; }
  .bh-account-section-heading h2 { font-size: 21px; }
  .bh-inline-wallet-actions button { padding: 8px 13px; }
}
