body {
    font-family: system-ui;
    background: #f3f4f6;
    margin: 0;
    display: flex;
    justify-content: center;
    padding-top: 8px;
  }
  
  .app-container {
    width: 1200px;
    background: white;
    padding: 22px 44px 32px;
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);


    padding-bottom: 50px;
    overflow-y: visible; /* 🔥 Critical for scrolling */
    height: auto;           /* Allow container to grow with content */
  min-height: 100vh;
  overflow-y: visible;    /* Critical for scrolling through analysis */
  padding-bottom: 50px;
  }
  
  .btn {
    padding: 10px 22px;
    background: linear-gradient(135deg,#2563eb,#1d4ed8);
    border-radius: 999px;
    color: white;
    font-weight: 700;
    border: none;
    cursor: pointer;
  }
  
  .btn.danger { background:#dc2626; }
  
  .card-section {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 22px;
    margin-top: 14px;
  }
  
  .live-question-box {
    background:#eef2ff;
    padding:16px;
    border-radius:10px;
    font-weight:700;
  }
  
  .live-answer-box {
    border:1px solid #e5e7eb;
    border-radius:12px;
    padding:16px;
    min-height:80px;
  }
  
  .hidden { display:none !important; }
  
  #startAssessmentOverlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.8);
    display:flex;
    align-items:center;
    justify-content:center;
  }
  
  .overlay-card {
    background:white;
    padding:30px;
    border-radius:20px;
    box-shadow:0 30px 80px rgba(0,0,0,.25);
  }

  .feedback-box {
    padding: 12px 14px;
    margin-bottom: 10px;
    }
    
    .feedback-box h4 {
    font-size: 14px;
    margin-bottom: 6px;
    }
    
    .feedback-box li {
    font-size: 13.5px;
    line-height: 1.45;
    margin-bottom: 4px;
    }
    .feedback-box {
        border-radius: 14px;
        padding: 16px 18px;
        margin-bottom: 16px;
        }
        
        .feedback-box h4 {
        margin: 0 0 10px 0;
        font-size: 16px;
        font-weight: 800;
        }
  
  #guestFeedbackArea {
    max-height: 320px;
    overflow-y: auto;
    margin-top: 16px;
    padding-right: 8px;
    }
    /* ===== STICKY ANALYSIS PANEL ===== */
    #guestFeedbackWrapper {
    position: sticky;
    top: 100px;              /* below header/question */
    z-index: 20;
    }
    
    #guestFeedbackArea {
    max-height: calc(100vh - 160px); /* full screen minus header */
    overflow-y: auto;
    padding-right: 6px;
    scroll-behavior: smooth;
    }
    
    /* Prevent layout jump */
    #guestFeedbackArea::-webkit-scrollbar {
    width: 6px;
    }
    #guestFeedbackArea::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 10px;
    }
    @media (min-width: 1024px) {
    #guestLivePanel {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
    }
    
    #guestTopSection {
    position: sticky;
    top: 0;
    }
    
    #guestFeedbackWrapper {
    position: sticky;
    top: 0;
    }
    }
    
  #guestLivePanel {
  position: relative;
  }
  
  #guestTopSection {
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
  }

  .feedback-box ul {
    margin: 0;
    padding-left: 20px;
    }
    
    .feedback-box li {
    margin-bottom: 8px;
    font-size: 14.5px;
    line-height: 1.6;
    }
    
    .feedback-box.good {
    background: #ecfdf5;
    border-left: 6px solid #16a34a;
    }
    
    .feedback-box.bad {
    background: #fef2f2;
    border-left: 6px solid #dc2626;
    }

    .score-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
        margin-bottom: 20px;
        }

        #guestLivePanel {
            display: none;
            margin-top: 20px;
          }
          
          #cvStatus {
            display: none;
            margin-top: 8px;
          }
          .user-dropdown {
            position: absolute;
            top: 52px;
            right: 0;
            background: white;
            border-radius: 14px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.15);
            padding: 8px 0;
            display: none;
            z-index: 1000;
          }
          
          .user-dropdown.show {
            display: block;
          }
          .form-row { margin-bottom:12px; }
          .card-section {
            background: #ffffff;
            border: 1px solid #e5e7eb;
            border-radius: 18px;
            padding: 22px;
            margin-top: 14px;
            }

/* ---------- Guest Intro ---------- */
.guest-intro {
  margin-bottom: 18px;
}

.guest-intro-title {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 4px;
}

.guest-intro-subtitle {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}


/* ================== FIXED AVATAR POSITIONING ================== */
.user-menu-wrapper {
  position: absolute; /* Keep it absolute */
  top: 20px;
  left: 26px;
  z-index: 1000;
}

.main-content {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 20px;      /* Prevents content from hitting the absolute avatar */
}

/* =====================================================
   📱 GUEST PAGE — FULL MOBILE SUPPORT (CSS ONLY)
   SAFE: NO HTML / JS CHANGES REQUIRED
===================================================== */

