/* ============================================================
   MentifyHub — Unified Design System v2
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300..800;1,9..40,300..800&family=DM+Mono:wght@400;500&display=swap');

:root {
  /* Brand */
  --accent:       #0b3b89;
  --accent2:      #1d4ed8;
  --accent3:      #3b82f6;
  --green:        #059669;
  --green-soft:   rgba(5,150,105,.10);

  /* Neutrals */
  --bg:           #f4f7fb;
  --card:         #ffffff;
  --text:         #0f172a;
  --muted:        #64748b;
  --subtle:       #94a3b8;
  --line:         #e2e8f0;
  --soft:         #f8fafc;
  --soft2:        #f1f5f9;

  /* Status */
  --pending-bg:   rgba(245,158,11,.10);
  --pending-fg:   #92400e;
  --pending-line: rgba(245,158,11,.28);
  --accepted-bg:  rgba(5,150,105,.10);
  --accepted-fg:  #065f46;
  --accepted-line:rgba(5,150,105,.28);
  --declined-bg:  rgba(239,68,68,.08);
  --declined-fg:  #b91c1c;
  --declined-line:rgba(239,68,68,.22);

  /* Sizing */
  --radius:       20px;
  --radius-sm:    14px;
  --radius-xs:    10px;
  --shadow:       0 1px 3px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.07);
  --shadow-lg:    0 4px 8px rgba(15,23,42,.06), 0 20px 48px rgba(15,23,42,.10);
  --shadow-btn:   0 1px 2px rgba(15,23,42,.08), 0 4px 12px rgba(29,78,216,.18);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(ellipse 900px 500px at 5% 0%, rgba(29,78,216,.07) 0%, transparent 60%),
    radial-gradient(ellipse 700px 400px at 95% 5%, rgba(11,59,137,.05) 0%, transparent 60%),
    var(--bg);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
img { display: block; max-width: 100%; }

/* ── Layout ─────────────────────────────────── */

.mh-wrap    { max-width: 1180px; margin: 0 auto; padding: 20px; }
.mh-wrap-sm { max-width: 520px;  margin: 0 auto; padding: 20px; }
.mh-wrap-md { max-width: 820px;  margin: 0 auto; padding: 20px; }

/* ── Topbar ──────────────────────────────────── */

.mh-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 22px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  position: sticky;
  top: 16px;
  z-index: 40;
}

.mh-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.mh-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: contain;
  border: 1px solid rgba(29,78,216,.12);
  box-shadow: 0 2px 8px rgba(29,78,216,.10);
}

.mh-brand-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.1px;
  color: var(--text);
}

.mh-brand-text span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.mh-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── Buttons ─────────────────────────────────── */

.mh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: transform .1s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
  user-select: none;
}
.mh-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: #c8d6e8;
}
.mh-btn:active { transform: translateY(0); }

.mh-btn-primary {
  border-color: transparent;
  background: linear-gradient(160deg, var(--accent2) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.mh-btn-primary:hover { box-shadow: 0 2px 4px rgba(15,23,42,.08), 0 8px 22px rgba(29,78,216,.28); border-color: transparent; }

.mh-btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.mh-btn-ghost:hover { background: var(--soft2); border-color: var(--line); color: var(--text); }

.mh-btn-danger {
  border-color: var(--declined-line);
  background: var(--declined-bg);
  color: var(--declined-fg);
}

.mh-btn-green {
  border-color: var(--accepted-line);
  background: var(--accepted-bg);
  color: var(--accepted-fg);
}

.mh-btn-sm { padding: 7px 11px; font-size: 12px; border-radius: var(--radius-xs); }
.mh-btn-lg { padding: 12px 20px; font-size: 15px; border-radius: var(--radius); }
.mh-btn-full { width: 100%; }

.mh-btn[disabled], .mh-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Card ────────────────────────────────────── */

.mh-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.mh-card-body  { padding: 20px; }
.mh-card-sm    { padding: 14px; }

.mh-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.mh-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--soft);
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Badge / Status ──────────────────────────── */

.mh-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.mh-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .6;
  flex-shrink: 0;
}

