/* v3.17 activity album: a stable image-above-text surface for every v3 type. */
html:root:has(>body.v3-app[data-v3-page=feed][data-reading-cards]){scroll-snap-type:y proximity}
body.v3-app[data-v3-page=feed][data-reading-cards] main{padding-bottom:calc(110px + env(safe-area-inset-bottom))}
body.v3-app[data-v3-page=feed] #social-feed-list.activity-album{display:block!important;max-width:680px;margin:16px auto 0;border:0;background:transparent}
.activity-album-stage{min-width:0;touch-action:pan-y pinch-zoom;border-radius:22px}
.activity-album-stage:focus-visible{outline:3px solid var(--green);outline-offset:4px}
body.v3-app[data-v3-page=feed] #social-feed-list.activity-album .activity-feed-card{display:block;position:relative;box-sizing:border-box;width:100%;min-width:0;margin:0;padding:0;border:1px solid #dce6de;border-radius:22px;background:#fff;box-shadow:0 6px 24px #17392b09;overflow:hidden}
body.v3-app[data-v3-page=feed] #social-feed-list.activity-album .activity-feed-card[hidden]{display:none!important}
.activity-feed-card .activity-feed-hero{position:relative;width:100%;aspect-ratio:3/2;background:#e8efe6;overflow:hidden}
.activity-feed-hero>.activity-feed-photo-link{display:block;position:absolute;inset:0}
.activity-feed-card .activity-feed-hero .activity-feed-image{display:block;position:absolute;inset:0;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:cover;object-position:center 40%;margin:0;background:#edf1ea}
.activity-feed-kind{position:absolute;top:14px;left:14px;max-width:calc(100% - 28px);padding:5px 9px;border:1px solid #ffffff9e;border-radius:7px;background:#ffffffed;color:#285943;font-size:calc(12px * var(--app-text-scale,1));line-height:1.4;font-weight:700;pointer-events:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.activity-feed-placeholder{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;overflow:hidden;background:radial-gradient(circle at 90% 110%,#cadbc9 0,30%,transparent 30.2%),linear-gradient(125deg,#f0f1e2,#dfece2);color:#416e50;text-decoration:none}
.activity-feed-placeholder>span{font-size:calc(96px * var(--app-text-scale,1));line-height:1.1;font-family:Georgia,'Noto Serif TC',serif}
.activity-feed-placeholder>small{font-size:calc(15px * var(--app-text-scale,1))}
.activity-feed-card .activity-feed-copy>header{box-sizing:border-box;display:flex;align-items:center;gap:10px;height:68px;margin:0;padding:10px 18px}
.activity-feed-card .activity-feed-copy>header>div{display:grid;min-width:0;gap:3px}
.activity-feed-card .activity-feed-copy>header>div>a{color:var(--ink);font-weight:700;font-size:calc(14px * var(--app-text-scale,1));text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.activity-feed-card time{font-size:calc(12px * var(--app-text-scale,1));color:var(--muted)}
.activity-feed-avatar{width:40px;height:40px;flex:none;display:grid;place-items:center;border-radius:50%;overflow:hidden;background:#e5f1e7;color:var(--green);font-weight:700;font-size:calc(18px * var(--app-text-scale,1));text-decoration:none}
.activity-feed-avatar img{width:100%;height:100%;object-fit:cover}
body.v3-app .activity-feed-card .activity-feed-title{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;box-sizing:content-box;height:2.8em;max-height:2.8em;line-height:1.4;margin:0 18px 8px;color:var(--ink);font-size:calc(21px * var(--app-text-scale,1));font-weight:750;text-decoration:none;overflow:hidden;overflow-wrap:anywhere}
.activity-feed-excerpt{display:block;box-sizing:content-box;height:3em;margin:0 18px 14px;line-height:1.5;color:var(--muted)!important;font-size:calc(15px * var(--app-text-scale,1));text-decoration:none;overflow:hidden}
body.v3-app .activity-feed-card .activity-feed-body{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:1.5;font:inherit;color:inherit;white-space:normal;overflow:hidden;overflow-wrap:anywhere;margin:0}
.activity-feed-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px;border-top:1px solid var(--line);padding:5px 10px;margin:0 12px}
body.v3-app .activity-feed-actions button{box-sizing:border-box;min-height:44px;padding:5px 2px;border:0;border-radius:10px;background:transparent;color:var(--green);font-size:calc(14px * var(--app-text-scale,1));white-space:nowrap;min-width:0}
body.v3-app .activity-feed-actions button[aria-pressed=true]{background:#edf7f0}
.activity-feed-status:empty{display:none}.activity-feed-status{position:absolute;z-index:4;bottom:58px;left:10px;right:10px;padding:8px 12px;border-radius:10px;background:#fffbeeee;margin:0;overflow-wrap:anywhere;font-size:calc(13px * var(--app-text-scale,1))}
.activity-feed-verified{display:inline-grid;place-items:center;width:18px;height:18px;margin-left:4px;border-radius:50%;background:#ffd33d;color:#304424;font-size:13px;vertical-align:middle}
/* Keep video and Shorts inside exactly the same media window, without cropping. */
.activity-feed-hero .activity-feed-video{position:absolute;inset:0;width:100%;height:100%;max-width:none;margin:0;padding:0;background:#101713}
.activity-feed-hero .activity-feed-video-frame{position:absolute;inset:0 0 38px;aspect-ratio:auto!important;width:100%;height:calc(100% - 38px);min-height:0!important;max-width:none;margin:0;background:#101713}
.activity-feed-video-frame iframe,.activity-feed-video-frame .youtube-player-placeholder{position:absolute;inset:0;display:block;width:100%;height:100%;min-height:0;margin:0;border:0}
.activity-feed-video-frame .youtube-player-placeholder img{display:block;width:100%;height:100%;object-fit:contain}
.activity-feed-hero .activity-feed-video-tools{position:absolute;bottom:0;left:0;right:0;box-sizing:border-box;height:38px;display:flex;gap:8px;align-items:center;padding:0 10px;background:#f6faf7}
body.v3-app .activity-feed-video-tools button{font-size:calc(12px * var(--app-text-scale,1));min-height:36px;padding:3px 6px;border:0;background:transparent}
.activity-feed-video-tools a{margin-left:auto;color:#326448;font-size:calc(12px * var(--app-text-scale,1))}
.activity-feed-video>p{position:absolute;bottom:40px;left:8px;right:8px;margin:0;padding:6px 8px;background:#fffef3ec;border-radius:8px;color:#263b2c;font-size:calc(12px * var(--app-text-scale,1));line-height:1.4;pointer-events:none}
.activity-feed-video [hidden]{display:none!important}
/* Horizontal paging never scrolls the document or automatically advances. */
body.v3-app .activity-album-controls{display:flex;align-items:center;gap:10px;padding:10px 0 2px;margin:0;background:transparent;border:0}
body.v3-app .activity-album-controls[hidden]{display:none!important}
body.v3-app .activity-album-controls>button{display:grid;place-items:center;flex:0 0 44px;width:44px;min-width:44px;height:44px;min-height:44px;margin:0;padding:0;border:1px solid #d6e3d8;border-radius:50%;background:#fff;color:#256047;font:28px/1 system-ui}
body.v3-app .activity-album-controls>button:disabled{opacity:.35}
.activity-album-pages{display:flex;flex:1;align-items:center;justify-content:center;gap:5px;min-width:0}
body.v3-app .activity-album-pages>button{position:relative;box-sizing:border-box;flex:1;max-width:44px;min-width:0;min-height:44px;height:44px;margin:0;padding:0;border:0;background:transparent;border-radius:4px;box-shadow:none}
.activity-album-page:after{content:'';position:absolute;left:0;right:0;top:20px;height:4px;border-radius:3px;background:#cfdad0}
.activity-album-page[aria-current=true]:after{background:#21835a;height:5px}
.activity-album-count{min-width:48px;color:var(--muted);font-size:calc(13px * var(--app-text-scale,1));font-variant-numeric:tabular-nums;text-align:center}
body.v3-app .activity-album-controls :focus-visible,.activity-feed-card :focus-visible{outline:3px solid #1b815e;outline-offset:-3px}
/* Opening comments does not change the shared card height. */
body.v3-app dialog.activity-feed-comments{inset:auto 0 0;width:min(680px,100%);max-width:100%;max-height:85dvh;margin:0 auto;padding:0;border:0;border-radius:22px 22px 0 0;background:#fff;color:var(--ink);overflow:hidden}
body.v3-app dialog.activity-feed-comments[open]{display:flex;flex-direction:column}
.activity-feed-comments::backdrop{background:#16291e88}
.activity-feed-comments>header{display:flex;justify-content:space-between;align-items:center;gap:12px;flex:none;padding:14px 18px;border-bottom:1px solid var(--line)}
.activity-feed-comments h2{font-size:20px;margin:0}.activity-feed-comment-content{overflow:auto;min-height:0;padding:14px 18px calc(18px + env(safe-area-inset-bottom))}
.activity-feed-comments article{padding:10px 12px;border-radius:12px;background:#f1f6f3;margin:0 0 10px}.activity-feed-comments article p{white-space:pre-wrap;overflow-wrap:anywhere;margin:4px 0}
.activity-feed-comments form{display:grid;gap:8px}.activity-feed-comments textarea{box-sizing:border-box;width:100%;min-height:76px}.activity-feed-comments form>button{background:var(--green);color:#fff}
@media(max-width:600px){body.v3-app[data-v3-page=feed] #social-feed-list.activity-album{margin-top:12px}.activity-album-controls{gap:6px}.activity-feed-card .activity-feed-copy>header{padding-inline:14px}.activity-feed-kind{top:10px;left:10px}body.v3-app .activity-feed-card .activity-feed-title{margin-inline:14px;font-size:calc(20px * var(--app-text-scale,1))}.activity-feed-excerpt{margin-inline:14px}.activity-feed-actions{margin-inline:8px}body.v3-app .activity-feed-actions button{font-size:calc(13px * var(--app-text-scale,1))}}

@media(min-width:850px){body.v3-app[data-v3-page=feed] #social-feed-list.activity-album{max-width:520px}}

body.v3-app .activity-feed-actions button{display:flex;gap:5px;align-items:center;justify-content:center}.activity-feed-actions svg{width:19px;height:19px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.activity-feed-actions button[aria-pressed=true] svg{fill:#d4e9dc}

/* v3.17.2: a continuous, comfortably sized mixed-media desktop feed. */
body.v3-app[data-v3-page=feed] #social-feed-list.activity-stream{display:block!important;width:100%;max-width:700px;margin:16px auto;background:transparent;border:0}
body.v3-app[data-v3-page=feed] #social-feed-list.activity-stream>.activity-feed-card{display:block;position:relative;box-sizing:border-box;width:100%;margin:0 0 20px;padding:0;border:1px solid #dce6de;border-radius:20px;background:#fff;box-shadow:0 4px 20px #17392b08;overflow:hidden}
body.v3-app #social-feed-list.activity-stream .activity-feed-title{height:auto;max-height:none;min-height:0;-webkit-line-clamp:3;margin-bottom:10px}
body.v3-app #social-feed-list.activity-stream .activity-feed-excerpt{height:auto;max-height:none;overflow:visible;line-height:1.6;margin-bottom:16px}
body.v3-app #social-feed-list.activity-stream .activity-feed-body{display:block;-webkit-line-clamp:unset;white-space:pre-wrap;overflow:visible;line-height:1.6}
body.v3-app #social-feed-list.activity-stream .activity-feed-body>.activity-feed-more{display:inline;min-height:0!important;min-width:0!important;width:auto;height:auto;background:none;border:0;border-radius:0;box-shadow:none;color:#32674d;padding:0;margin:0;font:inherit;font-weight:600;white-space:nowrap;cursor:pointer}
.activity-feed-more[hidden]{display:none!important}
.activity-stream .activity-feed-hero{aspect-ratio:16/10}
.activity-stream .activity-feed-text-only .activity-feed-copy>header{height:68px}
.activity-stream .activity-feed-actions{margin-top:10px}
@media(max-width:600px){body.v3-app[data-v3-page=feed] #social-feed-list.activity-stream{margin-top:12px}body.v3-app[data-v3-page=feed] #social-feed-list.activity-stream>.activity-feed-card{margin-bottom:16px}}

/* v3.18: increase the complete card by about 30%, without scaling text or controls.
   Media gets three parts, concise copy one; controls stay outside.
   Explicit expansion can grow naturally, so full text is never clipped. */
body.v3-app[data-v3-page=feed] #social-feed-list.activity-stream{max-width:640px}
body.v3-app #social-feed-list.activity-stream>.activity-feed-card{--activity-copy-size:160px;margin-bottom:16px;scroll-snap-align:start;scroll-snap-stop:normal}
.activity-stream .activity-feed-hero{height:calc(var(--activity-copy-size) * 3);aspect-ratio:auto}
.activity-stream .activity-feed-copy{box-sizing:border-box;height:var(--activity-copy-size);display:flex;flex-direction:column;justify-content:center;gap:4px;padding:7px 16px}
body.v3-app #social-feed-list.activity-stream .activity-feed-copy>header{height:34px;min-height:34px;padding:0;margin:0;gap:8px}
.activity-stream .activity-feed-avatar{width:30px;height:30px;font-size:16px}
.activity-stream .activity-feed-copy>header>div{gap:0}
.activity-stream .activity-feed-copy time{font-size:11px}
body.v3-app #social-feed-list.activity-stream .activity-feed-title{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;height:auto;max-height:none;margin:0;font-size:calc(18px * var(--app-text-scale,1));line-height:1.35}
body.v3-app #social-feed-list.activity-stream .activity-feed-excerpt{margin:0;font-size:calc(14px * var(--app-text-scale,1));line-height:1.4}
body.v3-app #social-feed-list.activity-stream .activity-feed-body{line-height:1.4}
body.v3-app #social-feed-list.activity-stream .activity-feed-actions{margin:0 8px;padding:3px 4px;min-height:44px}
body.v3-app #social-feed-list.activity-stream .activity-feed-actions button{font-size:13px}
.activity-stream .activity-feed-text-only .activity-feed-copy,.activity-stream .activity-feed-copy:has(.expanded){height:auto;min-height:var(--activity-copy-size);padding-block:12px}
body.v3-app #social-feed-list.activity-stream .activity-feed-text-only .activity-feed-title{white-space:normal}
.activity-stream .activity-feed-copy:has(.expanded){justify-content:flex-start}
@media(max-width:600px){body.v3-app #social-feed-list.activity-stream>.activity-feed-card{--activity-copy-size:150px;margin-bottom:14px}.activity-stream .activity-feed-copy{padding-inline:12px}}
/* Native snapping only: never intercept wheel, touch or mouse movement.
   Suspend it for reading expanded copy, dialogs, typing and history restore. */
html:root:has(>body.v3-app[data-v3-page=feed][data-reading-cards]):has(dialog[open],.activity-feed-body.expanded,input:focus,textarea:focus,select:focus){scroll-snap-type:none}
@media(prefers-reduced-motion:reduce){html:root:has(>body.v3-app[data-v3-page=feed][data-reading-cards]){scroll-snap-type:none;scroll-behavior:auto}}

/* Feed controls stay above the reading cards, including on narrow/iOS layouts.
   Measured heights adapt to text size, safe areas and window resizing. */
body.v3-app[data-v3-page=feed] main>.hub-section-tabs {
  position:sticky;top:var(--activity-shell-height,58px);z-index:42;
  margin-bottom:0!important;padding-block:4px;
  background:#f5faf7;
  -webkit-backdrop-filter:var(--app-glass-filter,blur(14px));backdrop-filter:var(--app-glass-filter,blur(14px));
}
body.v3-app[data-v3-page=feed] .feed-hero {
  position:sticky;top:calc(var(--activity-shell-height,58px) + var(--activity-tabs-height,54px));z-index:41;
  display:flow-root;background:#f5faf7;
  -webkit-backdrop-filter:var(--app-glass-filter,blur(14px));backdrop-filter:var(--app-glass-filter,blur(14px));
}
body.v3-app[data-v3-page=feed] .feed-hero .section-title {margin:0;padding:8px 0;}
html:root:has(>body.v3-app[data-v3-page=feed][data-reading-cards]) {
  scroll-padding-top:calc(var(--activity-shell-height,58px) + var(--activity-tabs-height,54px) + var(--activity-tools-height,56px) + 12px);
}

/* Retired v2 themes force transparent hero backgrounds. Keep the sticky title
   readable over moving media without changing the accepted glass navigation. */
body.v3-app[data-v3-page=feed] #activity-feed-tools {background:#f5faf7!important;}
/* iPhone momentum scroll stays completely free. A passive idle helper only
   eases the final 18px when already near a card, never while a finger is down. */
html:root[data-app-appearance=ios]:has(>body.v3-app[data-v3-page=feed][data-reading-cards]) {scroll-snap-type:none;}
