/* Field notification chat. Uses theme tokens from base.html. */

.notif-setup {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.notif-chat {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 14px 14px 12px;
}

.notif-chat-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.notif-chat-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.notif-chat-title i {
    color: var(--link-color);
    margin-right: 6px;
}

.notif-chat-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 46%;
}

.notif-chat-lead {
    margin: 6px 0 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.notif-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    margin-top: 12px;
    padding-right: 2px;
}

.notif-empty {
    padding-top: 2px;
}

.notif-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.notif-chip {
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-radius: var(--radius-pill);
    padding: 5px 11px;
    font-size: 0.75rem;
    line-height: 1.3;
}

.notif-chip:hover,
.notif-chip:focus-visible {
    border-color: var(--link-color);
    color: var(--accent-soft-text);
    background: var(--accent-soft);
    outline: none;
}

.notif-bubble {
    max-width: 88%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 0.875rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.notif-bubble-user {
    align-self: flex-end;
    background: var(--accent-soft);
    color: var(--accent-soft-text);
    border-bottom-right-radius: 4px;
}

.notif-bubble-assistant {
    align-self: flex-start;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.notif-note {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--success-color);
}

.notif-note-error {
    color: var(--danger-color);
}

.notif-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.notif-input {
    flex: 1;
    min-width: 0;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    padding: 9px 12px;
    font-size: 0.875rem;
    line-height: 1.4;
    field-sizing: content;
}

.notif-input:focus {
    outline: none;
    border-color: var(--link-color);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.notif-input::placeholder {
    color: var(--text-muted);
}

.notif-send {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.notif-send:hover:not(:disabled) {
    background: var(--btn-primary-hover);
}

.notif-send:disabled {
    opacity: 0.45;
}

.notif-send:focus-visible {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}

.notif-typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    min-height: 18px;
}

.notif-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: notif-bounce 1s infinite;
}

.notif-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.notif-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes notif-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-3px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .notif-typing span {
        animation: none;
    }
}

.notif-rules-head {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.notif-rules .list-group-item {
    background: var(--bg-elevated);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.notif-rules-empty {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.notif-manual {
    margin-top: 14px;
    border-top: 1px solid var(--border-light);
    padding-top: 12px;
}

.notif-manual > summary {
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    list-style: none;
}

.notif-manual > summary::-webkit-details-marker {
    display: none;
}

.notif-manual > summary::before {
    content: "";
    display: inline-block;
    width: 0.4rem;
    height: 0.4rem;
    margin-right: 8px;
    border-right: 1.5px solid var(--text-muted);
    border-bottom: 1.5px solid var(--text-muted);
    transform: rotate(-45deg) translateY(-1px);
}

.notif-manual[open] > summary::before {
    transform: rotate(45deg) translateY(-1px);
}

.notif-domains {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.btn-field-notify {
    line-height: 1;
}

@media (max-width: 575.98px) {
    .notif-chat-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .notif-chat-hint {
        max-width: 100%;
        text-align: left;
    }

    .notif-bubble {
        max-width: 100%;
    }
}
