/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE SWIPE CARDS — Task #1320165
   Premium Mobile Card Experience: Swipeable Cards · Pull-to-Refresh Radar ·
   Floating Action Button · Bottom Tab Bar · Spring Physics · Haptics
   60%+ of traffic is mobile. This is the premium mobile experience.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────
   DESIGN TOKENS
   ───────────────────────────────────────────────────────────────────────── */
:root {
  --ms-gold: #d4af37;
  --ms-gold-light: #f5d77e;
  --ms-gold-dark: #a88a20;
  --ms-gold-glow: rgba(212,175,55,0.35);
  --ms-navy: #0f1117;
  --ms-navy-2: #1a1f2e;
  --ms-card-bg: #ffffff;
  --ms-text: #111827;
  --ms-text-muted: #6b7280;
  --ms-border: rgba(0,0,0,0.08);
  --ms-safe-bottom: env(safe-area-inset-bottom, 0px);
  --ms-safe-top: env(safe-area-inset-top, 0px);
  --ms-nav-h: 60px;
  --ms-fab-size: 56px;
  --ms-radius: 16px;
  --ms-green: #16a34a;
  --ms-red: #dc2626;
  --ms-amber: #d97706;
}

/* ─────────────────────────────────────────────────────────────────────────
   @view-transition: required for cross-document transitions (avoids stuck
   pseudo-elements blocking pointer events on mobile navigation)
   ───────────────────────────────────────────────────────────────────────── */
@view-transition { navigation: auto; }

/* ═══════════════════════════════════════════════════════════════════════════
   1. BOTTOM NAVIGATION BAR
   5 tabs: Home · Browse · Eligibility · File · Profile
   iOS-style frosted glass, gold active state, hide/show on scroll
   ═══════════════════════════════════════════════════════════════════════════ */
.ms-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--ms-nav-h) + var(--ms-safe-bottom));
  padding-bottom: var(--ms-safe-bottom);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid rgba(0,0,0,0.07);
  box-shadow: 0 -1px 0 rgba(0,0,0,0.06), 0 -4px 20px rgba(0,0,0,0.06);
  z-index: 9900;
  align-items: stretch;
  justify-content: space-around;
  will-change: transform;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.6, 1);
}

@media (max-width: 900px) {
  .ms-tab-bar {
    display: flex !important;
  }

  /* Body padding: content clears bottom nav */
  body {
    padding-bottom: calc(var(--ms-nav-h) + var(--ms-safe-bottom) + 8px) !important;
  }
}

@media (min-width: 901px) {
  .ms-tab-bar { display: none !important; }
  .ms-fab-wrap { display: none !important; }
  .ms-ptr-indicator { display: none !important; }
}

.ms-tab-bar.is-hidden {
  transform: translateY(100%);
}

.ms-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 6px 4px 2px;
  text-decoration: none;
  color: #9ca3af;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  position: relative;
  transition: color 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

.ms-tab-item__icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 3px;
  transition: color 0.15s, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ms-tab-item__icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
  fill: none;
}

.ms-tab-item__label {
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.ms-tab-item.is-active {
  color: var(--ms-gold-dark);
}

.ms-tab-item.is-active .ms-tab-item__icon {
  color: var(--ms-gold-dark);
  transform: scale(1.12);
}

.ms-tab-item.is-active .ms-tab-item__icon svg {
  fill: rgba(212,175,55,0.12);
  stroke: var(--ms-gold-dark);
}

.ms-tab-item.is-active .ms-tab-item__label {
  font-weight: 700;
  color: var(--ms-gold-dark);
}

/* Active indicator underline */
.ms-tab-item::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 20px;
  height: 2px;
  background: var(--ms-gold-dark);
  border-radius: 2px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ms-tab-item.is-active::after {
  transform: translateX(-50%) scaleX(1);
}

/* Badge (notification count) */
.ms-tab-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 16px);
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  border: 1.5px solid #fff;
}

