/* Conversation list items */
#convs-list li {
    padding: 16px 18px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background 0.15s;
}
#convs-list li:hover {
    background: #f3f8fa;
}

/* Scrollable list for both panels */
#convs-list,
#characters-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    overflow-y: auto;
}

/* Character item */
.character-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    position: relative; /* Needed for buttons */
}
.character-item:hover {
    background-color: #f5f5f5;
}

/* Character entry structure */
.character-entry {
    display: flex;
    align-items: center;
    gap: 12px;
}
.character-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #ccc;
}
.character-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    flex: 1 1 auto;
    padding-right: 40px;
}
.character-name {
    font-weight: bold;
    font-size: 1em;
    color: #333;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.character-preview {
    font-size: 0.9em;
    color: #666;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.character-actions {
    position: absolute;
    top: 50%;
    right: 10px;
    z-index: 3;
    transform: translateY(-50%);
}

.character-more-btn {
    appearance: none;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    opacity: 0.56;
    transition: background 0.14s ease, color 0.14s ease, opacity 0.14s ease;
}

.character-more-btn:hover,
.character-more-btn:focus-visible,
.character-actions.is-open .character-more-btn {
    background: rgba(15, 23, 42, 0.08);
    color: #111827;
    opacity: 1;
    outline: none;
}

.character-actions-menu {
    position: absolute;
    top: 36px;
    right: 0;
    z-index: 20;
    min-width: 176px;
    padding: 6px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}

.character-actions-menu[hidden] {
    display: none;
}

.character-menu-item {
    appearance: none;
    width: 100%;
    min-height: 36px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #0f172a;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
}

.character-menu-item:hover,
.character-menu-item:focus-visible {
    background: #eef2f7;
    outline: none;
}

.character-menu-delete {
    color: #b91c1c;
}

.character-menu-delete:hover,
.character-menu-delete:focus-visible {
    background: #fef2f2;
}

.character-menu-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: block;
    padding: 3px;
    border-radius: 999px;
    background: #475569;
    box-sizing: border-box;
}

.character-menu-delete .character-menu-icon {
    background: #b91c1c;
}

@media (pointer: fine) {
  .character-more-btn {
      opacity: 0;
  }

  .character-item:hover .character-more-btn,
  .character-item:focus-within .character-more-btn,
  .character-actions.is-open .character-more-btn {
      opacity: 0.72;
  }
}
