/* ===== Mobile-first enhancements — E HOTLING ===== */

:root {
  --mobile-nav-height: 56px;
  --bottom-nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-max-width: 480px;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  padding-bottom: var(--safe-bottom);
}

body.has-bottom-nav {
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 8px);
}

body.has-install-banner {
  padding-bottom: calc(56px + var(--safe-bottom));
}

body.has-bottom-nav.has-install-banner {
  padding-bottom: calc(var(--bottom-nav-height) + 56px + var(--safe-bottom));
}

/* ----- Hamburger navbar ----- */
.nav-container {
  position: relative;
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  z-index: 110;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.mobile-menu-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.open span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 98;
}

.nav-drawer-backdrop.active {
  display: block;
}

@media (max-width: 900px) {
  .nav-container {
    flex-wrap: nowrap;
    padding: 0 1rem;
    gap: 0.5rem;
  }

  .logo {
    font-size: 1.25rem;
    flex: 1;
    letter-spacing: 1px;
  }

  .mobile-menu-btn {
    display: flex;
    margin-left: auto;
  }

  .nav-menu,
  .nav-auth {
    display: none !important;
  }

  .nav-menu.mobile-open,
  .nav-auth.mobile-open {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: var(--mobile-nav-height);
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #6d28d9 0%, #7c3aed 100%);
    padding: 1rem 1.25rem 1.5rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    z-index: 99;
    max-height: calc(100vh - var(--mobile-nav-height));
    overflow-y: auto;
    gap: 0.25rem;
  }

  .nav-menu.mobile-open {
    padding-bottom: 0.5rem;
  }

  .nav-auth.mobile-open {
    position: relative;
    top: auto;
    bottom: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 0.5rem;
    padding-top: 1rem;
    padding-bottom: 0.5rem;
  }

  .nav-menu.mobile-open a,
  .nav-auth.mobile-open .nav-login,
  .nav-auth.mobile-open .nav-signup {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    min-height: 44px;
  }

  .nav-auth.mobile-open .user-profile {
    width: 100%;
    flex-direction: column;
    gap: 0.75rem;
  }

  .navbar {
    padding: 0.5rem 0;
  }

  .nav-auth.mobile-open .nav-download-app {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

/* Fixed install entry — navbar only (no screen popup) */
.nav-download-app {
  margin-right: 0.65rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
}

.nav-download-app:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ----- Hero & banners ----- */
@media (max-width: 768px) {
  .header-hero {
    padding: 2rem 1rem 2.5rem;
  }

  .header-hero-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }

  .header-hero .header-content {
    text-align: center;
  }

  .header-hero .header-content p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta-row {
    justify-content: center;
  }

  .hero-install-btn {
    display: inline-flex !important;
    width: 100%;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.85) !important;
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    cursor: pointer;
    font-family: inherit;
  }

  .header-illustration,
  .hero-svg {
    max-width: 280px;
    margin: 0 auto;
  }

  .page-banner-inner {
    grid-template-columns: 1fr !important;
    text-align: center;
    gap: 1rem !important;
  }

  .page-banner-text h1 {
    font-size: 1.75rem !important;
  }

  .trust-strip-inner {
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
  }

  .trust-item {
    flex-direction: column;
    text-align: center;
    font-size: 0.85rem;
  }

  .balance-card {
    flex-wrap: wrap;
    padding: 1.25rem !important;
  }

  .balance-amount {
    font-size: 1.75rem !important;
  }

  .cards-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .card {
    padding: 1.25rem;
  }

  .card-btn,
  .submit-btn,
  .hero-btn,
  .login-btn,
  .auth-btn,
  .referral-copy-btn,
  .referral-admin-submit,
  .complete-booking-btn,
  .home-download-app-btn,
  .install-app-modal-primary {
    min-height: 44px;
    width: 100%;
    max-width: 100%;
  }

  .balance-refresh button,
  .close-modal,
  .mobile-menu-btn,
  .nav-logout,
  .copy-btn,
  .select-hotel-btn,
  .cancel-btn,
  .amount-preset {
    width: auto;
    max-width: 100%;
  }

  .contact-form input,
  .contact-form textarea,
  .form-group input,
  .form-group select {
    font-size: 16px !important;
    min-height: 44px;
  }

  .section-with-graphic {
    flex-direction: column;
    align-items: center;
  }

  .about-section,
  .contact-section {
    padding: 2rem 1rem;
  }

  .referral-link-box {
    flex-direction: column !important;
  }

  .referral-link-input {
    width: 100% !important;
    font-size: 14px !important;
  }

  .referral-copy-btn {
    width: 100%;
  }

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

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

  .users-table,
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.8rem;
  }

  .modal-content {
    max-width: calc(100vw - 24px) !important;
    margin: 12px;
  }

  .auth-card {
    margin: 1rem;
    padding: 1.5rem !important;
  }

  body::after {
    display: none;
  }
}