.mh-badge-pending  { background: var(--pending-bg);  color: var(--pending-fg);  border-color: var(--pending-line); }
.mh-badge-accepted { background: var(--accepted-bg); color: var(--accepted-fg); border-color: var(--accepted-line); }
.mh-badge-declined { background: var(--declined-bg); color: var(--declined-fg); border-color: var(--declined-line); }

/* ── Tag pill ────────────────────────────────── */

.mh-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.mh-tag-blue {
  background: rgba(29,78,216,.07);
  border-color: rgba(29,78,216,.16);
  color: var(--accent);
}

/* ── Avatar ──────────────────────────────────── */

.mh-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(29,78,216,.14), rgba(11,59,137,.10));
  border: 1px solid rgba(29,78,216,.14);
  color: var(--accent);
}

.mh-avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  font-size: 22px;
}

.mh-avatar-round { border-radius: 50%; }

/* ── Form elements ───────────────────────────── */

.mh-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.mh-input,
.mh-select,
.mh-textarea {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.mh-input:focus,
.mh-select:focus,
.mh-textarea:focus {
  border-color: var(--accent3);
  box-shadow: 0 0 0 3px rgba(59,130,246,.14);
}

.mh-textarea { resize: vertical; min-height: 100px; }

.mh-field { margin-bottom: 14px; }

/* ── Progress bar ────────────────────────────── */

.mh-bar-wrap {
  height: 8px;
  border-radius: 999px;
  background: var(--soft2);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-top: 6px;
}

.mh-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent3), var(--accent2));
  transition: width .5s ease;
}

/* ── Stat box ────────────────────────────────── */

.mh-stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fff 0%, var(--soft) 100%);
}
.mh-stat-val  { font-size: 22px; font-weight: 800; letter-spacing: -.5px; color: var(--text); }
.mh-stat-lbl  { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── Section header ──────────────────────────── */

.mh-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.mh-section-head h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}

/* ── Chip ────────────────────────────────────── */

.mh-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--soft);
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.mh-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
  flex-shrink: 0;
}

/* ── Toast ───────────────────────────────────── */

.mh-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(15,23,42,.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 100;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.mh-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Modal ───────────────────────────────────── */

.mh-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15,23,42,.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  backdrop-filter: blur(3px);
}
.mh-modal-backdrop.open { display: flex; }

.mh-modal {
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: mh-modal-in .18s ease;
}

@keyframes mh-modal-in {
  from { transform: scale(.96) translateY(8px); opacity: 0; }
  to   { transform: scale(1)   translateY(0);   opacity: 1; }
}

/* ── Empty state ─────────────────────────────── */

.mh-empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--muted);
  background: linear-gradient(180deg, #fff, var(--soft));
}
.mh-empty strong { display: block; color: var(--text); margin-bottom: 6px; }

/* ── Skeleton ────────────────────────────────── */

.mh-skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--soft2), #fff, var(--soft2));
  background-size: 200% 100%;
  animation: mh-shimmer 1.2s ease-in-out infinite;
}
@keyframes mh-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ── Utilities ───────────────────────────────── */

.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.wrap   { flex-wrap: wrap; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mt-20  { margin-top: 20px; }
.muted  { color: var(--muted); }
.small  { font-size: 12px; }
.bold   { font-weight: 700; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Footer ──────────────────────────────────── */

.mh-footer {
  margin-top: 24px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}
.mh-footer a { text-decoration: underline; text-underline-offset: 3px; }

/* ── Responsive ──────────────────────────────── */

@media (max-width: 768px) {
  .mh-topbar { position: static; border-radius: 16px; }
  .hide-mobile { display: none !important; }
}


/* ══════════════════════════════════════════════════
   MOBILE RESPONSIVE — Global
   ══════════════════════════════════════════════════ */

/* Mobile nav overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,31,19,.55);
  backdrop-filter: blur(4px);
  z-index: 90;
}
.mobile-nav-overlay.open { display: block; }

/* Hamburger button — hidden everywhere by default */
.mh-hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
}
.mh-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .2s ease;
}

