    * { font-family: 'DM Sans', sans-serif; box-sizing: border-box; }
    html, body, #app { height: 100%; margin: 0; }

    /* === Backgrounds === */
    .gradient-ocean { background: linear-gradient(160deg, #f1f5f9 0%, #f8fafc 40%, #f1f5f9 100%); }
    .glass { background: rgba(255,255,255,0.85); backdrop-filter: blur(16px); border: 1px solid rgba(0,0,0,0.06); box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
    .glass-white { background: rgba(255,255,255,0.92); backdrop-filter: blur(12px); }

    /* === Cards === */
    .card { background: #fff; border-radius: 20px; box-shadow: 0 4px 24px rgba(16,42,67,0.08), 0 1px 3px rgba(16,42,67,0.04); transition: all 0.35s cubic-bezier(.4,0,.2,1); }
    .card:hover { box-shadow: 0 12px 40px rgba(16,42,67,0.14); transform: translateY(-3px); }
    .card-flat { background: #fff; border-radius: 20px; box-shadow: 0 4px 24px rgba(16,42,67,0.06); border: 1px solid #e2e8f0; }

    /* === Buttons === */
    .btn-gold { background: linear-gradient(135deg, #f7c948 0%, #f0b429 60%, #de911d 100%); color: #102a43; font-weight: 700; border-radius: 14px; padding: 14px 28px; transition: all 0.3s cubic-bezier(.4,0,.2,1); box-shadow: 0 4px 14px rgba(240,180,41,0.3); }
    .btn-gold:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(240,180,41,0.45); }
    .btn-ghost { background: rgba(16,42,67,0.06); color: #334e68; font-weight: 500; border-radius: 12px; padding: 10px 20px; transition: all 0.25s ease; border: 1px solid rgba(16,42,67,0.1); }
    .btn-ghost:hover { background: rgba(16,42,67,0.1); }

    /* === Inputs === */
    .field { width: 100%; padding: 13px 18px; border-radius: 14px; border: 2px solid #e2e8f0; outline: none; font-size: 0.95rem; transition: border-color 0.25s, box-shadow 0.25s; background: #fff; }
    .field:focus { border-color: #f0b429; box-shadow: 0 0 0 4px rgba(240,180,41,0.12); }
    select.field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23627d98' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }

    /* === Section toggles === */
    .section-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-radius: 16px; cursor: pointer; transition: all 0.25s ease; }
    .section-toggle:hover { filter: brightness(0.96); }
    .qual-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; transition: background 0.15s; font-size: 13px; color: #1e293b; }
    .qual-item:hover { background: #f0f4f8; }
    .qual-item input { flex-shrink: 0; }
    .qual-item.hidden { display: none; }
    .section-body { overflow: hidden; transition: max-height 0.4s cubic-bezier(.4,0,.2,1), opacity 0.3s ease; }
    .section-body.collapsed { max-height: 0; opacity: 0; padding: 0 !important; }
    .section-body.expanded { max-height: 9999px; opacity: 1; }
    .chevron { transition: transform 0.3s ease; }
    .chevron.open { transform: rotate(180deg); }
    @keyframes spin { to { transform: rotate(360deg); } }
    .animate-spin { animation: spin 1s linear infinite; display: inline-block; }

    /* === Animations === */
    .fade-up { animation: fadeUp 0.5s cubic-bezier(.4,0,.2,1) both; }
    @keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
    .stagger-1 { animation-delay: 0.05s; }
    .stagger-2 { animation-delay: 0.12s; }
    .stagger-3 { animation-delay: 0.2s; }

    @keyframes float1 { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-20px) scale(1.05); } }
    @keyframes float2 { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(15px) scale(1.08); } }
    @keyframes scrollBounce { 0%,100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(6px); opacity: 0.4; } }
    @keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
    @keyframes pulse-glow { 0%,100% { opacity: 0.6; } 50% { opacity: 1; } }

    .toast-slide { animation: slideIn 0.35s cubic-bezier(.4,0,.2,1); }
    @keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

    /* === Stats === */
    .stat-card { border-radius: 16px; padding: 20px; background: #fff; box-shadow: 0 2px 12px rgba(16,42,67,0.06); border: 1px solid #e2e8f0; }

    /* === Orange-themed card for portals === */
    .card-orange { background: rgba(255,255,255,0.9); border-radius: 20px; box-shadow: 0 4px 24px rgba(234,88,12,0.08); border: 1px solid rgba(234,88,12,0.15); }

    /* === Misc === */
    .tag { display: inline-block; padding: 4px 12px; border-radius: 99px; font-size: 0.75rem; font-weight: 600; }
    .divider { height: 1px; background: #e2e8f0; margin: 24px 0; }
    .hero-overlay { background: linear-gradient(to bottom, rgba(16,42,67,0.55) 0%, rgba(16,42,67,0.7) 100%); }
    #qr-container { background: #fff; padding: 20px; border-radius: 16px; display: flex; justify-content: center; align-items: center; min-height: 280px; }
    #qr-container canvas { display: block; }
    .page { visibility: hidden; position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; z-index: 1; }
    .page.active { visibility: visible; pointer-events: auto; opacity: 1; z-index: 2; }
    .page.modal-page { z-index: 40 !important; }

    /* === Scrollbar === */
    ::-webkit-scrollbar { width: 6px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: rgba(98,125,152,0.3); border-radius: 99px; }

    /* === MOBILE & TABLET RESPONSIVE === */
    /* Touch-friendly tap targets */
    @media (max-width: 640px) {
      .field { padding: 14px 16px; font-size: 16px !important; border-radius: 12px; } /* 16px prevents iOS zoom */
      select.field { font-size: 16px !important; }
      textarea.field { font-size: 16px !important; }
      .btn-gold { padding: 16px 24px; font-size: 1rem; }
      .stat-card { padding: 14px; }
      .stat-card .text-3xl { font-size: 1.5rem; }
      .stat-card .text-xl { font-size: 1.15rem; }
      .card-flat { border-radius: 16px; }
      .tag { padding: 3px 10px; font-size: 0.7rem; }
      .divider { margin: 16px 0; }

      /* Stack grids on mobile */
      .grid-cols-2 { grid-template-columns: 1fr !important; }

      /* Modal padding */
      .modal-page .card-flat { margin: 8px; padding: 20px !important; border-radius: 16px; }
      .modal-page .max-w-md, .modal-page .max-w-2xl { max-width: 100%; }

      /* Admin filter grids — stack fully */
      .md\:grid-cols-4 { grid-template-columns: 1fr !important; }
      .md\:grid-cols-3 { grid-template-columns: 1fr !important; }

      /* Header compact */
      header .gap-3 { gap: 8px; }

      /* Journey timeline compact */
      .space-y-3 > .border-l-4 { margin-left: 0; }

      /* Long text wrapping */
      .truncate { white-space: normal !important; word-break: break-word; }

      /* Fix absolutely positioned toast on small screens */
      #toast-container { left: 12px; right: 12px; top: auto; bottom: 12px; }

      /* Profile photo sizing — scale nicely on small screens */
      #profile-photo-container { width: min(50vw, 200px) !important; height: min(50vw, 200px) !important; }

      /* QR code sizing */
      #qr-container { min-height: 200px; padding: 12px; }
      #qr-container canvas { max-width: 200px !important; max-height: 200px !important; }
    }

    /* Tablet tweaks */
    @media (min-width: 641px) and (max-width: 1024px) {
      .field { padding: 13px 16px; }
      .stat-card { padding: 16px; }
      .modal-page .card-flat { padding: 28px !important; }
    }

    /* Fix iOS safe area for notch phones */
    @supports (padding-top: env(safe-area-inset-top)) {
      .page { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
      header { padding-top: calc(12px + env(safe-area-inset-top)); }
    }

    /* Smooth scrolling on iOS */
    .overflow-auto, .overflow-y-auto { -webkit-overflow-scrolling: touch; }

    /* Prevent text overflow in flex containers */
    [class*="flex"] { min-width: 0; }

    /* Better touch targets for checkboxes/radios */
    input[type="checkbox"], input[type="radio"] { min-width: 20px; min-height: 20px; }

    /* === Coming Soon Blur Overlay === */
    .coming-soon-wrap { position: relative; overflow: hidden; border-radius: 20px; }
    .coming-soon-blur { filter: blur(4px); opacity: 0.45; pointer-events: none; user-select: none; }
    .coming-soon-overlay {
      position: absolute; inset: 0; z-index: 5;
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      background: rgba(255,255,255,0.55); backdrop-filter: blur(2px);
      border-radius: 20px; pointer-events: auto;
    }
    .coming-soon-badge {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 10px 24px; border-radius: 99px;
      background: linear-gradient(135deg, #102a43 0%, #243b53 100%);
      color: #fff; font-weight: 700; font-size: 0.85rem;
      box-shadow: 0 4px 20px rgba(16,42,67,0.25);
      letter-spacing: 0.02em;
    }
    label { cursor: pointer; }

    /* === Cloud Sync Status Indicator === */
    .sync-indicator {
      position: fixed; bottom: 16px; left: 16px; z-index: 50;
      display: flex; align-items: center; gap: 6px;
      padding: 6px 12px; border-radius: 20px;
      font-size: 0.7rem; font-weight: 600;
      transition: all 0.3s ease; cursor: default;
      background: rgba(255,255,255,0.92); backdrop-filter: blur(8px);
      box-shadow: 0 2px 8px rgba(0,0,0,0.08); border: 1px solid rgba(0,0,0,0.06);
    }
    .sync-dot {
      width: 8px; height: 8px; border-radius: 50%; display: inline-block;
    }
    .synced-dot { background: #10b981; }
    .pending-dot { background: #f59e0b; animation: sync-pulse 1.5s ease-in-out infinite; }
    .sync-spinner {
      width: 10px; height: 10px; border: 2px solid #e2e8f0;
      border-top-color: #3b82f6; border-radius: 50%;
      display: inline-block; animation: sync-spin 0.8s linear infinite;
    }
    @keyframes sync-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
    @keyframes sync-spin { to { transform: rotate(360deg); } }

    /* === Inline Form Validation === */
    .field-error { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239,68,68,0.1) !important; }
    .field-success { border-color: #10b981 !important; box-shadow: 0 0 0 3px rgba(16,185,129,0.08) !important; }
    .field-hint { font-size: 0.75rem; margin-top: 4px; line-height: 1.3; }
    .field-hint-error { color: #ef4444; }

    /* === Password Visibility Toggle === */
    .pw-toggle-wrap { position: relative; }
    .pw-toggle-wrap .field { padding-right: 44px; }
    .pw-toggle-btn {
      position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
      background: none; border: none; cursor: pointer; padding: 4px;
      color: #627d98; transition: color 0.2s;
      display: flex; align-items: center; justify-content: center;
    }
    .pw-toggle-btn:hover { color: #102a43; }
    .pw-toggle-btn svg { width: 20px; height: 20px; }

    /* === Password Strength Meter === */
    .pw-strength-meter {
      display: none; align-items: center; gap: 8px; margin-top: 6px;
    }
    .pw-strength-bars { display: flex; gap: 3px; flex: 1; }
    .pw-strength-bars span {
      height: 4px; flex: 1; border-radius: 2px;
      background: #e2e8f0; transition: background 0.25s ease;
    }
    .pw-strength-label { font-size: 0.7rem; font-weight: 600; min-width: 44px; text-align: right; }

    /* === Loading Button State === */
    .btn-loading { opacity: 0.7; pointer-events: none; cursor: wait; }
    .btn-spinner {
      display: inline-block; width: 16px; height: 16px;
      border: 2.5px solid rgba(255,255,255,0.3); border-top-color: #fff;
      border-radius: 50%; animation: spin 0.7s linear infinite;
      vertical-align: middle; margin-right: 4px;
    }

    /* === Skeleton Loading === */
    .skeleton {
      background: linear-gradient(90deg, #e2e8f0 25%, #f0f4f8 50%, #e2e8f0 75%);
      background-size: 200% 100%; animation: shimmer 1.5s ease-in-out infinite;
      border-radius: 8px;
    }
    .skeleton-text { height: 14px; margin-bottom: 8px; }
    .skeleton-text:last-child { width: 60%; }
    .skeleton-heading { height: 20px; width: 40%; margin-bottom: 12px; }
    .skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
    .skeleton-card {
      padding: 20px; border-radius: 16px; border: 1px solid #e2e8f0;
      background: #fff;
    }

    /* === Social / Messenger Layout === */
    #social-sidebar { transition: width 0.2s ease; }
    #social-conv-list > div { transition: background 0.15s ease; }
    #social-chat-messages { scroll-behavior: smooth; }

    /* Mobile: stack sidebar full-width, chat is hidden until JS shows it */
    @media (max-width: 767px) {
      #social-sidebar { width: 100% !important; border-right: none !important; }
      #social-view-chats { position: relative; }
      /* Chat panel overlays sidebar on mobile when opened via JS */
      .social-mobile-chat-open #social-chat-panel {
        display: flex !important;
        position: absolute; inset: 0; z-index: 5;
        background: #f9fafb;
      }
      .social-mobile-chat-open #social-sidebar { display: none !important; }
    }

    /* Tablet: narrower sidebar */
    @media (min-width: 768px) and (max-width: 1024px) {
      #social-sidebar { width: 240px !important; }
    }

    /* Desktop: comfortable sidebar */
    @media (min-width: 1025px) {
      #social-sidebar { width: 300px !important; }
    }

    /* Ensure images don't overflow */
    img, canvas, svg { max-width: 100%; height: auto; }