/* File/CTA tab — gold raised center button */
.ms-tab-item--file .ms-tab-item__icon {
  background: linear-gradient(135deg, var(--ms-gold) 0%, var(--ms-gold-dark) 100%);
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  box-shadow: 0 4px 14px var(--ms-gold-glow);
  margin-top: -10px;
  margin-bottom: 5px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.ms-tab-item--file .ms-tab-item__icon svg {
  fill: none !important;
  stroke: #fff !important;
  stroke-width: 2 !important;
}

.ms-tab-item--file:active .ms-tab-item__icon {
  transform: scale(0.93);
  box-shadow: 0 2px 8px var(--ms-gold-glow);
}

.ms-tab-item--file.is-active .ms-tab-item__icon {
  transform: none;
}

.ms-tab-item--file::after { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   2. FLOATING ACTION BUTTON (FAB)
   Gold gradient · 56px · Radial menu with 4 items · Spring animation
   Hides on scroll-down, shrinks slightly
   ═══════════════════════════════════════════════════════════════════════════ */
.ms-fab-wrap {
  position: fixed;
  bottom: calc(var(--ms-nav-h) + var(--ms-safe-bottom) + 16px);
  right: 24px;
  z-index: 9850;
  display: none;
  will-change: transform, opacity;
  transition: transform 0.25s cubic-bezier(0.4,0,0.6,1), opacity 0.25s;
}

@media (max-width: 900px) {
  .ms-fab-wrap {
    display: block;
  }
}

.ms-fab-wrap.is-hidden {
  transform: translateY(20px) scale(0.88);
  opacity: 0;
  pointer-events: none;
}

.ms-fab-wrap.is-shrunk .ms-fab-btn {
  width: 48px;
  height: 48px;
}

/* Pulse animation when idle */
@keyframes ms-fab-pulse {
  0%, 100% { box-shadow: 0 4px 20px var(--ms-gold-glow), 0 2px 8px rgba(0,0,0,0.18); }
  50% { box-shadow: 0 4px 20px var(--ms-gold-glow), 0 2px 8px rgba(0,0,0,0.18), 0 0 0 8px rgba(212,175,55,0.08); }
}

.ms-fab-btn {
  width: var(--ms-fab-size);
  height: var(--ms-fab-size);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ms-gold) 0%, var(--ms-gold-dark) 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--ms-gold-glow), 0 2px 8px rgba(0,0,0,0.18);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, width 0.2s, height 0.2s;
  position: relative;
  z-index: 2;
  animation: ms-fab-pulse 3s ease-in-out infinite;
}

.ms-fab-btn:active {
  transform: scale(0.9);
  animation: none;
}

.ms-fab-btn svg {
  width: 24px;
  height: 24px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
}

.ms-fab-btn.is-open {
  animation: none;
}

.ms-fab-btn.is-open svg.ms-fab-icon-open {
  transform: rotate(45deg);
}

/* Radial menu */
.ms-fab-menu {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.8) translateY(12px);
  transform-origin: bottom right;
  transition: opacity 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 200px;
}

.ms-fab-menu.is-open {
  pointer-events: all;
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Stagger item entrance */
.ms-fab-menu.is-open .ms-fab-menu-item:nth-child(1) { transition-delay: 0ms; }
.ms-fab-menu.is-open .ms-fab-menu-item:nth-child(2) { transition-delay: 50ms; }
.ms-fab-menu.is-open .ms-fab-menu-item:nth-child(3) { transition-delay: 100ms; }
.ms-fab-menu.is-open .ms-fab-menu-item:nth-child(4) { transition-delay: 150ms; }

.ms-fab-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1e293b;
  color: #f9fafb;
  text-decoration: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  padding: 10px 16px 10px 12px;
  border-radius: 28px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.28);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 46px;
  transition: background 0.15s, transform 0.15s;
  border: 1px solid rgba(255,255,255,0.06);
  -webkit-user-select: none;
  user-select: none;
}

.ms-fab-menu-item:active {
  background: #334155;
  transform: scale(0.97);
}

.ms-fab-menu-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--ms-gold);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.ms-fab-menu-item--primary {
  background: linear-gradient(135deg, var(--ms-gold) 0%, var(--ms-gold-dark) 100%);
  color: #fff;
  border-color: transparent;
}

