:root {
  --wm-blue: #3b82f6;
  --wm-blue-dark: #2563eb;
  --wm-navy: #0b1426;
  --wm-panel: #101d31;
  --wm-line: rgba(148, 163, 184, 0.18);
}

.wallet-app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.wallet-header-brand {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.wallet-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
  max-width: 100%;
}

.wallet-header-slot {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.wallet-header-slot:empty {
  display: none;
}

.wallet-header-actions #walletLogoutBtn,
.wallet-header-actions [data-testid="button-lang-toggle"],
.wallet-header-actions .support-lang,
.wallet-header-actions .wallet-message-top-button {
  position: relative !important;
  inset: auto !important;
  transform: none;
  margin: 0 !important;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.wallet-header-actions button:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 3px;
}

.wallet-message-top-button {
  appearance: none;
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #dbeafe;
  min-height: 32px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font: 700 11px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
}

.wallet-message-top-button:hover,
.wallet-message-top-button:focus-visible {
  background: rgba(59, 130, 246, 0.22);
  outline: none;
}

.wallet-message-top-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wallet-message-top-button.is-floating {
  position: fixed;
  right: 72px;
  top: max(14px, env(safe-area-inset-top));
  z-index: 2147482500;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.wallet-message-top-button.is-futures {
  min-height: 30px;
  padding: 5px 8px;
}

.wallet-message-badge {
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  font: 800 10px/17px system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 0 0 2px #0b1426;
}

.wallet-message-badge[hidden] {
  display: none !important;
}

.wallet-message-overlay,
.wallet-admin-message-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 8, 23, 0.72);
  backdrop-filter: blur(5px);
}

.wallet-message-dialog {
  width: min(460px, 100%);
  max-height: min(720px, calc(100vh - 32px));
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, #122238 0%, #0c1729 100%);
  color: #f8fafc;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wallet-message-dialog-header {
  min-height: 68px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--wm-line);
}

.wallet-message-dialog-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
}

.wallet-message-dialog-header p {
  margin: 4px 0 0;
  color: #94a3b8;
  font-size: 11px;
}

.wallet-message-close,
.wallet-admin-close {
  appearance: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.1);
  color: inherit;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.wallet-message-list {
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallet-message-empty {
  padding: 48px 18px;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  color: #94a3b8;
  text-align: center;
  font-size: 13px;
}

.wallet-message-item {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  background: rgba(15, 29, 49, 0.78);
  padding: 14px;
}

.wallet-message-item.is-unread {
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(37, 99, 235, 0.13);
  box-shadow: inset 3px 0 #3b82f6;
}

.wallet-message-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.wallet-message-item-title {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.wallet-message-item-time {
  margin-top: 3px;
  color: #64748b;
  font-size: 10px;
  white-space: nowrap;
}

.wallet-message-item-body {
  margin-top: 10px;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.wallet-message-read-button,
.wallet-message-alert-confirm {
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--wm-blue), var(--wm-blue-dark));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.wallet-message-read-button {
  margin-top: 12px;
  padding: 8px 12px;
  font-size: 12px;
}

.wallet-message-read-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.wallet-message-alert-card {
  width: min(410px, 100%);
  border: 1px solid rgba(96, 165, 250, 0.42);
  border-radius: 24px;
  background: linear-gradient(160deg, #142743 0%, #0b1729 76%);
  color: #f8fafc;
  padding: 22px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58), 0 0 50px rgba(37, 99, 235, 0.13);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wallet-message-alert-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 800;
}

.wallet-message-alert-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #3b82f6;
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.14);
}

