/* Posts read as a vertical feed; novels keep a separate portrait layout. */
.feed-card.post-card, .feed-card.novel-card { display: block; padding: 22px; border-radius: 10px; }
.feed-card .post-card-main { display: block; }
.feed-card .novel-card-main { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 20px; align-items: start; }
.feed-card .feed-card-copy { grid-area: auto; min-width: 0; }
.feed-card .novel-cover { grid-area: auto; width: 100px; height: 150px; aspect-ratio: 2 / 3; }
.feed-card .novel-cover img { object-fit: contain; aspect-ratio: 2 / 3; background: #f0ebfb; }
.feed-card .post-image, .discovery-post .discovery-post-image { display: block; grid-area: auto; width: var(--post-preview-width,fit-content); max-width: min(100%,520px); height: auto; min-height: 0; max-height: none; aspect-ratio: auto; margin: 16px 0 0; padding: 0; border-radius: 8px; background: transparent; overflow: visible; }
.feed-card .post-image img, .discovery-post .discovery-post-image img { display: block; width: var(--post-preview-width,auto); max-width: 100%; height: auto; max-height: 453px; aspect-ratio: auto; object-fit: contain; margin: 0; border-radius: 8px; }
.feed-card .post-image[hidden], .discovery-post .discovery-post-image[hidden] { display: none; }
.feed-card.post-card, .discovery-list > .discovery-post { height: auto; min-height: 0; }
.feed-card.post-card .feed-author { margin: 0 0 13px; min-height: 32px; }
.feed-card.post-card .feed-author .avatar { width: 32px; height: 32px; font-size: 13px; }
.feed-card.post-card .feed-author strong { font-size: 13px; font-weight: 650; }
.feed-card .feed-edit { min-height: 30px; display: inline-flex; align-items: center; }
.feed-card.post-card .feed-kind { margin-bottom: 8px; }
.feed-card .feed-price.free { color: #6f687b; background: #f4f2f8; }
.feed-card .feed-price.paid { color: #7852bf; background: #f2ebfc; }
.feed-card .feed-excerpt { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.feed-card.post-card .feed-excerpt { -webkit-line-clamp: 3; font-size: 14px; line-height: 1.85; color: #6a6676; }
.feed-card.novel-card .feed-excerpt { -webkit-line-clamp: 2; margin-top: 9px; }
.feed-card .feed-tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.feed-card .feed-tags { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; max-height: 48px; margin: 0; line-height: 24px; }
.feed-card .feed-tags > a { display: inline; background: transparent; padding: 0; margin-right: 8px; font-size: 11px; line-height: inherit; }
.feed-card .feed-tag-row > .ai-badge, .feed-card .feed-kind > .ai-badge { flex-shrink: 0; font-size: 9px; }
.feed-card .feed-kind > .ai-badge { margin-left: auto; }
.feed-card.novel-card .feed-author { margin: 5px 0 0; flex-wrap: wrap; gap: 5px; }
.feed-episode-info { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; font-size: 11px; color: #6d657a; }
.feed-card .feed-episode-info .feed-price { margin: 0; }
.feed-card .feed-latest { margin-top: 7px; padding-top: 0; border: 0; }
.feed-published { display: block; margin-top: 7px; color: #9991a6; font-size: 10px; }
.feed-card .feed-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; padding-top: 10px; border-top: 1px solid #f2eff7; }
.feed-card .feed-actions > button, .feed-card .feed-actions > a { min-height: 36px; }
.feed-card .feed-bookmark { margin-left: auto; }
.feed-card .feed-reading-count { margin-left: 0; }
.novel-like-total { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.feed-card .novel-like-total { min-height: 36px; }
.feed-card .feed-actions .reading-metric { font-size: 11px; }

/* The compact edit control must not inherit the row's full height. */
.episode-edit { align-self: center; }
.detail-mobile-actions, .detail-mobile-reactions, .detail-mobile-stats, .detail-mobile-tags { display: none; }
.detail-engagement .novel-like-total { min-height: 34px; font-size: 11px; }
.profile-info > .work-support { align-self: center; flex-shrink: 0; }
.related-cover { aspect-ratio: 2 / 3; height: auto; }
.feed-side-cover.side-novel-cover { width: 42px; height: 63px; aspect-ratio: 2 / 3; object-fit: contain; background: #f0ebfb; }

/* The post list uses the same author → text → tags → optional image order. */
.discovery-post .discovery-post-body { display: block; }
.discovery-post .discovery-post-body p { -webkit-line-clamp: 3; }
.discovery-post .discovery-post-meta { justify-content: flex-start; }
.discovery-post .discovery-author { flex-wrap: wrap; }
.discovery-post .discovery-post-edit { margin-left: auto; color: #88799b; font-size: 11px; min-height: 32px; display: inline-flex; align-items: center; }
.discovery-post-kind { display: flex; align-items: center; gap: 10px; margin: 0 0 9px; font-size: 11px; color: #91889e; }
.discovery-post-kind .discovery-price { margin-left: auto; }
.discovery-post-kind .discovery-price.free { color: #6f687b; background: #f4f2f8; }
.discovery-post-tags { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; }
.discovery-post-tags .discovery-tags { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-width: 0; line-height: 24px; }
.discovery-post-tags .discovery-tags a { display: inline; padding: 0; margin-right: 8px; background: transparent; color: #9985b0; font-size: 11px; line-height: inherit; }
.discovery-post-tags > .ai-badge { flex-shrink: 0; margin-top: 3px; }
.discovery-post .discovery-post-bottom { display: block; margin-top: 15px; }
.discovery-post .discovery-reactions { width: 100%; margin: 0; gap: 14px; flex-wrap: wrap; }
.discovery-post .discovery-reactions > a, .discovery-post .discovery-reactions > button { min-height: 44px; font-size: 11px; }
.discovery-post .discovery-reactions .discovery-metrics { margin: 0; flex-wrap: wrap; justify-content: flex-start; min-width: 0; }
.discovery-post .discovery-bookmark { margin-left: auto; }

/* Chapter reader: metadata and comments stay out of the main reading column. */
.reader { min-height: 100dvh; }
.reader .reader-header { height: 58px; padding-inline: max(24px,calc((100vw - 960px) / 2)); gap: 20px; }
.reader .reader-back { min-width: 0; font-size: 13px; gap: 10px; }
.reader .reader-back span { max-width: 540px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.reader .reader-tools { flex-shrink: 0; }
.reader .reader-tools .icon-button { min-width: 40px; min-height: 40px; }
.reader .reader-main { max-width: 720px; padding: 64px 0 80px; }
.reader .reader-heading { border: 0; padding: 0; margin-bottom: 54px; }
.reader-chapter { font-size: 12px; opacity: .55; }
.reader .reader-heading h1 { margin: 10px 0 18px; font-size: 28px; font-family: var(--reader-font,var(--serif)); font-weight: 650; }
.reader-meta summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 11px; opacity: .55; min-height: 32px; list-style: none; }
.reader-meta summary::-webkit-details-marker, .reader-comments summary::-webkit-details-marker { display: none; }
.reader-meta p { margin: 6px 0 0; line-height: 1.8; }
.reader .prose { line-height: var(--reader-line,1.95); }
.reader .reader-end { border: 0; padding-top: 16px; margin-top: 64px; }
.reader .author-note { padding: 24px 0; border-top: 1px solid #8883; background: transparent; font-size: 13px; line-height: 1.9; color: inherit; opacity: .8; white-space: pre-wrap; }
.reader-reaction { display: flex; justify-content: center; padding: 20px 0; }
.reader .episode-like { gap: 10px; min-height: 48px; min-width: 152px; justify-content: center; border-radius: 28px; background: transparent; color: inherit; border-color: #8885; }
.reader .episode-like.liked { color: #a368d5; border-color: #a368d5; }
.reader .reader-nav { display: grid; grid-template-columns: 1fr .7fr 1fr; gap: 10px; margin: 28px 0; }
.reader .reader-nav .btn { min-height: 46px; }
.reader-comments { border-top: 1px solid #8883; margin-top: 32px; }
.reader-comments > summary { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; font-size: 13px; cursor: pointer; list-style: none; }
.reader-comments .comments { margin-top: 16px; }
.reader-locked .paywall { margin: 40px 0; }
.reader-locked .reader-nav { margin-top: 40px; }
.reader.dark .reader-comments .comments { color: inherit; }

@media (max-width: 760px) {
 .feed-card.post-card, .feed-card.novel-card { padding: 18px 16px; }
 .feed-card .novel-card-main { grid-template-columns: 76px minmax(0,1fr); gap: 14px; }
 .feed-card .novel-cover { width: 76px; height: 114px; }
 .feed-card h2 { font-size: 17px; }
 .feed-card.novel-card h2 { font-size: 16px; }
 .feed-card.post-card .feed-excerpt { font-size: 13px; }
 .feed-card .feed-actions { gap: 12px; padding-top: 6px; margin-top: 13px; }
 .feed-card .feed-actions > button, .feed-card .feed-actions > a { min-height: 44px; }
 .feed-card .feed-episode-info { gap: 5px; margin-top: 9px; }
 .feed-card .feed-price { font-size: 10px; }
 .feed-card .feed-latest { display: none; }
 .feed-card .feed-author strong { max-width: 130px; }
 .novel-detail-sidebar { display: none; }
 .novel-detail-main .detail-buttons, .novel-detail-main > .detail-metrics, .novel-detail-main .detail-top > .detail-tags { display: none; }
 .novel-detail-main .detail-top { grid-template-rows: auto; gap: 13px 16px; }
 .novel-detail-main .detail-cover { grid-row: 1; aspect-ratio: 2 / 3; }
 .novel-detail-main .detail-info { align-self: center; }
 .detail-mobile-stats { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; font-size: 10px; color: #94899f; }
 .detail-mobile-stats .reading-metric { font-size: 10px; }
 .detail-mobile-tags { display: block; grid-column: 1 / -1; font-size: 11px; color: #8b789e; }
 .detail-mobile-tags summary { min-height: 32px; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
 .detail-mobile-tags summary > span { margin-left: auto; }
 .detail-mobile-tags > div { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 10px; }
 .detail-mobile-tags[open] summary svg { transform: rotate(180deg); }
 .detail-mobile-actions { grid-column: 1 / -1; display: flex; gap: 10px; }
 .detail-mobile-actions .btn { flex: 1; min-height: 46px; font-size: 13px; border-radius: 7px; background: #7650ee; color: white; }
 .detail-mobile-actions .secondary { background: white; border-color: #ddcffd; color: #7650ee; }
 .detail-mobile-actions .btn:disabled { background: #eeeaf4; color: #a299ae; }
 .detail-mobile-reactions { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; margin: 8px 0 2px; padding: 4px 0; border-bottom: 1px solid #e8e6f1; }
 .detail-mobile-reactions > button, .detail-mobile-reactions > .novel-like-total { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; color: #8a7b9b; font-size: 10px; white-space: nowrap; }
 .detail-mobile-reactions .work-like-count { font-size: 10px; }
 .detail-mobile-reactions button[aria-pressed="true"] { color: #7650ee; }
 .detail-episode-list .episode-edit { align-self: center; min-height: 44px; }
 .reader .reader-header { padding-inline: 14px; height: 54px; gap: 8px; }
 .reader .reader-back { font-size: 12px; }
 .reader .reader-back span { max-width: calc(100vw - 156px); }
 .reader .reader-tools .icon-button { min-width: 44px; min-height: 44px; }
 .reader .reader-main { width: calc(100% - 40px); padding: 38px 0 48px; }
 .reader .reader-heading { margin-bottom: 38px; }
 .reader .reader-heading h1 { font-size: 23px; margin: 8px 0 12px; }
 .reader .reader-end { margin-top: 42px; }
 .reader-meta summary { min-height: 44px; }
 .reader .reader-nav { gap: 7px; }
 .reader .reader-nav .btn { font-size: 12px; padding-inline: 8px; }
}