.ms-fab-menu-item--primary svg {
  color: #fff;
  stroke: #fff;
}

/* Dark overlay behind FAB menu */
.ms-fab-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: rgba(0,0,0,0.35);
  display: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.ms-fab-backdrop.is-open {
  display: block;
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. PULL-TO-REFRESH — RADAR SWEEP
   Full-width animated radar SVG + sweep line + floating dots
   ═══════════════════════════════════════════════════════════════════════════ */
.ms-ptr-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9950;
  height: 88px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(249,250,251,0.95) 100%);
  border-bottom: 1px solid rgba(212,175,55,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transform: translateY(-100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.ms-ptr-indicator.is-pulling {
  transform: translateY(0);
}

.ms-ptr-indicator.is-refreshing {
  transform: translateY(0);
}

.ms-ptr-radar-wrap {
  position: relative;
  width: 52px;
  height: 52px;
}

/* Radar circles */
.ms-ptr-radar-wrap svg {
  width: 52px;
  height: 52px;
}

/* Sweep line animation */
@keyframes ms-radar-sweep {
  from { transform: rotate(-90deg); }
  to { transform: rotate(270deg); }
}

.ms-ptr-sweep-line {
  transform-origin: 26px 26px;
  animation: ms-radar-sweep 1.5s linear infinite;
}

.ms-ptr-indicator:not(.is-refreshing) .ms-ptr-sweep-line {
  animation-play-state: paused;
}

.ms-ptr-indicator.is-refreshing .ms-ptr-sweep-line {
  animation-play-state: running;
}

/* Floating radar dots */
@keyframes ms-radar-dot-pulse {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.ms-ptr-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ms-gold);
  animation: ms-radar-dot-pulse 1.2s ease-in-out infinite;
}

.ms-ptr-dot:nth-child(1) { top: 8px; left: 22px; animation-delay: 0s; }
.ms-ptr-dot:nth-child(2) { top: 18px; right: 8px; animation-delay: 0.3s; }
.ms-ptr-dot:nth-child(3) { bottom: 12px; left: 10px; animation-delay: 0.6s; }

.ms-ptr-text {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.ms-ptr-indicator.is-refreshing .ms-ptr-text {
  color: var(--ms-gold-dark);
}

/* Body offset when PTR is active */
body.ms-ptr-active {
  padding-top: 88px !important;
  transition: padding-top 0.25s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════
   4. SWIPEABLE SETTLEMENT CARDS
   Stack layout · Physics spring · Swipe left (save) / right (eligibility)
   Tap to flip to back · Premium multi-layer shadow
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {

  /* Card stack container */
  .ms-swipe-section {
    padding: 16px 0 100px;
    position: relative;
    min-height: 520px;
  }

  .ms-swipe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px 16px;
  }

  .ms-swipe-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ms-text);
  }

  .ms-swipe-subtitle {
    font-size: 12px;
    color: var(--ms-text-muted);
    margin-top: 2px;
  }

  .ms-swipe-view-all {
    font-size: 13px;
    font-weight: 600;
    color: #0055B8;
    text-decoration: none;
    background: #eff6ff;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
  }

  /* Card stack */
  .ms-card-stack {
    position: relative;
    height: 420px;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
  }

  /* Swipe hint animations */
  @keyframes ms-swipe-hint-right {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    25% { transform: translateX(calc(-50% + 12px)) rotate(3deg); }
    75% { transform: translateX(calc(-50% - 4px)) rotate(-1deg); }
  }

  .ms-card-stack.show-hint .ms-swipe-card:first-child {
    animation: ms-swipe-hint-right 0.7s ease-in-out;
  }

  /* Individual swipe card */
  .ms-swipe-card {
    position: absolute;
    width: calc(100vw - 48px);
    max-width: 360px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: var(--ms-radius);
    /* Multi-layer premium shadow */
    box-shadow:
      0 2px 4px rgba(0,0,0,0.04),
      0 8px 24px rgba(0,0,0,0.10),
      0 20px 48px rgba(0,0,0,0.06);
    overflow: hidden;
    cursor: grab;
    will-change: transform;
    -webkit-tap-highlight-color: transparent;
    top: 0;
    transition: box-shadow 0.2s;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }

  .ms-swipe-card:active {
    cursor: grabbing;
  }

  /* Stack depth z-layers */
  .ms-swipe-card[data-depth="0"] {
    z-index: 30;
    transform: translateX(-50%) scale(1) translateY(0);
  }

  .ms-swipe-card[data-depth="1"] {
    z-index: 20;
    transform: translateX(-50%) scale(0.95) translateY(12px);
    opacity: 0.85;
    pointer-events: none;
  }

  .ms-swipe-card[data-depth="2"] {
    z-index: 10;
    transform: translateX(-50%) scale(0.90) translateY(24px);
    opacity: 0.65;
    pointer-events: none;
  }

  .ms-swipe-card[data-depth="3"],
  .ms-swipe-card[data-depth="4"] {
    z-index: 5;
    transform: translateX(-50%) scale(0.86) translateY(36px);
    opacity: 0;
    pointer-events: none;
  }

  /* Gold gradient border on high-value settlements ($1000+) */
  .ms-swipe-card.is-high-value {
    box-shadow:
      0 2px 4px rgba(0,0,0,0.04),
      0 8px 24px rgba(0,0,0,0.10),
      0 20px 48px rgba(0,0,0,0.06),
      0 0 0 2px var(--ms-gold),
      0 0 20px rgba(212,175,55,0.25);
  }

  /* Decision overlays — appear on swipe */
  .ms-swipe-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .ms-swipe-overlay--save {
    background: linear-gradient(135deg, rgba(22,163,74,0.15) 0%, transparent 60%);
  }

  .ms-swipe-overlay--skip {
    background: linear-gradient(225deg, rgba(220,38,38,0.15) 0%, transparent 60%);
  }

  .ms-swipe-overlay-label {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0.1em;
    padding: 8px 18px;
    border-radius: 10px;
    border: 3px solid;
    transform: rotate(-10deg);
  }

  .ms-swipe-overlay--save .ms-swipe-overlay-label {
    color: var(--ms-green);
    border-color: var(--ms-green);
    background: rgba(22,163,74,0.08);
    transform: rotate(-10deg);
  }

  .ms-swipe-overlay--skip .ms-swipe-overlay-label {
    color: var(--ms-red);
    border-color: var(--ms-red);
    background: rgba(220,38,38,0.08);
    transform: rotate(10deg);
  }

  /* Card FRONT */
  .ms-swipe-card__front,
  .ms-swipe-card__back {
    width: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }

  .ms-swipe-card__back {
    display: none;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 360px;
  }

  .ms-swipe-card.is-flipped .ms-swipe-card__front {
    display: none;
  }

  .ms-swipe-card.is-flipped .ms-swipe-card__back {
    display: block;
  }

  /* Card hero (top section with gradient background) */
  .ms-swipe-card__hero {
    height: 160px;
    background: linear-gradient(135deg, #1a1f2e 0%, #2d1f3d 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
  }

  /* Radar pulse background in hero */
  .ms-swipe-card__hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 120% 120% at 50% 120%, rgba(212,175,55,0.12) 0%, transparent 70%);
    pointer-events: none;
  }

  /* LIVE badge */
  .ms-swipe-card__live-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(22,163,74,0.9);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px 3px 6px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
  }

  .ms-swipe-card__live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: ms-live-pulse 1.4s ease-in-out infinite;
    flex-shrink: 0;
  }

  @keyframes ms-live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
  }

  /* Payout badge (top right of hero) */
  .ms-swipe-card__payout-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
  }

  .ms-swipe-card__payout {
    background: linear-gradient(135deg, var(--ms-gold) 0%, var(--ms-gold-dark) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    font-family: 'SF Mono', 'Monaco', 'Fira Mono', monospace;
    letter-spacing: -0.02em;
    white-space: nowrap;
    display: block;
    box-shadow: 0 2px 8px rgba(212,175,55,0.4);
  }

  .ms-swipe-card__payout-range {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    text-align: center;
    margin-top: 2px;
    font-family: inherit;
    letter-spacing: 0;
  }

  /* Card body */
  .ms-swipe-card__body {
    padding: 16px;
  }

  .ms-swipe-card__meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
  }

  .ms-swipe-card__company {
    font-size: 12px;
    font-weight: 600;
    color: var(--ms-text-muted);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ms-swipe-card__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ms-text);
    margin: 0 0 10px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Status badges row */
  .ms-swipe-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
  }

  .ms-swipe-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    line-height: 1.2;
  }

  .ms-swipe-badge--active {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #86efac;
  }

  .ms-swipe-badge--closing {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
  }

  .ms-swipe-badge--urgent {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
  }

  .ms-swipe-badge--noproof {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
  }

  .ms-swipe-badge__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .ms-swipe-badge--active .ms-swipe-badge__dot { background: #16a34a; }
  .ms-swipe-badge--closing .ms-swipe-badge__dot { background: #d97706; animation: ms-live-pulse 1.4s ease-in-out infinite; }
  .ms-swipe-badge--urgent .ms-swipe-badge__dot { background: #dc2626; animation: ms-live-pulse 0.8s ease-in-out infinite; }

  /* Filed count */
  .ms-swipe-filed-count {
    font-size: 12px;
    color: var(--ms-text-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .ms-swipe-filed-count svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    opacity: 0.5;
  }

  /* Action buttons row */
  .ms-swipe-card__actions {
    display: flex;
    gap: 8px;
    border-top: 1px solid #f1f5f9;
    padding-top: 14px;
  }

  .ms-swipe-card__action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    font-family: inherit;
    transition: transform 0.15s, opacity 0.15s;
    -webkit-user-select: none;
    user-select: none;
  }

  .ms-swipe-card__action-btn:active {
    transform: scale(0.96);
    opacity: 0.9;
  }

  .ms-swipe-card__action-btn--save {
    background: #f3f4f6;
    color: #374151;
  }

  .ms-swipe-card__action-btn--eligibility {
    background: linear-gradient(135deg, var(--ms-gold) 0%, var(--ms-gold-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 8px var(--ms-gold-glow);
  }

  .ms-swipe-card__action-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    flex-shrink: 0;
  }

  /* BACK side */
  .ms-swipe-card__back-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--ms-text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ms-gold);
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .ms-swipe-card__back-title svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--ms-gold);
    stroke-width: 2;
    flex-shrink: 0;
  }

  .ms-swipe-card__back-desc {
    font-size: 13px;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 16px;
  }

  .ms-swipe-card__back-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--ms-gold) 0%, var(--ms-gold-dark) 100%);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    text-decoration: none;
    min-height: 46px;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s, transform 0.15s;
    box-shadow: 0 2px 8px var(--ms-gold-glow);
    margin-bottom: 10px;
  }

  .ms-swipe-card__back-cta:active { opacity: 0.9; transform: scale(0.98); }

  .ms-swipe-card__back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #0055B8;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 8px;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
  }

  .ms-swipe-card__back-link:active { background: #eff6ff; }

  /* Back close button */
  .ms-swipe-card__back-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.06);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    color: #6b7280;
    font-size: 16px;
    transition: background 0.15s;
    z-index: 3;
  }

  .ms-swipe-card__back-close:active { background: rgba(0,0,0,0.1); }

  /* Swipe hint labels (appear on drag) */
  .ms-swipe-card__hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.1em;
    padding: 6px 14px;
    border-radius: 8px;
    border: 2.5px solid;
    opacity: 0;
    transition: opacity 0.08s;
    pointer-events: none;
  }

  .ms-swipe-card__hint--right {
    left: 16px;
    color: var(--ms-green);
    border-color: var(--ms-green);
    background: rgba(22,163,74,0.08);
  }

  .ms-swipe-card__hint--left {
    right: 16px;
    color: #0055B8;
    border-color: #0055B8;
    background: rgba(0,85,184,0.08);
  }

  /* Progress dots */
  .ms-swipe-progress {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 14px 0 0;
  }

  .ms-swipe-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e5e7eb;
    transition: background 0.2s, transform 0.2s cubic-bezier(0.34,1.56,0.64,1), width 0.2s;
  }

  .ms-swipe-dot.is-active {
    background: var(--ms-gold-dark);
    transform: scale(1.3);
    width: 16px;
    border-radius: 3px;
  }

  /* Swipe hint text below cards */
  .ms-swipe-instructions {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 12px 0 0;
    flex-wrap: wrap;
  }

  .ms-swipe-hint-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--ms-text-muted);
    font-weight: 500;
  }

  .ms-swipe-hint-item svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
  }

  /* "All caught up" end state */
  .ms-swipe-end {
    display: none;
    text-align: center;
    padding: 32px 24px;
  }

  .ms-swipe-end.is-visible {
    display: block;
  }

  .ms-swipe-end__icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
  }

  .ms-swipe-end__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ms-text);
    margin-bottom: 8px;
  }

  .ms-swipe-end__sub {
    font-size: 14px;
    color: var(--ms-text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
  }

  .ms-swipe-end__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ms-gold);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 10px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s;
    min-height: 46px;
  }

  .ms-swipe-end__btn:active { opacity: 0.9; }

} /* end @media (max-width: 900px) */

