/* ═══════════════════════════════════════════════════════
   Member portal — responsive (mobile-first fixes)
   ═══════════════════════════════════════════════════════ */

/* ── Global containment ── */
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body.member-app {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

body.member-app .main {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body.member-app .content {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body.member-app .panel,
body.member-app .pf-section,
body.member-app .wd-form-card {
  max-width: 100%;
  min-width: 0;
}

body.member-app img {
  max-width: 100%;
  height: auto;
}

.member-bottom-nav {
  display: none;
}

/* ── Mobile menu ── */
.tb-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #e4ad3f;
  background: linear-gradient(180deg, #ffdc78, #dca03a);
  color: #071424;
  box-shadow: 0 4px 12px rgba(126, 80, 8, 0.2);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.tb-menu-btn i {
  color: #071424 !important;
}

.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 22, 38, 0.55);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.sb-overlay.is-open {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

body.member-app.sb-open,
body.member-app.ord-open {
  overflow: hidden;
  width: 100%;
}

body.member-app.sb-open {
  position: fixed;
}

.ord-filter .n {
  opacity: 0.85;
  margin-left: 3px;
  font-size: 10px;
}

/* ── Table scroll ── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  max-width: 100%;
  min-width: 0;
}

.table-scroll .data-table,
.table-scroll .comm-table {
  min-width: 480px;
}

/* ── Overview ── */
.ov-welcome {
  background: linear-gradient(120deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
  border-radius: 14px;
  padding: 20px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.ov-welcome-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 55% 50%, rgba(240, 185, 66, 0.08) 0%, transparent 65%);
  pointer-events: none;
}

.ov-welcome-inner {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1;
}

.ov-welcome h2 {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.35;
  word-break: break-word;
}

.ov-welcome p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 300;
}

.ov-welcome-btn {
  background: linear-gradient(90deg, #f0b942, #e09020);
  color: #1a0a00;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Prompt', sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.ov-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.ov-page {
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.ov-layout {
  min-width: 0;
}

.ov-layout > div {
  min-width: 0;
  max-width: 100%;
}

.ov-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

/* เมนูด่วน — ไอคอน FA */
.ov-quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  text-decoration: none;
  min-width: 0;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.ov-quick-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.ov-quick-link:active {
  transform: translateY(0);
  box-shadow: none;
}

.ov-quick-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.14);
}

.ov-quick-icon i {
  font-size: 17px;
  line-height: 1;
  display: block;
  width: 1em;
  text-align: center;
}

.ov-quick-label {
  display: block;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.35;
  max-width: 100%;
  word-break: break-word;
}

.ov-quick-link--purple {
  background: linear-gradient(180deg, #faf8ff 0%, #f5f3ff 100%);
  border-color: #e9e5ff;
}

.ov-quick-link--purple .ov-quick-icon {
  background: linear-gradient(145deg, #a78bfa, #7c3aed);
}

.ov-quick-link--blue {
  background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
  border-color: #dbeafe;
}

.ov-quick-link--blue .ov-quick-icon {
  background: linear-gradient(145deg, #60a5fa, #2563eb);
}

.ov-quick-link--amber {
  background: linear-gradient(180deg, #fffdf7 0%, #fffbeb 100%);
  border-color: #fde68a;
}

.ov-quick-link--amber .ov-quick-icon {
  background: linear-gradient(145deg, #fbbf24, #d97706);
}

.ov-quick-link--green {
  background: linear-gradient(180deg, #f7fef9 0%, #f0fdf4 100%);
  border-color: #bbf7d0;
}

.ov-quick-link--green .ov-quick-icon {
  background: linear-gradient(145deg, #34d399, #059669);
}

.ov-quick-link--pink {
  background: linear-gradient(180deg, #fefaff 0%, #fdf4ff 100%);
  border-color: #f5d0fe;
}

.ov-quick-link--pink .ov-quick-icon {
  background: linear-gradient(145deg, #e879f9, #a21caf);
}

.ov-quick-link--slate {
  background: linear-gradient(180deg, #fafbfc 0%, #f8fafc 100%);
  border-color: #e2e8f0;
}

.ov-quick-link--slate .ov-quick-icon {
  background: linear-gradient(145deg, #94a3b8, #475569);
}

/* โปรไฟล์ย่อ — ภาพรวม */
.ov-prof-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.ov-prof-text {
  flex: 1;
  min-width: 0;
}

.ov-prof-name {
  font-weight: 500;
  font-size: 14px;
  word-break: break-word;
}

.ov-prof-email {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.ov-prof-code {
  font-size: 11px;
  color: var(--primary);
  margin-top: 2px;
  word-break: break-all;
}

.ov-prof-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  min-width: 0;
}

.ov-prof-row i {
  color: var(--muted);
  width: 14px;
  text-align: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.ov-prof-lbl {
  color: var(--muted);
  flex-shrink: 0;
}

.ov-prof-val {
  flex: 1;
  min-width: 0;
  text-align: right;
  word-break: break-word;
}

.mb-grid-sidebar,
.mb-grid-sidebar--sm {
  display: grid;
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.mb-grid-sidebar {
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
}

.mb-grid-sidebar--sm {
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
}

/* Stat cards — แถวเดียวบนมือถือ (เลื่อนซ้าย-ขวา) */
@media (max-width: 767px) {
  body.member-app {
    padding-bottom: calc(66px + env(safe-area-inset-bottom));
    background: #f4f6fb;
  }

  body.member-app .main {
    min-height: calc(100dvh - 66px);
  }

  body.member-app .topbar {
    height: 56px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
  }

  body.member-app .tb-menu-btn {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: #f1f4f8;
    box-shadow: none;
  }

  body.member-app .tb-menu-btn i {
    color: #0f2744 !important;
  }

  body.member-app .content {
    padding: 12px 10px 18px;
  }

  body.member-app .stats-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 0 0 12px;
    padding: 0;
    overflow: visible;
    scroll-snap-type: none;
  }

  body.member-app .stat-card {
    width: auto;
    min-width: 0;
    min-height: 92px;
    padding: 12px 10px;
    gap: 9px;
    border-radius: 12px;
    scroll-snap-align: none;
  }

  body.member-app .stat-card .sc-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 14px;
  }

  body.member-app .sc-value {
    font-size: 17px;
  }

  body.member-app .panel-head {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  body.member-app .panel-head .panel-action {
    flex: 0 0 auto;
    align-self: center;
  }

  body.member-app .ov-welcome {
    padding: 14px;
    border-radius: 13px;
  }

  body.member-app .ov-welcome h2 {
    font-size: 16px;
  }

  body.member-app .member-bottom-nav {
    position: fixed;
    z-index: 1000;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: 62px;
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
    border-top: 1px solid #e2e7ee;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -5px 20px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  body.member-app .member-bottom-nav a {
    display: flex;
    min-width: 0;
    min-height: 49px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 9px;
    color: #758195;
    font-size: 9.5px;
    line-height: 1.1;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  body.member-app .member-bottom-nav a i {
    font-size: 19px;
  }

  body.member-app .member-bottom-nav a.is-active {
    color: #d49322;
  }

  body.member-app .member-bottom-nav a:active {
    background: #fff7e5;
    transform: scale(0.96);
  }

  body.member-app .stats-row,
  body.member-app .wlt-summary,
  body.member-app .comm-summary,
  body.member-app .ref-summary {
    display: flex !important;
    flex-wrap: nowrap !important;
    grid-template-columns: unset !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    gap: 10px !important;
    margin-bottom: 14px;
    padding-bottom: 6px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  body.member-app .stats-row::-webkit-scrollbar,
  body.member-app .wlt-summary::-webkit-scrollbar,
  body.member-app .comm-summary::-webkit-scrollbar,
  body.member-app .ref-summary::-webkit-scrollbar {
    display: none;
  }

  body.member-app .stat-card,
  body.member-app .wlt-sum-card,
  body.member-app .comm-sum-card,
  body.member-app .ref-sum {
    flex: 0 0 auto;
    min-width: 128px;
    max-width: 148px;
    scroll-snap-align: start;
  }

  body.member-app .stat-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
    gap: 8px;
  }

  body.member-app .stat-card .sc-icon {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  body.member-app .sc-value {
    font-size: 16px;
    word-break: break-all;
  }

  body.member-app .sc-label {
    font-size: 10px;
    line-height: 1.3;
  }

  body.member-app .sc-value {
    font-size: 16px;
    line-height: 1.2;
  }

  body.member-app .sc-sub {
    font-size: 9px;
  }

  body.member-app .wlt-sum-card,
  body.member-app .comm-sum-card {
    padding: 12px 14px;
  }

  body.member-app .wlt-sum-icon,
  body.member-app .comm-sum-icon,
  body.member-app .ref-sum-ic {
    width: 34px;
    height: 34px;
    font-size: 14px;
    margin-bottom: 8px;
  }

  body.member-app .wlt-sum-val,
  body.member-app .comm-sum-val,
  body.member-app .ref-sum-val {
    font-size: 16px;
  }

  body.member-app .wlt-sum-lbl,
  body.member-app .comm-sum-lbl,
  body.member-app .ref-sum-lbl {
    font-size: 10px;
    line-height: 1.3;
  }
}

body.member-app .stats-row {
  min-width: 0;
  max-width: 100%;
}

body.member-app .stat-card {
  min-width: 0;
}

body.member-app .tx-list {
  min-width: 0;
  max-width: 100%;
}

/* ── Tablet ── */
@media (max-width: 1199px) {
  body.member-app .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ov-layout {
    grid-template-columns: 1fr 260px;
  }
}

/* ── Mobile layout (sidebar drawer) ── */
@media (max-width: 1023px) {
  body.member-app {
    display: block;
  }

  .tb-menu-btn {
    display: inline-flex;
  }

  body.member-app .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    width: min(280px, 85vw);
    z-index: 110;
    box-shadow: none;
  }

  body.member-app .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.28);
  }

  body.member-app .main {
    margin-left: 0 !important;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
  }

  body.member-app .topbar {
    padding: 0 12px;
    height: 52px;
    gap: 8px;
  }

  body.member-app .topbar-left {
    gap: 10px;
    min-width: 0;
    flex: 1;
  }

  body.member-app .topbar-right {
    gap: 8px;
    flex-shrink: 0;
  }

  body.member-app .content {
    padding: 14px 12px 24px;
  }

  .ov-layout,
  .mb-grid-sidebar,
  .mb-grid-sidebar--sm {
    grid-template-columns: 1fr;
  }

  body.member-app .profile-page {
    grid-template-columns: 1fr;
  }

  body.member-app .pf-grid {
    grid-template-columns: 1fr;
  }

  body.member-app .panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 14px;
  }

  body.member-app .panel-head .panel-action {
    align-self: flex-start;
  }

  body.member-app .panel-title {
    font-size: 13px;
  }

  body.member-app .tb-notif-dropdown {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 58px;
    width: auto;
    max-width: none;
  }
}

/* ── Phone ── */
@media (max-width: 767px) {
  body.member-app .content {
    padding: 12px 10px 20px;
  }

  body.member-app .panel {
    border-radius: 12px;
    margin-bottom: 12px;
  }

  body.member-app .panel-body {
    padding: 12px;
  }

  body.member-app .topbar-title {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
  }

  body.member-app .tb-user span {
    display: none;
  }

  body.member-app .tb-user {
    padding: 4px;
    border-radius: 50%;
  }

  .ov-page,
  .ov-layout,
  .ov-layout > div {
    max-width: 100%;
    min-width: 0;
  }

  .ov-welcome {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 14px;
    max-width: 100%;
  }

  .ov-welcome h2 {
    word-break: break-word;
  }

  .ov-welcome-btn {
    width: 100%;
    text-align: center;
  }

  /* เมนูด่วน — บรรทัดละ 3 เมนู (2 แถว) */
  .ov-quick-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    overflow: visible !important;
    max-width: 100%;
    min-width: 0;
  }

  .ov-quick-link {
    min-width: 0;
    max-width: none;
    width: 100%;
    padding: 10px 4px 8px;
    gap: 6px;
  }

  .ov-quick-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  }

  .ov-quick-icon i {
    font-size: 15px;
  }

  .ov-quick-label {
    font-size: 9.5px;
    line-height: 1.25;
  }

  body.member-app .wallet-card {
    padding: 16px 14px;
    border-radius: 12px;
    max-width: 100%;
    overflow: hidden;
  }

  body.member-app .wc-amount {
    font-size: 22px;
    word-break: break-all;
    line-height: 1.2;
  }

  /* รายการล่าสุด — ไม่ล้นจอ */
  body.member-app .tx-item {
    min-width: 0;
    max-width: 100%;
    padding: 12px 14px;
    align-items: flex-start;
  }

  body.member-app .tx-info {
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }

  body.member-app .tx-name {
    white-space: normal;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  body.member-app .tx-amount {
    flex-shrink: 0;
    font-size: 13px;
    max-width: 42%;
    text-align: right;
    word-break: break-all;
    white-space: normal;
  }

  body.member-app .wc-actions {
    flex-wrap: wrap;
  }

  body.member-app .wc-btn {
    min-width: 0;
    flex: 1 1 120px;
  }

  body.member-app .table-scroll {
    max-width: 100%;
    margin: 0;
  }

  body.member-app .comm-table {
    min-width: 360px;
    font-size: 11px;
  }

  body.member-app .comm-table th,
  body.member-app .comm-table td {
    padding: 8px 10px;
  }

  body.member-app .panel-title {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.member-app .panel-action {
    flex-shrink: 0;
    white-space: nowrap;
  }

  body.member-app .wc-actions {
    flex-direction: column;
    gap: 8px;
  }

  .comm-hero,
  .wlt-hero,
  .wd-hero,
  .ref-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    gap: 12px;
    margin-bottom: 14px;
  }

  .comm-hero-amount,
  .wlt-hero-amount,
  .ref-banner-val {
    font-size: 22px !important;
  }

  .ref-banner-stats {
    width: 100%;
    justify-content: stretch;
  }

  .ref-bstat {
    flex: 1;
    min-width: 0;
  }

  .ref-share-row {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .ref-code-card {
    min-width: 0 !important;
    width: 100%;
    padding: 16px;
  }

  .ref-url-input-row {
    flex-direction: column;
  }

  .ref-btn-copy,
  .ref-btn-share {
    width: 100%;
    justify-content: center;
  }

  .wlt-hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .wlt-action-btn {
    min-width: 0;
    justify-content: center;
    padding: 10px 8px;
    font-size: 11px;
  }

  .ac-grid {
    grid-template-columns: 1fr !important;
  }

  .pay-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .pay-overlay.open .pay-modal {
    transform: translateY(0);
  }

  .pay-modal {
    width: 100%;
    max-width: 100%;
    max-height: 90dvh;
    border-radius: 14px 14px 0 0;
  }

  .pay-body {
    padding: 14px 16px 20px;
  }

  .wd-form-card {
    padding: 18px 14px;
  }

  body.member-app .pf-section {
    padding: 16px 14px;
  }

  body.member-app .pf-addr-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  body.member-app .pf-addr-form-actions {
    flex-direction: column;
  }

  body.member-app .pf-btn,
  body.member-app .pf-btn-outline {
    width: 100%;
    justify-content: center;
  }

  body.member-app .tx-item,
  .cm-item,
  .tx2-item,
  .wd-hist-item {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
  }

  body.member-app .tx-amount,
  .cm-right,
  .tx2-right,
  .wd-hist-right {
    width: 100%;
    text-align: left;
  }

  .how-row {
    flex-direction: column;
    gap: 16px;
  }

  .how-step:not(:last-child)::after {
    display: none;
  }
}

@media (max-width: 480px) {
  body.member-app .stat-card,
  body.member-app .wlt-sum-card,
  body.member-app .comm-sum-card,
  body.member-app .ref-sum {
    min-width: 118px;
    max-width: 132px;
  }

  body.member-app .sb-logo img {
    height: 36px !important;
  }
}

/* ══ Orders page (member) ══ */
.ord-filters-scroll {
  margin: 0 -4px 12px;
  padding: 0 4px 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ord-filters-scroll::-webkit-scrollbar {
  display: none;
}

.ord-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  width: max-content;
  min-width: 100%;
  padding-bottom: 2px;
}

.ord-filter {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  font-family: 'Prompt', sans-serif;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.ord-filter.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.ord-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.ord-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  min-width: 0;
}

.ord-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: #fafbff;
  border-bottom: 1px solid #f1f5f9;
}

.ord-card-top-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.ord-card-id {
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  word-break: break-all;
}

.ord-card-date {
  font-size: 10px;
  color: var(--muted);
}

.ord-card-top .badge {
  flex-shrink: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ord-card-main {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  align-items: flex-start;
  min-width: 0;
}

.ord-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #f0f4ff;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ord-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ord-info {
  flex: 1;
  min-width: 0;
}

.ord-name {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.ord-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.ord-progress-wrap {
  padding: 0 12px 10px;
  min-width: 0;
}

.ord-progress {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
}

.ord-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--blue));
  border-radius: 2px;
}

.ord-progress-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

.ord-progress-meta span:first-child {
  color: var(--text);
  font-weight: 400;
  line-height: 1.35;
}

.ord-track {
  color: var(--blue);
  font-size: 11px;
  word-break: break-all;
  max-width: 100%;
}

.ord-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
}

.ord-total {
  font-size: 12px;
  color: var(--muted);
}

.ord-total strong {
  font-size: 14px;
  color: var(--primary);
}

.ord-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

@media (min-width: 400px) {
  .ord-card-actions {
    width: auto;
    margin-left: auto;
  }
}

.ord-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #e9d5ff;
  background: #faf5ff;
  color: var(--primary);
  font-size: 12px;
  font-family: 'Prompt', sans-serif;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.ord-panel-meta {
  font-size: 11px;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.4;
}

/* Order modal */
.ord-ov {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(8, 22, 38, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.ord-ov.is-open {
  opacity: 1;
  pointer-events: all;
}

.ord-modal {
  background: #fff;
  width: 100%;
  max-width: 500px;
  max-height: 92dvh;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -8px 40px rgba(13, 18, 52, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.28s ease;
}

.ord-ov.is-open .ord-modal {
  transform: translateY(0);
}

@media (min-width: 640px) {
  .ord-ov {
    align-items: center;
    padding: 16px;
  }

  .ord-modal {
    border-radius: 12px;
    max-height: min(88vh, 640px);
    transform: translateY(12px);
  }

  .ord-ov.is-open .ord-modal {
    transform: translateY(0);
  }
}

.ord-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.ord-modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  word-break: break-all;
}

.ord-modal-body {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.ord-steps {
  display: none;
}

.ord-steps-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  margin-bottom: 8px;
  scrollbar-width: none;
}

.ord-steps-scroll::-webkit-scrollbar {
  display: none;
}

.ord-step {
  flex: 0 0 auto;
  min-width: 56px;
  text-align: center;
  font-size: 9px;
  color: #94a3b8;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f8fafc;
}

.ord-step.done {
  background: #ede9fe;
  color: var(--primary);
}

.ord-step.current {
  background: var(--primary);
  color: #fff;
}

.ord-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
}

.ord-item .pr {
  white-space: nowrap;
}

@media (max-width: 380px) {
  .ord-item {
    grid-template-columns: 40px 1fr;
  }

  .ord-item .pr {
    grid-column: 2;
    text-align: left;
  }
}

/* ══ Minimal finance and order theme ══ */
body.member-app .wlt-hero,
body.member-app .comm-hero {
  background: #0f2744;
  border: 1px solid #183b61;
  box-shadow: none;
}

body.member-app .comm-hero {
  background: #eab445 url('../banner-free-shipping.png') center / cover no-repeat;
  border-color: #e2aa35;
}

body.member-app .wlt-hero {
  background: #eab445 url('../banner-free-shipping.png') center / cover no-repeat;
  border-color: #e2aa35;
}

body.member-app .wlt-hero-label,
body.member-app .wlt-hero-amount,
body.member-app .wlt-hero-amount span,
body.member-app .wlt-hero-sub {
  color: #0f2744;
}

body.member-app .wlt-action-btn,
body.member-app .wlt-action-btn.gold {
  border-color: rgba(15, 39, 68, 0.16);
  background: rgba(255, 255, 255, 0.58);
  color: #0f2744;
}

body.member-app .wlt-action-btn:hover,
body.member-app .wlt-action-btn.gold:hover {
  border-color: rgba(15, 39, 68, 0.24);
  background: rgba(255, 255, 255, 0.76);
}

body.member-app .comm-hero-label,
body.member-app .comm-hero-amount,
body.member-app .comm-hero-amount span,
body.member-app .comm-hero-sub {
  color: #0f2744;
}

body.member-app .wlt-hero::before,
body.member-app .wlt-hero::after,
body.member-app .comm-hero::before,
body.member-app .comm-hero::after {
  display: none;
}

body.member-app .wlt-sum-card,
body.member-app .comm-sum-card {
  border-radius: 10px;
  box-shadow: none;
}

body.member-app .wlt-sum-icon,
body.member-app .comm-sum-icon {
  background: #f1f4f7 !important;
  color: #0f2744 !important;
  border: 1px solid #e3e8ee;
  border-radius: 9px;
}

body.member-app .wlt-filter-btn.active,
body.member-app .comm-filter-btn.active,
body.member-app .ord-filter.active {
  background: #0f2744;
  border-color: #0f2744;
  color: #fff;
}

body.member-app .tx2-icon,
body.member-app .cm-icon {
  background: #f3f5f7;
  color: #40546a;
  border: 1px solid #e6eaef;
  border-radius: 9px;
}

body.member-app .cm-amount,
body.member-app .ord-card-id,
body.member-app .ord-total strong {
  color: #0f2744;
}

body.member-app .ord-progress-fill {
  background: #d9a438;
}

body.member-app .ord-btn {
  border-color: #d9e0e7;
  background: #fff;
  color: #0f2744;
}

body.member-app .ord-step.done {
  background: #eef2f5;
  color: #0f2744;
}

body.member-app .ord-step.current {
  background: #0f2744;
  color: #fff;
}

@media (max-width: 767px) {
  body.member-app .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.member-app .wlt-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.member-app .comm-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.member-app .stat-card,
  body.member-app .wlt-sum-card,
  body.member-app .comm-sum-card {
    width: 100%;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
  }

  body.member-app .wlt-hero,
  body.member-app .comm-hero {
    min-height: 126px;
    margin-bottom: 12px;
    padding: 16px;
    border-radius: 12px;
  }

  body.member-app .wlt-hero-amount,
  body.member-app .comm-hero-amount {
    font-size: 25px;
  }

  body.member-app .wlt-hero-actions {
    width: auto;
    grid-template-columns: auto auto;
  }

  body.member-app .wlt-action-btn {
    min-height: 38px;
    padding: 8px 10px;
  }

  body.member-app .wlt-summary,
  body.member-app .comm-summary {
    display: grid;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    overflow: visible;
  }

  body.member-app .wlt-sum-card,
  body.member-app .comm-sum-card {
    width: auto;
    min-width: 0;
    max-width: none;
    min-height: 104px;
    padding: 10px;
  }

  body.member-app .wlt-summary .wlt-sum-card:last-child {
    grid-column: auto;
    min-height: 104px;
    display: block;
  }

  body.member-app .wlt-summary .wlt-sum-card:last-child .wlt-sum-icon {
    margin-bottom: 8px;
  }

  body.member-app .wlt-sum-icon,
  body.member-app .comm-sum-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
    font-size: 13px;
  }

  body.member-app .wlt-sum-val,
  body.member-app .comm-sum-val {
    max-width: 100%;
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.member-app .wlt-filter,
  body.member-app .comm-filter {
    display: flex;
    width: 100%;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body.member-app .wlt-filter-btn,
  body.member-app .comm-filter-btn {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 7px 12px;
  }

  body.member-app .tx2-item,
  body.member-app .cm-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
    align-items: center;
  }

  body.member-app .tx2-icon,
  body.member-app .cm-icon {
    width: 38px;
    height: 38px;
  }

  body.member-app .tx2-name,
  body.member-app .cm-name {
    overflow: hidden;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.member-app .tx2-date,
  body.member-app .cm-date {
    font-size: 10px;
  }

  body.member-app .tx2-right,
  body.member-app .cm-right {
    width: auto;
    max-width: 112px;
    text-align: right;
  }

  body.member-app .tx2-amount,
  body.member-app .cm-amount {
    font-size: 13px;
    white-space: nowrap;
  }

  body.member-app .cm-status .badge {
    max-width: 100%;
    padding: 2px 6px;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.member-app .ord-card {
    border-radius: 10px;
    box-shadow: none;
  }

  body.member-app .ord-card-top,
  body.member-app .ord-card-foot {
    background: #fff;
  }

  body.member-app .ord-card-main {
    padding-block: 12px;
  }

  body.member-app .ord-thumb {
    width: 58px;
    height: 58px;
    border-radius: 7px;
    background: #f3f5f7;
  }

  body.member-app .ord-filters-scroll {
    margin-bottom: 10px;
  }

  body.member-app .ord-filter {
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 8px;
  }

  body.member-app .ord-card-actions {
    width: auto;
    margin-left: auto;
  }

  body.member-app .ord-modal {
    max-height: calc(100dvh - 72px);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Keep stat cards on one row and distribute them across the full section. */
@media (max-width: 767px) {
  body.member-app .stats-row {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    width: 100% !important;
    gap: 6px !important;
    overflow: visible !important;
  }

  body.member-app .wlt-summary {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    gap: 8px !important;
    overflow: visible !important;
  }

  body.member-app .comm-summary {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    width: 100% !important;
    gap: 6px !important;
    overflow: visible !important;
  }

  body.member-app .stat-card,
  body.member-app .wlt-sum-card,
  body.member-app .comm-sum-card,
  body.member-app .wlt-summary .wlt-sum-card:last-child {
    grid-column: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 100px;
    padding: 9px 8px;
    box-sizing: border-box;
  }

  body.member-app .stat-card {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 7px;
  }

  body.member-app .wlt-sum-card,
  body.member-app .comm-sum-card,
  body.member-app .wlt-summary .wlt-sum-card:last-child {
    display: block !important;
  }

  body.member-app .stat-card .sc-icon,
  body.member-app .wlt-sum-icon,
  body.member-app .comm-sum-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 6px;
    font-size: 12px;
  }

  body.member-app .sc-label,
  body.member-app .wlt-sum-lbl,
  body.member-app .comm-sum-lbl {
    font-size: 9px;
    line-height: 1.25;
  }

  body.member-app .sc-value,
  body.member-app .wlt-sum-val,
  body.member-app .comm-sum-val {
    max-width: 100%;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.member-app .wlt-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 14px;
    min-height: 0;
    padding: 16px;
    text-align: left;
  }

  body.member-app .wlt-hero-left {
    width: 100%;
    min-width: 0;
  }

  body.member-app .wlt-hero-label {
    margin-bottom: 5px;
    color: rgba(15, 39, 68, 0.7);
    font-size: 11px;
    letter-spacing: 0;
  }

  body.member-app .wlt-hero-amount {
    max-width: 100%;
    overflow: hidden;
    font-size: 28px !important;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.member-app .wlt-hero-sub {
    margin-top: 5px;
    color: rgba(15, 39, 68, 0.62);
    font-size: 10px;
  }

  body.member-app .wlt-hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(15, 39, 68, 0.16);
  }

  body.member-app .wlt-action-btn {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    box-sizing: border-box;
  }

  body.member-app .comm-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 14px;
    min-height: 0;
    padding: 16px;
    text-align: left;
  }

  body.member-app .comm-hero > div {
    width: 100%;
    min-width: 0;
  }

  body.member-app .comm-hero-label {
    margin-bottom: 5px;
    color: rgba(15, 39, 68, 0.7);
    font-size: 11px;
    letter-spacing: 0;
  }

  body.member-app .comm-hero-amount {
    max-width: 100%;
    overflow: hidden;
    font-size: 28px !important;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.member-app .comm-hero-sub {
    margin-top: 5px;
    color: rgba(15, 39, 68, 0.62);
    font-size: 10px;
  }

  body.member-app .comm-hero > div:last-child {
    display: block !important;
    padding-top: 12px;
    border-top: 1px solid rgba(15, 39, 68, 0.16);
  }

  body.member-app .comm-hero > div:last-child > div {
    display: flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px !important;
    border: 1px solid rgba(15, 39, 68, 0.14) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.58) !important;
    box-sizing: border-box;
  }

  body.member-app .comm-hero > div:last-child > div > div {
    margin: 0 !important;
  }

  body.member-app .comm-hero > div:last-child > div > div:first-child {
    color: rgba(15, 39, 68, 0.68) !important;
  }

  body.member-app #commPending {
    color: #0f2744 !important;
    font-size: 15px !important;
    white-space: nowrap;
  }
}

/* ══ Minimal overview theme ══ */
body.member-app .ov-welcome {
  background: #0f2744;
  border: 1px solid #183b61;
  box-shadow: none;
}

body.member-app .ov-welcome-bg {
  display: none;
}

body.member-app .ov-welcome-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: none;
}

body.member-app .stat-card,
body.member-app .ov-page .panel {
  border: 1px solid #e1e6ec;
  box-shadow: none;
}

body.member-app .stat-card .sc-icon,
body.member-app .stat-card .sc-icon.purple,
body.member-app .stat-card .sc-icon.gold,
body.member-app .stat-card .sc-icon.green,
body.member-app .stat-card .sc-icon.blue {
  border: 1px solid #e2e7ed;
  background: #f1f4f7;
  color: #0f2744;
  box-shadow: none;
}

body.member-app .stat-card .sc-sub {
  color: #8491a2;
}

body.member-app .ov-quick-link,
body.member-app .ov-quick-link--purple,
body.member-app .ov-quick-link--blue,
body.member-app .ov-quick-link--amber,
body.member-app .ov-quick-link--green,
body.member-app .ov-quick-link--pink,
body.member-app .ov-quick-link--slate {
  border-color: #e2e7ed;
  background: #fff;
  box-shadow: none;
}

body.member-app .ov-quick-link .ov-quick-icon,
body.member-app .ov-quick-link--purple .ov-quick-icon,
body.member-app .ov-quick-link--blue .ov-quick-icon,
body.member-app .ov-quick-link--amber .ov-quick-icon,
body.member-app .ov-quick-link--green .ov-quick-icon,
body.member-app .ov-quick-link--pink .ov-quick-icon,
body.member-app .ov-quick-link--slate .ov-quick-icon {
  border: 1px solid #e2e7ed;
  background: #f1f4f7;
  color: #0f2744;
  box-shadow: none;
}

body.member-app .ov-page .panel-title i {
  color: #0f2744 !important;
}

body.member-app .ov-page .panel-action {
  border-color: #dbe2e9;
  color: #0f2744;
}

body.member-app .ov-page .panel-action:hover {
  background: #f3f5f7;
}

body.member-app .ov-page .wallet-card {
  background: #0f2744;
  box-shadow: none;
}

body.member-app .ov-page .wallet-card::before {
  display: none;
}

body.member-app .ov-page .tx-icon {
  border: 1px solid #e3e8ed;
  background: #f1f4f7;
  color: #0f2744;
}

body.member-app .ov-page .comm-table td:nth-child(2) {
  color: #0f2744 !important;
}

body.member-app .ov-prof-code {
  color: #b07b18;
}

@media (max-width: 767px) {
  body.member-app .ov-page .wallet-card {
    min-height: 0;
    margin-bottom: 12px;
    padding: 16px;
    border: 1px solid #e2aa35;
    border-radius: 12px;
    background: #eab445 url('../banner-free-shipping.png') center / cover no-repeat;
    color: #0f2744;
  }

  body.member-app .ov-page .wc-label {
    margin-bottom: 5px;
    color: rgba(15, 39, 68, 0.7);
    font-size: 11px;
  }

  body.member-app .ov-page .wc-amount {
    max-width: 100%;
    margin-bottom: 2px;
    overflow: hidden;
    color: #0f2744;
    font-size: 28px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
  }

  body.member-app .ov-page .wc-currency {
    color: rgba(15, 39, 68, 0.6);
    font-size: 10px;
  }

  body.member-app .ov-page .wc-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(15, 39, 68, 0.16);
  }

  body.member-app .ov-page .wc-btn {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px;
    border: 1px solid rgba(15, 39, 68, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.62);
    color: #0f2744;
    font-size: 11px;
    box-sizing: border-box;
  }
}
