.feeds-page { padding-bottom:32px; }
.feeds-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:28px 0 22px; }
.feeds-heading h1 { font-size:clamp(40px,5vw,56px); margin:0 0 10px; }
.feeds-heading p { margin:0; }
.recycle-intro { margin:24px 0 0; text-align:left; }
.recycle-intro > summary { width:fit-content; cursor:pointer; color:var(--accent-ink); font-size:13px; font-weight:600; padding:6px 0; }
.recycle-loop { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; list-style:none; padding:0; margin:12px 0 0; }
.recycle-loop li { padding:16px 18px; border:1px solid var(--line); border-radius:8px; background:var(--accent-soft); }
.recycle-loop li:nth-child(2) { background:var(--green-soft,var(--card)); }
.recycle-loop li:nth-child(3) { background:var(--cream,var(--card)); }
.recycle-step { display:block; margin-bottom:8px; font-size:11px; font-weight:600; color:var(--dim); }
.recycle-loop strong { display:block; font:400 22px/1.2 Georgia,'Times New Roman',serif; color:var(--ink); }
.recycle-loop p { margin:8px 0 0; font-size:13px; line-height:1.5; color:var(--dim); }
@media(max-width:640px) {
    .recycle-loop { grid-template-columns:1fr; gap:8px; }
    .recycle-loop li { padding:12px 16px; }
}
.feeds-layout { display:grid; grid-template-columns:minmax(0,1fr); gap:20px; align-items:start; }
.feeds-main { min-width:0; }
.feeds-sidebar { min-width:0; }
.feed-composer { background:var(--paper,var(--card)); border:1px solid var(--line); border-radius:12px; padding:18px 20px; }
.feed-composer form { max-width:680px; }
.feeds-sidebar:has(.feed-composer:not([open])) .feeds-guidance { display:none; }
.feed-composer > summary { cursor:pointer; font-weight:600; }
.feed-composer h2 { margin:0 0 12px; font:600 20px/1.3 var(--font); text-transform:none; letter-spacing:normal; }
.feed-composer form { margin-top:16px; }
.feeds-page :is(form label,.feed-comment-form label),.feed-editor label { display:block; font-size:13px; font-weight:600; margin:12px 0 6px; }
.feeds-page :is(input:not([type=checkbox]),textarea,select),.feed-editor :is(input,textarea) { width:100%; box-sizing:border-box; padding:10px 12px; font:inherit; border:1px solid var(--line); border-radius:8px; background:var(--bg); color:var(--ink); }
.feeds-page textarea,.feed-editor textarea { resize:vertical; min-height:88px; }
.feeds-guidance { line-height:1.6; margin:14px 4px; }
.feeds-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.feeds-toolbar #feedSearch { flex:1 1 180px; width:auto; min-width:0; }
.feeds-toolbar .feeds-mine { display:flex; align-items:center; gap:6px; margin:0; white-space:nowrap; }
.feeds-mine input { width:16px; height:16px; flex:0 0 16px; padding:0; margin:0; accent-color:var(--accent); }
#feedStatus:empty,#feedPostStatus:empty,#feedEditStatus:empty { display:none; }
#communityPostList { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; margin-top:18px; min-width:0; align-items:start; }
#communityPostList > :is(.data-state,.feed-skeleton) { grid-column:1/-1; }
#communityPostList.feed-single-post { grid-template-columns:minmax(0,640px); justify-content:center; }
.community-post { display:flex; flex-direction:column; height:540px; box-sizing:border-box; overflow-wrap:anywhere; min-width:0; overflow:hidden; background:var(--paper,var(--bg)); border:1px solid var(--line); border-radius:16px; }
.feed-post-header { display:flex; gap:10px; align-items:center; height:74px; flex:0 0 74px; padding:16px; box-sizing:border-box; }
.feed-author-mark { width:38px; height:38px; flex:0 0 38px; display:grid; place-items:center; border-radius:50%; background:var(--accent-soft); color:var(--accent-ink); font-weight:600; border:2px solid var(--paper,var(--bg)); outline:1px solid var(--accent); }
.feed-author-meta { flex:1; min-width:0; }
.feed-author-meta strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; line-height:1.4; }
.feed-post-manage { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; max-width:90px; }
.feed-post-manage .link-btn { font-size:12px; }
.feed-post-content { display:flex; flex-direction:column; justify-content:safe center; flex:1 1 auto; min-height:0; overflow-y:auto; scrollbar-width:thin; box-sizing:border-box; padding:28px 24px; background:var(--accent-soft); background:color-mix(in srgb,var(--accent-soft) 55%,var(--paper,var(--bg))); border-block:1px solid var(--line); }
.community-post h2 { flex-shrink:0; font-size:28px; line-height:1.2; letter-spacing:-.02em; text-transform:none; margin:0 0 16px; }
.feed-post-body,.feed-comment-body { white-space:pre-wrap; line-height:1.6; margin:0; }
.feed-post-body { flex-shrink:0; font-size:15px; }
.feed-post-footer { flex:0 0 auto; max-height:55%; overflow-y:auto; box-sizing:border-box; padding:12px 16px 16px; }
.feed-post-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.feed-action { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:40px; padding:7px 10px; border:1px solid var(--line); border-radius:8px; background:var(--bg); color:var(--ink); font:600 13px var(--font); cursor:pointer; }
.feed-post-actions .feed-action { border-color:transparent; background:transparent; padding:6px; }
.feed-post-actions svg,.feed-permalink svg,.feed-comments > summary svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; flex:none; }
.feed-action[aria-pressed=true] { color:var(--accent-ink); background:var(--accent-soft); border-color:var(--accent); }
.feed-action:hover,.feed-permalink:hover { color:var(--accent-ink); background:var(--accent-soft); }
.feed-action:disabled { opacity:.55; cursor:wait; }
.feed-score { font-size:12px; color:var(--dim); margin-left:auto; }
.feed-permalink { display:inline-flex; align-items:center; justify-content:center; min-width:40px; min-height:40px; color:var(--ink); border-radius:8px; }
.feed-comments { margin-top:4px; }
.feed-comments > summary { display:flex; align-items:center; gap:6px; list-style:none; cursor:pointer; font-size:13px; font-weight:400; min-height:44px; color:var(--dim); }
.feed-comments > summary::-webkit-details-marker { display:none; }
.feed-comments > summary svg { width:18px; height:18px; margin-right:2px; }
.feed-comments > summary:hover { color:var(--ink); }
.feed-comments[open] > summary { border-bottom:1px solid var(--line); margin-bottom:8px; }
.feed-comment { padding:14px 0; border-bottom:1px solid var(--line); }
.feed-comment-head { display:flex; justify-content:space-between; gap:12px; font-size:13px; margin-bottom:6px; }
.feed-comment-head small { color:var(--dim); }
.feed-comment-body { font-size:14px; margin-bottom:8px; }
.feed-comment-manage { display:flex; gap:12px; }
.feed-comment-form textarea { min-height:72px; }
.feed-comment-form .btn { margin-top:10px; }
.feed-comment-status:empty { display:none; }
.feed-skeleton { padding:24px; border:1px solid var(--line); border-radius:12px; }
.feed-skeleton span { display:block; height:14px; margin-bottom:16px; border-radius:6px; background:linear-gradient(90deg,var(--line) 25%,var(--accent-soft) 50%,var(--line) 75%); background-size:200% 100%; animation:data-state-shimmer 1.5s ease-in-out infinite; }
.feed-skeleton span:nth-child(1) { width:30%; }.feed-skeleton span:nth-child(2) { width:70%; }.feed-skeleton span:nth-child(3) { width:100%; height:60px; margin:0; }
.feed-editor { width:min(600px,calc(100% - 32px)); max-height:calc(100dvh - 32px); overflow:auto; box-sizing:border-box; padding:24px; border:1px solid var(--line); border-radius:12px; background:var(--paper,var(--bg)); color:var(--ink); }
.feed-editor::backdrop { background:#0006; }
.feed-editor-head,.feed-edit-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.feed-editor-head h2 { font-size:28px; margin:0; text-transform:none; }
.feed-edit-actions { justify-content:flex-start; margin-top:16px; }
.feeds-page [hidden],.feed-editor [hidden] { display:none!important; }
@media(max-width:1199px) {
    #communityPostList { grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
}
@media(max-width:759px) {
    .feeds-layout { gap:16px; }
    #communityPostList { grid-template-columns:minmax(0,560px); justify-content:center; gap:20px; }
}
@media(max-width:540px) {
    .feeds-heading { padding-top:22px; gap:10px; }.feeds-heading h1 { font-size:38px; }
    .feeds-heading > .btn { font-size:12px; padding-inline:10px; }
    .feed-composer { padding:16px; }
    .community-post { border-radius:12px; }
    .feed-post-content { padding:26px 20px; }
    .feed-post-header { padding:14px; }
    .feed-post-footer { padding:10px 14px 14px; }
    .feed-post-manage { margin-left:auto; }
    .feed-action,.feed-post-manage button,.feed-comment-manage button,.feed-permalink { min-height:44px; }
    .feed-editor { padding:18px; }.community-post h2 { flex-shrink:0; font-size:26px; }
}
@media(prefers-reduced-motion:reduce) { .feed-skeleton span { animation:none; } }

.feed-sign-in { width:min(400px,calc(100% - 32px)); }
.feed-sign-in .feed-editor-head h2 { font-size:24px; }
.feed-sign-in p { font-size:14px; line-height:1.5; margin:14px 0 0; }

/* Account-owned AI issues use a paired vote control with separate totals. */
#feedNewPost { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; padding:0; flex:0 0 44px; }
#feedNewPost svg { width:20px; height:20px; flex-shrink:0; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.feed-vote-toggle { display:inline-flex; min-width:0; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.feed-vote-toggle .feed-action { gap:5px; min-height:44px; padding:8px; border:0; border-radius:0; font-size:12px; }
.feed-vote-toggle .feed-action + .feed-action { border-left:1px solid var(--line); }
.feed-vote-toggle .feed-action[aria-pressed=true] { background:var(--accent-soft); color:var(--accent-ink); }
.feed-vote-toggle svg { width:18px; height:18px; }
.feed-vote-toggle [data-vote-count] { font-variant-numeric:tabular-nums; }
@media(max-width:640px) {
    .feeds-heading { flex-wrap:wrap; gap:16px; }
    .feeds-heading > div { min-width:0; width:100%; }
    .feeds-heading h1 { font-size:clamp(32px,8vw,44px); }
    .feeds-heading p { line-height:1.5; }
    #feedNewPost { width:44px; min-height:44px; }
}

/* Keep the feed grid and controls, with the same paper folders as task guides. */
.feed-paper { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; }
:root[data-style=paper] .community-post {
    --feed-mount:var(--mount-peach);
    padding:38px 20px 20px; background:var(--feed-mount);
    border:1px solid var(--line); border-radius:8px; overflow:visible;
}
:root[data-style=paper] .community-post:nth-child(3n+2) { --feed-mount:var(--mount-lavender); }
:root[data-style=paper] .community-post:nth-child(3n) { --feed-mount:var(--mount-sage); }
:root[data-style=paper] .feed-paper {
    position:relative; background:var(--paper); border:1.5px solid var(--paper-edge);
    border-radius:0 2px 2px 2px; box-shadow:2px 3px 0 #302e2914;
}
:root[data-style=paper] .feed-paper::before {
    content:attr(data-paper-label); position:absolute; left:-1.5px; bottom:100%;
    padding:5px 13px 4px; max-width:calc(100% - 24px);
    border:1.5px solid var(--paper-edge); border-bottom:0; border-radius:5px 5px 0 0;
    background:var(--paper); color:var(--ink); font:10px/1.2 var(--font);
    box-shadow:-4px -2px 0 -1px var(--mount-lavender),-7px -4px 0 -2px var(--paper-edge);
    pointer-events:none;
}

:root[data-style=paper] .feed-post-header { flex-basis:78px; height:78px; padding:26px 16px 8px; }
:root[data-style=paper] .feed-author-mark { background:var(--feed-mount); color:var(--ink); outline-color:var(--paper-edge); }
:root[data-style=paper] .feed-post-content {
    justify-content:flex-start; padding:10px 18px 22px;
    background:var(--paper); border-top:0;
}
:root[data-style=paper] .community-post h2 { font-size:30px; line-height:1.16; margin-bottom:14px; }
:root[data-style=paper] .feed-post-body { font-size:13px; line-height:1.65; color:var(--dim); }
:root[data-style=paper] .feed-post-footer { padding:12px 14px 14px; }
:root[data-style=paper] .feed-vote-toggle { border-radius:5px; }
:root[data-style=paper] .feed-vote-toggle .feed-action { padding:8px 6px; gap:4px; }
:root[data-style=paper] .feed-comments > summary { color:var(--accent-ink); font-weight:600; }
@media(max-width:540px) {
    :root[data-style=paper] .community-post { padding:34px 14px 14px; }
    :root[data-style=paper] .feed-post-header { padding-inline:12px; gap:8px; }
    :root[data-style=paper] .feed-author-mark { width:30px; height:30px; flex-basis:30px; }
    :root[data-style=paper] .feed-post-manage { gap:6px; }
    :root[data-style=paper] .feed-post-content { padding:10px 14px 18px; }
    :root[data-style=paper] .community-post h2 { font-size:26px; }
    :root[data-style=paper] .feed-post-footer { padding-inline:10px; }
    :root[data-style=paper] .feed-vote-toggle { flex:1 1 auto; }
    :root[data-style=paper] .feed-vote-toggle .feed-action { flex:1; }
}

/* Cards are previews; full-length reading lives in the dialog. */
.feeds-page .feed-post-content { overflow:hidden; cursor:pointer; justify-content:flex-start; }
.feed-preview-text { flex:1; min-height:0; overflow:hidden; mask-image:linear-gradient(#000 calc(100% - 18px),transparent); }
.feed-preview-text h2 { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.feed-read-more { display:flex; align-items:center; justify-content:space-between; flex:none; padding-top:12px; color:var(--accent-ink); font-size:12px; font-weight:600; }
.feed-post-content:hover .feed-read-more { text-decoration:underline; text-underline-offset:3px; }
.feed-post-content:focus-visible { outline:2px solid var(--accent); outline-offset:-4px; }
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
    .community-post { transition:transform 220ms ease,box-shadow 220ms ease,border-color 220ms ease; }
    .feed-paper { transition:box-shadow 220ms ease; }
    .feed-read-more > span { transition:transform 220ms ease; }
    .community-post:hover {
        transform:translateY(-4px);
        border-color:var(--paper-edge,var(--accent));
        box-shadow:0 10px 22px #00000014;
    }
    :root[data-style=paper] .community-post:hover .feed-paper { box-shadow:4px 6px 0 #302e2926; }
    .feed-post-content:hover .feed-read-more > span { transform:translate(3px,-3px); }
}
.feed-reader { width:min(820px,calc(100% - 32px)); max-height:calc(100dvh - 32px); box-sizing:border-box; padding:0; overflow-y:auto; overscroll-behavior:contain; border:1px solid var(--paper-edge,var(--line)); border-radius:10px; background:var(--paper,var(--bg)); color:var(--ink); }
.feed-reader::backdrop { background:#0008; }
body:has(.feed-reader[open]) { overflow:hidden; }
.feed-reader-heading { position:sticky; top:0; z-index:1; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 24px; background:var(--paper,var(--bg)); border-bottom:1px solid var(--line); }
.feed-reader-heading > span { font-size:12px; font-weight:600; color:var(--dim); }
.feed-reader-heading button { min-width:44px; min-height:44px; font-size:24px; }
.feed-reader-content { padding:12px 32px 28px; overflow-wrap:anywhere; }
.feed-reader-content h2 { margin:16px 0 24px; font-size:clamp(28px,5vw,42px); line-height:1.15; text-transform:none; }
#feedReaderBody { white-space:pre-wrap; font-size:16px; line-height:1.8; margin:0; }
.feed-reader-footer { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; padding:16px 24px; border-top:1px solid var(--line); }
@media(max-width:540px) {
    .feed-reader { width:calc(100% - 20px); max-height:calc(100dvh - 20px); }
    .feed-reader-heading,.feed-reader-footer { padding:10px 16px; }
    .feed-reader-content { padding:8px 20px 24px; }
    #feedReaderBody { font-size:15px; line-height:1.75; }
}

/* Place the two vote directions at opposite edges of each card. */
.feeds-page .feed-post-actions .feed-vote-toggle {
    display:flex; flex:1 1 100%; justify-content:space-between;
    border:0; border-radius:0; overflow:visible;
}
.feeds-page .feed-post-actions .feed-vote-toggle .feed-action {
    flex:0 0 auto; min-width:64px; min-height:44px; gap:8px; padding:8px 12px;
    border:1px solid var(--line); border-radius:6px;
}
.feeds-page .feed-vote-toggle svg { width:22px; height:22px; }
.feeds-page .feed-score { margin-left:0; }
.feeds-page .feed-permalink { margin-left:auto; }
.feed-post-bottom {
    display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:4px 12px;
    flex:none; margin-top:auto; padding:6px 16px;
    border-top:1px solid var(--line);
}
@media(max-width:540px) {
    .feed-post-bottom { padding-inline:10px; }
}

.feed-post-time { flex:0 1 auto; margin-left:auto; text-align:right; font-size:11px; line-height:1.4; color:var(--dim); }

.feed-paper { position:relative; }
.feed-share-button { position:absolute; top:0; right:4px; display:grid; place-items:center; width:44px; height:32px; padding:0; border:0; border-radius:5px; background:transparent; color:var(--dim); cursor:pointer; }
.feed-share-button svg { width:26px; height:24px; fill:none; stroke:currentColor; stroke-width:1.2; }
.feed-share-button:hover,.feed-share-button:focus-visible { color:var(--accent-ink); background:var(--accent-soft); }
.feed-share-dialog { width:min(440px,calc(100% - 32px)); }
.feed-share-dialog input { margin-top:8px; }
@media(pointer:coarse) { .feed-share-button { height:44px; top:-6px; } }

/* Optional one-at-a-time reading stage, using the site's existing characters. */
.feed-view-switch { display:flex; justify-content:flex-end; gap:8px; margin-top:14px; }
.feed-view-switch .btn { display:grid; place-items:center; flex:0 0 44px; width:44px; height:44px; padding:0; }
.feed-view-switch svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.feed-view-switch [aria-pressed=true] { background:var(--accent-soft); color:var(--accent-ink); border-color:var(--accent); }
.feeds-deck { min-width:0; }
.feed-card-navigation { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:16px; }
.feeds-card-view .feeds-stage { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,540px) minmax(0,1fr); align-items:start; gap:20px; margin-top:24px; }
.feeds-card-view #communityPostList { grid-template-columns:minmax(0,1fr); margin-top:0; }
.feeds-card-view .feed-character { margin-top:20px; }
.feeds-card-view .votes-board-result { gap:1.5cqw; }
.feeds-card-view .votes-board-result strong { font-size:6cqw; }
.feeds-card-view .feed-character [data-board-model] { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
@media(max-width:1000px) and (min-width:761px) {
    .feeds-card-view .feeds-stage { grid-template-columns:minmax(0,1fr) minmax(0,440px) minmax(0,1fr); gap:12px; }
}
@media(max-width:760px) {
    .feeds-card-view .feeds-stage { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
    .feeds-card-view .feeds-deck { grid-column:1/-1; grid-row:1; width:100%; max-width:560px; justify-self:center; }
    .feeds-card-view .feed-character { grid-row:2; height:230px; margin-top:4px; }
    .feed-view-switch { justify-content:flex-end; }
    .feed-card-navigation { gap:8px; }
    .feed-card-navigation .btn { padding-inline:10px; }
}

.feeds-page .feeds-heading.page-controls { padding:0 0 20px; }

/* Put search on the first useful row, alongside the compose action. */
.feeds-heading .feeds-toolbar { flex:1 1 260px; min-width:0; margin:0; }
.feeds-heading .feeds-toolbar #feedSearch { min-height:44px; }
.feeds-heading > #feedNewPost { flex-shrink:0; }
@media(min-width:761px) {
    .feeds-page .feeds-heading.page-controls { flex-wrap:nowrap; gap:12px; }
    .feeds-heading .feed-view-switch { flex:none; margin-top:0; }
}
@media(max-width:760px) {
    .feeds-page .feeds-heading.page-controls { flex-wrap:wrap; gap:10px; }
    .feeds-heading .feeds-toolbar { flex-basis:100%; }
    .feeds-heading > #feedNewPost { flex:0 0 100%; width:100%; margin:0; }
    .feeds-heading .feed-view-switch { display:none; }
}