/* ═══════════════════════════════════════════════════════════════════════════
   5. ME-* CLASS BRIDGE
   The mobile-experience-partial.ejs uses me-* classes. Bridge them to ms-*.
   ═══════════════════════════════════════════════════════════════════════════ */

/* FAB bridge */
.me-fab-container {
  position: fixed;
  bottom: calc(var(--ms-nav-h) + var(--ms-safe-bottom) + 16px);
  right: 24px;
  z-index: 9850;
  transition: transform 0.25s cubic-bezier(0.4,0,0.6,1), opacity 0.25s;
  will-change: transform;
}

@media (max-width: 900px) {
  .me-fab-container { display: block; }
}

@media (min-width: 901px) {
  .me-fab-container { display: none !important; }
}

.me-fab-main {
  width: var(--ms-fab-size);
  height: var(--ms-fab-size);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ms-gold) 0%, var(--ms-gold-dark) 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--ms-gold-glow), 0 2px 8px rgba(0,0,0,0.18);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
  animation: ms-fab-pulse 3s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

.me-fab-main svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

.me-fab-main:active {
  transform: scale(0.9);
  animation: none;
}

.me-fab-main.open {
  animation: none;
}

.me-fab-main.open svg {
  transform: rotate(45deg);
}

.me-fab-menu {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.8) translateY(12px);
  transform-origin: bottom right;
  transition: opacity 0.2s, transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
  min-width: 210px;
}