/* Mobile drawer */
.mh-mobile-drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  flex-direction: column;
  padding: 20px 16px;
  transform: translateX(-100%);
  transition: transform .25s ease;
}
.mh-mobile-drawer.open {
  display: flex;
  transform: translateX(0);
}
.mh-mobile-drawer .drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.mh-mobile-drawer .drawer-brand img { width: 32px; height: 32px; border-radius: 10px; }
.mh-mobile-drawer .drawer-brand span { font-size: 16px; font-weight: 800; color: var(--text); }
.mh-drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: all .15s ease;
  margin-bottom: 4px;
}
.mh-drawer-link:hover, .mh-drawer-link.active { background: var(--soft); color: var(--green); }
.mh-drawer-link .icon { font-size: 16px; width: 20px; text-align: center; }
.drawer-signout {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

@media (max-width: 768px) {
  /* Show hamburger, hide desktop nav items */
  .mh-hamburger { display: flex; }
  .hide-mobile { display: none !important; }

  /* Topbar adjustments */
  .mh-topbar {
    position: sticky;
    top: 8px;
    margin: 8px;
    border-radius: 16px;
    padding: 10px 14px;
  }

  /* Page padding */
  .mh-page { padding: 16px 12px !important; }

  /* Cards */
  .mh-card { padding: 16px !important; }

  /* Stats row */
  .stats-row { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }

  /* Grids → single column */
  .grid-2, .grid-3 { grid-template-columns: 1fr !important; }

  /* Notification panel */
  .notif-panel {
    position: fixed !important;
    top: 70px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-height: 70vh;
    overflow-y: auto;
  }

  /* Buttons */
  .mh-btn { padding: 10px 14px !important; font-size: 13px !important; }

  /* Forms */
  .form-grid { grid-template-columns: 1fr !important; }
  .mh-input, .mh-select, .mh-textarea { font-size: 16px !important; } /* Prevents iOS zoom */

  /* Modal */
  .mh-modal-backdrop .mh-card {
    margin: 16px !important;
    max-height: 90vh;
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr !important; }
  .hero-stats { flex-direction: column; gap: 16px !important; }
  .mh-topbar { margin: 6px; padding: 8px 12px; }
}

/* ── Mobile topbar layout fix ──────────────────────────── */
@media (max-width: 768px) {
  /* Show hamburger on mobile only */
  #hamburgerBtn {
    display: flex !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    border: 1px solid var(--line) !important;
    background: transparent !important;
    cursor: pointer !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
  }

  /* Center brand in topbar */
  .mh-topbar {
    position: relative !important;
  }
  .mh-brand {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  /* Hide desktop nav completely */
  .mh-nav { display: none !important; }
}

/* Ensure desktop nav always shows on large screens */
@media (min-width: 769px) {
  .mh-hamburger { display: none !important; }
  .mh-nav { display: flex !important; }
  #mobileDrawer { display: none !important; }
  #navOverlay { display: none !important; }
}


/* ══════════════════════════════════════════════════
   MOBILE ENHANCEMENT v3 — App-like experience
   ══════════════════════════════════════════════════ */

/* ── Bottom nav bar (mobile only) ───────────────── */

.mh-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 80;
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  gap: 0;
  box-shadow: 0 -4px 24px rgba(15,23,42,.08);
}

.mh-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .2px;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: color .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.mh-bottom-nav-item .bn-icon {
  font-size: 20px;
  line-height: 1;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}

.mh-bottom-nav-item.active {
  color: var(--accent2);
}

.mh-bottom-nav-item.active .bn-icon {
  transform: scale(1.15) translateY(-1px);
}

.mh-bottom-nav-item:active .bn-icon {
  transform: scale(.92);
}