@media (max-width: 480px) {
  .trust-strip-inner {
    grid-template-columns: 1fr !important;
  }

  .nav-login,
  .nav-signup {
    font-size: 0.95rem;
  }

  .footer {
    padding: 1.25rem 1rem;
    font-size: 0.85rem;
  }
}

/* ----- Install app banner ----- */
.install-app-banner {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  padding: 12px 14px calc(12px + var(--safe-bottom));
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
  color: #fff;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
  align-items: center;
  gap: 12px;
}

.install-app-banner.visible {
  display: flex;
}

body.has-bottom-nav .install-app-banner.visible {
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
}

.install-app-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}

.install-app-text {
  flex: 1;
  min-width: 0;
}

.install-app-text strong {
  display: block;
  font-size: 0.95rem;
}

.install-app-text span {
  font-size: 0.75rem;
  opacity: 0.85;
}

.install-app-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.install-app-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
}

.install-app-btn-primary {
  background: #7c3aed;
  color: #fff;
}

.install-app-btn-dismiss {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  padding: 4px 8px;
}

/* ----- Bottom navigation (logged-in app) ----- */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #fff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
  justify-content: space-around;
  align-items: center;
}

.mobile-bottom-nav.visible {
  display: flex;
}

.mobile-bottom-nav a,
.mobile-bottom-nav button.bottom-nav-helpline {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: #6b7280;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 6px 2px;
  min-height: 44px;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}