.me-fab-menu.open {
  pointer-events: all;
  opacity: 1;
  transform: scale(1) translateY(0);
}

.me-fab-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1e293b;
  color: #f9fafb;
  text-decoration: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  padding: 10px 16px 10px 12px;
  border-radius: 28px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.28);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 46px;
  transition: background 0.15s, transform 0.15s;
  border: 1px solid rgba(255,255,255,0.06);
}

.me-fab-menu-item:active {
  background: #334155;
  transform: scale(0.97);
}

.me-fab-menu-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--ms-gold);
  stroke-width: 2;
}

.me-fab-menu-item:first-child {
  background: linear-gradient(135deg, var(--ms-gold) 0%, var(--ms-gold-dark) 100%);
  color: #fff;
  border-color: transparent;
}

.me-fab-menu-item:first-child svg {
  stroke: #fff;
}

/* FAB backdrop overlay */
.me-fab-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: rgba(0,0,0,0.35);
  display: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.me-fab-backdrop.is-open {
  display: block;
  opacity: 1;
}

/* Card stack bridge (me-* classes) */
.me-card-stack {
  position: relative;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.me-settlement-card {
  position: absolute;
  width: calc(100vw - 48px);
  max-width: 360px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: var(--ms-radius);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.04),
    0 8px 24px rgba(0,0,0,0.10),
    0 20px 48px rgba(0,0,0,0.06);
  overflow: hidden;
  cursor: grab;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
  top: 0;
  z-index: 20;
  transition: box-shadow 0.2s;
}