/* Active indicator dot */
.mh-bottom-nav-item.active::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent2);
  position: absolute;
  bottom: 6px;
}

/* Pill highlight for active */
.mh-bottom-nav-item.active .bn-icon-wrap {
  background: rgba(29,78,216,.10);
  border-radius: 10px;
  padding: 3px 14px;
}

.mh-bottom-nav-item .bn-icon-wrap {
  padding: 3px 14px;
  transition: background .15s ease;
}

/* ── Safe-area padding when bottom nav is shown ── */

body.has-bottom-nav {
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

/* ── Pull-to-refresh feel ────────────────────────── */

@media (max-width: 768px) {
  html { overscroll-behavior-y: contain; }
}

/* ── Topbar improvements for mobile ─────────────── */

@media (max-width: 768px) {

  /* Show bottom nav */
  .mh-bottom-nav { display: flex; }

  /* Tighten topbar */
  .mh-topbar {
    margin: 8px 8px 0;
    padding: 10px 14px;
    border-radius: 18px;
    top: 8px;
  }

  /* Hide desktop nav links on mobile entirely */
  .mh-nav { display: none !important; }
  .mh-hamburger { display: none !important; }

  /* Layout: stack all grids */
  .layout,
  .stats-row,
  .how-grid,
  .features,
  .paths,
  .info-grid,
  .form-grid,
  .filters {
    grid-template-columns: 1fr !important;
  }

  /* Hero stacks */
  .hero { grid-template-columns: 1fr !important; }
  .hero-right { min-height: 200px !important; }
  .hero-left { padding: 20px !important; }

  /* Cards full-width */
  .mh-wrap,
  .mh-wrap-md,
  .mh-wrap-sm {
    padding: 12px 10px;
  }

  /* Prevent iOS input zoom */
  .mh-input,
  .mh-select,
  .mh-textarea {
    font-size: 16px !important;
  }

  /* Touch-friendly tap targets */
  .mh-btn {
    min-height: 44px;
    padding: 10px 16px !important;
  }

  .mh-btn-sm {
    min-height: 36px;
    padding: 7px 12px !important;
  }

  /* Mentor grid → 1 col on narrow, 2 col on tablet */
  .mentor-grid {
    grid-template-columns: 1fr !important;
  }

  /* Sessions layout fix */
  .layout[style*="280px"] {
    grid-template-columns: 1fr !important;
  }

  /* Sidebar becomes horizontal scroll list */
  aside.mh-card {
    position: static !important;
  }

  /* Sticky topbar */
  .mh-topbar { position: sticky !important; }

  /* Modal full-screen feel */
  .mh-modal {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
  }
  .mh-modal-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  /* Stat boxes 2-up */
  .stats-row {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Section heads */
  .mh-section-head { flex-wrap: wrap; }

  /* Footer */
  .mh-footer { flex-direction: column; gap: 8px; text-align: center; }
  .mh-footer > div { justify-content: center; }

  /* Filters bar becomes vertical stack */
  .filters { flex-direction: column; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr !important; }
  .mh-topbar { margin: 6px 6px 0; }
  .mh-wrap,
  .mh-wrap-md,
  .mh-wrap-sm { padding: 10px 8px; }

  /* Hide label text in bottom nav on very small screens */
  .mh-bottom-nav-item span.bn-label { display: none; }
  .mh-bottom-nav-item .bn-icon-wrap { padding: 4px 18px; }
}

/* Tablet: 2-column mentor grid */
@media (min-width: 480px) and (max-width: 768px) {
  .mentor-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .stats-row { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ── Touch ripple effect ─────────────────────────── */

.mh-btn,
.mh-bottom-nav-item,
.req-card,
.mentor-card {
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
}

/* ── Smooth scrolling & momentum ────────────────── */

@media (max-width: 768px) {
  .req-list,
  #requestList {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .req-list::-webkit-scrollbar,
  #requestList::-webkit-scrollbar { display: none; }

  .req-item {
    flex-shrink: 0;
    min-width: 140px;
  }
}

/* ── Swipeable card feel ────────────────────────── */

@media (max-width: 768px) {
  .mh-card {
    border-radius: var(--radius) !important;
  }
}


/* ── Topbar: mobile — logo LEFT, sign-out RIGHT, nothing else ── */

@media (max-width: 768px) {

  /* Topbar layout: flex, space-between, brand anchored left */
  .mh-topbar {
    justify-content: space-between !important;
    gap: 8px !important;
    padding: 10px 14px !important;
    position: relative !important;
  }

  /* Brand always stays on the left — no centering trick */
  .mh-brand {
    position: static !important;
    transform: none !important;
    left: auto !important;
    flex-shrink: 0;
  }

  /* Hide hamburger — bottom nav replaces all nav */
  .mh-hamburger,
  #hamburgerBtn {
    display: none !important;
  }

  /* Hide the entire nav by default */
  .mh-nav {
    display: none !important;
  }

  /* When page has bottom nav: show nav rail but hide EVERYTHING except sign-out */
  body.has-bottom-nav .mh-nav {
    display: flex !important;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
  }

  /* Nuke every child in the nav */
  body.has-bottom-nav .mh-nav > * {
    display: none !important;
  }

  /* Bring back ONLY the sign-out button */
  body.has-bottom-nav .mh-nav > #signOutBtn {
    display: inline-flex !important;
    padding: 7px 12px !important;
    font-size: 12px !important;
    white-space: nowrap;
    min-height: 36px !important;
  }

  /* Also hide the desktop bell-wrap — bell lives in bottom nav on mobile */
  body.has-bottom-nav .mh-nav > .bell-wrap {
    display: none !important;
  }

  /* Hide chips/status text — too cramped */
  body.has-bottom-nav .mh-nav > .mh-chip,
  body.has-bottom-nav .mh-nav > #whoChip,
  body.has-bottom-nav .mh-nav > #envChip {
    display: none !important;
  }
}

/* ── Bottom nav active glow ─────────────────────── */

.mh-bottom-nav-item.active .bn-icon-wrap {
  background: rgba(29,78,216,.10);
  border-radius: 10px;
}

/* ── Smooth page transitions ────────────────────── */

@media (max-width: 768px) {
  .mh-wrap,
  .mh-wrap-md,
  .mh-wrap-sm {
    animation: mh-page-in .2s ease;
  }
}

@keyframes mh-page-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ── Mobile drawer components ────────────────────────── */
.mh-mobile-drawer .drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.mh-mobile-drawer .drawer-head-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mh-mobile-drawer .drawer-head-brand img {
  width: 32px; height: 32px; border-radius: 10px;
}
.mh-mobile-drawer .drawer-head-brand strong {
  font-size: 15px; font-weight: 800; color: var(--text);
}
.mh-drawer-close {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: var(--muted); padding: 4px;
  line-height: 1;
}
.mh-drawer-user {
  font-size: 12px; color: var(--muted);
  padding: 8px 14px; margin-bottom: 8px;
  background: var(--soft); border-radius: 10px;
}
.mh-drawer-links {
  display: flex; flex-direction: column; gap: 2px; flex: 1;
}
.mh-drawer-footer {
  padding-top: 12px; border-top: 1px solid var(--line);
}
.mh-drawer-signout {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: none; background: #fff5f5; color: #dc2626;
  font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit; text-align: left;
}
.mh-drawer-signout:hover { background: #fee2e2; }

/* ── Menu button (hamburger) ────────────────────────── */

/* Hidden by default on desktop — never shows the stray dot */
.mh-menu-btn {
  display: none !important;
}

/* Only show on mobile when there is NO bottom nav (i.e. pages without it) */
@media (max-width: 768px) {
  body:not(.has-bottom-nav) .mh-menu-btn {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: transparent;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
  }

  body:not(.has-bottom-nav) .mh-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
  }
}
