/* Keep the article heading independent of summary actions and usage. */
.news-section-heading.section-title {
    margin-bottom: 0.65rem;
    text-align: left;
    font-size: 1rem;
    min-width: 0;
    white-space: nowrap;
}

.news-summary-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    min-width: 0;
    margin-bottom: 1rem;
    padding: 0.65rem 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.news-summary-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: 0;
}

.news-summary-pdf-btn.panel-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--primary-500);
    white-space: nowrap;
    text-decoration: none;
    font-size: 0.8rem;
    line-height: 1.15;
}

.news-summary-pdf-btn.panel-action-btn:hover { border-color: var(--primary-500); }
.news-summary-pdf-btn.panel-action-btn:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 2px; }
.news-summary-pdf-btn[hidden] { display: none !important; }
.news-summary-pdf-btn svg { width: 14px; height: 14px; flex: 0 0 14px; }

.news-summary-usage {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin-left: auto;
}

.news-summary-feedback {
    margin: 0 0 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 640px) {
    .news-summary-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }

    .news-summary-actions .ai-summary-btn {
        width: 100%;
        justify-content: center;
    }

    .news-summary-actions .news-summary-pdf-btn {
        width: auto;
        justify-content: center;
    }

    .news-summary-actions .ai-summary-inline-hint {
        flex-wrap: wrap;
    }

    .news-summary-usage {
        margin-left: 0;
    }

    .news-feed .reference-link {
        overflow-wrap: break-word;
    }

    #news-modal .reference-item {
        flex-direction: column;
    }

    #news-modal .reference-link {
        overflow-wrap: anywhere;
    }
}

.news-feed {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: var(--bg-card);
}

.news-item {
    position: relative;
    padding: 0.85rem 1rem 0.8rem;
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.15s ease;
}

.news-feed > .news-item:last-child,
.news-feed-rest > .news-item:last-child {
    border-bottom: 0;
}

.news-item:hover {
    background: color-mix(in srgb, var(--primary-500) 8%, transparent);
}

.news-item-link {
    min-width: 0;
}

.news-item .reference-link {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-right: 1.1rem;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.45;
    text-decoration: none;
    border-bottom: 0;
    word-break: normal;
    overflow-wrap: break-word;
}

.news-item .reference-link::after {
    content: none;
}

.news-item .reference-link::before {
    content: "";
    position: absolute;
    inset: 0;
}

.news-item-link::after {
    content: "↗";
    position: absolute;
    top: 0.95rem;
    right: 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.news-item:hover .news-item-link::after,
.news-item:focus-within .news-item-link::after {
    opacity: 1;
}

.news-item-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.3;
}

.news-item-source {
    min-width: 0;
    overflow: hidden;
    color: var(--text-secondary);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-item-dot {
    flex: 0 0 auto;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.7;
}

.news-item-meta time {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
}

.news-item-details {
    position: relative;
    z-index: 1;
    margin-top: 0.45rem;
}

.news-item-details summary {
    width: fit-content;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
}

.news-item .summary-preview {
    margin-top: 0.3rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.45;
    overflow-wrap: break-word;
}

.news-feed-more {
    border-top: 1px solid var(--glass-border);
}

.news-feed > .news-item:last-of-type {
    border-bottom: 0;
}

.news-feed-more summary {
    padding: 0.7rem 1rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.news-feed-more summary::-webkit-details-marker {
    display: none;
}

.news-feed-more summary:hover {
    color: var(--text-primary);
    background: color-mix(in srgb, var(--primary-500) 8%, transparent);
}

.news-feed-rest .news-item:first-child {
    border-top: 1px solid var(--glass-border);
}

.summary-language {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-secondary);
}

.summary-language-option {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 999px;
    min-width: 2.4rem;
    padding: 0.28rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1;
    cursor: pointer;
}

.summary-language-option.is-active {
    background: var(--primary-500);
    color: #fff;
    cursor: default;
}

.summary-language-option:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

.campaign-tag-list,
.campaign-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.campaign-tag-row {
    margin-top: 0.45rem;
}

.campaign-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    max-width: 100%;
    padding: 0.18rem 0.6rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.14);
    color: var(--primary-500);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
}

.campaign-tag.is-match {
    border-color: var(--primary-500);
}

.campaign-tag-remove {
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0 0.1rem;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.campaign-tag-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.7rem;
}

.campaign-tag-form input {
    min-width: 0;
    flex: 1 1 12rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.campaign-tag-hint,
.campaign-tag-error {
    margin: 0.45rem 0 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.campaign-tag-error {
    color: var(--danger, #dc2626);
}