.mobile-bottom-nav button.bottom-nav-helpline {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.mobile-bottom-nav a .nav-icon,
.mobile-bottom-nav button.bottom-nav-helpline .nav-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.mobile-bottom-nav a.active {
  color: #7c3aed;
}

.mobile-bottom-nav-6 a,
.mobile-bottom-nav-6 button.bottom-nav-helpline {
  font-size: 0.58rem;
  padding: 6px 1px;
}

.mobile-bottom-nav-6 a .nav-icon,
.mobile-bottom-nav-6 button.bottom-nav-helpline .nav-icon {
  font-size: 1.2rem;
}

.mobile-bottom-nav-6 a span:last-child,
.mobile-bottom-nav-6 button.bottom-nav-helpline span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-bottom-nav-6 button.bottom-nav-helpline span:last-child {
  font-size: 0.5rem;
  letter-spacing: -0.02em;
}

/* Finance page mobile */
@media (max-width: 768px) {
  .finance-grid {
    grid-template-columns: 1fr !important;
  }

  .finance-container {
    padding: 12px !important;
  }

  .finance-header h1 {
    font-size: 1.75rem !important;
  }
}

/* Tasks grid mobile */
@media (max-width: 768px) {
  .tasks-grid,
  .task-grid {
    grid-template-columns: 1fr !important;
  }

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

/* Withdrawal page */
@media (max-width: 768px) {
  body:has(.container > nav) {
    padding: 12px !important;
  }

  body:has(.container > nav) nav {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px !important;
    text-align: center;
  }

  body:has(.container > nav) nav .user-info {
    flex-direction: column;
    width: 100%;
  }

  body:has(.container > nav) .withdrawal-form,
  body:has(.container > nav) .form-section {
    padding: 16px !important;
  }
}

/* Admin portal mobile */
@media (max-width: 768px) {
  .admin-content {
    padding: 16px 12px !important;
  }

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

  .stat-value {
    font-size: 1.25rem !important;
  }

  .controls-section {
    padding: 16px !important;
    overflow-x: auto;
  }

  .search-group {
    flex-direction: column !important;
  }

  .search-group input,
  .search-group button {
    width: 100% !important;
  }

  .login-form {
    margin: 40px 16px !important;
    padding: 24px !important;
  }

  .admin-navbar {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .admin-nav-actions {
    justify-content: center;
    width: 100%;
  }
}

/* Floating download FAB on home */
.app-download-fab {
  display: none;
  position: fixed;
  right: 16px;
  bottom: calc(80px + var(--safe-bottom));
  z-index: 9998;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.45);
  font-size: 1.4rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.app-download-fab.visible {
  display: flex;
}

body.has-bottom-nav .app-download-fab.visible {
  bottom: calc(var(--bottom-nav-height) + 16px + var(--safe-bottom));
}

@media (min-width: 901px) {
  .app-download-fab.visible {
    bottom: 24px;
  }

  .hero-install-btn {
    display: none !important;
  }
}

.hero-install-btn {
  display: none;
}

/* ===== App shell — mobile layout on every screen (user site only) ===== */
html.ehotling-app-html {
  background: linear-gradient(165deg, #111827 0%, #374151 45%, #1f2937 100%);
  min-height: 100%;
}

body.ehotling-mobile-app {
  max-width: var(--app-max-width);
  margin-left: auto;
  margin-right: auto;
  background-color: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 25px 50px -12px rgba(0, 0, 0, 0.45);
  overflow-x: hidden;
  position: relative;
}

@media (min-width: 521px) {
  body.ehotling-mobile-app {
    margin-top: 20px;
    margin-bottom: 20px;
    min-height: calc(100vh - 40px);
    border-radius: 22px;
  }
}

body.ehotling-mobile-app::after {
  display: none;
}

body.ehotling-mobile-app::before {
  opacity: 0.35;
}

/* Always use hamburger nav */
body.ehotling-mobile-app .nav-container {
  flex-wrap: nowrap;
  padding: 0 1rem;
  gap: 0.5rem;
  max-width: 100%;
}

body.ehotling-mobile-app .logo {
  font-size: 1.25rem;
  flex: 1;
  letter-spacing: 1px;
}

body.ehotling-mobile-app .mobile-menu-btn {
  display: flex !important;
  margin-left: auto;
}

body.ehotling-mobile-app .nav-menu,
body.ehotling-mobile-app .nav-auth {
  display: none !important;
}

body.ehotling-mobile-app .nav-menu.mobile-open,
body.ehotling-mobile-app .nav-auth.mobile-open {
  display: flex !important;
  flex-direction: column;
  position: fixed;
  top: var(--mobile-nav-height);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max-width);
  right: auto;
  background: linear-gradient(180deg, #6d28d9 0%, #7c3aed 100%);
  padding: 1rem 1.25rem 1.5rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  z-index: 99;
  max-height: calc(100vh - var(--mobile-nav-height));
  overflow-y: auto;
  gap: 0.25rem;
}

body.ehotling-mobile-app .nav-menu.mobile-open {
  padding-bottom: 0.5rem;
}

body.ehotling-mobile-app .nav-auth.mobile-open {
  position: relative;
  top: auto;
  bottom: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 0.5rem;
  padding-top: 1rem;
  padding-bottom: 0.5rem;
}

body.ehotling-mobile-app .nav-menu.mobile-open a,
body.ehotling-mobile-app .nav-auth.mobile-open .nav-login,
body.ehotling-mobile-app .nav-auth.mobile-open .nav-signup {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  min-height: 44px;
}

body.ehotling-mobile-app .nav-auth.mobile-open .user-profile {
  width: 100%;
  flex-direction: column;
  gap: 0.75rem;
}

body.ehotling-mobile-app .navbar {
  padding: 0.5rem 0;
}

body.ehotling-mobile-app .nav-auth.mobile-open .nav-download-app {
  display: block;
  width: 100%;
  margin-bottom: 0.5rem;
}

/* Bottom nav aligned to app frame */
body.ehotling-mobile-app .mobile-bottom-nav.visible {
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max-width);
  right: auto;
}

@media (min-width: 521px) {
  body.ehotling-mobile-app .mobile-bottom-nav.visible {
    border-radius: 0 0 22px 22px;
  }
}

/* Single-column layouts everywhere */
body.ehotling-mobile-app .container,
body.ehotling-mobile-app .finance-content {
  max-width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}

body.ehotling-mobile-app .header-hero {
  padding: 2rem 1rem 2.5rem;
}

body.ehotling-mobile-app .header-hero-inner {
  grid-template-columns: 1fr;
  gap: 1.5rem;
  text-align: center;
}

body.ehotling-mobile-app .header-hero .header-content {
  text-align: center;
}

body.ehotling-mobile-app .header-hero .header-content p {
  margin-left: auto;
  margin-right: auto;
}

body.ehotling-mobile-app .header-content h1 {
  font-size: 2rem;
}

body.ehotling-mobile-app .header-content p {
  font-size: 1.05rem;
}

body.ehotling-mobile-app .hero-cta-row {
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
}

body.ehotling-mobile-app .hero-install-btn {
  display: inline-flex !important;
  width: 100%;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.85) !important;
  background: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
  cursor: pointer;
  font-family: inherit;
}

body.ehotling-mobile-app .header-illustration,
body.ehotling-mobile-app .hero-svg {
  max-width: 280px;
  margin: 0 auto;
}

body.ehotling-mobile-app .page-banner-inner {
  grid-template-columns: 1fr !important;
  flex-direction: column;
  text-align: center;
  gap: 1rem !important;
}

body.ehotling-mobile-app .page-banner-text h1 {
  font-size: 1.75rem !important;
}

body.ehotling-mobile-app .trust-strip-inner {
  grid-template-columns: 1fr !important;
  gap: 1rem !important;
}

body.ehotling-mobile-app .trust-item {
  flex-direction: column;
  text-align: center;
  font-size: 0.85rem;
}

body.ehotling-mobile-app .balance-card {
  flex-wrap: wrap;
  padding: 1.25rem !important;
}

body.ehotling-mobile-app .balance-amount {
  font-size: 1.75rem !important;
}

body.ehotling-mobile-app .cards-grid,
body.ehotling-mobile-app .tasks-grid,
body.ehotling-mobile-app .task-grid,
body.ehotling-mobile-app .levels-grid,
body.ehotling-mobile-app .finance-grid {
  grid-template-columns: 1fr !important;
  gap: 1rem;
}

body.ehotling-mobile-app .card {
  padding: 1.25rem;
}

body.ehotling-mobile-app .card-btn,
body.ehotling-mobile-app .submit-btn,
body.ehotling-mobile-app .hero-btn,
body.ehotling-mobile-app .login-btn,
body.ehotling-mobile-app .auth-btn,
body.ehotling-mobile-app .referral-copy-btn,
body.ehotling-mobile-app .home-download-app-btn,
body.ehotling-mobile-app .complete-booking-btn {
  min-height: 44px;
  width: 100%;
  max-width: 100%;
}

body.ehotling-mobile-app .balance-refresh button,
body.ehotling-mobile-app .close-modal,
body.ehotling-mobile-app .copy-btn,
body.ehotling-mobile-app .select-hotel-btn,
body.ehotling-mobile-app .cancel-btn,
body.ehotling-mobile-app .amount-preset,
body.ehotling-mobile-app .mobile-menu-btn,
body.ehotling-mobile-app .nav-logout {
  width: auto;
  max-width: 100%;
}

body.ehotling-mobile-app .contact-form input,
body.ehotling-mobile-app .contact-form textarea,
body.ehotling-mobile-app .form-group input,
body.ehotling-mobile-app .form-group select {
  font-size: 16px !important;
  min-height: 44px;
}

body.ehotling-mobile-app .section-with-graphic {
  flex-direction: column;
  align-items: center;
  grid-template-columns: 1fr;
  text-align: center;
}

body.ehotling-mobile-app .about-section,
body.ehotling-mobile-app .contact-section {
  padding: 2rem 1rem;
}

body.ehotling-mobile-app .referral-link-box {
  flex-direction: column !important;
}

body.ehotling-mobile-app .referral-link-input {
  width: 100% !important;
  font-size: 14px !important;
}

body.ehotling-mobile-app .referral-copy-btn {
  width: 100%;
}

body.ehotling-mobile-app .referral-share-grid,
body.ehotling-mobile-app .referral-stats {
  grid-template-columns: 1fr 1fr !important;
}

body.ehotling-mobile-app .users-table,
body.ehotling-mobile-app table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 0.8rem;
}

body.ehotling-mobile-app .modal-content {
  max-width: calc(var(--app-max-width) - 24px) !important;
  margin: 12px;
}

body.ehotling-mobile-app .auth-container {
  padding: 1rem;
  min-height: auto;
}

body.ehotling-mobile-app .auth-split {
  grid-template-columns: 1fr;
  max-width: 100%;
  padding: 1rem;
  min-height: auto;
}

body.ehotling-mobile-app .auth-illustration-panel {
  border-radius: 20px 20px 0 0;
  padding: 2rem 1.5rem;
}

body.ehotling-mobile-app .auth-split .auth-card {
  border-radius: 0 0 20px 20px;
  margin: 0;
  padding: 1.5rem !important;
}

body.ehotling-mobile-app .finance-container {
  padding: 12px !important;
}

body.ehotling-mobile-app .finance-header h1 {
  font-size: 1.75rem !important;
}

body.ehotling-mobile-app .main-content {
  grid-template-columns: 1fr !important;
}

body.ehotling-mobile-app .container > nav {
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px !important;
  text-align: center;
}

body.ehotling-mobile-app .container > nav .user-info {
  flex-direction: column;
  width: 100%;
}

body.ehotling-mobile-app .withdrawal-form,
body.ehotling-mobile-app .form-section {
  padding: 16px !important;
}

body.ehotling-mobile-app .footer {
  padding: 1.25rem 1rem;
  font-size: 0.85rem;
}

body.ehotling-mobile-app .decorative-graphics {
  padding: 2rem 0;
}

body.ehotling-mobile-app .hotel-graphics-svg {
  min-height: 120px;
}

body.ehotling-mobile-app .section-graphic-mini {
  margin: 0 auto;
}

body.ehotling-mobile-app .referral-page-grid {
  grid-template-columns: 1fr !important;
  max-width: 100%;
}

body.ehotling-mobile-app .earned-card {
  padding: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

body.ehotling-mobile-app .earned-card-icon {
  font-size: 2rem;
}

body.ehotling-mobile-app .earned-amount {
  font-size: 1.5rem;
}

body.ehotling-mobile-app .trust-strip {
  padding: 1.75rem 1rem;
}

body.ehotling-mobile-app .trust-strip-inner {
  max-width: 100%;
}

body.ehotling-mobile-app .header {
  padding: 2.5rem 1rem;
}

/* ----- Logged-in home dashboard (index only) ----- */
html.logged-in-home-pending #guestHome,
body.logged-in-home #guestHome,
#guestHome.guest-home-hidden {
  display: none !important;
}

html.logged-in-home-pending #userHome,
body.logged-in-home #userHome,
#userHome.user-home-visible {
  display: block !important;
}

