/* Phase 117xt: unified light/dark surfaces and feed-border cleanup */
:root{
  --sv117-light-surface: #ffffff;
  --sv117-light-border: #eff3f4;
  --sv117-dark-surface: #0f1419;
  --sv117-dark-border: #38444d;
}

body:not(.sv-reelsPage){
  --sv-bg: var(--sv117-light-surface);
  --sv-card: var(--sv117-light-surface);
  --sv-panel: var(--sv117-light-surface);
  --sv-border: var(--sv117-light-border);
}

body.sv-dark:not(.sv-reelsPage){
  --sv-bg: var(--sv117-dark-surface);
  --sv-card: var(--sv117-dark-surface);
  --sv-panel: var(--sv117-dark-surface);
  --sv-border: var(--sv117-dark-border);
  --sv-xSolidText: #0f1419;
}

html,
body,
body:not(.sv-reelsPage){
  background: var(--sv-bg) !important;
}

body:not(.sv-reelsPage) .sv-top,
body:not(.sv-reelsPage) .sv-side,
body:not(.sv-reelsPage) .sv-sideRight,
body:not(.sv-reelsPage) .sv-bottom,
body:not(.sv-reelsPage) .sv-card,
body:not(.sv-reelsPage) .sv-panel,
body:not(.sv-reelsPage) .sv-modalCard,
body:not(.sv-reelsPage) .sv-drawer,
body:not(.sv-reelsPage) .sv-searchPageV2 .sv-searchPanel,
body:not(.sv-reelsPage) .sv-notiHead,
body:not(.sv-reelsPage) .sv-liveCard,
body:not(.sv-reelsPage) .sv-gFbCard,
body:not(.sv-reelsPage) .sv-gFbComposer,
body:not(.sv-reelsPage) .sv-hashHead,
body:not(.sv-reelsPage) .sv-hashTabs,
body:not(.sv-reelsPage) .sv-msgShell,
body:not(.sv-reelsPage) .sv-msgList,
body:not(.sv-reelsPage) .sv-chatPane,
body:not(.sv-reelsPage) .sv-msgTop,
body:not(.sv-reelsPage) .sv-chatComposer,
body:not(.sv-reelsPage) .sv-popCard,
body:not(.sv-reelsPage) .sv-dropdown,
body:not(.sv-reelsPage) .sv-menu,
body:not(.sv-reelsPage) .sv-menuCard{
  background: var(--sv-card) !important;
  border-color: var(--sv-border) !important;
}

body:not(.sv-reelsPage) .sv-feed{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body:not(.sv-reelsPage) .sv-feed > .sv-card{
  margin: 0 !important;
  background: var(--sv-card) !important;
  border-left: none !important;
  border-right: none !important;
  border-top: 1px solid var(--sv-border) !important;
  border-bottom: 1px solid var(--sv-border) !important;
  box-shadow: none !important;
}

body:not(.sv-reelsPage) .sv-feed > .sv-card + .sv-card{
  margin-top: 0 !important;
}

body:not(.sv-reelsPage) .sv-feed > .sv-card:last-child{
  margin-bottom: 0 !important;
}

body:not(.sv-reelsPage) .sv-feed > .sv-stories,
body:not(.sv-reelsPage) .sv-feed > .sv-homeTabs,
body:not(.sv-reelsPage) .sv-feed > .sv-shelf,
body:not(.sv-reelsPage) .sv-feed > .sv-groupSuggest,
body:not(.sv-reelsPage) .sv-feed > .sv-userSuggest,
body:not(.sv-reelsPage) .sv-feed > .sv-groupSugCard,
body:not(.sv-reelsPage) .sv-feed > .sv-gShelf{
  border: none !important;
  box-shadow: none !important;
}

body:not(.sv-reelsPage) .sv-feed > .sv-shelf{
  border-top: 0 !important;
  border-bottom: 0 !important;
}

@media (max-width: 980px){
  html.sv-pwa-mobileApp body:not(.sv-auth-page):not(.sv-authPage):not(.sv-reelsPage) .sv-feed > .sv-card{
    margin-bottom: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: 1px solid var(--sv-border) !important;
    border-bottom: 1px solid var(--sv-border) !important;
  }
}
