/* Mobile Sportsbook UI (/m) — Compact League Accordions, Pitch Hero Detail & Day/Night Theme */
html, body {
  overflow-x: clip;
}
.m-app {
  --m-bg: #f2f4f8;
  --m-surface: #ffffff;
  --m-surface-2: #f7f9fc;
  --m-border: #e6ebf2;
  --m-ink: #1a2433;
  --m-muted: #708094;
  --m-blue: #1677ff;
  --m-blue-soft: #eaf3ff;
  --m-green: #0f6e45;
  --m-red: #d93829;
  --m-amber: #b45309;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 500px;
  margin: 0 auto;
  background: var(--m-bg);
  color: var(--m-ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  padding-bottom: calc(74px + env(safe-area-inset-bottom));
  position: relative;
  box-shadow: 0 0 30px rgba(15, 23, 42, 0.08);
  -webkit-text-size-adjust: 100%;
}
.m-app button,
.m-app input,
.m-app select,
.m-app a,
.m-app [role="button"],
.m-odd-cell,
.m-match-head {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.m-app button,
.m-app input,
.m-app select {
  -webkit-appearance: none;
  appearance: none;
}
.m-app input,
.m-app select,
.m-app textarea {
  font-size: 16px !important;
}

.m-app.has-float-slip {
  padding-bottom: calc(122px + env(safe-area-inset-bottom));
}

.m-app.m-dark {
  --m-bg: #0f151e;
  --m-surface: #18212e;
  --m-surface-2: #1e2938;
  --m-border: #283548;
  --m-ink: #eef3fa;
  --m-muted: #93a3b8;
  --m-blue: #4ea1ff;
  --m-blue-soft: rgba(78, 161, 255, 0.16);
}

.m-sticky-top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--m-surface);
  border-bottom: 1px solid var(--m-border);
  padding-top: env(safe-area-inset-top);
}
.m-sub-controls {
  background: var(--m-surface);
  border-bottom: 1px solid var(--m-border);
}
.m-sport-strip,
.m-ctrl-bar,
.m-league-filter-strip {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.m-head-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px 2px;
}

.m-brand-title {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--m-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-head-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
}

.m-back-icon {
  min-width: 32px !important;
  min-height: 32px !important;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--m-ink);
  display: inline-grid;
  place-items: center;
}

.m-top-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  padding: 0 6px 2px;
  border-bottom: 1px solid var(--m-border);
}

.m-top-tab {
  min-height: 34px !important;
  padding: 2px 2px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--m-muted);
  white-space: nowrap;
  text-align: center;
  position: relative;
}
.m-top-tab.active {
  color: var(--m-blue);
  font-weight: 800;
}
.m-top-tab.active::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 1px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--m-blue);
}

.m-bal-pill {
  min-height: 30px !important;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--m-surface-2);
  border: 1px solid var(--m-border);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--m-ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.m-sport-strip {
  display: flex;
  gap: 4px;
  padding: 6px 8px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.m-sport-strip::-webkit-scrollbar { display: none; }

.m-sport-item {
  flex: 0 0 60px;
  min-height: 54px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 10px;
  padding: 4px 2px;
  color: var(--m-muted);
  position: relative;
}
.m-sport-item.active {
  color: var(--m-blue);
  font-weight: 800;
}
.m-sport-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--m-surface-2);
  border: 1px solid var(--m-border);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  position: relative;
}
.m-sport-item.active .m-sport-icon-wrap {
  background: var(--m-blue-soft);
  border-color: var(--m-blue);
}
.m-sport-cnt {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--m-surface);
  color: var(--m-ink);
  border: 1px solid var(--m-border);
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  padding: 2px 4px;
  font-variant-numeric: tabular-nums;
}
.m-sport-item small {
  font-size: 0.71rem;
  line-height: 1.1;
  white-space: nowrap;
}

.m-ctrl-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.m-ctrl-bar::-webkit-scrollbar { display: none; }