html.logged-in-home-pending #siteFooter,
body.logged-in-home #siteFooter {
  display: none !important;
}

body.logged-in-home .footer {
  margin-top: auto;
}

.home-dashboard-wrap {
  padding: 1.25rem 1rem 0.5rem;
  min-height: calc(100vh - var(--mobile-nav-height) - var(--bottom-nav-height) - 48px);
  display: flex;
  flex-direction: column;
}

.home-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
}

.home-profile-card {
  background: linear-gradient(160deg, #5b21b6 0%, #7c3aed 55%, #a78bfa 100%);
  color: #fff;
  border-radius: 18px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.28);
}

.home-user-name {
  margin: 0 0 0.75rem;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.home-user-id-row {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
}

.home-user-id-label {
  font-size: 0.8rem;
  opacity: 0.85;
  font-weight: 500;
}

.home-user-id-value {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
}

.home-balance-panel {
  margin-bottom: 0;
}

.home-download-app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.85rem 1rem;
  border: 2px solid rgba(124, 58, 237, 0.35);
  border-radius: 12px;
  background: #f5f3ff;
  color: #6d28d9;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  min-height: 44px;
}

/* Install app modal */
.install-app-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(15, 23, 42, 0.55);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.install-app-modal.visible {
  display: flex;
}