.me-settlement-card.behind-1 {
  z-index: 15;
  transform: translateX(-50%) scale(0.95) translateY(12px);
  opacity: 0.85;
  pointer-events: none;
}

.me-settlement-card.behind-2 {
  z-index: 10;
  transform: translateX(-50%) scale(0.90) translateY(24px);
  opacity: 0.65;
  pointer-events: none;
}

.me-card-hero {
  display: block;
  height: 150px;
  overflow: hidden;
  text-decoration: none;
  position: relative;
}

.me-card-body {
  padding: 16px;
}

.me-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ms-text);
  margin: 0 0 6px;
  line-height: 1.3;
}

.me-card-company {
  font-size: 12px;
  color: var(--ms-text-muted);
  margin: 0 0 8px;
}

.me-card-deadline {
  font-size: 12px;
  color: var(--ms-text-muted);
  margin: 0 0 12px;
}

.me-card-category-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.me-card-actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.me-card-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-family: inherit;
  transition: transform 0.15s;
}

.me-card-btn.dismiss {
  background: #f3f4f6;
  color: #374151;
}

.me-card-btn.save {
  background: linear-gradient(135deg, var(--ms-gold) 0%, var(--ms-gold-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 8px var(--ms-gold-glow);
}

.me-card-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  flex-shrink: 0;
}

.me-card-action {
  position: absolute;
  top: 24px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.1em;
  opacity: 0;
  pointer-events: none;
  border: 2.5px solid;
  z-index: 10;
  transition: opacity 0.08s;
}

.me-card-action.save {
  left: 16px;
  color: var(--ms-green);
  border-color: var(--ms-green);
  background: rgba(22,163,74,0.08);
}

.me-card-action.dismiss {
  right: 16px;
  color: var(--ms-red);
  border-color: var(--ms-red);
  background: rgba(220,38,38,0.08);
}

.me-card-progress {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 12px 0;
}

.me-card-progress-fill {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ms-gold-dark);
}