.m-seg {
  display: inline-flex;
  background: var(--m-surface-2);
  border: 1px solid var(--m-border);
  border-radius: 999px;
  padding: 2px;
  flex: none;
}
.m-seg button {
  min-height: 28px !important;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--m-muted);
  white-space: nowrap;
}
.m-seg button.active {
  background: var(--m-surface);
  color: var(--m-ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.m-league-filter-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--m-surface);
  border-bottom: 1px solid var(--m-border);
}
.m-league-filter-strip::-webkit-scrollbar { display: none; }

.m-chip {
  min-height: 28px !important;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--m-muted);
  background: var(--m-surface-2);
  border: 1px solid transparent;
  white-space: nowrap;
  flex: none;
}
.m-chip.active {
  color: var(--m-blue);
  background: var(--m-blue-soft);
  border-color: rgba(22, 119, 255, 0.25);
}

.m-search-drawer {
  padding: 8px 10px;
  background: var(--m-surface);
  border-bottom: 1px solid var(--m-border);
  display: flex;
  gap: 6px;
}
.m-search-drawer input {
  flex: 1;
  min-height: 36px !important;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--m-border);
  background: var(--m-surface-2);
  color: var(--m-ink);
  font-size: 0.82rem;
}

.m-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 4px;
}
.m-sec-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--m-ink);
}
.m-sec-sub {
  padding: 0 12px 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--m-muted);
}
.m-expand-btn {
  min-height: 28px !important;
  padding: 0 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--m-muted);
}

.m-league-list {
  display: grid;
  gap: 6px;
  padding: 0 8px 10px;
}

.m-league-card {
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: 12px;
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: auto 46px;
}

.m-league-row {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 10px 4px 0;
  gap: 8px;
}

.m-league-accent {
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--m-blue);
  flex: none;
}
.m-league-card.live .m-league-accent { background: #10b981; }

.m-fav-star {
  min-width: 28px !important;
  min-height: 36px !important;
  font-size: 1rem;
  color: #b7c2d0;
  padding: 0;
}
.m-fav-star.on { color: #f59e0b; }

.m-league-main-btn {
  flex: 1;
  min-width: 0;
  min-height: 38px !important;
  display: flex;
  align-items: center;
  gap: 7px;
  text-align: left;
  padding: 2px 0;
}
.m-league-flag {
  font-size: 1.05rem;
  flex: none;
}
.m-league-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--m-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-league-count {
  font-size: 0.78rem;
  color: var(--m-muted);
  font-weight: 600;
  flex: none;
}

.m-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
.m-pin-btn, .m-chev-btn {
  min-width: 28px !important;
  min-height: 34px !important;
  color: var(--m-muted);
  font-size: 0.82rem;
  padding: 0 4px;
}
.m-pin-btn.pinned { color: var(--m-blue); font-weight: 800; }

.m-matches-wrap {
  border-top: 1px solid var(--m-border);
  background: var(--m-surface-2);
  display: grid;
}

.m-match-box {
  padding: 8px 10px;
  border-bottom: 1px solid var(--m-border);
  background: var(--m-surface);
  display: grid;
  gap: 6px;
}
.m-match-box:last-child { border-bottom: 0; }

.m-skeleton-wrap {
  padding: 10px;
  display: grid;
  gap: 10px;
}
.m-skel-card {
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
}
.m-skel-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--m-surface-2) 25%, var(--m-border) 50%, var(--m-surface-2) 75%);
  background-size: 200% 100%;
  animation: m-shimmer 1.1s infinite linear;
}
.m-skel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.m-skel-box {
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--m-surface-2) 25%, var(--m-border) 50%, var(--m-surface-2) 75%);
  background-size: 200% 100%;
  animation: m-shimmer 1.1s infinite linear;
}
@keyframes m-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.m-match-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--m-muted);
}
.m-live-badge {
  color: #059669;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.m-live-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.m-match-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.m-match-body.wide {
  grid-template-columns: minmax(0, 1fr);
}
.m-match-body.wide .m-odds-strip {
  grid-auto-flow: row;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.m-teams-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  padding: 2px 0;
  min-height: 40px !important;
}
.m-team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 700;
}
.m-team-row span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-score-num {
  font-weight: 900;
  color: var(--m-blue);
  font-variant-numeric: tabular-nums;
  flex: none;
}