.install-app-modal-card {
  background: #fff;
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  padding: 24px 22px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  position: relative;
}

.install-app-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
}

.install-app-modal-card h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  color: #1e293b;
}

.install-app-modal-lead {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: #64748b;
}

.install-app-steps {
  margin: 0 0 14px;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.55;
}

.install-app-modal-note {
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: #94a3b8;
}

.install-app-modal-primary {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.home-download-app-btn:hover {
  background: #ede9fe;
}

/* ===== Mobile: cards & boxes fit screen ===== */
@media (max-width: 768px) {
  html {
    overflow-x: hidden;
  }

  .container,
  .cards-section,
  .home-dashboard-wrap,
  .finance-content,
  .finance-container,
  .admin-content,
  .referral-page-grid,
  .referral-page-main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .container {
    padding-left: max(0.85rem, env(safe-area-inset-left));
    padding-right: max(0.85rem, env(safe-area-inset-right));
  }

  .cards-grid,
  .tasks-grid,
  .task-grid,
  .levels-grid,
  .finance-grid,
  .hotel-options-grid,
  .stats-grid {
    width: 100%;
    min-width: 0;
  }

  .card,
  .balance-card,
  .referral-card,
  .earned-card,
  .finance-card,
  .finance-header,
  .stat-card,
  .home-profile-card,
  .help-support-card,
  .level-progress-banner,
  .tasks-card,
  .tasks-card-container,
  .auth-card,
  .login-form,
  .content-box,
  .wallet-address-container,
  .message-box {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .balance-card {
    width: 100%;
  }

  .balance-content {
    min-width: 0;
    width: 100%;
  }

  .balance-amount,
  .earned-amount {
    font-size: clamp(1.25rem, 5.5vw, 1.75rem) !important;
    word-break: break-word;
  }

  .referral-card {
    padding: 1.25rem !important;
  }

  .referral-page-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
    padding: 0;
  }

  .referral-link-box {
    width: 100%;
  }

  .referral-link-input {
    min-width: 0 !important;
    flex: 1 1 auto;
    width: 100% !important;
  }

  .referral-list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .referral-list-item,
  .referral-list-item-4,
  .referral-list-item-2 {
    grid-template-columns: 1fr 1.5fr !important;
    gap: 6px;
    padding: 10px 12px;
    font-size: 0.8rem;
    min-width: 0;
  }

  .referral-list-header {
    display: none;
  }

  .earned-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem !important;
  }

  .earned-card-content {
    width: 100%;
    align-items: center;
  }

  .task-item {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.85rem;
  }

  .task-item label {
    min-width: 0;
    word-break: break-word;
  }

  .modal-content {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    margin: 10px;
  }

  .page-banner {
    padding: 2rem 1rem;
  }

  .page-banner-inner {
    padding: 0;
  }

  .section-title {
    font-size: clamp(1.35rem, 5vw, 2rem);
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .card-header .card-title {
    font-size: 1.35rem;
    word-break: break-word;
  }

  .amount-display {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .wallet-address-display {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .wallet-address-display .copy-btn {
    width: 100%;
  }

  .hotel-booking-footer {
    flex-direction: column;
    gap: 0.75rem;
  }

  .hotel-booking-footer .complete-booking-btn,
  .hotel-booking-footer .cancel-btn {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .referral-share-grid,
  .referral-stats,
  .stats-grid,
  .amount-display {
    grid-template-columns: 1fr !important;
  }

  .referral-list-item,
  .referral-list-item-4,
  .referral-list-item-2 {
    grid-template-columns: 1fr 1.5fr !important;
  }

  .trust-strip-inner {
    grid-template-columns: 1fr !important;
  }

  .finance-card,
  .finance-header {
    padding: 1.25rem !important;
  }

  .finance-header h1 {
    font-size: 1.5rem !important;
  }
}

@media (max-width: 520px) {
  body.ehotling-mobile-app {
    max-width: 100%;
    width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    border-radius: 0;
    min-height: 100vh;
    min-height: 100dvh;
  }

  html.ehotling-app-html {
    background: #f8fafc;
  }
}