.wallet-message-alert-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.wallet-message-alert-body {
  margin: 14px 0 0;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.wallet-message-alert-time {
  margin-top: 14px;
  color: #64748b;
  font-size: 11px;
}

.wallet-message-alert-confirm {
  width: 100%;
  min-height: 48px;
  margin-top: 20px;
  font-size: 14px;
}

.wallet-message-alert-confirm:disabled,
.wallet-message-read-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.wallet-withdrawal-notice {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  margin-top: 16px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 16px;
  background: #101d30;
  padding: 20px;
  color: #cbd5e1;
  overflow-wrap: anywhere;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wallet-withdrawal-notice-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: #60a5fa;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.wallet-withdrawal-notice-label svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.wallet-withdrawal-notice h4 {
  margin: 0;
  color: #f1f5f9;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 800;
}

.wallet-withdrawal-notice-body {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.8;
  color: #c0cbdc;
}

.wallet-withdrawal-notice-body h5 {
  margin: 24px 0 10px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  color: #f1f5f9;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.65;
}

.wallet-withdrawal-notice-body p {
  margin: 10px 0;
}

.wallet-withdrawal-notice-body a {
  color: #93c5fd;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.wallet-withdrawal-notice-body ul,
.wallet-withdrawal-notice-body ol {
  margin: 10px 0;
  padding: 0 0 0 21px;
  display: grid;
  gap: 8px;
}

.wallet-withdrawal-notice-body ul {
  list-style: disc;
}

.wallet-withdrawal-notice-body ol {
  list-style: decimal;
}

.wallet-withdrawal-notice-body li {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.wallet-withdrawal-notice-body .wallet-notice-footnote {
  padding-left: 12px;
  border-left: 2px solid #42648c;
  color: #a5b4c9;
  font-size: 13px;
}

.wallet-notice-table-scroll {
  overflow-x: auto;
  width: 100%;
  margin: 12px 0 18px;
  border: 1px solid #344359;
  border-radius: 10px;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #526a88 #14243a;
}

.wallet-notice-table-scroll:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 3px;
}

.wallet-notice-table {
  width: 100%;
  min-width: 390px;
  margin: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.wallet-notice-table th,
.wallet-notice-table td {
  padding: 13px 9px;
  border-right: 1px solid #344359;
  border-bottom: 1px solid #344359;
  vertical-align: middle;
  color: #e2e8f0;
  font-weight: 500;
  text-align: center;
}

.wallet-notice-table thead th {
  background: #1c2d44;
  color: #b8c9de;
  font-weight: 600;
}

.wallet-notice-table tbody th {
  background: #16263b;
  color: #b8c9de;
}

.wallet-notice-table tbody td {
  background: #101d30;
  color: #dbeafe;
  font-variant-numeric: tabular-nums;
}

.wallet-notice-table tr > :last-child { border-right: 0; }
.wallet-notice-table tbody tr:last-child > * { border-bottom: 0; }
.wallet-notice-table tbody th[rowspan] { border-bottom: 0; }

.wallet-admin-textarea.wallet-notice-editor {
  min-height: 280px;
  line-height: 1.7;
  font-size: 14px;
}

.wallet-admin-notice-help {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.65;
}

.wallet-admin-notice-preview summary {
  cursor: pointer;
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 0;
}

.wallet-admin-notice-preview .wallet-withdrawal-notice {
  margin-top: 0;
}

.wallet-admin-notice-grid > * {
  min-width: 0;
}

.wallet-admin-message-overlay {
  color: #0f172a;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wallet-admin-message-dialog {
  width: min(1180px, 98vw);
  height: min(850px, 94vh);
  border-radius: 18px;
  background: #f8fafc;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wallet-admin-header {
  padding: 18px 22px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wallet-admin-header h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 850;
}

.wallet-admin-header p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 12px;
}

.wallet-admin-close {
  color: #475569;
  background: #f1f5f9;
}

.wallet-admin-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 18px 0;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.wallet-admin-tab {
  appearance: none;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #64748b;
  padding: 11px 14px 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.wallet-admin-tab.is-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.wallet-admin-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
}

.wallet-admin-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  gap: 18px;
}

.wallet-admin-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.wallet-admin-card h3 {
  margin: 0 0 15px;
  font-size: 15px;
  font-weight: 850;
}

.wallet-admin-field {
  display: grid;
  gap: 7px;
  margin-top: 13px;
}

.wallet-admin-field label {
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.wallet-admin-input,
.wallet-admin-select,
.wallet-admin-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  padding: 10px 12px;
  font: 500 13px/1.5 Inter, system-ui, sans-serif;
  outline: none;
}

.wallet-admin-input:focus,
.wallet-admin-select:focus,
.wallet-admin-textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.wallet-admin-textarea {
  min-height: 150px;
  resize: vertical;
}

.wallet-admin-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.wallet-admin-segment button {
  appearance: none;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  padding: 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.wallet-admin-segment button.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #2563eb;
}

.wallet-admin-primary,
.wallet-admin-secondary {
  appearance: none;
  min-height: 42px;
  border-radius: 10px;
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.wallet-admin-primary {
  border: 0;
  background: #2563eb;
  color: #fff;
}

.wallet-admin-primary:hover {
  background: #1d4ed8;
}

.wallet-admin-secondary {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
}

.wallet-admin-primary:disabled,
.wallet-admin-secondary:disabled {
  opacity: 0.55;
  cursor: default;
}

.wallet-admin-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.wallet-admin-history {
  display: grid;
  gap: 9px;
  max-height: 610px;
  overflow-y: auto;
}

.wallet-admin-history-item {
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  padding: 12px;
  background: #f8fafc;
}

.wallet-admin-history-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.wallet-admin-history-title {
  font-size: 13px;
  font-weight: 850;
}

.wallet-admin-history-meta {
  color: #64748b;
  font-size: 10px;
  white-space: nowrap;
}

.wallet-admin-history-body {
  margin-top: 7px;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.wallet-admin-history-read {
  margin-top: 8px;
  color: #2563eb;
  font-size: 10px;
  font-weight: 750;
}

.wallet-admin-notice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.wallet-admin-notice-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 29px;
  height: 24px;
  margin-right: 6px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 900;
}

.wallet-admin-member-setting {
  margin-top: 18px;
}

.wallet-admin-status {
  display: none;
  margin-bottom: 13px;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
}

.wallet-admin-status.is-visible {
  display: block;
}

.wallet-admin-status.is-success {
  background: #ecfdf5;
  color: #047857;
}

.wallet-admin-status.is-error {
  background: #fef2f2;
  color: #b91c1c;
}

.wallet-admin-nav-button {
  width: 100%;
  border: 0;
  border-right: 2px solid transparent;
  background: transparent;
  color: #4b5563;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font: 500 14px/1.25 Inter, system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
}

.wallet-admin-nav-button:hover,
.wallet-admin-nav-button.is-active {
  color: #3b6bf5;
  background: #eff6ff;
  border-right-color: #3b6bf5;
  font-weight: 700;
}

.wallet-admin-nav-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wallet-admin-detail-action {
  appearance: none;
  height: 36px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  padding: 0 12px;
  font: 800 12px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}

.wallet-admin-detail-action.notice {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.wallet-admin-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2147483600;
  max-width: min(380px, calc(100vw - 36px));
  border-radius: 11px;
  background: #0f172a;
  color: #fff;
  padding: 12px 15px;
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.3);
  font: 700 12px/1.5 Inter, system-ui, sans-serif;
}

@media (max-width: 820px) {
  .wallet-admin-message-overlay {
    padding: 8px;
  }

  .wallet-admin-message-dialog {
    width: 100%;
    height: calc(100vh - 16px);
  }

  .wallet-admin-grid,
  .wallet-admin-notice-grid {
    grid-template-columns: 1fr;
  }

  .wallet-admin-header {
    padding: 15px;
  }

  .wallet-admin-body {
    padding: 13px;
  }

  .wallet-admin-history {
    max-height: none;
  }

  .wallet-admin-detail-action {
    height: 32px;
    padding: 0 9px;
    font-size: 10px;
  }
}

@media (max-width: 520px) {
  .wallet-message-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .wallet-message-dialog {
    width: 100%;
    max-height: 82vh;
    border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .wallet-message-alert-card {
    margin: 14px;
  }

  .wallet-message-top-button {
    padding: 6px 8px;
  }

  .wallet-message-top-button.is-futures .wallet-message-label {
    display: none;
  }
}

@media (max-width: 420px) {
  .wallet-app-header { gap: 8px; }
  .wallet-app-header .wallet-header-brand { gap: 7px; font-size: 16px; }
  .wallet-header-brand > span { font-size: 16px; }
  .wallet-header-brand > div:first-child { width: 30px; height: 30px; border-radius: 10px; }
  .wallet-header-actions { gap: 5px; }
  .wallet-header-actions .wallet-message-label { display: none; }
  .wallet-header-actions #walletLogoutBtn,
  .wallet-header-actions [data-testid="button-lang-toggle"],
  .wallet-header-actions .support-lang,
  .wallet-header-actions .wallet-message-top-button { padding: 7px 9px; }
  .wallet-withdrawal-notice { padding: 16px; }
}