/* Swiping class states for action hint opacity */
.me-settlement-card.swiping-right .me-card-action.save { opacity: 1; }
.me-settlement-card.swiping-left .me-card-action.dismiss { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   6. ACCESSIBILITY + REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .ms-fab-btn,
  .me-fab-main {
    animation: none !important;
  }

  .ms-swipe-card,
  .me-settlement-card {
    transition: none !important;
  }

  .ms-ptr-sweep-line {
    animation: none !important;
  }

  @keyframes ms-live-pulse {
    from { opacity: 1; }
    to { opacity: 1; }
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   7. MOBILE-SPECIFIC TYPOGRAPHY + TOUCH IMPROVEMENTS
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* iOS font size: prevents auto-zoom on input focus */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Touch: eliminate 300ms delay */
  a, button, [role="button"], [onclick] {
    touch-action: manipulation;
  }

  /* Remove tap highlight globally on mobile */
  * {
    -webkit-tap-highlight-color: transparent;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   8. SKELETON LOADING (card placeholders during data fetch)
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes ms-shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.ms-skeleton-card {
  width: calc(100vw - 48px);
  max-width: 360px;
  margin: 0 auto;
  height: 360px;
  background: #fff;
  border-radius: var(--ms-radius);
  box-shadow: 0 2px 4px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.08);
  overflow: hidden;
}

.ms-skeleton-hero {
  height: 160px;
  background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
  background-size: 800px 100%;
  animation: ms-shimmer 1.5s ease-in-out infinite;
}

.ms-skeleton-body {
  padding: 16px;
}

.ms-skeleton-line {
  height: 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
  background-size: 800px 100%;
  animation: ms-shimmer 1.5s ease-in-out infinite;
}

.ms-skeleton-line--short { width: 60%; }
.ms-skeleton-line--medium { width: 80%; }
.ms-skeleton-line--full { width: 100%; }