@media (max-width: 768px) {

  /* ---------- BODY & ROOT ---------- */
  body {
    display: block;
    padding-top: 0;
  }

  .app-container {
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    padding: 16px;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  /* ---------- HEADER ---------- */
  h2 {
    font-size: 20px;
    margin-top: 50px; /* space for avatar */
  }

  .subtitle {
    font-size: 13px;
    margin-bottom: 20px;
  }

  /* ---------- AVATAR ---------- */
  .user-menu-wrapper {
    top: 12px;
    left: 12px;
  }

  /* ---------- FORMS ---------- */
  .form-row label {
    font-size: 13px;
  }

  .form-row select,
  .form-row input {
    font-size: 16px; /* prevents iOS zoom */
    padding: 12px;
  }

  /* ---------- BUTTONS ---------- */
  .btn {
    width: 100%;
    min-height: 44px;
    font-size: 14px;
  }

  /* ---------- CARD SECTIONS ---------- */
  .card-section {
    padding: 16px;
    border-radius: 14px;
  }

  /* ---------- LIVE PANEL ---------- */
  #guestLivePanel {
    display: block;
    margin-top: 16px;
  }

  /* Disable sticky on mobile */
  #guestTopSection,
  #guestFeedbackWrapper {
    position: static !important;
    top: auto !important;
  }

  /* ---------- QUESTION ---------- */
  .live-question-box {
    font-size: 15px;
    padding: 14px;
    border-radius: 12px;
  }

  /* ---------- ANSWER BOX ---------- */
  .live-answer-box {
    font-size: 15px;
    min-height: 160px;
    max-height: none;
    padding: 14px;
    line-height: 1.6;
  }

  /* ---------- ANALYZE BUTTON ---------- */
  #guestAnalyzeBtn {
    width: 100%;
    margin-top: 12px;
  }

  /* ---------- FEEDBACK AREA ---------- */
  #guestFeedbackArea {
    display: block;
    max-height: none;
    overflow: visible;
    padding-right: 0;
    margin-top: 20px;
  }

  #guestFeedbackArea h4 {
    font-size: 16px;
    margin-bottom: 12px;
  }

  /* ---------- SCORE CARDS ---------- */
  .analytic-card {
    width: 100%;
    padding: 14px;
  }

  .star-rating {
    font-size: 16px;
  }

  /* ---------- SECTION TOGGLES ---------- */
  .section-toggle {
    border-radius: 14px;
    margin-bottom: 14px;
  }

  .section-header {
    font-size: 14px;
    padding: 14px;
  }

  .section-body {
    padding: 14px;
  }

  /* ---------- FEEDBACK BOXES ---------- */
  .feedback-box {
    padding: 14px;
    border-radius: 12px;
  }

  .feedback-box ul {
    padding-left: 18px;
  }

  .feedback-box li {
    font-size: 14px;
    line-height: 1.6;
  }

  /* ---------- PERFECT ANSWER ---------- */
  .suggested-answer-box {
    padding: 16px;
    font-size: 14.5px;
    line-height: 1.7;
  }

  /* ---------- NEXT BUTTON ---------- */
  .section-body + div button {
    width: 100%;
  }

  /* ---------- OVERLAYS ---------- */
  .jd-modal-card,
  .overlay-card {
    max-width: 90%;
    padding: 20px;
    border-radius: 16px;
  }

  /* ---------- SCROLL SAFETY ---------- */
  html,
  body {
    overflow-x: hidden;
  }
}

/* ===============================
   📱 MOBILE RESPONSIVE OVERRIDES
   =============================== */
   @media (max-width: 768px) {

    /* ---- PAGE BASE ---- */
    body {
      padding: 0;
      justify-content: flex-start;
    }
  
    .app-container {
      width: 100%;
      max-width: 100%;
      min-height: 100vh;
      border-radius: 0;
      padding: 16px;
      box-shadow: none;
      max-height: none;
    }
  
    h2 {
      font-size: 18px;
      margin-top: 40px;
    }
  
    .subtitle {
      font-size: 12px;
    }
  
    /* ---- USER MENU ---- */
    .user-menu-wrapper {
      top: 10px;
      left: 12px;
    }
  
    .avatar-circle {
      width: 34px;
      height: 34px;
      font-size: 14px;
    }
  
    .user-dropdown {
      width: 150px;
      top: 42px;
    }
  
    /* ---- TOP RIGHT LINKS ---- */
    .guest-links-topright {
      position: static;
      justify-content: center;
      margin: 10px 0 14px;
      font-size: 13px;
      gap: 14px;
    }
  
    /* ---- CONTROLS ---- */
    .controls {
      margin: 12px 0;
    }
  
    button {
      width: 100%;
      padding: 12px 0;
      font-size: 15px;
    }
  
    #status {
      font-size: 11px;
    }
  
    /* ---- QUESTION BOX ---- */
    #questionBox {
      padding: 12px;
      font-size: 14px;
    }
  
    #questionText {
      min-height: 60px;
    }
  
    /* ---- ANSWER BOX ---- */
    #answerBox {
      margin-top: 12px;
      height: auto;
      max-height: none;
      padding: 12px;
      font-size: 14px;
      overflow-y: visible;
    }
  
    #answerText {
      font-size: 14.5px;
      line-height: 1.7;
    }
  
    /* ---- LISTS & BULLETS ---- */
    .main-list {
      padding-left: 18px;
    }
  
    .sub-list {
      padding-left: 22px;
      font-size: 13px;
    }
  
    .ai-bullet {
      margin-left: 16px;
      padding-left: 14px;
    }
  
    /* ---- AI INTRO / CALLOUTS ---- */
    .ai-intro {
      font-size: 14px;
      padding: 10px 12px;
    }
  
    /* ---- CODE BLOCKS ---- */
    .code-container {
      margin-left: 0;
      margin-right: 0;
    }
  
    .code-content {
      font-size: 13px;
      overflow-x: auto;
    }
  
    /* ---- MODALS ---- */
    .modal-content {
      width: 92%;
      padding: 16px;
    }
  
    /* ---- LINKS ---- */
    .ai-link {
      font-size: 14px;
    }
  }
  