.m-odds-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(52px, 1fr);
  gap: 4px;
}
.m-match-body.multi-strip {
  grid-template-columns: 1fr;
}
.m-odds-multi-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.m-odds-multi-scroll::-webkit-scrollbar { display: none; }
.m-odds-multi-grp {
  flex: none;
  display: grid;
  gap: 3px;
}
.m-odds-multi-lbl {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--m-muted);
  padding-left: 2px;
}

.m-odd-cell {
  min-height: 42px !important;
  padding: 4px 5px;
  border-radius: 8px;
  background: var(--m-surface-2);
  border: 1px solid var(--m-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.m-odd-cell.up {
  background: rgba(16, 185, 129, 0.16);
  border-color: #10b981;
}
.m-odd-cell.up b {
  color: #047857;
}
.m-odd-cell.down {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}
.m-odd-cell.down b {
  color: #b91c1c;
}
.m-app.m-dark .m-odd-cell.up b { color: #34d399; }
.m-app.m-dark .m-odd-cell.down b { color: #f87171; }
.m-odd-cell.selected {
  background: var(--m-blue);
  border-color: var(--m-blue);
  color: #fff;
}
.m-odd-cell.selected small,
.m-odd-cell.selected b {
  color: #fff;
}
.m-odd-cell.locked {
  opacity: 0.55;
  background: var(--m-surface-2);
}
.m-odd-cell small {
  font-size: 0.65rem;
  color: var(--m-muted);
  line-height: 1;
}
.m-odd-cell b {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--m-ink);
  font-variant-numeric: tabular-nums;
}

/* Single Match Pitch Hero Detail (Screenshot 3 style) */
.m-pitch-hero {
  background: radial-gradient(circle at 50% 65%, #376e2c 0%, #1d3c19 52%, #131c15 100%);
  color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 12px 14px;
  position: relative;
}
.m-subscores-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.m-subscore-pill {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.m-pitch-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.m-pitch-nav button {
  color: #fff;
  min-height: 34px !important;
  font-weight: 700;
  font-size: 0.9rem;
}
.m-pitch-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 14px 4px 10px;
}
.m-pitch-team {
  display: grid;
  justify-items: center;
  gap: 6px;
}
.m-crest-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}
.m-pitch-team span {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.25;
}
.m-pitch-score-mid {
  display: grid;
  gap: 4px;
}
.m-pitch-score-mid small {
  font-size: 0.74rem;
  color: #d6f5d6;
  font-weight: 700;
}
.m-pitch-score-mid strong {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.m-pitch-pills {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.m-pitch-pill {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 700;
}

.m-detail-tabs {
  display: flex;
  background: var(--m-surface);
  border-bottom: 1px solid var(--m-border);
  padding: 0 12px;
  gap: 18px;
}
.m-detail-tabs button {
  min-height: 40px !important;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--m-muted);
  position: relative;
}
.m-detail-tabs button.active {
  color: var(--m-ink);
  font-weight: 800;
}
.m-detail-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5px;
  background: var(--m-blue);
  border-radius: 2px;
}

.m-mkt-list {
  display: grid;
  gap: 8px;
  padding: 8px 10px 18px;
}
.m-mkt-card {
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: 10px;
  overflow: hidden;
}
.m-mkt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  min-height: 42px;
  gap: 8px;
}
.m-mkt-head-btn {
  flex: 1;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--m-ink);
  min-height: 32px !important;
}
.m-mkt-odds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 6px;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--m-border);
  background: var(--m-surface-2);
}

/* Bottom Sticky Tab Bar (Screenshot 1 & 2 style) */
.m-bottom-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 500px;
  z-index: 45;
  background: var(--m-surface);
  border-top: 1px solid var(--m-border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
}
.m-bottom-bar[hidden] { display: none; }
.m-bottom-tab {
  min-height: 48px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--m-muted);
  transition: transform 0.1s ease, opacity 0.1s ease;
}
.m-bottom-tab:active { transform: scale(0.94); opacity: 0.78; }
.m-bottom-tab span:first-child { font-size: 1.05rem; line-height: 1; }
.m-bottom-tab.active { color: var(--m-blue); }

