/* SocialPress V4.10.69 — ultra-clean mobile UI + slim scrollbars */
:root{
  --sp-clean-line:#e8ecf2;
  --sp-clean-muted:#6b7280;
  --sp-clean-soft:#f5f7fa;
  --sp-clean-thumb:rgba(100,116,139,.34);
  --sp-clean-thumb-hover:rgba(71,85,105,.52);
}

/* Slim, neutral scrollbars everywhere. This also removes the wide blue gutter
   seen in long lists/panels while keeping scroll affordance available. */
html{scrollbar-gutter:auto!important;scrollbar-width:thin;scrollbar-color:var(--sp-clean-thumb) transparent}
body,*{scrollbar-color:var(--sp-clean-thumb) transparent}
html::-webkit-scrollbar,body::-webkit-scrollbar,*::-webkit-scrollbar{width:4px;height:4px}
html::-webkit-scrollbar-track,body::-webkit-scrollbar-track,*::-webkit-scrollbar-track{background:transparent!important}
html::-webkit-scrollbar-thumb,body::-webkit-scrollbar-thumb,*::-webkit-scrollbar-thumb{background:var(--sp-clean-thumb)!important;border:0!important;border-radius:999px!important;min-height:28px}
html::-webkit-scrollbar-thumb:hover,body::-webkit-scrollbar-thumb:hover,*::-webkit-scrollbar-thumb:hover{background:var(--sp-clean-thumb-hover)!important}
html::-webkit-scrollbar-button,body::-webkit-scrollbar-button,*::-webkit-scrollbar-button{display:none!important;width:0!important;height:0!important}
html::-webkit-scrollbar-corner,body::-webkit-scrollbar-corner,*::-webkit-scrollbar-corner{background:transparent!important}
.sp-theme-dark,.sp-theme-dark-root{--sp-clean-thumb:rgba(148,163,184,.34);--sp-clean-thumb-hover:rgba(203,213,225,.48)}

