/* Feed list: header search, chips, cards, sentinel (index.html) */

.feed-main {
    flex: 1;
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: 20px 20px 96px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
}

.topbar-search {
    width: 100%;
    max-width: 740px;
    min-width: 0;
    display: flex;
    justify-self: center;
}

.feed-search {
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 6px 0 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    transition: border-color .15s ease, box-shadow .15s ease;
    min-width: 0;
}
.feed-search:focus-within {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px var(--focus-ring);
    color: var(--text);
}
.feed-search .feed-search-icon { flex-shrink: 0; align-self: center; }
.feed-search input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14px;
}
.feed-search input::-webkit-search-cancel-button,
.feed-search input::-webkit-search-decoration { display: none; -webkit-appearance: none; }

.feed-filter-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
    flex-shrink: 0;
    position: relative;
}
.feed-filter-btn:hover { background: var(--bg-subtle); color: var(--text); }
.feed-filter-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.feed-filter-btn svg { color: inherit; }
.filter-count {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 14px;
    height: 14px;
    padding: 0 4px;
    border-radius: 7px;
    background: var(--accent);
    color: var(--accent-fg);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--bg-elevated);
}

.feed-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.feed-chips:empty { display: none; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 6px 0 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-elevated);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: border-color .12s ease, background-color .12s ease;
    white-space: nowrap;
}
.chip:hover { border-color: var(--border-strong); }
/* Period chip cannot be cleared — click opens the drawer instead; no "×" glyph */
.chip-locked { padding-right: 12px; }
.chip-x {
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-subtle);
    font-size: 14px;
    line-height: 1;
    transition: background-color .12s ease, color .12s ease;
}
.chip:hover .chip-x { background: var(--bg-subtle); color: var(--text); }

/* Feed card */

.feed-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--border);
    overflow: hidden;
}

.feed-card {
    background: var(--bg-elevated);
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "title  bm"
        "excerpt excerpt"
        "meta  meta";
    column-gap: 10px;
    row-gap: 6px;
    cursor: pointer;
    transition: background-color .12s ease;
    border: none;
    text-align: left;
    width: 100%;
    font: inherit;
    color: inherit;
}
.feed-card:hover { background: var(--bg-subtle); }
.feed-card.is-active { background: var(--bg-subtle); }
.feed-card:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--focus-ring);
}

.feed-card-title {
    grid-area: title;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.005em;
    line-height: 1.35;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.feed-card-excerpt {
    grid-area: excerpt;
    min-width: 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.feed-card-meta {
    grid-area: meta;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 11px;
    color: var(--text-subtle);
    letter-spacing: 0.02em;
    flex-wrap: wrap;
}
.feed-card-meta .sep { opacity: 0.5; }
.feed-card-meta .meta-source { color: var(--text-muted); }
.feed-card-meta .meta-tone { display: inline-flex; align-items: center; gap: 5px; }

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.dot-pos { background: #22c55e; }
.dot-neu { background: var(--text-subtle); }
.dot-neg { background: #ef4444; }

.feed-card-bookmark {
    grid-area: bm;
    align-self: start;
    justify-self: end;
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-subtle);
    cursor: pointer;
    border-radius: 4px;
    transition: color .12s ease, background-color .12s ease;
    padding: 0;
    margin: -2px -4px 0 0;
}
.feed-card-bookmark:hover { background: var(--bg-subtle); color: var(--text); }
.feed-card-bookmark:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--focus-ring); }
.feed-card-bookmark[aria-pressed="true"] { color: var(--text); }
.feed-card-bookmark[aria-pressed="true"] svg { fill: currentColor; }

/* Sentinel / empty */

.feed-sentinel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 0;
    color: var(--text-subtle);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    min-height: 40px;
}
.feed-loader {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--text-muted);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.feed-sentinel.done { display: none; }

.feed-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    font-size: 14px;
}
