:root {
    --bg-color: #17212b;
    --card-bg: #242f3d;
    --text-primary: #ffffff;
    --text-secondary: #8d98a3;
    /* Grigio leggermente più chiaro */
    --accent-blue: #5288c1;
    --accent-blue-bright: #64b5ef;
    --separator: #131a23;
    /* Nero/blu molto scuro per la linea */
}

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

body {
    background-color: var(--bg-color);
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    width: 100%;
    max-width: 380px;
    /* Larghezza più realistica per il popup */
    padding: 15px 10px;
    position: relative;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 15px;
}

.logo-container {
    margin-bottom: 12px;
}

.main-logo {
    width: 60px;
    /* Logo più piccolo */
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 6px;
}

h1 {
    font-size: 18px;
    font-weight: 500;
}

.verified-badge {
    width: 16px;
    height: 16px;
}

.description {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
    padding: 0 10px;
    margin-bottom: 15px;
}

.description a {
    color: var(--accent-blue-bright);
    text-decoration: none;
}

.description a:hover {
    text-decoration: underline;
}

/* Search Bar */
.search-container {
    margin-bottom: 15px;
}

.search-box {
    background-color: #1a242f;
    /* Colore più scuro per l'input */
    border-radius: 18px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    height: 36px;
    /* Altezza ridotta */
    border: 1px solid transparent;
}

.search-box:focus-within {
    border-color: var(--accent-blue);
    background-color: var(--card-bg);
}

.search-icon {
    width: 18px;
    height: 18px;
    stroke: #6c7883;
    margin-right: 10px;
}

#searchInput {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
    outline: none;
}

#searchInput::placeholder {
    color: #5d6874;
}

/* List Section */
.section-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    padding-left: 6px;
    color: var(--text-primary);
}

.list-container {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    /* Padding ridotto per compattezza */
    cursor: pointer;
    transition: background 0.1s;
    position: relative;
    height: 52px;
    /* Altezza fissa per consistenza */
}

/* LINEA DI SEPARAZIONE CORRETTA */
/* La linea deve essere un elemento assoluto ancorato in basso */
.list-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    /* <--- MODIFICATO: Metti 0 per far continuare la linea sotto l'avatar */
    right: 0;
    height: 1px;
    background-color: #10161d;
    /* Assicurati che il colore sia questo scuro */
}

/* Nascondi la linea per l'ultimo elemento */
.list-item:last-child::after {
    display: none;
}

.list-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

/* Avatar Styling - RIDIMENSIONATI */
.avatar-circle {
    width: 34px;
    /* Ridotto da 42px a 34px */
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    /* Spazio tra avatar e testo */
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.add-icon {
    background: transparent;
    /* Nessun bordo nel design originale recente, o molto sottile */
    border: 1px solid var(--accent-blue-bright);
    color: var(--accent-blue-bright);
}

.add-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.5;
    /* Linea più sottile */
}

/* Text Content */
.item-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    /* Previene overflow del testo */
}

.bot-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bot-handle {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-text {
    color: var(--accent-blue-bright);
    font-size: 14px;
    font-weight: 400;
}

/* Chevron Icon - Molto più piccola e sottile */
.chevron {
    color: #58636d;
    /* Grigio scuro spento */
    width: 16px;
    height: 16px;
    margin-left: 10px;
    flex-shrink: 0;
}

.footer-handle {
    text-align: center;
    color: #444f58;
    font-size: 12px;
    margin-top: 15px;
}