/* Articles */
.dispatch-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}
.dispatch-card:last-child {
    margin-bottom: 0;
}

.dispatch-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-element);
    border-radius: 20px;
}

.dispatch-message {
    background: var(--bg-message);
    border-left: 3px solid var(--primary);
    padding: 16px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.6;
}

.article-item {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.article-item:last-child { border-bottom: none; padding-bottom: 0; }

.articles-list .article-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
.articles-list .article-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
}
.article-title:hover { color: var(--primary); text-decoration: underline; }

.article-category {
    font-size: 0.75rem;
    background: var(--bg-element);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.article-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.action-btn {
    background: var(--bg-element);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}
.action-btn:hover { background: var(--bg-card); transform: scale(1.05); }

.icon-btn {
    padding: 0;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
}
.icon-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.05);
}

/* Persona & Config */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.cat-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
}
.cat-card h3 { margin-bottom: 12px; display: flex; justify-content: space-between; }
.badge { 
    font-size: 0.75rem; 
    padding: 2px 8px; 
    border-radius: 10px; 
    background: var(--bg-element);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    font-weight: 600;
}
.badge-daily {
    background: rgba(16, 185, 129, 0.15); /* Green-ish */
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-weekly {
    background: rgba(234, 88, 12, 0.15); /* Orange-ish */
    color: var(--primary);
    border: 1px solid rgba(234, 88, 12, 0.3);
}
.badge-mode-group_summary {
    background: rgba(59, 130, 246, 0.15); /* Blue */
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}
.badge-mode-individual_detail {
    background: rgba(139, 92, 246, 0.15); /* Purple */
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
}
.badge-mode-image_only {
    background: rgba(236, 72, 153, 0.15); /* Pink */
    color: #ec4899;
    border: 1px solid rgba(236, 72, 153, 0.3);
}
.feed-list { list-style: none; margin-top: 12px; }
.feed-list li {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.persona-grid {
    display: flex;
    flex-direction: column;
}
.persona-grid > .glass-panel {
    display: flex;
    flex-direction: column;
}
.code-block {
    background: var(--bg-message);
    padding: 16px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-y: auto;
    margin-top: 12px;
}
.pref-list { list-style: none; margin-top: 12px; }
.pref-list li {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 4px;
    background: var(--bg-element);
}
.pref-list.positive li { border: 1px solid rgba(16, 185, 129, 0.3); color: var(--success); }
.pref-list.negative li { border: 1px solid rgba(239, 68, 68, 0.3); color: var(--danger); }
.pref-list input:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 4px;
    outline: 1px solid var(--primary) !important;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 30px;
    position: relative;
    transform: translateY(20px);
    transition: var(--transition);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-overlay.active .modal-content { transform: translateY(0); }
.close-btn {
    position: absolute;
    top: 20px; right: 20px;
    background: none; border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.response-area {
    background: var(--bg-message);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 16px;
    font-size: 0.95rem;
    max-height: 40vh;
    overflow-y: auto;
}
.response-area h4 { margin-bottom: 8px; color: var(--primary); }

.loader {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .modal-content {
        width: 92%;
        padding: 20px;
        max-height: 95vh;
    }
    .response-area {
        max-height: 55vh;
    }
}

.reason-mobile { display: none; }
.reason-desktop { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    background: var(--bg-hover, rgba(255,255,255,0.05)); 
    padding: 0 8px; 
    height: 26px; 
    box-sizing: border-box;
    border-radius: 13px; 
    font-size: 0.8rem; 
    color: var(--text-muted); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    max-width: 250px; 
    margin-left: -2px;
}

@media (max-width: 768px) {
    .reason-mobile { display: inline-flex; }
    .reason-desktop { display: none; }
}