.m-float-slip-btn {
  position: fixed;
  right: max(12px, calc(50% - 238px));
  bottom: calc(64px + env(safe-area-inset-bottom));
  z-index: 46;
  background: var(--m-blue);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 40px !important;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(22, 119, 255, 0.35);
  transition: transform 0.12s ease;
}
.m-float-slip-btn:active { transform: scale(0.96); }

.m-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 18, 30, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: m-fade-in 0.16s ease-out both;
}
.m-sheet {
  width: 100%;
  max-width: 500px;
  max-height: 82vh;
  max-height: 82dvh;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--m-surface);
  color: var(--m-ink);
  border-radius: 16px 16px 0 0;
  padding: 14px 14px calc(16px + env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
  will-change: transform;
  animation: m-sheet-up 0.2s cubic-bezier(0.2, 0.85, 0.25, 1) both;
}
.m-detail-view {
  animation: m-detail-in 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.m-odd-cell {
  transition: transform 0.08s ease, background-color 0.15s ease;
}
.m-odd-cell:active:not(:disabled) {
  transform: scale(0.95);
}
@keyframes m-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes m-sheet-up {
  from { transform: translate3d(0, 32px, 0); opacity: 0.7; }
  to { transform: translate3d(0, 0, 0); opacity: 1; }
}
@keyframes m-detail-in {
  from { transform: translate3d(12px, 0, 0); opacity: 0.65; }
  to { transform: translate3d(0, 0, 0); opacity: 1; }
}
.m-quick-stakes {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.m-quick-stakes .m-stake-chip {
  flex: 1 1 calc(16.6% - 5px);
  min-width: 48px;
}
.m-stake-chip.recent {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde047;
}
.m-stake-chip {
  min-height: 34px !important;
  border-radius: 8px;
  background: var(--m-surface-2);
  border: 1px solid var(--m-border);
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--m-ink);
}
.m-stake-chip.max {
  background: var(--m-blue-soft);
  color: var(--m-blue);
  border-color: rgba(22, 119, 255, 0.35);
}
.m-chg-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
  margin-left: 6px;
}
.m-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--m-border);
}
.m-sheet-head strong { font-size: 0.96rem; }
.m-close-btn {
  min-width: 34px !important;
  min-height: 34px !important;
  border-radius: 50%;
  background: var(--m-surface-2);
  font-weight: 800;
}

.m-order-card {
  background: var(--m-surface-2);
  border: 1px solid var(--m-border);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 4px;
  font-size: 0.8rem;
}
.m-warn-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}
.m-app .m-primary-btn,
.m-app .m-primary-btn:hover {
  width: 100%;
  min-height: 42px !important;
  border-radius: 10px;
  background-color: var(--m-blue);
  background: var(--m-blue);
  color: #fff;
  font-weight: 800;
  font-size: 0.88rem;
}
.m-app .m-primary-btn:disabled,
.m-app .m-primary-btn:disabled:hover {
  background-color: #cbd5e1;
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
}
.m-app .m-odd-cell.selected:hover {
  background-color: var(--m-blue);
  color: #fff;
}
.m-app .m-adm-btn-sm.on:hover {
  background-color: var(--m-green);
  color: #fff;
}

