/* GG Master Compound V28 — additive regression-safe layer */
:root{--gg-v28-gold:#e2ad29;--gg-v28-green:#22c55e}

/* Keep the validated V18/V21 header structure; polish without hiding its More button. */
@media(max-width:900px){
  .gg-mobile-v17 .member-app:not(.flow-mode)>.community-head{background:linear-gradient(135deg,#0c100c 0%,#171b14 76%,#211e11 100%)!important}
  .gg-mobile-v17 .member-app:not(.flow-mode)>.community-head>img{filter:drop-shadow(0 4px 9px #0008)!important}
  .gg-mobile-v17 .community-head>div:nth-child(2)>span{font-weight:850!important;letter-spacing:.15em!important;color:#edc85d!important}
  .gg-mobile-v17 .community-head h1{font-weight:820!important}
  .gg-mobile-v17 .gg-mobile-more{display:grid!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;z-index:4!important;color:#fff!important;background:#ffffff0b!important;border-color:#ffffff1f!important}
}

/* Persistent app installation — disappears only when installed/standalone. */
.gg-v28-install{position:relative;top:auto;z-index:74;display:flex;align-items:center;justify-content:space-between;gap:10px;max-width:1120px;margin:8px auto 10px;padding:9px 11px;border:1px solid color-mix(in srgb,var(--gg-v28-gold) 42%,transparent);border-radius:14px;background:linear-gradient(120deg,#11150ff4,#222015f2);color:#fff;box-shadow:0 9px 28px #0002;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.gg-v28-install>div{display:flex;align-items:center;gap:9px;min-width:0}.gg-v28-install img{width:34px;height:34px;object-fit:contain}.gg-v28-install span{min-width:0}.gg-v28-install strong{display:block;font-size:12px}.gg-v28-install small{display:block;margin-top:2px;color:#ffffffa8;font-size:9.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gg-v28-install button{flex:none;border:0;border-radius:999px;padding:8px 13px;background:#e5b83f;color:#11140f;font-size:11px;font-weight:900}
@media(max-width:900px){.gg-v28-install{top:auto;margin:6px 8px 8px;max-width:none}.gg-v28-install small{max-width:200px}.member-app.flow-mode>.gg-v28-install{position:fixed;z-index:245;top:calc(env(safe-area-inset-top,0px) + 8px);left:50%;transform:translateX(-50%);width:auto;max-width:calc(100vw - 130px);margin:0;padding:6px 8px;border-radius:999px;box-shadow:0 8px 28px #0007}.member-app.flow-mode>.gg-v28-install img{width:25px;height:25px}.member-app.flow-mode>.gg-v28-install strong{font-size:10px;white-space:nowrap}.member-app.flow-mode>.gg-v28-install small{display:none}.member-app.flow-mode>.gg-v28-install button{padding:6px 9px;font-size:9px}}
.gg-v28-ios-install{position:fixed;z-index:600;inset:0;display:grid;place-items:end center;padding:16px;background:#0009;backdrop-filter:blur(5px)}.gg-v28-ios-install section{width:min(480px,100%);padding:20px;border-radius:22px;background:#fff;color:#111;text-align:center}.gg-v28-ios-install img{width:58px;height:58px;margin:auto}.gg-v28-ios-install h3{margin:9px 0 6px;font-size:18px}.gg-v28-ios-install p{margin:0 0 14px;color:#555;font-size:13px;line-height:1.65}.gg-v28-ios-install button{width:100%;padding:11px;border:0;border-radius:13px;background:#10130f;color:#fff;font-weight:850}

/* Stories: unmistakable new vs seen state while preserving V21 actions/replies. */
.gg-v18-story-person.new .gg-v18-story-ring{position:relative;background:conic-gradient(from 0deg,#fff2a8,#f7c840,#d78e00,#fff2a8)!important;box-shadow:0 0 0 1px #ffd95b55,0 0 18px #e9b82dbb,0 0 32px #e9b82d44!important;animation:ggV28StoryGlow 1.6s ease-in-out infinite}
.gg-v18-story-person.new .gg-v18-story-ring::after{content:"";position:absolute;inset:-4px;border:1px solid #ffdd7477;border-radius:50%;animation:ggV28StoryPulse 1.6s ease-out infinite}
.gg-v18-story-person.seen .gg-v18-story-ring{background:#686d67!important;box-shadow:none!important;filter:saturate(.15)!important;opacity:.66!important}.gg-v18-story-person.seen>span:last-child{opacity:.62}
@keyframes ggV28StoryGlow{50%{box-shadow:0 0 0 2px #ffda6655,0 0 24px #e9b82de6,0 0 38px #e9b82d4a}}
@keyframes ggV28StoryPulse{0%{transform:scale(.96);opacity:.85}75%{transform:scale(1.11);opacity:0}100%{opacity:0}}

/* Messages: preserve the original Instagram-like structure and refine it, no row reconstruction. */
@media(max-width:900px){
  .gg-mobile-v17 .messages-layout>.conversation-inbox>button{position:relative!important;display:flex!important;align-items:center!important;gap:12px!important;min-height:76px!important;padding:10px 14px!important;text-align:start!important}
  .gg-mobile-v17 .messages-layout>.conversation-inbox>button>.gg-avatar{flex:0 0 52px!important;width:52px!important;height:52px!important;min-width:52px!important;border-radius:50%!important;object-fit:cover!important}
  .gg-mobile-v17 .messages-layout>.conversation-inbox>button>span{flex:1 1 auto!important;min-width:0!important;display:grid!important;gap:3px!important}
  .gg-mobile-v17 .messages-layout>.conversation-inbox>button>span>strong{font-size:14px!important;font-weight:850!important;line-height:1.25!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .gg-mobile-v17 .messages-layout>.conversation-inbox>button>span>small{font-size:11px!important;color:#7a807a!important;line-height:1.3!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .gg-mobile-v17 .message-unread-count{flex:none!important;min-width:22px!important;height:22px!important;padding:0 6px!important;border-radius:999px!important;display:grid!important;place-items:center!important;background:#e3ad26!important;color:#14160f!important;font-size:10px!important;font-weight:900!important}
  .gg-v28-online-dot{position:absolute;z-index:8;width:14px;height:14px;border-radius:50%;background:var(--gg-v28-green);border:3px solid var(--gg-mobile-surface,#fff);box-shadow:0 0 0 1px #22c55e33;pointer-events:none}
  html[data-theme="dark"] .gg-v28-online-dot{border-color:#11130f}
  .messages-layout .thread>p.mine>small::after{content:" · ✓";font-weight:900;color:#8c8f88}.messages-layout .thread>p.mine.seen>small::after{content:" · ✓✓";color:#a87507}
  .messages-layout>.conversation-thread>form{max-width:100%!important;overflow:visible!important}
  .messages-layout>.conversation-thread>form input{min-width:0!important}
}

/* Reliable voice messages. */
.audio-card{max-width:100%}.audio-card audio{display:block!important;width:min(100%,360px)!important;min-width:220px;min-height:40px}.audio-card.gg-audio-failed{outline:1px solid #d67b3b55}

/* Media stays inside its card instead of turning the remaining page black. */
.video-attachment{overflow:hidden!important;background:transparent!important}.video-attachment video{display:block!important;width:100%!important;height:auto!important;max-height:min(62dvh,560px)!important;object-fit:contain!important;background:#000!important}
.message-attachments .video-attachment video{max-height:min(48dvh,430px)!important}.feed-card .video-attachment{max-height:min(62dvh,560px)!important}

/* Keep extra sections in the top More sheet, not the five-item bottom bar. */
#gg-mobile-nav{grid-template-columns:repeat(5,minmax(0,1fr))!important}
#gg-mobile-more-sheet .gg-sheet-grid .gg-v28-settings-entry{border-color:color-mix(in srgb,var(--gg-v28-gold) 30%,var(--gg-mobile-line))!important}

@media(prefers-reduced-motion:reduce){.gg-v18-story-person.new .gg-v18-story-ring,.gg-v18-story-person.new .gg-v18-story-ring::after{animation:none!important}}

/* Regression lock: inline member reels stay bounded inside Community instead of expanding into a page-sized black field. */
@media(max-width:900px){
  .gg-mobile-v17 .community-inline-video{min-height:0!important;height:auto!important;max-height:min(58dvh,620px)!important;aspect-ratio:9/16!important;overflow:hidden!important;display:grid!important;place-items:center!important;background:#050605!important}
  .gg-mobile-v17 .community-inline-video video{display:block!important;width:100%!important;height:100%!important;max-height:min(58dvh,620px)!important;aspect-ratio:9/16!important;object-fit:cover!important}
  .gg-mobile-v17 .community-inline-video:has(video:not([src])),.gg-mobile-v17 .community-inline-video:empty{display:none!important}
}
.gg-v28-deep-target{outline:2px solid color-mix(in srgb,var(--gg-v28-gold) 72%,transparent)!important;outline-offset:3px;transition:outline-color .25s ease}