@media (max-width:860px){
  :root{--sp-mobile-edge:8px;--sp-mobile-radius:14px}
  html{overflow-x:hidden!important;scrollbar-gutter:auto!important}
  body{width:100%!important;max-width:100%!important;overflow-x:hidden!important;background:var(--sp-bg,#f4f6f8)!important}
  html::-webkit-scrollbar,body::-webkit-scrollbar,*::-webkit-scrollbar{width:2px!important;height:2px!important}
  *{scrollbar-width:thin}

  /* Defensive width/overflow guards for flex/grid children. */
  :where(.sp-shell,.sp-feed,.sp-app-page,.sp-post-card,.sp-post-head,.sp-post-text,.sp-actions,.sp-modal-card,.sp-share-dialog,.sp-comments-dialog,.sp-live-page,.sp-live-studio-dialog,.sp-live-viewer-dialog,.sp-messages-page,.sp-settings-page,.sp-profile-card,.sp-profile-wide-card){min-width:0!important;max-width:100%}
  :where(.sp-post-text,.sp-author,.sp-chat-bubble,.sp-notification-copy,.sp-live-broadcast-info,.sp-mobile-menu-grid a span){overflow-wrap:anywhere;word-break:break-word}
  img,video,canvas,iframe{max-width:100%!important}

  /* Header: one line, no decorative bulk. */
  .sp-topbar{height:54px!important;min-height:54px!important;border-bottom:1px solid var(--sp-clean-line)!important;box-shadow:none!important;background:rgba(255,255,255,.97)!important}
  .sp-theme-dark .sp-topbar{background:rgba(17,24,39,.97)!important;border-bottom-color:#273142!important}
  .sp-topbar-inner{height:54px!important;min-height:54px!important;padding:6px max(8px,env(safe-area-inset-right)) 6px max(8px,env(safe-area-inset-left))!important;gap:7px!important}
  .sp-brand-mark{width:36px!important;height:36px!important;border-radius:11px!important;box-shadow:none!important}
  .sp-brand-text{display:none!important}
  .sp-search{height:38px!important;border-radius:12px!important;border:1px solid transparent!important;box-shadow:none!important;background:var(--sp-clean-soft)!important;padding:0 10px!important}
  .sp-theme-dark .sp-search{background:#202936!important}
  .sp-search input{font-size:15px!important}
  .sp-mobile-menu-toggle{width:38px!important;height:38px!important;min-width:38px!important;border-radius:12px!important;box-shadow:none!important}

  /* Main canvas: tighter rhythm, flatter surfaces. */
  .sp-shell{padding:8px var(--sp-mobile-edge) calc(70px + env(safe-area-inset-bottom))!important}
  .sp-feed{margin:0 auto!important}
  :where(.sp-composer,.sp-post-card,.sp-comments-card,.sp-empty,.sp-view-head,.sp-person-card,.sp-settings-card,.sp-profile-card,.sp-profile-wide-card,.sp-friend-result,.sp-notifications-page-card,.sp-stories){border-radius:var(--sp-mobile-radius)!important;border:1px solid var(--sp-clean-line)!important;box-shadow:none!important}
  .sp-theme-dark :where(.sp-composer,.sp-post-card,.sp-comments-card,.sp-empty,.sp-view-head,.sp-person-card,.sp-settings-card,.sp-profile-card,.sp-profile-wide-card,.sp-friend-result,.sp-notifications-page-card,.sp-stories){border-color:#273142!important}
  .sp-post-card{margin-bottom:8px!important}
  .sp-composer{margin-bottom:8px!important;padding:9px 10px!important}
  .sp-stories{margin-bottom:8px!important;padding:8px!important}
  .sp-post-head{padding:10px 10px 6px!important}
  .sp-post-text{padding:3px 10px 10px!important;font-size:14.5px!important;line-height:1.45!important}
  .sp-post-public-title{padding:2px 10px 4px!important;font-size:15.5px!important}
  .sp-social-stats{padding:7px 10px!important}
  .sp-actions{padding:3px 5px 5px!important;gap:2px!important}
  .sp-actions button,.sp-actions a{min-height:40px!important;border-radius:10px!important;box-shadow:none!important}

  /* Page headers: title + real action only. Remove duplicate helper copy. */
  .sp-app-page-head,.sp-view-head,.sp-live-head{margin-bottom:9px!important}
  .sp-app-page-head h1,.sp-live-head h1{font-size:22px!important;line-height:1.15!important;margin:0!important;letter-spacing:-.025em!important}
  .sp-app-page-head p,.sp-live-head p,.sp-settings-eyebrow,.sp-mobile-drawer-brand small,.sp-mobile-drawer-profile small{display:none!important}
  .sp-app-page-head :where(p:empty,small:empty),.sp-view-head :where(p:empty,small:empty){display:none!important}

  /* Drawer: flatten the old Main / Community / Manage accordion sections. */
  .sp-mobile-drawer{width:min(88vw,340px)!important;border-radius:0 20px 20px 0!important;box-shadow:18px 0 50px rgba(2,8,23,.18)!important}
  .sp-mobile-drawer-head{padding:10px 10px 6px!important}
  .sp-mobile-drawer-profile{padding:5px 9px 7px!important}
  .sp-mobile-drawer-profile a{min-height:58px!important;border-radius:14px!important;padding:7px 9px!important}
  .sp-mobile-drawer-nav{padding:3px 9px 10px!important}
  .sp-mobile-menu-section{margin:0!important;padding:0!important;border:0!important;background:transparent!important;overflow:visible!important}
  .sp-mobile-menu-section-toggle{display:none!important}
  .sp-mobile-menu-collapse,.sp-mobile-menu-section.is-open .sp-mobile-menu-collapse{display:block!important;grid-template-rows:1fr!important;overflow:visible!important}
  .sp-mobile-menu-grid,.sp-mobile-menu-section.is-open .sp-mobile-menu-grid{padding:3px 0!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:6px!important}
  .sp-mobile-menu-grid a{min-height:46px!important;padding:0 10px!important;border-radius:12px!important;border:0!important;box-shadow:none!important;font-size:12.5px!important;transform:none!important;opacity:1!important}
  .sp-mobile-drawer-actions{padding:8px 10px calc(9px + env(safe-area-inset-bottom))!important}

  /* Bottom navigation stays useful, but visually lighter. */
  .sp-mobile-nav{height:calc(56px + env(safe-area-inset-bottom))!important;padding:2px 4px env(safe-area-inset-bottom)!important;border-top:1px solid var(--sp-clean-line)!important;box-shadow:none!important;background:rgba(255,255,255,.98)!important}
  .sp-theme-dark .sp-mobile-nav{background:rgba(17,24,39,.98)!important;border-top-color:#273142!important}
  body.logged-in .sp-mobile-nav{grid-template-columns:repeat(5,minmax(0,1fr))!important}
  .sp-mobile-nav a{min-width:0!important;gap:1px!important;border-radius:10px!important}
  .sp-mobile-nav .sp-icon{width:21px!important;height:21px!important}
  .sp-mobile-nav small{font-size:9px!important;line-height:1!important;font-weight:600!important;letter-spacing:0!important}
  .sp-mobile-nav a.active{background:transparent!important}

  /* Reels: video first. Remove instructional/duplicate chrome. */
  body.sp-reels-route .sp-shell{padding:0!important}
  .sp-reels-mobile-hint,.sp-reel-loader span,.sp-reel-author small,.sp-reel-error span{display:none!important}
  .sp-reel-sound{width:36px!important;height:36px!important;top:10px!important;right:9px!important;background:rgba(0,0,0,.34)!important;box-shadow:none!important}
  .sp-reel-actions{right:5px!important;bottom:22px!important;gap:8px!important}
  .sp-reel-action{width:48px!important;min-width:48px!important}
  .sp-reel-action-icon{width:39px!important;height:39px!important;background:rgba(0,0,0,.34)!important;box-shadow:none!important}
  .sp-reel-action.sp-share-btn b{display:none!important}
  .sp-reel-meta{left:10px!important;right:62px!important;bottom:20px!important}
  .sp-reel-meta p{margin-top:5px!important;font-size:11.5px!important;line-height:1.35!important}
  .sp-reel-progress{height:2px!important}

  /* Live: remove text that repeats what the controls already say. */
  .sp-live-go-copy p,.sp-live-layout-controls>p,.sp-live-empty-card p{display:none!important}
  .sp-live-section-title{margin-bottom:8px!important}
  .sp-live-section-title [data-sp-refresh-live]{display:none!important} /* list already auto-refreshes */
  .sp-live-go-card,.sp-live-broadcast-card,.sp-live-player-card,.sp-live-channel-panel{box-shadow:none!important}
  .sp-live-broadcast-cover .sp-live-source-pill{display:none!important}
  .sp-live-studio-head,.sp-live-viewer-top,.sp-live-chat-head{box-shadow:none!important}
  .sp-live-studio-body{gap:9px!important;padding:8px 8px 12px!important}
  .sp-live-field{gap:5px!important}
  .sp-live-source-grid{gap:6px!important}
  .sp-live-source-option{min-height:48px!important;border-radius:12px!important;box-shadow:none!important}
  .sp-live-chat-messages{padding:8px 9px 10px!important}

  /* Messenger: flatter header/composer, no visual noise. */
  body.sp-messages-route .sp-chat-head{box-shadow:none!important}
  body.sp-messages-route .sp-chat-person small:empty{display:none!important}
  body.sp-messages-route .sp-chat-bubble{box-shadow:none!important}
  body.sp-messages-route .sp-chat-composer{box-shadow:none!important}

  /* Modal sheets: one separator, no stacked borders/shadows. */
  :where(.sp-modal-card,.sp-share-dialog,.sp-comments-dialog){box-shadow:0 -12px 34px rgba(2,8,23,.16)!important;border:0!important}
  :where(.sp-modal-head,.sp-share-head,.sp-comments-dialog-head){box-shadow:none!important}
  .sp-comments-dialog-handle{width:34px!important;height:4px!important}

  /* Forms/buttons: consistent, compact, touch-safe. */
  :where(.sp-app-primary,.sp-app-secondary,.sp-submit,.sp-live-primary,.sp-live-secondary){min-height:42px!important;border-radius:11px!important;box-shadow:none!important}
  :where(input,textarea,select){max-width:100%!important}
  textarea{resize:vertical}

  /* Hide genuinely empty shells instead of leaving dead whitespace. */
  :where(.sp-widget,.sp-side-card,.sp-app-page-head,.sp-view-head,.sp-live-section-title)>:empty{display:none!important}
  [hidden]{display:none!important}
}

@media (max-width:390px){
  .sp-shell{padding-left:6px!important;padding-right:6px!important}
  .sp-mobile-menu-grid{gap:5px!important}
  .sp-mobile-menu-grid a{padding:0 8px!important;font-size:12px!important}
  .sp-mobile-nav small{font-size:8.5px!important}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
}
