/*
 * feeds.css
 *
 * Feeds operations dashboard. Read-only diagnostics for the rolling
 * timeline domain plus per-treatment feed ads. Class namespace is
 * `feeds-*`; this file does not inherit from posts-library.css /
 * posts-compose.css per the partition isolation rules.
 */

.page-shell--feeds {
    padding: var(--sp-6);
    gap: var(--sp-4);
    overflow: auto;
}

.page-shell--feeds .page-shell-header {
    width: 100%;
    margin: 0 0 var(--sp-3);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-4);
}

.feeds-page-heading__copy {
    min-width: 0;
    flex: 1 1 auto;
}

.feeds-page-heading__actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex: 0 0 auto;
}

.feeds-body {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

/* ============================================================
   Summary strip
   ============================================================ */
.feeds-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--sp-3);
}

.feeds-summary__placeholder {
    grid-column: 1 / -1;
    padding: var(--sp-3);
    color: var(--c-text-muted);
    font-style: italic;
}

.feeds-summary-card {
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    background: var(--c-surface);
    padding: var(--sp-3);
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
}

.feeds-summary-card__label {
    font-size: var(--fs-xs);
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.feeds-summary-card__value {
    font-size: var(--fs-xl);
    font-weight: 600;
    color: var(--c-text);
}

.feeds-summary-card__hint {
    font-size: var(--fs-xs);
    color: var(--c-text-muted);
    line-height: var(--lh);
}

/* ============================================================
   Cards
   ============================================================ */
.feeds-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.feeds-card__header {
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--c-border);
}

.feeds-card__title {
    margin: 0 0 var(--sp-1);
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--c-text);
}

.feeds-card__hint {
    margin: 0;
    color: var(--c-text-muted);
    font-size: var(--fs-xs);
    line-height: var(--lh);
}

.feeds-card__body {
    padding: var(--sp-3) var(--sp-4);
}

.feeds-card__body--two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
}

@media (max-width: 1100px) {
    .feeds-card__body--two-col {
        grid-template-columns: 1fr;
    }
}

.feeds-section-title {
    margin: 0 0 var(--sp-2);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--c-text);
}

/* ============================================================
   Tables
   ============================================================ */
.feeds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.feeds-table th,
.feeds-table td {
    text-align: left;
    padding: var(--sp-1) var(--sp-2);
    border-bottom: 1px solid var(--c-border);
    vertical-align: top;
}

.feeds-table th {
    font-weight: 600;
    color: var(--c-text-muted);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--c-bg);
}

.feeds-empty {
    text-align: center;
    color: var(--c-text-muted);
    font-style: italic;
    padding: var(--sp-3);
}

.feeds-pill {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 var(--sp-2);
    border-radius: var(--radius-full);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--c-hover);
    color: var(--c-text);
}

.feeds-pill--active {
    background: color-mix(in srgb, var(--c-success, #10b981) 18%, transparent);
    color: var(--c-success-strong, #047857);
}

.feeds-pill--disabled {
    background: color-mix(in srgb, var(--c-text-muted) 16%, transparent);
    color: var(--c-text);
}

.feeds-pill--archived {
    background: color-mix(in srgb, var(--c-warning, #f59e0b) 16%, transparent);
    color: var(--c-warning-strong, #b45309);
}

/* ============================================================
   Diagnose panel
   ============================================================ */
.feeds-diagnose {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.feeds-diagnose__form {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.feeds-diagnose__form .ui-input {
    height: 32px;
    padding: 0 var(--sp-3);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    color: var(--c-text);
    font-size: var(--fs-sm);
    font-family: inherit;
    width: 200px;
}

.feeds-diagnose__result {
    border: 1px dashed var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--sp-3);
    background: var(--c-bg);
    color: var(--c-text-muted);
    font-size: var(--fs-sm);
    min-height: 80px;
}

.feeds-diagnose__result--filled {
    border-style: solid;
    background: var(--c-surface);
    color: var(--c-text);
}

.feeds-diagnose__heading {
    font-weight: 600;
    margin: 0 0 var(--sp-1);
}

.feeds-diagnose__row {
    margin: 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--sp-1) var(--sp-3);
    font-size: var(--fs-xs);
}

.feeds-diagnose__row dt { color: var(--c-text-muted); font-weight: 500; }
.feeds-diagnose__row dd { margin: 0; color: var(--c-text); overflow-wrap: anywhere; }

.feeds-diagnose__sections {
    margin-top: var(--sp-2);
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
}

.feeds-diagnose__section {
    padding: var(--sp-1) var(--sp-2);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-xs);
    background: var(--c-bg);
}
