/* Quiet empty state for the chat library. */
#chatsListView #emptyChatsListState {
    display: none !important;
    flex: 1 1 auto;
    min-height: 280px !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-direction: column;
    padding: 36px 20px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 18px !important;
    background: transparent !important;
    color: var(--text-secondary);
    text-align: center;
    transform: translateY(-42px);
}

#chatsListView #emptyChatsListState.is-visible {
    display: flex !important;
    transform: translateY(-42px) !important;
}

/* Library uses the same understated empty-state language as the chat list. */
#libraryView .library-empty-upload {
    display: none !important;
    align-self: center;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: min(430px, 100%);
    min-height: 0 !important;
    margin: auto;
    padding: 0 24px;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: translateY(-42px);
}

#libraryView.library-empty-visible .library-empty-upload {
    display: flex !important;
}

/* Both empty states share the same viewport anchor inside their content surface. */
#chatsListView #emptyChatsListState,
#libraryView .library-empty-upload {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    margin: 0 !important;
    transform: translate(-50%, calc(-50% - 42px)) !important;
}

#chatsListView #emptyChatsListState {
    width: min(430px, calc(100% - 48px)) !important;
}

#libraryView .library-empty-upload {
    width: min(430px, calc(100% - 48px)) !important;
}

#libraryView .library-empty-upload .empty-chats-illustration {
    margin-bottom: 2px;
}

#libraryView .library-empty-copy {
    text-align: center;
}

#libraryView .library-empty-copy p {
    margin-bottom: 14px;
}

body.light-mode #chatsListView #emptyChatsListState {
    background: transparent !important;
}

.empty-chats-illustration {
    width: 142px;
    height: 74px;
    opacity: 0.46;
    color: var(--text-secondary);
}

.empty-chats-illustration svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.empty-chats-ground,
.empty-chats-bush,
.empty-chats-bush-detail {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.empty-chats-ground {
    stroke-width: 2;
    opacity: 0.38;
}

.empty-chats-bush {
    fill: currentColor;
    stroke-width: 2;
    opacity: 0.18;
    transform-origin: 105px 70px;
    animation: emptyChatsBush 2.4s steps(4, end) infinite;
}

.empty-chats-bush-detail {
    stroke-width: 2.2;
    opacity: 0.48;
}

.empty-chats-copy h2 {
    width: 100%;
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.empty-chats-copy p {
    width: 100%;
    max-width: 320px;
    margin: 5px 0 14px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

/* Keep Chat and Library on the same visual grid, regardless of copy length. */
.empty-chats-copy {
    width: min(100%, 360px);
    min-height: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.empty-chats-action {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--logicum-border, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-primary);
    font: 600 13px/1 inherit;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.empty-chats-action:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: var(--logicum-border-strong, rgba(255, 255, 255, 0.16));
}

@keyframes emptyChatsBush {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-1px) rotate(-1deg); }
    50% { transform: translateX(1px) rotate(1deg); }
    75% { transform: translateX(0) rotate(-0.5deg); }
}

@media (prefers-reduced-motion: reduce) {
    .empty-chats-bush { animation: none; }
}

@media (max-width: 700px) {
    #chatsListView #emptyChatsListState.is-visible {
        transform: translate(-50%, calc(-50% - 24px)) !important;
    }
}

/* Final shared anchor: empty states stay at the same visual height on both
   Chat and Library, regardless of flex content or scrollbars. */
#chatsListView #emptyChatsListState,
#chatsListView #emptyChatsListState.is-visible,
#libraryView .library-empty-upload {
    top: 42% !important;
    transform: translate(-50%, -50%) !important;
}