/* Mobile Login & Admin Console Pages */
.m-subpage-head {
  position: sticky;
  top: 0;
  z-index: 42;
  background: var(--m-surface);
  border-bottom: 1px solid var(--m-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
}
.m-subpage-head strong {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--m-ink);
}
.m-login-wrap {
  padding: 16px 12px 28px;
  display: grid;
  gap: 14px;
}
.m-login-hero {
  background: linear-gradient(135deg, #0b5d36 0%, #0f6e45 58%, #1677ff 100%);
  color: #fff;
  border-radius: 14px;
  padding: 18px 16px;
  display: grid;
  gap: 6px;
}
.m-login-hero strong { font-size: 1.12rem; }
.m-login-hero small { font-size: 0.78rem; opacity: 0.92; line-height: 1.45; }
.m-form-card {
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.m-field {
  display: grid;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--m-ink);
}
.m-field input, .m-field select {
  width: 100%;
  min-height: 40px !important;
  padding: 6px 10px;
  border: 1px solid var(--m-border);
  border-radius: 9px;
  background: var(--m-surface-2);
  color: var(--m-ink);
  font-size: 0.86rem;
}
.m-pw-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.m-pw-row input { flex: 1; }
.m-adm-wrap {
  padding: 10px 10px 28px;
  display: grid;
  gap: 12px;
}
.m-adm-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.m-adm-kpi {
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 2px;
}
.m-adm-kpi small { font-size: 0.72rem; color: var(--m-muted); }
.m-adm-kpi strong { font-size: 1.08rem; color: var(--m-green); font-variant-numeric: tabular-nums; }
.m-adm-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  background: var(--m-surface-2);
  border: 1px solid var(--m-border);
  border-radius: 12px;
  padding: 4px;
}
.m-adm-tab {
  min-height: 36px !important;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--m-muted);
}
.m-adm-tab.active {
  background: var(--m-blue);
  color: #fff;
}
.m-adm-card {
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
}
.m-adm-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--m-border);
}
.m-adm-card-head strong { font-size: 0.9rem; color: var(--m-ink); }
.m-adm-acct {
  background: var(--m-surface-2);
  border: 1px solid var(--m-border);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
}
.m-adm-inline {
  display: flex;
  gap: 6px;
  align-items: center;
}
.m-adm-inline input {
  flex: 1;
  min-width: 0;
  min-height: 36px !important;
  padding: 4px 8px;
  border: 1px solid var(--m-border);
  border-radius: 8px;
  background: var(--m-surface);
  color: var(--m-ink);
  font-size: 0.82rem;
}
.m-adm-btn-sm {
  min-height: 36px !important;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--m-ink);
  white-space: nowrap;
}
.m-adm-btn-sm.on {
  background: var(--m-green);
  border-color: var(--m-green);
  color: #fff;
}
.m-adm-limits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 6px;
  align-items: end;
}
.m-ok-box {
  background: #e7f6ec;
  border: 1px solid #9ad3ad;
  color: #0e5333;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}
.m-badge-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--m-blue-soft);
  color: var(--m-blue);
}
.m-badge-tag.ok { background: #e7f6ec; color: #0e5333; }
.m-badge-tag.off { background: #fde8e8; color: #9b2c2c; }

.m-head-icon-btn {
  min-width: 30px !important;
  min-height: 30px !important;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--m-surface-2);
  border: 1px solid var(--m-border);
  font-size: 0.84rem;
  color: var(--m-ink);
  display: inline-grid;
  place-items: center;
}
.m-head-icon-btn.active {
  background: var(--m-blue);
  border-color: var(--m-blue);
  color: #fff;
}
.m-conn-banner {
  background: #fef9c3;
  color: #854d0e;
  border-bottom: 1px solid #fde047;
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
}
.m-toast {
  position: fixed;
  left: 50%;
  top: max(14px, calc(10px + env(safe-area-inset-top)));
  transform: translateX(-50%);
  z-index: 95;
  max-width: min(92vw, 420px);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-toast.warn {
  background: #b45309;
}
.m-load-sentinel {
  height: 1px;
  width: 100%;
}

@media (max-width: 390px) {
  .m-head-bar {
    gap: 4px;
    padding: 6px 8px 2px;
  }
  .m-brand-title {
    font-size: 0.82rem;
  }
  .m-head-actions {
    gap: 4px;
  }
  .m-head-icon-btn {
    min-width: 28px !important;
    min-height: 28px !important;
    padding: 0 5px;
    font-size: 0.78rem;
  }
  .m-bal-pill {
    min-height: 28px !important;
    padding: 2px 7px;
    font-size: 0.72rem;
  }
}


.m-app button[data-m-adm-settle] { min-height: 44px !important; }
