@font-face {
  font-family: 'Yaro Cut Bold';
  src: url('./YaroCut-Bold/YaroCut-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,100..900;1,100..900&family=Google+Sans+Flex:opsz,wght@6..144,1..1000&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
a{
    text-decoration: none;
    color: inherit;
}
header nav{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 5%;
}
header nav .logo h2{
  font-family: 'Yaro Cut Bold', sans-serif;
  font-size: 30px;
  color: #4e6fd8;
  padding-top: 20px;
}
nav .logo h2{
  font-family: 'Yaro Cut Bold', sans-serif;
  font-size: 30px;
  color: #4e6fd8;
  margin-bottom: 10px;
}
header nav .left{
  display: flex;
  align-items: center;
  gap: 20px;
}

header nav .left .streak {
    display: flex;
    align-items: center;
    justify-content: center;
}
header nav .left .streak img{
  width: 30px;
  height: 30px;
}
header nav .left .streak p{
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: #000;

}
.mood .not{
    width: 120px;       /* adjust this to control how much of a push you want */
    flex-shrink: 0;     /* stops flexbox from squishing it in the scroll row */
    border: none;       /* remove once you're done using it to visually debug */
}
.greeting{
   
 margin: 10px 5%;
}
.greeting h2{
    font-family: 'Archivo', sans-serif;
    font-size: 30px;
    color: #071039;

}
.greeting .mood{
     overflow-y: hidden;
    padding-left: 220px; /* pushes all items right by 20px, no phantom div needed */
}
.greeting p{
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    color: #000;
    padding-top: 10px;
}

.greeting .mood{
    display: flex;
    align-items: flex-start;
    margin-top: 15px;
    gap: 16px;
    padding: 10px 0px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}


.greeting .mood::-webkit-scrollbar{
    display: none;
}
.greeting .mood{
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mood-item{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
   
    flex-shrink: 0;
    scroll-snap-align: start;
    transition: transform 0.15s ease;
}

.mood-item:hover{
    transform: translateY(-4px);
}

.mood-item .icon-wrap{
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #E8F0FE; /* default pastel, override per mood below */
}



.mood-item p{
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #1a1a2e;
    font-weight: 500;
    text-align: center;
}
.mood-item .icon-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f2f2;
    border: 2px solid transparent;
    overflow: hidden;
}



/* per-mood background tints, matching the reference */
.mood-item.happy .icon-wrap{ background: #DCEBFB; }
.mood-item.excited .icon-wrap{ background: #FADCE1; }
.mood-item.okay .icon-wrap{ background: #FCEFC7; }
.mood-item.tired .icon-wrap{ background: #E3E3F5; }
.mood-item.sleepy .icon-wrap{ background: #E3E3F5; }

/* selected checkmark badge */
.mood-item .check-badge{
    position: absolute;
    top: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #4e6fd8;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 2px solid #fff;
}

.mood-item.selected .check-badge{
    display: flex;
}

.mood-item.selected .icon-wrap{
    outline: 2px solid #4e6fd8;
    outline-offset: 2px;
}

.categories{
    margin: 30px 5%;
}
.categories h1{
    font-family: 'Archivo', sans-serif;
    font-size: 24px;
    color: #071039;
    margin-bottom: 16px;
}

.cat-grid{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.cat-card{
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 240px;
    padding: 16px;
   
}

.cat-card img{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70%;
    object-fit: cover;
}

.cat-info{
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
     border-top-left-radius: 120px;
    border-top-right-radius: 120px;
}

.cat-info p{
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: #071039;
}

.cat-arrow{
    background: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4e6fd8;
    font-size: 18px;
    flex-shrink: 0;
}

/* pastel backgrounds, alternating like the reference */
.cat-card.c1{ background: #E3EAFB; }
.cat-card.c2{ background: #FBE3E9; }
.cat-card.c3{ background: #FCEFC7; }
.cat-card.c4{ background: #E3F5EA; }
.cat-card.c5{ background: #E3E3F5; }
.cat-card.c6{ background: #FBE9E3; }
.cat-card.c7{ background: #DCEBFB; }
.cat-card.c8{ background: #FADCE1; }
.cat-card.c9{ background: #E3EAFB; }
.cat-info{
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.cat-text{
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cat-info p{
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: #071039;
}

.cat-info span:not(.cat-arrow){
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    line-height: 1;
    color: #4a5568;
}
.chat-page{
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    font-family: 'Inter', sans-serif;
}

/* default = direct (1-to-1): hide group-only bits */
.chat-page [data-group-only]{ display: none; }
.chat-page.is-group [data-group-only]{ display: flex; }
.chat-page.is-group [data-direct-only]{ display: none; }
.chat-page.is-group .chat-status{ display: inline; } /* span override below */

/* ===== header ===== */
.chat-header{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 5%;
    border-bottom: 1px solid #EEF0F6;
}
.icon-btn{
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #071039;
    cursor: pointer;
}
.avatar-stack{
    position: relative;
    width: 44px;
    height: 40px;
    flex-shrink: 0;
}
.avatar{
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
}
.avatar-extra{
    position: absolute;
    top: 0;
    left: 16px;
}
.chat-header-info{
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.chat-header-text{
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.chat-name{
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #071039;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-status{
    font-size: 12px;
    color: #6B7280;
}
.chat-header-actions{
    display: flex;
    align-items: center;
    gap: 12px;
}
.streak-pill{
    display: flex;
    align-items: center;
    gap: 4px;
}
.streak-pill img{ width: 20px; height: 20px; }
.streak-pill span{
    font-size: 14px;
    font-weight: 600;
    color: #071039;
}

/* ===== question banner ===== */
.question-banner{
    background: linear-gradient(135deg, #5B7FE6, #4356C4);
    color: #fff;
    padding: 20px 6%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.question-prev{
    font-size: 13px;
    opacity: 0.6;
    text-decoration: line-through;
}
.question-current{
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.question-current .dot{
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    margin-top: 8px;
    flex-shrink: 0;
}

/* ===== message body ===== */
.chat-body{
    flex: 1;
    overflow-y: auto;
    padding: 20px 5%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #F8F9FD;
}
.msg-row{
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 85%;
}
.msg-row.received{ align-self: flex-start; }
.msg-row.sent{ align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar{
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.msg-col{
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.msg-sender{
    font-size: 12px;
    font-weight: 600;
    color: #4e6fd8;
    padding-left: 4px;
}

.msg-bubble{
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}
.msg-row.received .msg-bubble{
    background: #fff;
    color: #1a1a2e;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.msg-row.sent .msg-bubble{
    background: #4e6fd8;
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* voice bubble */
.msg-bubble.voice{
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.play-btn{
    background: #4e6fd8;
    color: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}
.waveform{
    display: flex;
    align-items: center;
    gap: 2px;
    height: 20px;
}
.waveform span{
    width: 3px;
    height: var(--h);
    background: #C7D0F0;
    border-radius: 2px;
}
.voice-time{
    font-size: 12px;
    color: #6B7280;
    flex-shrink: 0;
}

/* ===== input bar ===== */
.chat-input-bar{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 5%;
    border-top: 1px solid #EEF0F6;
    background: #fff;
}
.chat-input-bar input{
    flex: 1;
    border: 1px solid #E3E6F0;
    border-radius: 24px;
    padding: 12px 18px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
    min-width: 0;
}
.mic-btn{
    background: #4e6fd8;
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}

/* ===== responsive ===== */
@media (min-width: 481px){
    .chat-page{
        border-left: 1px solid #EEF0F6;
        border-right: 1px solid #EEF0F6;
    }
}
.convo-page{
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: #fff;
    font-family: 'Inter', sans-serif;
    position: relative;
    padding-bottom: 20px;
}

/* ===== header ===== */
.convo-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 5% 10px;
}
.convo-header h2{
    font-family: 'Archivo', sans-serif;
    font-size: 24px;
    color: #071039;
}
.icon-btn{
    background: none;
    border: none;
    color: #071039;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ===== tabs ===== */
.convo-tabs{
    display: flex;
    gap: 10px;
    padding: 10px 5% 16px;
}
.tab{
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #6B7280;
    background: #F3F4F9;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
}
.tab.active{
    background: #4e6fd8;
    color: #fff;
}

/* ===== list ===== */
.convo-list{
    display: flex;
    flex-direction: column;
}
.convo-item{
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 5%;
    cursor: pointer;
    transition: background 0.15s ease;
}
.convo-item:hover{
    background: #F8F9FD;
}

/* avatar */
.convo-avatar{
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}
.convo-avatar img{
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}
.online-dot{
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #3CCB7F;
    border: 2px solid #fff;
}
.convo-avatar.group img{
    width: 36px;
    height: 36px;
    position: absolute;
    border: 2px solid #fff;
}
.convo-avatar.group .g1{ top: 0; left: 0; z-index: 2; }
.convo-avatar.group .g2{ bottom: 0; right: 0; z-index: 1; }

/* text */
.convo-main{
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.convo-top{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.convo-name{
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: #071039;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.convo-time{
    font-size: 12px;
    color: #9CA3AF;
    flex-shrink: 0;
}
.convo-bottom{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.convo-preview{
    font-size: 13px;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.preview-sender{
    color: #4e6fd8;
    font-weight: 600;
}

/* unread state */
.convo-item.unread .convo-name{ color: #071039; }
.convo-item.unread .convo-preview{
    color: #071039;
    font-weight: 500;
}
.unread-badge{
    background: #4e6fd8;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    flex-shrink: 0;
}

/* mini streak on convo row */
.mini-streak{
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}
.mini-streak img{ width: 14px; height: 14px; }
.mini-streak span{
    font-size: 12px;
    font-weight: 600;
    color: #071039;
}

/* ===== floating new conversation button ===== */
.new-convo-btn{
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #4e6fd8;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(78,111,216,0.35);
    cursor: pointer;
}

@media (min-width: 481px){
    .convo-page{
        border-left: 1px solid #EEF0F6;
        border-right: 1px solid #EEF0F6;
    }
}
.auth-page{
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #EAF0FF, #F8F9FD);
    padding: 20px;
}

.auth-card{
    background: #fff;
    width: 100%;
    max-width: 400px;
    border-radius: 24px;
    padding: 40px 32px;
    box-shadow: 0 10px 30px rgba(78,111,216,0.1);
}

.auth-card h2{
    font-family: 'Archivo', sans-serif;
    font-size: 26px;
    color: #071039;
    text-align: center;
}

.auth-sub{
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #6B7280;
    text-align: center;
    margin-top: 8px;
    margin-bottom: 24px;
}

.auth-errors{
    background: #FBE3E9;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.auth-errors p{
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #B3261E;
    margin: 0;
}

.auth-form{
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row{
    display: flex;
    gap: 10px;
}
.form-row .form-group{
    flex: 1;
}

.form-group{
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label{
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #071039;
}
.form-group input{
    border: 1px solid #E3E6F0;
    border-radius: 12px;
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
}
.form-group input:focus{
    border-color: #4e6fd8;
}

.auth-btn{
    background: #4e6fd8;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    margin-top: 8px;
}
.auth-btn:hover{
    background: #3d5bc4;
}

.auth-switch{
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #6B7280;
    text-align: center;
    margin-top: 20px;
}
.auth-switch a{
    color: #4e6fd8;
    font-weight: 600;
    text-decoration: none;
}
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
}
.modal-box.hidden { display: none; }
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}
.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}
.btn-primary { background: #4f46e5; color: #fff; }
.btn-secondary { background: #eee; color: #333; }

.gender-choice {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}
.gender-btn {
    background: none;
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    width: 120px;
}
.gender-btn img { width: 94px; height: 94px; }
.gender-btn:hover { border-color: #4f46e5; }
.gender-btn  span {
    display: block;
    margin-top: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #071039;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 20px;
}
#backToGender {
    margin-top: 20px;
    background: none;
    border: none;
    color: #4f46e5;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    cursor: pointer;
}
#genderChoiceStep h2, #avatarGridStep h2 {
    font-family: 'Archivo', sans-serif;
    font-size: 24px;
    color: #071039;
}
.avatar-grid img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
}
.avatar-grid img:hover { border-color: #4f46e5; }
/* ============ ADD FRIEND PAGE ============ */

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #1f2937;
    text-decoration: none;
    transition: background 0.15s ease;
}
.back-link:hover { background: #f1f1f6; }

.add-friend-page {
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.add-friend-page h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 18px;
}

/* --- Search box --- */
.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f9;
    border: 1px solid #ececf3;
    border-radius: 14px;
    padding: 12px 16px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.search-box:focus-within {
    background: #fff;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.search-box .material-symbols-outlined {
    color: #9ca3af;
    font-size: 20px;
}
.search-box input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    font-size: 14px;
    color: #1f2937;
}
.search-box input::placeholder { color: #9ca3af; }

/* --- Results list --- */
.friend-results {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 4px; /* avoids layout jump while empty */
}

.friend-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 12px 14px;
    animation: fadeIn 0.2s ease;
}

.friend-row img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    background: #f1f1f6;
    flex-shrink: 0;
}

.friend-info { flex: 1; min-width: 0; }

.friend-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-username {
    font-size: 12px;
    color: #9ca3af;
}

.no-results {
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    padding: 24px 0;
}

/* --- Add / status button --- */
.add-btn {
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, opacity 0.15s ease;
    background: #4f46e5;
    color: #fff;
}
.add-btn:hover { background: #4338ca; }
.add-btn:disabled { opacity: 0.6; cursor: default; }

.add-btn[data-status="pending"] {
    background: #fff;
    color: #4f46e5;
    border: 1.5px solid #4f46e5;
}
.add-btn[data-status="pending"]:hover { background: #fff; }

.add-btn[data-status="accepted"] {
    background: #ecfdf5;
    color: #059669;
    border: 1.5px solid #a7f3d0;
    cursor: default;
}
.add-btn[data-status="accepted"]:hover { background: #ecfdf5; }

/* --- Invite box --- */
.invite-box {
    margin-top: 32px;
    text-align: center;
    padding: 20px;
    border-radius: 14px;
    background: #f9f9fc;
    border: 1px dashed #d9d9e6;
}
.invite-box p {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
}

/* --- Reuse modal system, just add invite-specific spacing --- */
#inviteOverlay .modal-box input[type="email"] {
    font-size: 14px;
    color: #1f2937;
}
#inviteOverlay .modal-box input[type="email"]:focus {
    outline: none;
    border-color: #4f46e5;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Mobile --- */
@media (max-width: 480px) {
    .add-friend-page { padding: 18px 14px 50px; }
    .friend-row { padding: 10px 12px; gap: 10px; }
    .friend-row img { width: 40px; height: 40px; }
}
.section-hint { font-size: 0.85rem; color: #888; margin: 4px 0 12px; }
.mutual-count { font-size: 0.75rem; color: #999; display: block; margin-top: 2px; }
.no-results { text-align: center; padding: 24px 12px; color: #777; }
.no-results button { margin-top: 10px; }
.badge-count {
    position: absolute;
    top: -1.7px;
    right: -5px;
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.badge-count.hidden {
    display: none;
}
.select-friend-page {
    min-height: 100vh;
    background: #fafafa;
}

.select-friend-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.sf-eyebrow {
    font-size: 12px;
    color: #888;
    margin: 0 0 2px;
}

.select-friend-title h2 {
    margin: 0;
    font-size: 18px;
}

.friend-select-list {
    display: flex;
    flex-direction: column;
    padding: 8px 16px;
}

.friend-select-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 4px;
    border: none;
    background: none;
    border-bottom: 1px solid #f0f0f0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 15px;
}

.friend-select-row img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.friend-select-row span:not(.sf-chevron) {
    flex: 1;
}

.sf-chevron {
    color: #ccc;
}

.friend-select-row.loading .sf-chevron {
    opacity: 0;
}

.friend-select-row.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    animation: sf-spin 0.6s linear infinite;
}

.friend-select-row.disabled:not(.loading) {
    opacity: 0.4;
    pointer-events: none;
}

@keyframes sf-spin {
    to { transform: rotate(360deg); }
}

.sf-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 24px;
    text-align: center;
    color: #666;
}

.sf-empty-state .material-symbols-outlined {
    font-size: 40px;
    color: #ccc;
}
.mood-item {
    border: none;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mood-item:focus-visible {
    outline: 2px solid #333;
    outline-offset: 2px;
}
.select-friend-page {
    min-height: 100vh;
    background: #fafafa;
}

.select-friend-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.sf-eyebrow {
    font-size: 12px;
    color: #888;
    margin: 0 0 2px;
}

.select-friend-title h2 {
    margin: 0;
    font-size: 18px;
}

.friend-select-list {
    display: flex;
    flex-direction: column;
    padding: 8px 16px;
}

.friend-select-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 4px;
    border: none;
    background: none;
    border-bottom: 1px solid #f0f0f0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 15px;
}

.friend-select-row img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.friend-select-row span:not(.sf-chevron) {
    flex: 1;
}

.sf-chevron {
    color: #ccc;
}

.friend-select-row.loading .sf-chevron {
    opacity: 0;
}

.friend-select-row.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    animation: sf-spin 0.6s linear infinite;
}

.friend-select-row.disabled:not(.loading) {
    opacity: 0.4;
    pointer-events: none;
}

@keyframes sf-spin {
    to { transform: rotate(360deg); }
}

.sf-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 24px;
    text-align: center;
    color: #666;
}

.sf-empty-state .material-symbols-outlined {
    font-size: 40px;
    color: #ccc;
}
/* ============================================================
   Tell Us A Bit More — pre-conversation context intake
   ============================================================ */


.select-friend-page {
    --sf-bg: #FBFBFF;
    --sf-panel: #F4F5FC;
    --sf-ink: #262A4D;
    --sf-ink-soft: #6C7093;
    --sf-accent: #4E6FD8;
    --sf-accent-deep: #2B3272;
    --sf-accent-soft: #EEF1FF;
    --sf-line: #DEE3FA;
    --sf-serif: 'Archivo', Georgia, serif;
    --sf-sans: 'Inter', -apple-system, sans-serif;

    position: relative;
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    background: var(--sf-bg);
    font-family: var(--sf-sans);
    color: var(--sf-ink);
    padding-bottom: 108px; /* room for the fixed CTA */
    overflow-x: hidden;
}

/* ambient wash behind the header — quiet warmth, not decoration for its own sake */
.select-friend-page::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -80px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(78,111,216,0.14), rgba(78,111,216,0) 70%);
    pointer-events: none;
    z-index: 0;
}

/* ===== Header ===== */
.select-friend-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px 6% 8px;
}

.select-friend-header .icon-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--sf-line);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sf-accent-deep);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}
.select-friend-header .icon-btn:hover { background: var(--sf-accent-soft); }
.select-friend-header .icon-btn:active { transform: scale(0.92); }
.select-friend-header .icon-btn .material-symbols-outlined { font-size: 20px; }

.select-friend-title { padding-top: 4px; }

.sf-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--sf-accent);
    margin: 0 0 6px;
}
/* small linking dot — this pairing (edition · person) is the whole premise of the page */
.sf-eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sf-accent);
    box-shadow: 0 0 0 3px var(--sf-accent-soft);
    flex-shrink: 0;
}

.select-friend-title h2 {
    font-family: var(--sf-serif);
    font-weight: 500;
    font-size: 17px;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--sf-ink);
    margin: 0;
}

/* ===== Empty state (skip-the-form) ===== */
.sf-empty-state {
    position: relative;
    z-index: 1;
    margin: 28px 6% 0;
    padding: 26px 22px;
    background: var(--sf-panel);
    border: 1px solid var(--sf-line);
    border-radius: 20px;
    text-align: center;
    animation: sfFadeUp 0.45s ease both;
}
.sf-empty-state.hidden { display: none; }

.sf-empty-state p {
    font-size: 14px;
    line-height: 1.55;
    color: var(--sf-ink-soft);
    margin: 0 0 20px;
}

.sf-empty-state .btn-primary { margin-bottom: 10px; }
.sf-empty-state .btn-secondary { margin: 0 auto; }

/* ===== Form ===== */
.context-form {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    padding: 28px 6% 0;
}
.context-form.hidden { display: none; }
.context-form:not(.hidden) { animation: sfFadeUp 0.4s ease both; }

.context-form label {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sf-ink);
    margin-bottom: 18px;
    padding-left: 0;
}

.context-form input[type="text"],
.context-form select,
.context-form textarea {
    font-family: var(--sf-sans);
    font-weight: 400;
    font-size: 14.5px;
    color: var(--sf-ink);
    background: var(--sf-panel);
    border: 1.5px solid var(--sf-line);
    border-radius: 14px;
    padding: 13px 15px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    appearance: none;
}

.context-form select {
    background-image: linear-gradient(45deg, transparent 50%, var(--sf-ink-soft) 50%),
                       linear-gradient(135deg, var(--sf-ink-soft) 50%, transparent 50%);
    background-position: calc(100% - 20px) center, calc(100% - 15px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.context-form input[type="text"]::placeholder {
    color: #A6ABC9;
    font-weight: 400;
}

.context-form input[type="text"]:focus,
.context-form select:focus {
    background: #fff;
    border-color: var(--sf-accent);
    box-shadow: 0 0 0 4px var(--sf-accent-soft);
}

/* signature device: the two "how you connect" fields form a relationship timeline —
   how_met is always the first label rendered, connection_since always the second,
   whenever the shared-context block is shown */
.context-form label:nth-of-type(1),
.context-form label:nth-of-type(2) {
    padding-left: 20px;
}
.context-form label:nth-of-type(1)::before,
.context-form label:nth-of-type(2)::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sf-accent);
}
.context-form label:nth-of-type(1)::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 12px;
    width: 2px;
    height: calc(100% + 6px);
    background: var(--sf-line);
}
.context-form label:nth-of-type(2)::before { background: var(--sf-accent-deep); }

/* ===== Buttons ===== */
.btn-primary,
.btn-secondary {
    font-family: var(--sf-sans);
    font-size: 14.5px;
    font-weight: 600;
    border: none;
    border-radius: 24px;
    padding: 14px 20px;
    cursor: pointer;
    width: 100%;
    display: block;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-primary {
    background: var(--sf-accent);
    color: #fff;
    box-shadow: 0 6px 18px rgba(78,111,216,0.28);
}
.btn-primary:hover { background: var(--sf-accent-deep); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    background: transparent;
    color: var(--sf-ink-soft);
    width: auto;
    padding: 10px 12px;
}
.btn-secondary:hover { color: var(--sf-accent-deep); }

/* the form's own submit stays pinned like the chat composer, so it's always reachable */
#submitBtn {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 18px;
    width: 88%;
    max-width: 416px;
    z-index: 2;
}

/* ===== Motion ===== */
@keyframes sfFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Accessibility ===== */
.context-form input[type="text"]:focus-visible,
.context-form select:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.select-friend-header .icon-btn:focus-visible {
    outline: 2px solid var(--sf-accent-deep);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .sf-empty-state,
    .context-form:not(.hidden) {
        animation: none;
    }
    .btn-primary:active,
    .select-friend-header .icon-btn:active {
        transform: none;
    }
}

/* ===== Small screens ===== */
@media (max-width: 360px) {
    .select-friend-title h2 { font-size: 22px; }
    #submitBtn { width: 92%; }
}